Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ public enum ExperimentFileColumns {
EXP_TITLE(ExperimentObservation.Columns.EXP_TITLE, Column.ColumnDataType.STRING),
EXP_DESCRIPTION(ExperimentObservation.Columns.EXP_DESCRIPTION, Column.ColumnDataType.STRING),
EXP_UNIT(ExperimentObservation.Columns.EXP_UNIT, Column.ColumnDataType.STRING),
SUB_OBS_UNIT(ExperimentObservation.Columns.SUB_OBS_UNIT, Column.ColumnDataType.STRING),
//SUB_OBS_UNIT(ExperimentObservation.Columns.SUB_OBS_UNIT, Column.ColumnDataType.STRING),
EXP_TYPE(ExperimentObservation.Columns.EXP_TYPE, Column.ColumnDataType.STRING),
ENV(ExperimentObservation.Columns.ENV, Column.ColumnDataType.STRING),
ENV_LOCATION(ExperimentObservation.Columns.ENV_LOCATION, Column.ColumnDataType.STRING),
ENV_YEAR(ExperimentObservation.Columns.ENV_YEAR, Column.ColumnDataType.INTEGER),
EXP_UNIT_ID(ExperimentObservation.Columns.EXP_UNIT_ID, Column.ColumnDataType.STRING),
SUB_UNIT_ID(ExperimentObservation.Columns.SUB_UNIT_ID, Column.ColumnDataType.STRING),
//SUB_UNIT_ID(ExperimentObservation.Columns.SUB_UNIT_ID, Column.ColumnDataType.STRING),
REP_NUM(ExperimentObservation.Columns.REP_NUM, Column.ColumnDataType.INTEGER),
BLOCK_NUM(ExperimentObservation.Columns.BLOCK_NUM, Column.ColumnDataType.INTEGER),
ROW(ExperimentObservation.Columns.ROW, Column.ColumnDataType.STRING),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

DO $$
BEGIN
update importer_mapping
set
mapping = '[{"id": "726a9f10-4892-4204-9e52-bd2b1d735f65", "value": {"fileFieldName": "Germplasm Name"}, "objectId": "germplasmName"}, {"id": "98774e20-6f89-4d6a-a7c9-f88887228ed6", "value": {"fileFieldName": "Germplasm GID"}, "objectId": "gid"}, {"id": "880ef0c9-4e3e-42d4-9edc-667684a91889", "value": {"fileFieldName": "Test (T) or Check (C)"}, "objectId": "test_or_check"}, {"id": "b693eca7-efcd-4518-a9d3-db0b037a76ee", "value": {"fileFieldName": "Exp Title"}, "objectId": "exp_title"}, {"id": "df340215-db6e-4219-a3b7-119f297b81c3", "value": {"fileFieldName": "Exp Description"}, "objectId": "expDescription"}, {"id": "9ca7cc81-562c-43a7-989a-41da309f603d", "value": {"fileFieldName": "Exp Unit"}, "objectId": "expUnit"}, {"id": "27215777-c8f9-4fe7-a7ac-918d6168b0dd", "value": {"fileFieldName": "Exp Type"}, "objectId": "expType"}, {"id": "19d220e2-dff0-4a3a-ad6e-32f4d8602b5c", "value": {"fileFieldName": "Env"}, "objectId": "env"}, {"id": "861518b9-5c9e-4fe5-b31e-baf16e27155d", "value": {"fileFieldName": "Env Location"}, "objectId": "envLocation"}, {"id": "667355c3-dae1-4a64-94c8-ac2d543bd474", "value": {"fileFieldName": "Env Year"}, "objectId": "envYear"}, {"id": "ad11f2df-c5b4-4a05-8e52-c57625140061", "value": {"fileFieldName": "Exp Unit ID"}, "objectId": "expUnitId"}, {"id": "639b40ec-20f8-4659-8464-6a4be997ac7a", "value": {"fileFieldName": "Exp Replicate #"}, "objectId": "expReplicateNo"}, {"id": "2a62a80f-d8ba-42c4-9997-3b4ac8a965aa", "value": {"fileFieldName": "Exp Block #"}, "objectId": "expBlockNo"}, {"id": "f3e7de69-21ad-4cda-b1cc-a5e1987fb931", "value": {"fileFieldName": "Row"}, "objectId": "row"}, {"id": "251c5bbd-fc4d-4371-a4ce-4e2686f6837e", "value": {"fileFieldName": "Column"}, "objectId": "column"}, {"id": "a0edcc27-d423-478f-8eed-05b554805ec9", "value": {"fileFieldName": "Lat"}, "objectId": "lat"}, {"id": "a8fd2190-d277-4369-ae72-af32416f14ac", "value": {"fileFieldName": "Long"}, "objectId": "long"}, {"id": "95caefec-2b12-4728-9f2e-3bc17478b662", "value": {"fileFieldName": "Elevation"}, "objectId": "elevation"}, {"id": "e8f80336-0982-4a48-85ac-4b0278e28b70", "value": {"fileFieldName": "RTK"}, "objectId": "rtk"}, {"id": "ce5f61f2-f1de-45a4-8baf-e2471a5d863d", "value": {"fileFieldName": "Treatment Factors"}, "objectId": "treatmentFactors"}, {"id": "c5b8276f-e777-4385-a80f-5199abe63aac", "value": {"fileFieldName": "ObsUnitID"}, "objectId": "ObsUnitID"}]',
file = '[{"Germplasm Name": "Test", "Germplasm GID": 1, "Test (T) or Check (C)": true, "Exp Title": "New Trial", "Exp Description": "A new trial", "Exp Unit": "plot", "Exp Type": "phenotyping", "Env": "New Study", "Env Location": "New Location", "Env Year": 2012, "Exp Unit ID": 3, "Exp Replicate #": 0, "Exp Block #": 2, "Row": 4, "Column": 5, "Lat": 42.4440, "Long": 76.5019, "Elevation": 123, "RTK": "RTK description", "Treatment Factors": "Jam application", "ObsUnitID": ""}]'
where import_type_id = 'ExperimentImport';
END $$;
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ void downloadDatasets(boolean includeTimestamps, String extension, int numberOfE
@ParameterizedTest
@CsvSource(value = {"CSV", "XLSX", "XLS"})
@SneakyThrows
@Disabled // disabled for now until we re-enable subentity support
void downloadSubEntityDataset(String extension) {

// Create sub-entity dataset.
Expand Down Expand Up @@ -389,13 +390,13 @@ private Map<String, Object> makeExpImportRow(String environment) {
row.put(ExperimentObservation.Columns.TEST_CHECK, "T");
row.put(ExperimentObservation.Columns.EXP_TITLE, "Test Exp");
row.put(ExperimentObservation.Columns.EXP_UNIT, "Plot");
row.put(ExperimentObservation.Columns.SUB_OBS_UNIT, "");
//row.put(ExperimentObservation.Columns.SUB_OBS_UNIT, "");
row.put(ExperimentObservation.Columns.EXP_TYPE, "Phenotyping");
row.put(ExperimentObservation.Columns.ENV, environment);
row.put(ExperimentObservation.Columns.ENV_LOCATION, "Location A");
row.put(ExperimentObservation.Columns.ENV_YEAR, "2023");
row.put(ExperimentObservation.Columns.EXP_UNIT_ID, "a-1");
row.put(ExperimentObservation.Columns.SUB_UNIT_ID, "");
//row.put(ExperimentObservation.Columns.SUB_UNIT_ID, "");
row.put(ExperimentObservation.Columns.REP_NUM, "1");
row.put(ExperimentObservation.Columns.BLOCK_NUM, "1");
row.put(ExperimentObservation.Columns.ROW, "1");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,13 @@ public File writeExperimentDataToFile(List<Map<String, Object>> data, List<Trait
columns.add(Column.builder().value(ExperimentObservation.Columns.EXP_TITLE).dataType(Column.ColumnDataType.STRING).build());
columns.add(Column.builder().value(ExperimentObservation.Columns.EXP_DESCRIPTION).dataType(Column.ColumnDataType.STRING).build());
columns.add(Column.builder().value(ExperimentObservation.Columns.EXP_UNIT).dataType(Column.ColumnDataType.STRING).build());
columns.add(Column.builder().value(ExperimentObservation.Columns.SUB_OBS_UNIT).dataType(Column.ColumnDataType.STRING).build());
//columns.add(Column.builder().value(ExperimentObservation.Columns.SUB_OBS_UNIT).dataType(Column.ColumnDataType.STRING).build());
columns.add(Column.builder().value(ExperimentObservation.Columns.EXP_TYPE).dataType(Column.ColumnDataType.STRING).build());
columns.add(Column.builder().value(ExperimentObservation.Columns.ENV).dataType(Column.ColumnDataType.STRING).build());
columns.add(Column.builder().value(ExperimentObservation.Columns.ENV_LOCATION).dataType(Column.ColumnDataType.STRING).build());
columns.add(Column.builder().value(ExperimentObservation.Columns.ENV_YEAR).dataType(Column.ColumnDataType.INTEGER).build());
columns.add(Column.builder().value(ExperimentObservation.Columns.EXP_UNIT_ID).dataType(Column.ColumnDataType.STRING).build());
columns.add(Column.builder().value(ExperimentObservation.Columns.SUB_UNIT_ID).dataType(Column.ColumnDataType.STRING).build());
//columns.add(Column.builder().value(ExperimentObservation.Columns.SUB_UNIT_ID).dataType(Column.ColumnDataType.STRING).build());
columns.add(Column.builder().value(ExperimentObservation.Columns.REP_NUM).dataType(Column.ColumnDataType.INTEGER).build());
columns.add(Column.builder().value(ExperimentObservation.Columns.BLOCK_NUM).dataType(Column.ColumnDataType.INTEGER).build());
columns.add(Column.builder().value(ExperimentObservation.Columns.ROW).dataType(Column.ColumnDataType.INTEGER).build());
Expand Down