Changeset 2091


Ignore:
Timestamp:
Oct 21, 2013, 12:51:45 PM (9 years ago)
Author:
Nicklas Nordborg
Message:

References #512: Updates to the register pooled libraries wizard

Improved performance when loading library plate information for pools. There is no need to load the individual libraries in all pools. Better to only use the code developed for #502 in [2090] to load library bioplates directly.

Location:
extensions/net.sf.basedb.reggie/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/resources/libprep/pool_protocol.jsp

    r1973 r2091  
    2828
    2929<script language="JavaScript">
    30 var debug = false;
     30var debug = 0;
    3131var currentStep = 1;
    3232
     
    5252      var pool = pools[poolNo];
    5353     
    54       var libPlateForPool = null;
    55       for (var libNo = 0; libNo < pool.libraries.length; libNo++)
    56       {
    57         var lib = pool.libraries[libNo];
    58         var libPlate = lib.bioWell.bioPlate;
    59        
    60         if (libNo == 0)
    61         {
    62           libPlateForPool = libPlate;
    63         }
    64         else if (libPlateForPool.id != libPlate.id)
    65         {
    66           libPlateForPool = null;
    67           break;
    68         }
    69       }
    70      
    71       // Store the library bioplate
    72       pool.libPlate = libPlateForPool;
    73      
     54      // Shortcut to single-plate pools
     55      var libPlateForPool = pool.libPlates.length == 1 ? pool.libPlates[0] : null;
     56      pool.libPlate = libPlateForPool
     57   
    7458      // If the pool has a single library bioplate add it to the selection list
    7559      // If the pool doesn't have a single library bioplate, nothing is added to
  • extensions/net.sf.basedb.reggie/trunk/resources/libprep/pool_registration.jsp

    r2066 r2091  
    5555      var pool = pools[poolNo];
    5656     
    57       var libPlateForPool = null;
    58       for (var libNo = 0; libNo < pool.libraries.length; libNo++)
    59       {
    60         var lib = pool.libraries[libNo];
    61         var libPlate = lib.bioWell.bioPlate;
    62        
    63         if (libNo == 0)
    64         {
    65           libPlateForPool = libPlate;
    66         }
    67         else if (libPlateForPool.id != libPlate.id)
    68         {
    69           libPlateForPool = null;
    70           break;
    71         }
    72       }
    73      
    74       // Store the library bioplate
    75       pool.libPlate = libPlateForPool;
    76      
     57      // Shortcut to single-plate pools
     58      var libPlateForPool = pool.libPlates.length == 1 ? pool.libPlates[0] : null;
     59      pool.libPlate = libPlateForPool
     60
    7761      // If the pool has a single library bioplate add it to the selection list
    7862      // If the pool doesn't have a single library bioplate, nothing is added to
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/PoolServlet.java

    r2066 r2091  
    249249        for (PooledLibrary pool : pools)
    250250        {
     251          pool.loadLibPlates(dc);
    251252          pool.loadAnnotations(dc, "molarity", Annotationtype.POOL_MOLARITY, null);
    252253          pool.loadAnnotations(dc, "conc", Annotationtype.POOL_CONC, null);
     
    254255          pool.setAnnotation("comments", pool.getExtract().getDescription());
    255256          jsonPools.add(pool.asJSONObject());
    256          
    257           List<Library> libs = Library.getByPool(dc, pool);
    258           JSONArray jsonLibs = new JSONArray();
    259           for (Library lib : libs)
    260           {
    261             lib.loadBioPlateLocation();
    262             lib.setAnnotation("comment", lib.getExtract().getDescription());
    263             jsonLibs.add(lib.asJSONObject());
    264           }
    265           pool.setAnnotation("libraries", jsonLibs);
    266257        }
    267258        json.put("pools", jsonPools);
Note: See TracChangeset for help on using the changeset viewer.