Changeset 5934
- Timestamp:
- Jan 25, 2012, 1:52:40 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/3.0-stable merged: 5863,5925-5926,5930-5931 /tags/3.0.2 (added) merged: 5932
- Property svn:mergeinfo changed
-
trunk/credits.txt
r5864 r5934 1 1 $Id$ 2 2 3 The current BASE team is (at BASE 3.0. 1release)3 The current BASE team is (at BASE 3.0.2 release) 4 4 {{{ 5 5 Jari Häkkinen -
trunk/src/clients/web/net/sf/basedb/clients/web/Base.java
r5881 r5934 560 560 561 561 // Item permission 562 String permission = Values.getStringOrNull(request.getParameter("permission"));562 String permission = request.getParameter("permission"); 563 563 if (permission != null) 564 564 { … … 586 586 { 587 587 cc.removeAllPropertyFilters(); 588 cc.setItemPermission(null); 588 589 filterHasChanged = true; 589 590 } -
trunk/src/core/net/sf/basedb/core/Keyring.java
r5829 r5934 164 164 TRUE if the Timer has signaled that it is time to reload the information. 165 165 */ 166 private boolean reload;166 private volatile boolean reload; 167 167 168 168 /** … … 263 263 { 264 264 if (!getReload()) return true; 265 setReload(false); 265 266 org.hibernate.Session session = null; 266 267 org.hibernate.Transaction tx = null; … … 284 285 loadPluginPermissionKeys(session); 285 286 } 286 setReload(false);287 287 // Schedule another reload as configured in base.config 288 288 Application.getCoreTimer().schedule(new ReloadTask(), … … 743 743 else 744 744 { 745 maxProjectPermission = IntegerUtil.getInt(projects.get(projectId)) ;745 maxProjectPermission = IntegerUtil.getInt(projects.get(projectId)) | getRolePermissions(Item.PROJECT); 746 746 } 747 747 } -
trunk/src/plugins/core/net/sf/basedb/plugins/batchimport/AbstractItemImporter.java
r5899 r5934 605 605 if (subtypes.size() == 1) 606 606 { 607 selectedSubtype = subtypes.get(0);607 selectedSubtype = ItemSubtype.getById(dc, subtypes.get(0).getId()); 608 608 itemQuery.restrict(Restrictions.eq(Hql.property("itemSubtype"), subtypeParameter)); 609 609 itemQuery.setEntityParameter("subtypes", selectedSubtype); -
trunk/src/test/TestItemImporter.java
r5899 r5934 20 20 along with BASE. If not, see <http://www.gnu.org/licenses/>. 21 21 */ 22 23 import java.util.Collections; 22 24 23 25 import net.sf.basedb.core.BaseException; … … 28 30 import net.sf.basedb.core.Hardware; 29 31 import net.sf.basedb.core.Item; 32 import net.sf.basedb.core.ItemSubtype; 30 33 import net.sf.basedb.core.Job; 31 34 import net.sf.basedb.core.ParameterType; … … 81 84 int freezerId = TestHardware.test_create(SystemItems.getId(Hardware.FREEZER), "Freezer", false); 82 85 int childScanId = TestItemSubtype.test_create(Item.DERIVEDBIOASSAY, "ChildScan", SystemItems.getId(DerivedBioAssay.SCAN)); 86 int allSamplesSubtypeId = TestItemSubtype.test_create(Item.SAMPLE, "All samples"); 83 87 84 88 TestProject.test_defaultItem(projectId, Item.PROTOCOL, defaultSamplingProtocolId); … … 89 93 int bioPlateFileId = TestFile.test_create("data/test.batchimport.bioplates.txt", false, false); 90 94 int bioPlateImporterId = TestPluginDefinition.test_get("net.sf.basedb.plugins.batchimport.BioPlateImporter"); 91 int bioPlateJobId = test_create_item_import_job(Item.BIOPLATE, bioPlateImporterId, bioPlateFileId );95 int bioPlateJobId = test_create_item_import_job(Item.BIOPLATE, bioPlateImporterId, bioPlateFileId, 0); 92 96 ok = ok & TestJob.test_execute(bioPlateJobId, false); 93 97 ok = ok & TestBioPlate.test_list(2); … … 96 100 int bioSourceFileId = TestFile.test_create("data/test.batchimport.biosources.txt", false, false); 97 101 int bioSourceImporterId = TestPluginDefinition.test_get("net.sf.basedb.plugins.batchimport.BioSourceImporter"); 98 int bioSourceJobId = test_create_item_import_job(Item.BIOSOURCE, bioSourceImporterId, bioSourceFileId );102 int bioSourceJobId = test_create_item_import_job(Item.BIOSOURCE, bioSourceImporterId, bioSourceFileId, 0); 99 103 ok = ok & TestJob.test_execute(bioSourceJobId, false); 100 104 ok = ok & TestBioSource.test_list(3); … … 103 107 int sampleFileId = TestFile.test_create("data/test.batchimport.samples.txt", false, false); 104 108 int sampleImporterId = TestPluginDefinition.test_get("net.sf.basedb.plugins.batchimport.SampleImporter"); 105 int sampleJobId = test_create_item_import_job(Item.SAMPLE, sampleImporterId, sampleFileId );109 int sampleJobId = test_create_item_import_job(Item.SAMPLE, sampleImporterId, sampleFileId, allSamplesSubtypeId); 106 110 ok = ok & TestJob.test_execute(sampleJobId, false); 107 111 ok = ok & TestSample.test_list(4); … … 110 114 int extractFileId = TestFile.test_create("data/test.batchimport.extracts.txt", false, false); 111 115 int extractImporterId = TestPluginDefinition.test_get("net.sf.basedb.plugins.batchimport.ExtractImporter"); 112 int extractJobId = test_create_item_import_job(Item.EXTRACT, extractImporterId, extractFileId );116 int extractJobId = test_create_item_import_job(Item.EXTRACT, extractImporterId, extractFileId, 0); 113 117 ok = ok & TestJob.test_execute(extractJobId, false); 114 118 ok = ok & TestExtract.test_list(0, 4); … … 117 121 int labledExtractFileId = TestFile.test_create("data/test.batchimport.labeledextracts.txt", false, false); 118 122 int labledExtractImporterId = extractImporterId; 119 int labledExtractJobId = test_create_item_import_job(Item.EXTRACT, labledExtractImporterId, labledExtractFileId );123 int labledExtractJobId = test_create_item_import_job(Item.EXTRACT, labledExtractImporterId, labledExtractFileId, 0); 120 124 ok = ok & TestJob.test_execute(labledExtractJobId, false); 121 125 ok = ok & TestExtract.test_list(SystemItems.getId(Extract.LABELED), 7); … … 128 132 int designFileId = TestFile.test_create("data/test.batchimport.arraydesigns.txt", false, false); 129 133 int designImporterId = TestPluginDefinition.test_get("net.sf.basedb.plugins.batchimport.ArrayDesignImporter"); 130 int designJobId = test_create_item_import_job(Item.ARRAYDESIGN, designImporterId, designFileId );134 int designJobId = test_create_item_import_job(Item.ARRAYDESIGN, designImporterId, designFileId, 0); 131 135 ok = ok & TestJob.test_execute(designJobId, false); 132 136 ok = ok & TestArrayDesign.test_list(3); … … 135 139 int arrayBatchFileId = TestFile.test_create("data/test.batchimport.arraybatches.txt", false, false); 136 140 int arrayBatchImporterId = TestPluginDefinition.test_get("net.sf.basedb.plugins.batchimport.ArrayBatchImporter"); 137 int arrayBatchJobId = test_create_item_import_job(Item.ARRAYBATCH, arrayBatchImporterId, arrayBatchFileId );141 int arrayBatchJobId = test_create_item_import_job(Item.ARRAYBATCH, arrayBatchImporterId, arrayBatchFileId, 0); 138 142 ok = ok & TestJob.test_execute(arrayBatchJobId, false); 139 143 ok = ok & TestArrayBatch.test_list(3); … … 142 146 int arraySlideFileId = TestFile.test_create("data/test.batchimport.arrayslides.txt", false, false); 143 147 int arraySlideImporterId = TestPluginDefinition.test_get("net.sf.basedb.plugins.batchimport.ArraySlideImporter"); 144 int arraySlideJobId = test_create_item_import_job(Item.ARRAYSLIDE, arraySlideImporterId, arraySlideFileId );148 int arraySlideJobId = test_create_item_import_job(Item.ARRAYSLIDE, arraySlideImporterId, arraySlideFileId, 0); 145 149 ok = ok & TestJob.test_execute(arraySlideJobId, false); 146 150 ok = ok & TestArraySlide.test_list(5); … … 149 153 int hybFileId = TestFile.test_create("data/test.batchimport.hybridizations.txt", false, false); 150 154 int hybImporterId = TestPluginDefinition.test_get("net.sf.basedb.plugins.batchimport.PhysicalBioAssayImporter"); 151 int hybJobId = test_create_item_import_job(Item.PHYSICALBIOASSAY, hybImporterId, hybFileId );155 int hybJobId = test_create_item_import_job(Item.PHYSICALBIOASSAY, hybImporterId, hybFileId, 0); 152 156 ok = ok & TestJob.test_execute(hybJobId, false); 153 157 ok = ok & TestPhysicalBioAssay.test_list(3); … … 158 162 int scanFileId = TestFile.test_create("data/test.batchimport.scans.txt", false, false); 159 163 int scanImporterId = TestPluginDefinition.test_get("net.sf.basedb.plugins.batchimport.DerivedBioAssayImporter"); 160 int scanJobId = test_create_item_import_job(Item.DERIVEDBIOASSAY, scanImporterId, scanFileId );164 int scanJobId = test_create_item_import_job(Item.DERIVEDBIOASSAY, scanImporterId, scanFileId, 0); 161 165 ok = ok & TestJob.test_execute(scanJobId, false); 162 166 ok = ok & TestDerivedBioAssay.test_list(0, 4); … … 169 173 int rbaFileId = TestFile.test_create("data/test.batchimport.rawbioassays.txt", false, false); 170 174 int rbaImporterId = TestPluginDefinition.test_get("net.sf.basedb.plugins.batchimport.RawBioAssayImporter"); 171 int rbaJobId = test_create_item_import_job(Item.RAWBIOASSAY, rbaImporterId, rbaFileId );175 int rbaJobId = test_create_item_import_job(Item.RAWBIOASSAY, rbaImporterId, rbaFileId, 0); 172 176 ok = ok & TestJob.test_execute(rbaJobId, false); 173 177 ok = ok & TestRawBioAssay.test_list(4); … … 252 256 TestPlatform.test_delete_variant(variantId); 253 257 TestItemSubtype.test_delete(childScanId); 258 TestItemSubtype.test_delete(allSamplesSubtypeId); 254 259 TestProject.test_delete(projectId); 255 260 … … 258 263 } 259 264 260 static int test_create_item_import_job(Item itemType, int pluginDefinitionId, int fileId )265 static int test_create_item_import_job(Item itemType, int pluginDefinitionId, int fileId, int subtypeId) 261 266 { 262 267 if (pluginDefinitionId == 0 || fileId == 0) return 0; … … 278 283 setParserParameters(request); 279 284 setColumnMappingParameters(request, itemType, file); 285 if (subtypeId != 0) 286 { 287 request.setParameterValues("itemSubtypes", Collections.singletonList(ItemSubtype.getById(dc, subtypeId))); 288 } 289 290 280 291 PluginResponse response = request.invoke(); 281 292 if (response.getStatus() != Response.Status.CONTINUE)
Note: See TracChangeset
for help on using the changeset viewer.