Changeset 5934


Ignore:
Timestamp:
Jan 25, 2012, 1:52:40 PM (10 years ago)
Author:
Nicklas Nordborg
Message:

Merged patch release 3.0.2 to the trunk.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/credits.txt

    r5864 r5934  
    11$Id$
    22
    3 The current BASE team is (at BASE 3.0.1 release)
     3The current BASE team is (at BASE 3.0.2 release)
    44{{{
    55Jari Häkkinen
  • trunk/src/clients/web/net/sf/basedb/clients/web/Base.java

    r5881 r5934  
    560560     
    561561      // Item permission
    562       String permission = Values.getStringOrNull(request.getParameter("permission"));
     562      String permission = request.getParameter("permission");
    563563      if (permission != null)
    564564      {
     
    586586      {
    587587        cc.removeAllPropertyFilters();
     588        cc.setItemPermission(null);
    588589        filterHasChanged = true;
    589590      }
  • trunk/src/core/net/sf/basedb/core/Keyring.java

    r5829 r5934  
    164164    TRUE if the Timer has signaled that it is time to reload the information.
    165165  */
    166   private boolean reload;
     166  private volatile boolean reload;
    167167
    168168  /**
     
    263263  {
    264264    if (!getReload()) return true;
     265    setReload(false);
    265266    org.hibernate.Session session = null;
    266267    org.hibernate.Transaction tx = null;
     
    284285        loadPluginPermissionKeys(session);
    285286      }
    286       setReload(false);
    287287      // Schedule another reload as configured in base.config
    288288      Application.getCoreTimer().schedule(new ReloadTask(),
     
    743743    else
    744744    {
    745       maxProjectPermission = IntegerUtil.getInt(projects.get(projectId));
     745      maxProjectPermission = IntegerUtil.getInt(projects.get(projectId)) | getRolePermissions(Item.PROJECT);
    746746    }
    747747  }
  • trunk/src/plugins/core/net/sf/basedb/plugins/batchimport/AbstractItemImporter.java

    r5899 r5934  
    605605      if (subtypes.size() == 1)
    606606      {
    607         selectedSubtype = subtypes.get(0);
     607        selectedSubtype = ItemSubtype.getById(dc, subtypes.get(0).getId());
    608608        itemQuery.restrict(Restrictions.eq(Hql.property("itemSubtype"), subtypeParameter));
    609609        itemQuery.setEntityParameter("subtypes", selectedSubtype);
  • trunk/src/test/TestItemImporter.java

    r5899 r5934  
    2020  along with BASE. If not, see <http://www.gnu.org/licenses/>.
    2121*/
     22
     23import java.util.Collections;
    2224
    2325import net.sf.basedb.core.BaseException;
     
    2830import net.sf.basedb.core.Hardware;
    2931import net.sf.basedb.core.Item;
     32import net.sf.basedb.core.ItemSubtype;
    3033import net.sf.basedb.core.Job;
    3134import net.sf.basedb.core.ParameterType;
     
    8184    int freezerId = TestHardware.test_create(SystemItems.getId(Hardware.FREEZER), "Freezer", false);
    8285    int childScanId = TestItemSubtype.test_create(Item.DERIVEDBIOASSAY, "ChildScan", SystemItems.getId(DerivedBioAssay.SCAN));
     86    int allSamplesSubtypeId = TestItemSubtype.test_create(Item.SAMPLE, "All samples");
    8387   
    8488    TestProject.test_defaultItem(projectId, Item.PROTOCOL, defaultSamplingProtocolId);
     
    8993    int bioPlateFileId = TestFile.test_create("data/test.batchimport.bioplates.txt", false, false);
    9094    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);
    9296    ok = ok & TestJob.test_execute(bioPlateJobId, false);
    9397    ok = ok & TestBioPlate.test_list(2);
     
    96100    int bioSourceFileId = TestFile.test_create("data/test.batchimport.biosources.txt", false, false);
    97101    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);
    99103    ok = ok & TestJob.test_execute(bioSourceJobId, false);
    100104    ok = ok & TestBioSource.test_list(3);
     
    103107    int sampleFileId = TestFile.test_create("data/test.batchimport.samples.txt", false, false);
    104108    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);
    106110    ok = ok & TestJob.test_execute(sampleJobId, false);
    107111    ok = ok & TestSample.test_list(4);
     
    110114    int extractFileId = TestFile.test_create("data/test.batchimport.extracts.txt", false, false);
    111115    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);
    113117    ok = ok & TestJob.test_execute(extractJobId, false);
    114118    ok = ok & TestExtract.test_list(0, 4);
     
    117121    int labledExtractFileId = TestFile.test_create("data/test.batchimport.labeledextracts.txt", false, false);
    118122    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);
    120124    ok = ok & TestJob.test_execute(labledExtractJobId, false);
    121125    ok = ok & TestExtract.test_list(SystemItems.getId(Extract.LABELED), 7);
     
    128132    int designFileId = TestFile.test_create("data/test.batchimport.arraydesigns.txt", false, false);
    129133    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);
    131135    ok = ok & TestJob.test_execute(designJobId, false);
    132136    ok = ok & TestArrayDesign.test_list(3);
     
    135139    int arrayBatchFileId = TestFile.test_create("data/test.batchimport.arraybatches.txt", false, false);
    136140    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);
    138142    ok = ok & TestJob.test_execute(arrayBatchJobId, false);
    139143    ok = ok & TestArrayBatch.test_list(3);
     
    142146    int arraySlideFileId = TestFile.test_create("data/test.batchimport.arrayslides.txt", false, false);
    143147    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);
    145149    ok = ok & TestJob.test_execute(arraySlideJobId, false);
    146150    ok = ok & TestArraySlide.test_list(5);
     
    149153    int hybFileId = TestFile.test_create("data/test.batchimport.hybridizations.txt", false, false);
    150154    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);
    152156    ok = ok & TestJob.test_execute(hybJobId, false);
    153157    ok = ok & TestPhysicalBioAssay.test_list(3);
     
    158162    int scanFileId = TestFile.test_create("data/test.batchimport.scans.txt", false, false);
    159163    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);
    161165    ok = ok & TestJob.test_execute(scanJobId, false);
    162166    ok = ok & TestDerivedBioAssay.test_list(0, 4);
     
    169173    int rbaFileId = TestFile.test_create("data/test.batchimport.rawbioassays.txt", false, false);
    170174    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);
    172176    ok = ok & TestJob.test_execute(rbaJobId, false);
    173177    ok = ok & TestRawBioAssay.test_list(4);
     
    252256    TestPlatform.test_delete_variant(variantId);
    253257    TestItemSubtype.test_delete(childScanId);
     258    TestItemSubtype.test_delete(allSamplesSubtypeId);
    254259    TestProject.test_delete(projectId);
    255260
     
    258263  }
    259264
    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)
    261266  {
    262267    if (pluginDefinitionId == 0 || fileId == 0) return 0;
     
    278283      setParserParameters(request);
    279284      setColumnMappingParameters(request, itemType, file);
     285      if (subtypeId != 0)
     286      {
     287        request.setParameterValues("itemSubtypes", Collections.singletonList(ItemSubtype.getById(dc, subtypeId)));
     288      }
     289     
     290     
    280291      PluginResponse response = request.invoke();
    281292      if (response.getStatus() != Response.Status.CONTINUE)
Note: See TracChangeset for help on using the changeset viewer.