4366 |
02 Jul 08 |
nicklas |
1 |
/* |
4366 |
02 Jul 08 |
nicklas |
$Id$ |
4366 |
02 Jul 08 |
nicklas |
3 |
|
4366 |
02 Jul 08 |
nicklas |
Copyright (C) 2007 Nicklas Nordborg |
4366 |
02 Jul 08 |
nicklas |
5 |
|
4366 |
02 Jul 08 |
nicklas |
This file is part of BASE - BioArray Software Environment. |
4366 |
02 Jul 08 |
nicklas |
Available at http://base.thep.lu.se/ |
4366 |
02 Jul 08 |
nicklas |
8 |
|
4366 |
02 Jul 08 |
nicklas |
BASE is free software; you can redistribute it and/or |
4366 |
02 Jul 08 |
nicklas |
modify it under the terms of the GNU General Public License |
4480 |
05 Sep 08 |
jari |
as published by the Free Software Foundation; either version 3 |
4366 |
02 Jul 08 |
nicklas |
of the License, or (at your option) any later version. |
4366 |
02 Jul 08 |
nicklas |
13 |
|
4366 |
02 Jul 08 |
nicklas |
BASE is distributed in the hope that it will be useful, |
4366 |
02 Jul 08 |
nicklas |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
4366 |
02 Jul 08 |
nicklas |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4366 |
02 Jul 08 |
nicklas |
GNU General Public License for more details. |
4366 |
02 Jul 08 |
nicklas |
18 |
|
4366 |
02 Jul 08 |
nicklas |
You should have received a copy of the GNU General Public License |
4514 |
11 Sep 08 |
jari |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
4366 |
02 Jul 08 |
nicklas |
21 |
*/ |
4366 |
02 Jul 08 |
nicklas |
22 |
|
5934 |
25 Jan 12 |
nicklas |
23 |
import java.util.Collections; |
5934 |
25 Jan 12 |
nicklas |
24 |
|
4366 |
02 Jul 08 |
nicklas |
25 |
import net.sf.basedb.core.BaseException; |
4366 |
02 Jul 08 |
nicklas |
26 |
import net.sf.basedb.core.DbControl; |
5696 |
12 Aug 11 |
nicklas |
27 |
import net.sf.basedb.core.DerivedBioAssay; |
6520 |
18 Aug 14 |
nicklas |
28 |
import net.sf.basedb.core.Directory; |
5688 |
10 Aug 11 |
nicklas |
29 |
import net.sf.basedb.core.Extract; |
4366 |
02 Jul 08 |
nicklas |
30 |
import net.sf.basedb.core.File; |
5630 |
13 May 11 |
nicklas |
31 |
import net.sf.basedb.core.Hardware; |
4366 |
02 Jul 08 |
nicklas |
32 |
import net.sf.basedb.core.Item; |
5934 |
25 Jan 12 |
nicklas |
33 |
import net.sf.basedb.core.ItemSubtype; |
4366 |
02 Jul 08 |
nicklas |
34 |
import net.sf.basedb.core.Job; |
4366 |
02 Jul 08 |
nicklas |
35 |
import net.sf.basedb.core.ParameterType; |
6520 |
18 Aug 14 |
nicklas |
36 |
import net.sf.basedb.core.Path; |
4426 |
29 Aug 08 |
nicklas |
37 |
import net.sf.basedb.core.Platform; |
4366 |
02 Jul 08 |
nicklas |
38 |
import net.sf.basedb.core.PluginConfigurationRequest; |
4366 |
02 Jul 08 |
nicklas |
39 |
import net.sf.basedb.core.PluginDefinition; |
4366 |
02 Jul 08 |
nicklas |
40 |
import net.sf.basedb.core.PluginParameter; |
4366 |
02 Jul 08 |
nicklas |
41 |
import net.sf.basedb.core.PluginResponse; |
5630 |
13 May 11 |
nicklas |
42 |
import net.sf.basedb.core.Protocol; |
4366 |
02 Jul 08 |
nicklas |
43 |
import net.sf.basedb.core.RequestInformation; |
5630 |
13 May 11 |
nicklas |
44 |
import net.sf.basedb.core.Software; |
4366 |
02 Jul 08 |
nicklas |
45 |
import net.sf.basedb.core.SystemItems; |
4366 |
02 Jul 08 |
nicklas |
46 |
import net.sf.basedb.core.plugin.GuiContext; |
4366 |
02 Jul 08 |
nicklas |
47 |
import net.sf.basedb.core.plugin.Response; |
4366 |
02 Jul 08 |
nicklas |
48 |
|
4366 |
02 Jul 08 |
nicklas |
49 |
|
4366 |
02 Jul 08 |
nicklas |
50 |
public class TestItemImporter |
4366 |
02 Jul 08 |
nicklas |
51 |
{ |
4366 |
02 Jul 08 |
nicklas |
52 |
static boolean ok = true; |
4366 |
02 Jul 08 |
nicklas |
53 |
|
4366 |
02 Jul 08 |
nicklas |
54 |
public static void main(String[] args) |
4366 |
02 Jul 08 |
nicklas |
55 |
{ |
4366 |
02 Jul 08 |
nicklas |
56 |
TestUtil.checkArgs(args); |
4366 |
02 Jul 08 |
nicklas |
57 |
TestUtil.begin(); |
4366 |
02 Jul 08 |
nicklas |
58 |
test_all(); |
4366 |
02 Jul 08 |
nicklas |
59 |
TestUtil.stop(); |
4366 |
02 Jul 08 |
nicklas |
60 |
} |
4366 |
02 Jul 08 |
nicklas |
61 |
|
4366 |
02 Jul 08 |
nicklas |
62 |
static boolean test_all() |
4366 |
02 Jul 08 |
nicklas |
63 |
{ |
4366 |
02 Jul 08 |
nicklas |
64 |
write("++Testing item import using plugin"); |
4366 |
02 Jul 08 |
nicklas |
65 |
|
5899 |
06 Dec 11 |
nicklas |
// Project |
5899 |
06 Dec 11 |
nicklas |
67 |
int projectId = TestProject.test_create("Default project", false); |
5899 |
06 Dec 11 |
nicklas |
68 |
TestProject.test_activate_project(projectId, null); |
5899 |
06 Dec 11 |
nicklas |
69 |
|
4366 |
02 Jul 08 |
nicklas |
// Create referenced items |
7099 |
07 Mar 16 |
nicklas |
71 |
int annotationTypeCategoryId = TestAnnotationTypeCategory.test_create("Batch import", false); |
7101 |
08 Mar 16 |
nicklas |
72 |
int annotationTypeCategoryId2 = TestAnnotationTypeCategory.test_create("Batch2", false); |
5630 |
13 May 11 |
nicklas |
73 |
int samplingProtocolId = TestProtocol.test_create(SystemItems.getId(Protocol.SAMPLING), "Sampling", false); |
5899 |
06 Dec 11 |
nicklas |
74 |
int defaultSamplingProtocolId = TestProtocol.test_create(SystemItems.getId(Protocol.SAMPLING), "Sampling.def", false); |
5630 |
13 May 11 |
nicklas |
75 |
int extractionProtocolId = TestProtocol.test_create(SystemItems.getId(Protocol.EXTRACTION), "Extraction", false); |
5630 |
13 May 11 |
nicklas |
76 |
int labelingProtocolId = TestProtocol.test_create(SystemItems.getId(Protocol.LABELING), "Labeling", false); |
5630 |
13 May 11 |
nicklas |
77 |
int poolingProtocolId = TestProtocol.test_create(SystemItems.getId(Protocol.POOLING), "Pooling", false); |
5630 |
13 May 11 |
nicklas |
78 |
int hybProtocolId = TestProtocol.test_create(SystemItems.getId(Protocol.HYBRIDIZATION), "Hybridization", false); |
5630 |
13 May 11 |
nicklas |
79 |
int hybStationId = TestHardware.test_create(SystemItems.getId(Hardware.HYBRIDIZATION_STATION), "Hybstation", false); |
5630 |
13 May 11 |
nicklas |
80 |
int scanProtocolId = TestProtocol.test_create(SystemItems.getId(Protocol.SCANNING), "Scanning", false); |
5630 |
13 May 11 |
nicklas |
81 |
int scannerId = TestHardware.test_create(SystemItems.getId(Hardware.SCANNER), "Scanner", false); |
5630 |
13 May 11 |
nicklas |
82 |
int featureProtocolId = TestProtocol.test_create(SystemItems.getId(Protocol.FEATURE_EXTRACTION), "Feature", false); |
5630 |
13 May 11 |
nicklas |
83 |
int featureSoftwareId = TestSoftware.test_create(SystemItems.getId(Software.FEATURE_EXTRACTION), "Feature", false); |
4426 |
29 Aug 08 |
nicklas |
84 |
int genericId = TestPlatform.test_get(Platform.GENERIC); |
4434 |
02 Sep 08 |
nicklas |
85 |
int variantId = TestPlatform.test_create_variant(genericId, "Variant", "test.variant", null, 0, null); |
5630 |
13 May 11 |
nicklas |
86 |
int robotId = TestHardware.test_create(SystemItems.getId(Hardware.PRINT_ROBOT), "Robot", false); |
5630 |
13 May 11 |
nicklas |
87 |
int printProtocolId = TestProtocol.test_create(SystemItems.getId(Protocol.PRINTING), "Printing", false); |
5630 |
13 May 11 |
nicklas |
88 |
int freezerId = TestHardware.test_create(SystemItems.getId(Hardware.FREEZER), "Freezer", false); |
5696 |
12 Aug 11 |
nicklas |
89 |
int childScanId = TestItemSubtype.test_create(Item.DERIVEDBIOASSAY, "ChildScan", SystemItems.getId(DerivedBioAssay.SCAN)); |
5934 |
25 Jan 12 |
nicklas |
90 |
int allSamplesSubtypeId = TestItemSubtype.test_create(Item.SAMPLE, "All samples"); |
6520 |
18 Aug 14 |
nicklas |
91 |
|
5899 |
06 Dec 11 |
nicklas |
92 |
TestProject.test_defaultItem(projectId, Item.PROTOCOL, defaultSamplingProtocolId); |
5899 |
06 Dec 11 |
nicklas |
93 |
TestProject.test_defaultItem(projectId, Item.PROTOCOL, hybProtocolId); |
5899 |
06 Dec 11 |
nicklas |
94 |
TestProject.test_defaultItem(projectId, Item.HARDWARE, hybStationId); |
5899 |
06 Dec 11 |
nicklas |
95 |
|
6520 |
18 Aug 14 |
nicklas |
// Import files |
6520 |
18 Aug 14 |
nicklas |
97 |
int rootDirectoryId = TestDirectory.test_create(true, "file-import"); |
6520 |
18 Aug 14 |
nicklas |
98 |
int filesFileId = TestFile.test_create("data/test.batchimport.files.txt", false, false); |
6520 |
18 Aug 14 |
nicklas |
99 |
int fileImporterId = TestPluginDefinition.test_get("net.sf.basedb.plugins.batchimport.FileImporter"); |
6520 |
18 Aug 14 |
nicklas |
100 |
int fileJobId = test_create_item_import_job(Item.FILE, fileImporterId, filesFileId, 0); |
6520 |
18 Aug 14 |
nicklas |
101 |
ok = ok & TestJob.test_execute(fileJobId, false); |
6520 |
18 Aug 14 |
nicklas |
102 |
ok = ok & TestDirectory.test_list("/file-import", 2); // 'raw' and 'ext' |
6520 |
18 Aug 14 |
nicklas |
103 |
ok = ok & TestFile.test_list("/file-import", 1); // 'reporters.txt' |
6520 |
18 Aug 14 |
nicklas |
104 |
ok = ok & TestFile.test_list("/file-import/raw", 2); // 'file1.txt' and 'file2.txt' |
8083 |
20 Oct 22 |
nicklas |
105 |
ok = ok & TestFile.test_list("/file-import/ext", 1); // 'robots.txt' |
6520 |
18 Aug 14 |
nicklas |
106 |
|
7099 |
07 Mar 16 |
nicklas |
// Import annotation types |
7099 |
07 Mar 16 |
nicklas |
108 |
int annotationTypeFileId = TestFile.test_create("data/test.batchimport.annotationtypes.txt", false, false); |
7099 |
07 Mar 16 |
nicklas |
109 |
int annotationTypeImporterId = TestPluginDefinition.test_get("net.sf.basedb.plugins.batchimport.AnnotationTypeImporter"); |
7099 |
07 Mar 16 |
nicklas |
110 |
int annotationTypeJobId = test_create_item_import_job(Item.ANNOTATIONTYPE, annotationTypeImporterId, annotationTypeFileId, 0); |
7099 |
07 Mar 16 |
nicklas |
111 |
ok = ok & TestJob.test_execute(annotationTypeJobId, false); |
7099 |
07 Mar 16 |
nicklas |
112 |
ok = ok & TestAnnotationType.test_list("Batch import", 10); |
7099 |
07 Mar 16 |
nicklas |
113 |
|
6998 |
04 Nov 15 |
nicklas |
// Import kits |
6998 |
04 Nov 15 |
nicklas |
115 |
int kitFileId = TestFile.test_create("data/test.batchimport.kits.txt", false, false); |
6998 |
04 Nov 15 |
nicklas |
116 |
int kitImporterId = TestPluginDefinition.test_get("net.sf.basedb.plugins.batchimport.KitImporter"); |
6998 |
04 Nov 15 |
nicklas |
117 |
int kitJobId = test_create_item_import_job(Item.KIT, kitImporterId, kitFileId, 0); |
6998 |
04 Nov 15 |
nicklas |
118 |
ok = ok & TestJob.test_execute(kitJobId, false); |
6998 |
04 Nov 15 |
nicklas |
119 |
ok = ok & TestKit.test_list(4); |
6998 |
04 Nov 15 |
nicklas |
120 |
|
5445 |
13 Oct 10 |
nicklas |
// Import bioplates |
5445 |
13 Oct 10 |
nicklas |
122 |
int bioPlateFileId = TestFile.test_create("data/test.batchimport.bioplates.txt", false, false); |
5445 |
13 Oct 10 |
nicklas |
123 |
int bioPlateImporterId = TestPluginDefinition.test_get("net.sf.basedb.plugins.batchimport.BioPlateImporter"); |
5934 |
25 Jan 12 |
nicklas |
124 |
int bioPlateJobId = test_create_item_import_job(Item.BIOPLATE, bioPlateImporterId, bioPlateFileId, 0); |
5696 |
12 Aug 11 |
nicklas |
125 |
ok = ok & TestJob.test_execute(bioPlateJobId, false); |
5696 |
12 Aug 11 |
nicklas |
126 |
ok = ok & TestBioPlate.test_list(2); |
5445 |
13 Oct 10 |
nicklas |
127 |
|
4366 |
02 Jul 08 |
nicklas |
// Import biosources |
4366 |
02 Jul 08 |
nicklas |
129 |
int bioSourceFileId = TestFile.test_create("data/test.batchimport.biosources.txt", false, false); |
4366 |
02 Jul 08 |
nicklas |
130 |
int bioSourceImporterId = TestPluginDefinition.test_get("net.sf.basedb.plugins.batchimport.BioSourceImporter"); |
5934 |
25 Jan 12 |
nicklas |
131 |
int bioSourceJobId = test_create_item_import_job(Item.BIOSOURCE, bioSourceImporterId, bioSourceFileId, 0); |
5696 |
12 Aug 11 |
nicklas |
132 |
ok = ok & TestJob.test_execute(bioSourceJobId, false); |
5696 |
12 Aug 11 |
nicklas |
133 |
ok = ok & TestBioSource.test_list(3); |
4366 |
02 Jul 08 |
nicklas |
134 |
|
4366 |
02 Jul 08 |
nicklas |
// Import samples |
4366 |
02 Jul 08 |
nicklas |
136 |
int sampleFileId = TestFile.test_create("data/test.batchimport.samples.txt", false, false); |
4366 |
02 Jul 08 |
nicklas |
137 |
int sampleImporterId = TestPluginDefinition.test_get("net.sf.basedb.plugins.batchimport.SampleImporter"); |
5934 |
25 Jan 12 |
nicklas |
138 |
int sampleJobId = test_create_item_import_job(Item.SAMPLE, sampleImporterId, sampleFileId, allSamplesSubtypeId); |
5696 |
12 Aug 11 |
nicklas |
139 |
ok = ok & TestJob.test_execute(sampleJobId, false); |
5696 |
12 Aug 11 |
nicklas |
140 |
ok = ok & TestSample.test_list(4); |
4372 |
04 Jul 08 |
nicklas |
141 |
|
4372 |
04 Jul 08 |
nicklas |
// Import extracts |
4372 |
04 Jul 08 |
nicklas |
143 |
int extractFileId = TestFile.test_create("data/test.batchimport.extracts.txt", false, false); |
4372 |
04 Jul 08 |
nicklas |
144 |
int extractImporterId = TestPluginDefinition.test_get("net.sf.basedb.plugins.batchimport.ExtractImporter"); |
5934 |
25 Jan 12 |
nicklas |
145 |
int extractJobId = test_create_item_import_job(Item.EXTRACT, extractImporterId, extractFileId, 0); |
5696 |
12 Aug 11 |
nicklas |
146 |
ok = ok & TestJob.test_execute(extractJobId, false); |
5696 |
12 Aug 11 |
nicklas |
147 |
ok = ok & TestExtract.test_list(0, 4); |
4372 |
04 Jul 08 |
nicklas |
148 |
|
4372 |
04 Jul 08 |
nicklas |
// Import labeled extracts |
4372 |
04 Jul 08 |
nicklas |
150 |
int labledExtractFileId = TestFile.test_create("data/test.batchimport.labeledextracts.txt", false, false); |
5648 |
30 May 11 |
nicklas |
151 |
int labledExtractImporterId = extractImporterId; |
5934 |
25 Jan 12 |
nicklas |
152 |
int labledExtractJobId = test_create_item_import_job(Item.EXTRACT, labledExtractImporterId, labledExtractFileId, 0); |
5696 |
12 Aug 11 |
nicklas |
153 |
ok = ok & TestJob.test_execute(labledExtractJobId, false); |
5696 |
12 Aug 11 |
nicklas |
154 |
ok = ok & TestExtract.test_list(SystemItems.getId(Extract.LABELED), 7); |
4366 |
02 Jul 08 |
nicklas |
155 |
|
4434 |
02 Sep 08 |
nicklas |
// Import array designs |
4434 |
02 Sep 08 |
nicklas |
157 |
int cdfId = TestFile.test_create("data/test.affymetrix.cdf", false, false); |
4434 |
02 Sep 08 |
nicklas |
158 |
TestFile.test_rename(cdfId, "test.cdf"); |
4434 |
02 Sep 08 |
nicklas |
159 |
int mapId = TestFile.test_create("data/test.reportermap.import.txt", false, false); |
4434 |
02 Sep 08 |
nicklas |
160 |
TestFile.test_rename(mapId, "test.map"); |
4434 |
02 Sep 08 |
nicklas |
161 |
int designFileId = TestFile.test_create("data/test.batchimport.arraydesigns.txt", false, false); |
4434 |
02 Sep 08 |
nicklas |
162 |
int designImporterId = TestPluginDefinition.test_get("net.sf.basedb.plugins.batchimport.ArrayDesignImporter"); |
5934 |
25 Jan 12 |
nicklas |
163 |
int designJobId = test_create_item_import_job(Item.ARRAYDESIGN, designImporterId, designFileId, 0); |
5696 |
12 Aug 11 |
nicklas |
164 |
ok = ok & TestJob.test_execute(designJobId, false); |
5696 |
12 Aug 11 |
nicklas |
165 |
ok = ok & TestArrayDesign.test_list(3); |
4434 |
02 Sep 08 |
nicklas |
166 |
|
4434 |
02 Sep 08 |
nicklas |
// Import array batches |
4434 |
02 Sep 08 |
nicklas |
168 |
int arrayBatchFileId = TestFile.test_create("data/test.batchimport.arraybatches.txt", false, false); |
4434 |
02 Sep 08 |
nicklas |
169 |
int arrayBatchImporterId = TestPluginDefinition.test_get("net.sf.basedb.plugins.batchimport.ArrayBatchImporter"); |
5934 |
25 Jan 12 |
nicklas |
170 |
int arrayBatchJobId = test_create_item_import_job(Item.ARRAYBATCH, arrayBatchImporterId, arrayBatchFileId, 0); |
5696 |
12 Aug 11 |
nicklas |
171 |
ok = ok & TestJob.test_execute(arrayBatchJobId, false); |
5696 |
12 Aug 11 |
nicklas |
172 |
ok = ok & TestArrayBatch.test_list(3); |
4434 |
02 Sep 08 |
nicklas |
173 |
|
4434 |
02 Sep 08 |
nicklas |
// Import array slides |
4434 |
02 Sep 08 |
nicklas |
175 |
int arraySlideFileId = TestFile.test_create("data/test.batchimport.arrayslides.txt", false, false); |
4434 |
02 Sep 08 |
nicklas |
176 |
int arraySlideImporterId = TestPluginDefinition.test_get("net.sf.basedb.plugins.batchimport.ArraySlideImporter"); |
5934 |
25 Jan 12 |
nicklas |
177 |
int arraySlideJobId = test_create_item_import_job(Item.ARRAYSLIDE, arraySlideImporterId, arraySlideFileId, 0); |
5696 |
12 Aug 11 |
nicklas |
178 |
ok = ok & TestJob.test_execute(arraySlideJobId, false); |
5696 |
12 Aug 11 |
nicklas |
179 |
ok = ok & TestArraySlide.test_list(5); |
4434 |
02 Sep 08 |
nicklas |
180 |
|
4426 |
29 Aug 08 |
nicklas |
// Import hybridizations |
4426 |
29 Aug 08 |
nicklas |
182 |
int hybFileId = TestFile.test_create("data/test.batchimport.hybridizations.txt", false, false); |
5649 |
30 May 11 |
nicklas |
183 |
int hybImporterId = TestPluginDefinition.test_get("net.sf.basedb.plugins.batchimport.PhysicalBioAssayImporter"); |
5934 |
25 Jan 12 |
nicklas |
184 |
int hybJobId = test_create_item_import_job(Item.PHYSICALBIOASSAY, hybImporterId, hybFileId, 0); |
5696 |
12 Aug 11 |
nicklas |
185 |
ok = ok & TestJob.test_execute(hybJobId, false); |
5696 |
12 Aug 11 |
nicklas |
186 |
ok = ok & TestPhysicalBioAssay.test_list(3); |
5667 |
23 Jun 11 |
nicklas |
187 |
|
4426 |
29 Aug 08 |
nicklas |
// Import scans |
5696 |
12 Aug 11 |
nicklas |
189 |
int samId = TestFile.test_create("data/test.assembly.sam", false, false); |
5696 |
12 Aug 11 |
nicklas |
190 |
TestFile.test_rename(samId, "test.sam"); |
4426 |
29 Aug 08 |
nicklas |
191 |
int scanFileId = TestFile.test_create("data/test.batchimport.scans.txt", false, false); |
5696 |
12 Aug 11 |
nicklas |
192 |
int scanImporterId = TestPluginDefinition.test_get("net.sf.basedb.plugins.batchimport.DerivedBioAssayImporter"); |
5934 |
25 Jan 12 |
nicklas |
193 |
int scanJobId = test_create_item_import_job(Item.DERIVEDBIOASSAY, scanImporterId, scanFileId, 0); |
5696 |
12 Aug 11 |
nicklas |
194 |
ok = ok & TestJob.test_execute(scanJobId, false); |
5696 |
12 Aug 11 |
nicklas |
195 |
ok = ok & TestDerivedBioAssay.test_list(0, 4); |
4426 |
29 Aug 08 |
nicklas |
196 |
|
4426 |
29 Aug 08 |
nicklas |
// Import raw bioassays |
4426 |
29 Aug 08 |
nicklas |
198 |
int celId = TestFile.test_create("data/test.affymetrix.cel", false, false); |
4426 |
29 Aug 08 |
nicklas |
199 |
TestFile.test_rename(celId, "test.cel"); |
4426 |
29 Aug 08 |
nicklas |
200 |
int gprId = TestFile.test_create("data/test.rawdata.import.txt", false, false); |
4426 |
29 Aug 08 |
nicklas |
201 |
TestFile.test_rename(gprId, "test.gpr"); |
4426 |
29 Aug 08 |
nicklas |
202 |
int rbaFileId = TestFile.test_create("data/test.batchimport.rawbioassays.txt", false, false); |
4426 |
29 Aug 08 |
nicklas |
203 |
int rbaImporterId = TestPluginDefinition.test_get("net.sf.basedb.plugins.batchimport.RawBioAssayImporter"); |
5934 |
25 Jan 12 |
nicklas |
204 |
int rbaJobId = test_create_item_import_job(Item.RAWBIOASSAY, rbaImporterId, rbaFileId, 0); |
5696 |
12 Aug 11 |
nicklas |
205 |
ok = ok & TestJob.test_execute(rbaJobId, false); |
5696 |
12 Aug 11 |
nicklas |
206 |
ok = ok & TestRawBioAssay.test_list(4); |
4426 |
29 Aug 08 |
nicklas |
207 |
|
4366 |
02 Jul 08 |
nicklas |
208 |
if (TestUtil.waitBeforeDelete()) TestUtil.waitForEnter(); |
4366 |
02 Jul 08 |
nicklas |
209 |
|
4426 |
29 Aug 08 |
nicklas |
// Delete raw bioassays |
4426 |
29 Aug 08 |
nicklas |
211 |
TestRawBioAssay.test_delete_all(); |
4426 |
29 Aug 08 |
nicklas |
212 |
TestJob.test_delete(rbaJobId); |
4426 |
29 Aug 08 |
nicklas |
213 |
TestFile.test_delete(rbaFileId); |
4426 |
29 Aug 08 |
nicklas |
214 |
TestFile.test_delete(celId); |
4426 |
29 Aug 08 |
nicklas |
215 |
TestFile.test_delete(gprId); |
4426 |
29 Aug 08 |
nicklas |
216 |
|
4426 |
29 Aug 08 |
nicklas |
// Delete scans |
5688 |
10 Aug 11 |
nicklas |
218 |
TestDerivedBioAssay.test_delete_all(); |
4426 |
29 Aug 08 |
nicklas |
219 |
TestJob.test_delete(scanJobId); |
4426 |
29 Aug 08 |
nicklas |
220 |
TestFile.test_delete(scanFileId); |
5696 |
12 Aug 11 |
nicklas |
221 |
TestFile.test_delete(samId); |
4426 |
29 Aug 08 |
nicklas |
222 |
|
4426 |
29 Aug 08 |
nicklas |
// Delete hybridizations |
5642 |
26 May 11 |
nicklas |
224 |
TestPhysicalBioAssay.test_delete_all(); |
4426 |
29 Aug 08 |
nicklas |
225 |
TestJob.test_delete(hybJobId); |
4426 |
29 Aug 08 |
nicklas |
226 |
TestFile.test_delete(hybFileId); |
4434 |
02 Sep 08 |
nicklas |
227 |
|
4434 |
02 Sep 08 |
nicklas |
// Delete array slides |
4434 |
02 Sep 08 |
nicklas |
229 |
TestArraySlide.test_delete_all(); |
4434 |
02 Sep 08 |
nicklas |
230 |
TestJob.test_delete(arraySlideJobId); |
4434 |
02 Sep 08 |
nicklas |
231 |
TestFile.test_delete(arraySlideFileId); |
4426 |
29 Aug 08 |
nicklas |
232 |
|
4434 |
02 Sep 08 |
nicklas |
// Delete array batches |
4434 |
02 Sep 08 |
nicklas |
234 |
TestArrayBatch.test_delete_all(); |
4434 |
02 Sep 08 |
nicklas |
235 |
TestJob.test_delete(arrayBatchJobId); |
4434 |
02 Sep 08 |
nicklas |
236 |
TestFile.test_delete(arrayBatchFileId); |
4434 |
02 Sep 08 |
nicklas |
237 |
|
4434 |
02 Sep 08 |
nicklas |
// Delete array designs |
4434 |
02 Sep 08 |
nicklas |
239 |
TestArrayDesign.test_delete_all(); |
4434 |
02 Sep 08 |
nicklas |
240 |
TestJob.test_delete(designJobId); |
4434 |
02 Sep 08 |
nicklas |
241 |
TestFile.test_delete(designFileId); |
4434 |
02 Sep 08 |
nicklas |
242 |
TestFile.test_delete(cdfId); |
4434 |
02 Sep 08 |
nicklas |
243 |
TestFile.test_delete(mapId); |
4434 |
02 Sep 08 |
nicklas |
244 |
|
4372 |
04 Jul 08 |
nicklas |
// Delete labeled extracts |
5641 |
25 May 11 |
nicklas |
246 |
TestExtract.test_delete_all(); |
4372 |
04 Jul 08 |
nicklas |
247 |
TestJob.test_delete(labledExtractJobId); |
4372 |
04 Jul 08 |
nicklas |
248 |
TestFile.test_delete(labledExtractFileId); |
4372 |
04 Jul 08 |
nicklas |
249 |
|
4372 |
04 Jul 08 |
nicklas |
// Delete extracts |
4372 |
04 Jul 08 |
nicklas |
251 |
TestExtract.test_delete_all(); |
4372 |
04 Jul 08 |
nicklas |
252 |
TestJob.test_delete(extractJobId); |
4372 |
04 Jul 08 |
nicklas |
253 |
TestFile.test_delete(extractFileId); |
5667 |
23 Jun 11 |
nicklas |
254 |
|
4366 |
02 Jul 08 |
nicklas |
// Delete samples |
4366 |
02 Jul 08 |
nicklas |
256 |
TestSample.test_delete_all(); |
4366 |
02 Jul 08 |
nicklas |
257 |
TestJob.test_delete(sampleJobId); |
4366 |
02 Jul 08 |
nicklas |
258 |
TestFile.test_delete(sampleFileId); |
4366 |
02 Jul 08 |
nicklas |
259 |
|
4366 |
02 Jul 08 |
nicklas |
// Delete biosources |
4366 |
02 Jul 08 |
nicklas |
261 |
TestBioSource.test_delete_all(); |
4366 |
02 Jul 08 |
nicklas |
262 |
TestJob.test_delete(bioSourceJobId); |
4366 |
02 Jul 08 |
nicklas |
263 |
TestFile.test_delete(bioSourceFileId); |
4366 |
02 Jul 08 |
nicklas |
264 |
|
5445 |
13 Oct 10 |
nicklas |
// Delete bioplates |
5445 |
13 Oct 10 |
nicklas |
266 |
TestBioPlate.test_delete_all(); |
5445 |
13 Oct 10 |
nicklas |
267 |
TestJob.test_delete(bioPlateJobId); |
5445 |
13 Oct 10 |
nicklas |
268 |
TestFile.test_delete(bioPlateFileId); |
5445 |
13 Oct 10 |
nicklas |
269 |
|
6998 |
04 Nov 15 |
nicklas |
// Delete kits |
6998 |
04 Nov 15 |
nicklas |
271 |
TestKit.test_delete_all(); |
6998 |
04 Nov 15 |
nicklas |
272 |
TestJob.test_delete(kitJobId); |
6998 |
04 Nov 15 |
nicklas |
273 |
TestFile.test_delete(kitFileId); |
6998 |
04 Nov 15 |
nicklas |
274 |
|
7099 |
07 Mar 16 |
nicklas |
// Delete annotation types |
7099 |
07 Mar 16 |
nicklas |
276 |
TestAnnotationType.test_delete_all("Batch import"); |
7099 |
07 Mar 16 |
nicklas |
277 |
TestJob.test_delete(annotationTypeJobId); |
7099 |
07 Mar 16 |
nicklas |
278 |
TestFile.test_delete(annotationTypeFileId); |
7099 |
07 Mar 16 |
nicklas |
279 |
|
6520 |
18 Aug 14 |
nicklas |
// Delete files |
6520 |
18 Aug 14 |
nicklas |
281 |
TestDirectory.test_delete(rootDirectoryId, true); |
6520 |
18 Aug 14 |
nicklas |
282 |
TestJob.test_delete(fileJobId); |
6520 |
18 Aug 14 |
nicklas |
283 |
TestFile.test_delete(filesFileId); |
6520 |
18 Aug 14 |
nicklas |
284 |
|
4366 |
02 Jul 08 |
nicklas |
// References items |
7099 |
07 Mar 16 |
nicklas |
286 |
TestAnnotationTypeCategory.test_delete(annotationTypeCategoryId); |
7101 |
08 Mar 16 |
nicklas |
287 |
TestAnnotationTypeCategory.test_delete(annotationTypeCategoryId2); |
4434 |
02 Sep 08 |
nicklas |
288 |
TestProtocol.test_delete(printProtocolId); |
4434 |
02 Sep 08 |
nicklas |
289 |
TestHardware.test_delete(robotId); |
4366 |
02 Jul 08 |
nicklas |
290 |
TestProtocol.test_delete(samplingProtocolId); |
5899 |
06 Dec 11 |
nicklas |
291 |
TestProtocol.test_delete(defaultSamplingProtocolId); |
4372 |
04 Jul 08 |
nicklas |
292 |
TestProtocol.test_delete(extractionProtocolId); |
4372 |
04 Jul 08 |
nicklas |
293 |
TestProtocol.test_delete(labelingProtocolId); |
4366 |
02 Jul 08 |
nicklas |
294 |
TestProtocol.test_delete(poolingProtocolId); |
4426 |
29 Aug 08 |
nicklas |
295 |
TestProtocol.test_delete(hybProtocolId); |
4426 |
29 Aug 08 |
nicklas |
296 |
TestHardware.test_delete(hybStationId); |
4426 |
29 Aug 08 |
nicklas |
297 |
TestProtocol.test_delete(scanProtocolId); |
4426 |
29 Aug 08 |
nicklas |
298 |
TestHardware.test_delete(scannerId); |
5445 |
13 Oct 10 |
nicklas |
299 |
TestHardware.test_delete(freezerId); |
4426 |
29 Aug 08 |
nicklas |
300 |
TestProtocol.test_delete(featureProtocolId); |
4426 |
29 Aug 08 |
nicklas |
301 |
TestSoftware.test_delete(featureSoftwareId); |
4426 |
29 Aug 08 |
nicklas |
302 |
TestPlatform.test_delete_variant(variantId); |
5696 |
12 Aug 11 |
nicklas |
303 |
TestItemSubtype.test_delete(childScanId); |
5934 |
25 Jan 12 |
nicklas |
304 |
TestItemSubtype.test_delete(allSamplesSubtypeId); |
5899 |
06 Dec 11 |
nicklas |
305 |
TestProject.test_delete(projectId); |
4366 |
02 Jul 08 |
nicklas |
306 |
|
4366 |
02 Jul 08 |
nicklas |
307 |
write("++Testing item import using plugin "+(ok ? "OK" : "Failed")+"\n"); |
4366 |
02 Jul 08 |
nicklas |
308 |
return ok; |
4366 |
02 Jul 08 |
nicklas |
309 |
} |
4366 |
02 Jul 08 |
nicklas |
310 |
|
5934 |
25 Jan 12 |
nicklas |
311 |
static int test_create_item_import_job(Item itemType, int pluginDefinitionId, int fileId, int subtypeId) |
4366 |
02 Jul 08 |
nicklas |
312 |
{ |
4366 |
02 Jul 08 |
nicklas |
313 |
if (pluginDefinitionId == 0 || fileId == 0) return 0; |
4366 |
02 Jul 08 |
nicklas |
314 |
int id = 0; |
4366 |
02 Jul 08 |
nicklas |
315 |
DbControl dc = null; |
4366 |
02 Jul 08 |
nicklas |
316 |
try |
4366 |
02 Jul 08 |
nicklas |
317 |
{ |
4366 |
02 Jul 08 |
nicklas |
318 |
dc = TestUtil.getDbControl(); |
4366 |
02 Jul 08 |
nicklas |
319 |
|
4366 |
02 Jul 08 |
nicklas |
320 |
PluginDefinition plugin = PluginDefinition.getById(dc, pluginDefinitionId); |
4366 |
02 Jul 08 |
nicklas |
321 |
Job j = Job.getNew(dc, plugin, null, null); |
4366 |
02 Jul 08 |
nicklas |
322 |
j.setName("Import " + itemType.toString()); |
4366 |
02 Jul 08 |
nicklas |
323 |
|
4366 |
02 Jul 08 |
nicklas |
// Step 1 - file and parser regular expressions |
4366 |
02 Jul 08 |
nicklas |
325 |
PluginConfigurationRequest request = j.configure(new GuiContext(itemType, GuiContext.Type.LIST)); |
4366 |
02 Jul 08 |
nicklas |
326 |
request.getRequestInformation(); |
5641 |
25 May 11 |
nicklas |
327 |
File file = File.getById(dc, fileId); |
5641 |
25 May 11 |
nicklas |
328 |
request.setParameterValue("file", file); |
6520 |
18 Aug 14 |
nicklas |
329 |
setParserParameters(dc, request, itemType); |
5641 |
25 May 11 |
nicklas |
330 |
setColumnMappingParameters(request, itemType, file); |
5934 |
25 Jan 12 |
nicklas |
331 |
if (subtypeId != 0) |
5934 |
25 Jan 12 |
nicklas |
332 |
{ |
5934 |
25 Jan 12 |
nicklas |
333 |
request.setParameterValues("itemSubtypes", Collections.singletonList(ItemSubtype.getById(dc, subtypeId))); |
5934 |
25 Jan 12 |
nicklas |
334 |
} |
5934 |
25 Jan 12 |
nicklas |
335 |
|
5934 |
25 Jan 12 |
nicklas |
336 |
|
4366 |
02 Jul 08 |
nicklas |
337 |
PluginResponse response = request.invoke(); |
4366 |
02 Jul 08 |
nicklas |
338 |
if (response.getStatus() != Response.Status.CONTINUE) |
4366 |
02 Jul 08 |
nicklas |
339 |
{ |
6520 |
18 Aug 14 |
nicklas |
340 |
Throwable t = response.getErrorList() != null ? response.getErrorList().get(0) : null; |
6520 |
18 Aug 14 |
nicklas |
341 |
throw new BaseException(response.getMessage(), t); |
4366 |
02 Jul 08 |
nicklas |
342 |
} |
4366 |
02 Jul 08 |
nicklas |
343 |
|
4366 |
02 Jul 08 |
nicklas |
// Step 2 - other options and error handling |
4366 |
02 Jul 08 |
nicklas |
345 |
request = response.getNextRequest(); |
4366 |
02 Jul 08 |
nicklas |
346 |
request.getRequestInformation(); |
4366 |
02 Jul 08 |
nicklas |
347 |
setErrorHandlingParameters(request, itemType); |
4366 |
02 Jul 08 |
nicklas |
348 |
response = request.invoke(); |
4366 |
02 Jul 08 |
nicklas |
349 |
|
4366 |
02 Jul 08 |
nicklas |
350 |
if (response.getStatus() == Response.Status.DONE) |
4366 |
02 Jul 08 |
nicklas |
351 |
{ |
4366 |
02 Jul 08 |
nicklas |
352 |
response.saveParameters(dc); |
4366 |
02 Jul 08 |
nicklas |
353 |
dc.saveItem(j); |
4366 |
02 Jul 08 |
nicklas |
354 |
dc.commit(); |
4366 |
02 Jul 08 |
nicklas |
355 |
} |
4366 |
02 Jul 08 |
nicklas |
356 |
else |
4366 |
02 Jul 08 |
nicklas |
357 |
{ |
4366 |
02 Jul 08 |
nicklas |
358 |
throw new BaseException(response.getMessage(), response.getErrorList().get(0)); |
4366 |
02 Jul 08 |
nicklas |
359 |
} |
4366 |
02 Jul 08 |
nicklas |
360 |
id = j.getId(); |
4366 |
02 Jul 08 |
nicklas |
361 |
write("--Create job for " + itemType + " import OK"); |
4366 |
02 Jul 08 |
nicklas |
362 |
} |
4366 |
02 Jul 08 |
nicklas |
363 |
catch (Throwable ex) |
4366 |
02 Jul 08 |
nicklas |
364 |
{ |
4366 |
02 Jul 08 |
nicklas |
365 |
write("--Create job for " + itemType + " import FAILED"); |
4366 |
02 Jul 08 |
nicklas |
366 |
ex.printStackTrace(); |
4366 |
02 Jul 08 |
nicklas |
367 |
ok = false; |
4366 |
02 Jul 08 |
nicklas |
368 |
} |
4366 |
02 Jul 08 |
nicklas |
369 |
finally |
4366 |
02 Jul 08 |
nicklas |
370 |
{ |
4366 |
02 Jul 08 |
nicklas |
371 |
if (dc != null) dc.close(); |
4366 |
02 Jul 08 |
nicklas |
372 |
} |
4366 |
02 Jul 08 |
nicklas |
373 |
return id; |
4366 |
02 Jul 08 |
nicklas |
374 |
} |
4366 |
02 Jul 08 |
nicklas |
375 |
|
4366 |
02 Jul 08 |
nicklas |
376 |
static void write(String message) |
4366 |
02 Jul 08 |
nicklas |
377 |
{ |
4366 |
02 Jul 08 |
nicklas |
378 |
System.out.println(message); |
4366 |
02 Jul 08 |
nicklas |
379 |
} |
4366 |
02 Jul 08 |
nicklas |
380 |
|
4366 |
02 Jul 08 |
nicklas |
381 |
|
4366 |
02 Jul 08 |
nicklas |
382 |
static void write_request_information(RequestInformation ri) |
4366 |
02 Jul 08 |
nicklas |
383 |
{ |
4366 |
02 Jul 08 |
nicklas |
384 |
if (TestUtil.getSilent()) return; |
4366 |
02 Jul 08 |
nicklas |
385 |
|
4366 |
02 Jul 08 |
nicklas |
386 |
write("Request information for command: "+ri.getCommand()); |
4366 |
02 Jul 08 |
nicklas |
387 |
write("\tTitle:\t"+ri.getTitle()); |
4366 |
02 Jul 08 |
nicklas |
388 |
write("\tDescription:\t"+ri.getDescription()); |
4366 |
02 Jul 08 |
nicklas |
389 |
for (PluginParameter<?> pp : ri.getParameters()) |
4366 |
02 Jul 08 |
nicklas |
390 |
{ |
6875 |
20 Apr 15 |
nicklas |
391 |
ParameterType<?> pt = pp.getParameterType(); |
4366 |
02 Jul 08 |
nicklas |
392 |
System.out.println("\tParameter:\t"+pp.getName() + "\t" + pp.getLabel() + "\t" + pt ); |
4366 |
02 Jul 08 |
nicklas |
393 |
} |
4366 |
02 Jul 08 |
nicklas |
394 |
} |
4366 |
02 Jul 08 |
nicklas |
395 |
|
6520 |
18 Aug 14 |
nicklas |
396 |
private static void setParserParameters(DbControl dc, PluginConfigurationRequest request, Item itemType) |
4366 |
02 Jul 08 |
nicklas |
397 |
{ |
4366 |
02 Jul 08 |
nicklas |
398 |
request.setParameterValue("dataSplitterRegexp", "\\t"); |
4366 |
02 Jul 08 |
nicklas |
399 |
request.setParameterValue("dataHeaderRegexp", "Name.*"); |
4366 |
02 Jul 08 |
nicklas |
400 |
request.setParameterValue("ignoreRegexp", "#.*"); |
4366 |
02 Jul 08 |
nicklas |
401 |
|
6520 |
18 Aug 14 |
nicklas |
402 |
if (itemType == Item.FILE) |
6520 |
18 Aug 14 |
nicklas |
403 |
{ |
6520 |
18 Aug 14 |
nicklas |
404 |
request.setParameterValue("dataHeaderRegexp", "Path.*"); |
6520 |
18 Aug 14 |
nicklas |
405 |
request.setParameterValue("idMethod", "path"); |
6520 |
18 Aug 14 |
nicklas |
406 |
request.setParameterValue("root", Directory.getByPath(dc, new Path("/file-import", Path.Type.DIRECTORY))); |
6520 |
18 Aug 14 |
nicklas |
407 |
} |
6520 |
18 Aug 14 |
nicklas |
408 |
else |
6520 |
18 Aug 14 |
nicklas |
409 |
{ |
6520 |
18 Aug 14 |
nicklas |
410 |
request.setParameterValue("idMethod", "name"); |
6520 |
18 Aug 14 |
nicklas |
411 |
} |
7102 |
09 Mar 16 |
nicklas |
412 |
if (itemType == Item.ANNOTATIONTYPE) |
7102 |
09 Mar 16 |
nicklas |
413 |
{ |
7102 |
09 Mar 16 |
nicklas |
414 |
request.setParameterValue("enumerationSplitterRegexp", ";"); |
7102 |
09 Mar 16 |
nicklas |
415 |
} |
6784 |
18 Mar 15 |
nicklas |
416 |
request.setParameterValue("mode", itemType == Item.RAWBIOASSAY ? "create" : "create+update"); |
5445 |
13 Oct 10 |
nicklas |
417 |
request.setParameterValue("charset", "UTF-8"); |
4366 |
02 Jul 08 |
nicklas |
418 |
} |
4366 |
02 Jul 08 |
nicklas |
419 |
|
5641 |
25 May 11 |
nicklas |
420 |
private static void setColumnMappingParameters(PluginConfigurationRequest request, Item itemType, File file) |
4366 |
02 Jul 08 |
nicklas |
421 |
{ |
4366 |
02 Jul 08 |
nicklas |
422 |
request.setParameterValue("nameColumnMapping", "\\Name\\"); |
4366 |
02 Jul 08 |
nicklas |
423 |
request.setParameterValue("descriptionColumnMapping", "\\Description\\"); |
5899 |
06 Dec 11 |
nicklas |
424 |
request.setParameterValue("complexExpressions", "allow"); |
6520 |
18 Aug 14 |
nicklas |
425 |
if (itemType == Item.FILE) |
6520 |
18 Aug 14 |
nicklas |
426 |
{ |
6520 |
18 Aug 14 |
nicklas |
427 |
request.setParameterValue("pathColumnMapping", "\\Path\\"); |
6520 |
18 Aug 14 |
nicklas |
428 |
request.setParameterValue("urlColumnMapping", "\\URL\\"); |
6520 |
18 Aug 14 |
nicklas |
429 |
request.setParameterValue("fileServerColumnMapping", "\\File server\\"); |
6520 |
18 Aug 14 |
nicklas |
430 |
request.setParameterValue("mimeTypeColumnMapping", "\\Mime type\\"); |
6520 |
18 Aug 14 |
nicklas |
431 |
request.setParameterValue("subtypeColumnMapping", "\\Type\\"); |
6520 |
18 Aug 14 |
nicklas |
432 |
} |
7099 |
07 Mar 16 |
nicklas |
433 |
if (itemType == Item.ANNOTATIONTYPE) |
7099 |
07 Mar 16 |
nicklas |
434 |
{ |
7099 |
07 Mar 16 |
nicklas |
435 |
request.setParameterValue("valueTypeColumnMapping", "\\Value type\\"); |
7099 |
07 Mar 16 |
nicklas |
436 |
request.setParameterValue("externalIdColumnMapping", "\\External id\\"); |
7099 |
07 Mar 16 |
nicklas |
437 |
request.setParameterValue("categoryColumnMapping", "\\Category\\"); |
7100 |
08 Mar 16 |
nicklas |
438 |
request.setParameterValue("multiplicityColumnMapping", "\\Multiplicity\\"); |
7100 |
08 Mar 16 |
nicklas |
439 |
request.setParameterValue("defaultValueColumnMapping", "\\Default value\\"); |
7100 |
08 Mar 16 |
nicklas |
440 |
request.setParameterValue("miameColumnMapping", "\\Required for MIAME\\"); |
7100 |
08 Mar 16 |
nicklas |
441 |
request.setParameterValue("protocolParameterColumnMapping", "\\Protocol parameter\\"); |
7166 |
07 Jun 16 |
nicklas |
442 |
request.setParameterValue("disableChangeLogColumnMapping", "\\Disable history log\\"); |
7100 |
08 Mar 16 |
nicklas |
443 |
request.setParameterValue("disableInheritanceColumnMapping", "\\Disable inheritance\\"); |
7101 |
08 Mar 16 |
nicklas |
444 |
request.setParameterValue("itemTypesColumnMapping", "\\Item types\\"); |
7101 |
08 Mar 16 |
nicklas |
445 |
request.setParameterValue("defaultUnitColumnMapping", "\\Default unit\\"); |
7101 |
08 Mar 16 |
nicklas |
446 |
request.setParameterValue("usableUnitColumnMapping", "\\Usable units\\"); |
7102 |
09 Mar 16 |
nicklas |
447 |
request.setParameterValue("enumerationColumnMapping", "\\Enumeration\\"); |
7102 |
09 Mar 16 |
nicklas |
448 |
request.setParameterValue("minValueColumnMapping", "\\Min value\\"); |
7102 |
09 Mar 16 |
nicklas |
449 |
request.setParameterValue("maxValueColumnMapping", "\\Max value\\"); |
7099 |
07 Mar 16 |
nicklas |
450 |
} |
6998 |
04 Nov 15 |
nicklas |
451 |
if (itemType == Item.KIT) |
6998 |
04 Nov 15 |
nicklas |
452 |
{ |
6998 |
04 Nov 15 |
nicklas |
453 |
request.setParameterValue("expirationDateColumnMapping", "\\Expiration date\\"); |
6998 |
04 Nov 15 |
nicklas |
454 |
request.setParameterValue("subtypeColumnMapping", "\\Kit type\\"); |
6998 |
04 Nov 15 |
nicklas |
455 |
} |
5445 |
13 Oct 10 |
nicklas |
456 |
if (itemType == Item.BIOPLATE) |
5445 |
13 Oct 10 |
nicklas |
457 |
{ |
5445 |
13 Oct 10 |
nicklas |
458 |
request.setParameterValue("bioPlateTypeColumnMapping", "\\Bioplate type\\"); |
5445 |
13 Oct 10 |
nicklas |
459 |
request.setParameterValue("plateGeometryColumnMapping", "\\Plate geometry\\"); |
6055 |
04 Jun 12 |
nicklas |
460 |
request.setParameterValue("createdColumnMapping", "\\Created\\"); |
5445 |
13 Oct 10 |
nicklas |
461 |
request.setParameterValue("barcodeColumnMapping", "\\Barcode\\"); |
5445 |
13 Oct 10 |
nicklas |
462 |
request.setParameterValue("hardwareColumnMapping", "\\Freezer\\"); |
6063 |
13 Jun 12 |
nicklas |
463 |
request.setParameterValue("sectionColumnMapping", "\\Section\\"); |
6063 |
13 Jun 12 |
nicklas |
464 |
request.setParameterValue("trayColumnMapping", "\\Tray\\"); |
6063 |
13 Jun 12 |
nicklas |
465 |
request.setParameterValue("positionColumnMapping", "\\Position\\"); |
5445 |
13 Oct 10 |
nicklas |
466 |
} |
5641 |
25 May 11 |
nicklas |
467 |
if (itemType == Item.SAMPLE || itemType == Item.EXTRACT) |
4366 |
02 Jul 08 |
nicklas |
468 |
{ |
4426 |
29 Aug 08 |
nicklas |
469 |
request.setParameterValue("externalIdColumnMapping", "\\External ID\\"); |
5899 |
06 Dec 11 |
nicklas |
470 |
request.setParameterValue("protocolColumnMapping", "=default(col('Protocol'))"); |
6998 |
04 Nov 15 |
nicklas |
471 |
request.setParameterValue("kitColumnMapping", "\\Kit\\"); |
4366 |
02 Jul 08 |
nicklas |
472 |
request.setParameterValue("createdColumnMapping", "\\Created\\"); |
4366 |
02 Jul 08 |
nicklas |
473 |
request.setParameterValue("originalQuantityColumnMapping", "\\Original quantity\\"); |
5667 |
23 Jun 11 |
nicklas |
474 |
request.setParameterValue("parentTypeColumnMapping", "\\Parent type\\"); |
4366 |
02 Jul 08 |
nicklas |
475 |
request.setParameterValue("parentColumnMapping", "\\Parent\\"); |
4366 |
02 Jul 08 |
nicklas |
476 |
request.setParameterValue("usedQuantityColumnMapping", "\\Used quantity\\"); |
4366 |
02 Jul 08 |
nicklas |
477 |
} |
5641 |
25 May 11 |
nicklas |
478 |
if (file.getName().contains("labeledextracts")) |
4372 |
04 Jul 08 |
nicklas |
479 |
{ |
5648 |
30 May 11 |
nicklas |
480 |
request.setParameterValue("tagColumnMapping", "\\Label\\"); |
5667 |
23 Jun 11 |
nicklas |
481 |
request.setParameterValue("parentTypeColumnMapping", "EXTRACT"); |
5648 |
30 May 11 |
nicklas |
482 |
request.setParameterValue("subtypeColumnMapping", "Labeled extract"); |
4372 |
04 Jul 08 |
nicklas |
483 |
} |
5642 |
26 May 11 |
nicklas |
484 |
if (itemType == Item.PHYSICALBIOASSAY) |
4426 |
29 Aug 08 |
nicklas |
485 |
{ |
5649 |
30 May 11 |
nicklas |
486 |
request.setParameterValue("subtypeColumnMapping", "Hybridization"); |
5649 |
30 May 11 |
nicklas |
487 |
request.setParameterValue("sizeColumnMapping", "\\Size\\"); |
5899 |
06 Dec 11 |
nicklas |
488 |
request.setParameterValue("protocolColumnMapping", "=default(col('Protocol'))"); |
6998 |
04 Nov 15 |
nicklas |
489 |
request.setParameterValue("kitColumnMapping", "\\Kit\\"); |
5899 |
06 Dec 11 |
nicklas |
490 |
request.setParameterValue("hardwareColumnMapping", "=default()"); |
4426 |
29 Aug 08 |
nicklas |
491 |
request.setParameterValue("createdColumnMapping", "\\Created\\"); |
4426 |
29 Aug 08 |
nicklas |
492 |
request.setParameterValue("parentColumnMapping", "\\Parent\\"); |
4426 |
29 Aug 08 |
nicklas |
493 |
request.setParameterValue("usedQuantityColumnMapping", "\\Used quantity\\"); |
5649 |
30 May 11 |
nicklas |
494 |
request.setParameterValue("extractPositionColumnMapping", "\\Position\\"); |
4426 |
29 Aug 08 |
nicklas |
495 |
request.setParameterValue("arraySlideColumnMapping", "\\Array slide\\"); |
4426 |
29 Aug 08 |
nicklas |
496 |
} |
5688 |
10 Aug 11 |
nicklas |
497 |
if (itemType == Item.DERIVEDBIOASSAY) |
4426 |
29 Aug 08 |
nicklas |
498 |
{ |
5696 |
12 Aug 11 |
nicklas |
499 |
request.setParameterValue("dataDirectory", "/"); |
5696 |
12 Aug 11 |
nicklas |
500 |
request.setParameterValue("subtypeColumnMapping", "\\Subtype\\"); |
5696 |
12 Aug 11 |
nicklas |
501 |
request.setParameterValue("parentColumnMapping", "\\Parent\\"); |
5696 |
12 Aug 11 |
nicklas |
502 |
request.setParameterValue("extractColumnMapping", "\\Extract\\"); |
4426 |
29 Aug 08 |
nicklas |
503 |
request.setParameterValue("protocolColumnMapping", "\\Protocol\\"); |
4426 |
29 Aug 08 |
nicklas |
504 |
request.setParameterValue("hardwareColumnMapping", "\\Scanner\\"); |
5696 |
12 Aug 11 |
nicklas |
505 |
request.setParameterValue("fileTypeColumnMapping", "\\File type\\"); |
5696 |
12 Aug 11 |
nicklas |
506 |
request.setParameterValue("fileColumnMapping", "\\File\\"); |
4426 |
29 Aug 08 |
nicklas |
507 |
} |
4426 |
29 Aug 08 |
nicklas |
508 |
if (itemType == Item.RAWBIOASSAY) |
4426 |
29 Aug 08 |
nicklas |
509 |
{ |
4434 |
02 Sep 08 |
nicklas |
510 |
request.setParameterValue("dataDirectory", "/"); |
5688 |
10 Aug 11 |
nicklas |
511 |
request.setParameterValue("bioAssayColumnMapping", "\\Scan\\"); |
4426 |
29 Aug 08 |
nicklas |
512 |
request.setParameterValue("protocolColumnMapping", "\\Protocol\\"); |
4426 |
29 Aug 08 |
nicklas |
513 |
request.setParameterValue("platformColumnMapping", "\\Platform\\"); |
4426 |
29 Aug 08 |
nicklas |
514 |
request.setParameterValue("variantColumnMapping", "\\Variant\\"); |
4426 |
29 Aug 08 |
nicklas |
515 |
request.setParameterValue("rawDataTypeColumnMapping", "\\Raw data type\\"); |
4426 |
29 Aug 08 |
nicklas |
516 |
request.setParameterValue("softwareColumnMapping", "\\Software\\"); |
4434 |
02 Sep 08 |
nicklas |
517 |
request.setParameterValue("arrayDesignColumnMapping", "\\Array design\\"); |
4426 |
29 Aug 08 |
nicklas |
518 |
request.setParameterValue("fileTypeColumnMapping", "\\File type\\"); |
4426 |
29 Aug 08 |
nicklas |
519 |
request.setParameterValue("fileColumnMapping", "\\File\\"); |
4426 |
29 Aug 08 |
nicklas |
520 |
} |
4434 |
02 Sep 08 |
nicklas |
521 |
if (itemType == Item.ARRAYDESIGN) |
4434 |
02 Sep 08 |
nicklas |
522 |
{ |
4434 |
02 Sep 08 |
nicklas |
523 |
request.setParameterValue("dataDirectory", "/"); |
4434 |
02 Sep 08 |
nicklas |
524 |
request.setParameterValue("numArraysColumnMapping", "\\Num arrays\\"); |
4434 |
02 Sep 08 |
nicklas |
525 |
request.setParameterValue("platformColumnMapping", "\\Platform\\"); |
4434 |
02 Sep 08 |
nicklas |
526 |
request.setParameterValue("variantColumnMapping", "\\Variant\\"); |
4434 |
02 Sep 08 |
nicklas |
527 |
request.setParameterValue("fileTypeColumnMapping", "\\File type\\"); |
4434 |
02 Sep 08 |
nicklas |
528 |
request.setParameterValue("fileColumnMapping", "\\File\\"); |
4434 |
02 Sep 08 |
nicklas |
529 |
} |
4434 |
02 Sep 08 |
nicklas |
530 |
if (itemType == Item.ARRAYBATCH) |
4434 |
02 Sep 08 |
nicklas |
531 |
{ |
4434 |
02 Sep 08 |
nicklas |
532 |
request.setParameterValue("arrayDesignColumnMapping", "\\Array design\\"); |
4434 |
02 Sep 08 |
nicklas |
533 |
request.setParameterValue("protocolColumnMapping", "\\Protocol\\"); |
4434 |
02 Sep 08 |
nicklas |
534 |
request.setParameterValue("hardwareColumnMapping", "\\Robot\\"); |
4434 |
02 Sep 08 |
nicklas |
535 |
} |
4434 |
02 Sep 08 |
nicklas |
536 |
if (itemType == Item.ARRAYSLIDE) |
4434 |
02 Sep 08 |
nicklas |
537 |
{ |
4434 |
02 Sep 08 |
nicklas |
538 |
request.setParameterValue("arrayBatchColumnMapping", "\\Array batch\\"); |
4434 |
02 Sep 08 |
nicklas |
539 |
request.setParameterValue("indexColumnMapping", "\\Index\\"); |
4434 |
02 Sep 08 |
nicklas |
540 |
request.setParameterValue("barcodeColumnMapping", "\\Barcode\\"); |
4434 |
02 Sep 08 |
nicklas |
541 |
request.setParameterValue("destroyedColumnMapping", "\\Destroyed\\"); |
4434 |
02 Sep 08 |
nicklas |
542 |
} |
4366 |
02 Jul 08 |
nicklas |
543 |
} |
4366 |
02 Jul 08 |
nicklas |
544 |
|
4366 |
02 Jul 08 |
nicklas |
545 |
private static void setErrorHandlingParameters(PluginConfigurationRequest request, Item itemType) |
4366 |
02 Jul 08 |
nicklas |
546 |
{ |
4366 |
02 Jul 08 |
nicklas |
547 |
request.setParameterValue("defaultError", "fail"); |
4366 |
02 Jul 08 |
nicklas |
548 |
request.setParameterValue("stringTooLongError", "crop"); |
4366 |
02 Jul 08 |
nicklas |
549 |
request.setParameterValue("numberFormatError", "skip"); |
4366 |
02 Jul 08 |
nicklas |
550 |
request.setParameterValue("numberOutOfRangeError", "skip"); |
5689 |
11 Aug 11 |
nicklas |
551 |
|
4366 |
02 Jul 08 |
nicklas |
552 |
request.setParameterValue("logFile", "/" + itemType.name() + ".log"); |
4366 |
02 Jul 08 |
nicklas |
553 |
} |
4366 |
02 Jul 08 |
nicklas |
554 |
|
4366 |
02 Jul 08 |
nicklas |
555 |
} |
4366 |
02 Jul 08 |
nicklas |
556 |
|