Changeset 2033


Ignore:
Timestamp:
Oct 2, 2013, 2:13:03 PM (8 years ago)
Author:
olle
Message:

Refs #501. First version of wizard for clustering lab protocol.

Location:
extensions/net.sf.basedb.reggie/trunk
Files:
2 added
2 edited
1 copied

Legend:

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

    r2023 r2033  
    295295      var msg = error || 'Number of flow cells waiting for registration';
    296296      var count = error ? -1 : response.count;
     297      setCount('count.flow-cells.0', count, 'flow cells', msg);
    297298      setCount('count.flow-cells', count, 'flow cells', msg);
    298299    }
     
    504505            <li><a href="libprep/pool_registration.jsp?ID=<%=ID%>">Register pooled libraries</a> <span class="counter" id="count.pools.2" title="Counting..."><img src="images/loading-small.gif"></span>
    505506            <li><a href="libprep/create_flowcells.jsp?ID=<%=ID%>">Create flow cells</a> <span class="counter" id="count.pools.3" title="Counting..."><img src="images/loading-small.gif"></span>
     507            <li><a href="libprep/flowcell_protocol.jsp?ID=<%=ID%>">Lab protocols for clustering</a> <span class="counter" id="count.flow-cells.0" title="Counting..."><img src="images/loading-small.gif"></span>
    506508            <li><a href="libprep/flowcell_registration.jsp?ID=<%=ID%>">Register flow cells</a> <span class="counter" id="count.flow-cells" title="Counting..."><img src="images/loading-small.gif"></span>
    507509            </ul>
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/FlowCellServlet.java

    r2031 r2033  
    22
    33import java.io.IOException;
     4import java.util.ArrayList;
    45import java.util.Date;
    56import java.util.HashMap;
     
    1718
    1819import net.sf.basedb.core.Application;
     20import net.sf.basedb.core.Annotatable;
    1921import net.sf.basedb.core.BioMaterialEvent;
    2022import net.sf.basedb.core.BioMaterialEventSource;
     
    2224import net.sf.basedb.core.Extract;
    2325import net.sf.basedb.core.ItemQuery;
     26import net.sf.basedb.core.ItemResultList;
    2427import net.sf.basedb.core.ItemSubtype;
    2528import net.sf.basedb.core.PhysicalBioAssay;
     
    3033import net.sf.basedb.core.query.Orders;
    3134import net.sf.basedb.core.query.Restrictions;
     35import net.sf.basedb.core.snapshot.SnapshotManager;
    3236import net.sf.basedb.reggie.Reggie;
    3337import net.sf.basedb.reggie.dao.Annotationtype;
     
    142146        json.put("flowCells", jsonFlowCells);
    143147      }
    144 
     148      else if ("GetFlowCellInfo".equals(cmd))
     149      {
     150        dc = sc.newDbControl();
     151        // Use stored annotation snapshots for performance reasons
     152        SnapshotManager manager = new SnapshotManager();       
     153        JSONArray jsonFlowCellInfo = new JSONArray();
     154        String idListStr = req.getParameter("idlist");
     155        List<String> idList = new ArrayList<String>();
     156        for (String s: idListStr.split(","))
     157        {
     158          idList.add(s);
     159        }
     160        List<FlowCell> flowCellList = new ArrayList<FlowCell>();
     161        for (String s: idList)
     162        {
     163          int id = Integer.parseInt(s);
     164          FlowCell fc = FlowCell.getById(dc, id);
     165          flowCellList.add(fc);
     166        }
     167        for (FlowCell fc: flowCellList)
     168        {
     169          JSONObject jsonFlowCell = new JSONObject();
     170          jsonFlowCell.put("name", fc.getName());
     171          // Get ReadString annotation
     172          PhysicalBioAssay physBA = fc.getPhysicalBioAssay();
     173          jsonFlowCell.put("description", physBA.getDescription());
     174          int numLanes = physBA.getSize();
     175          String readString = (String) Annotationtype.READ_STRING.getAnnotationValue(dc, manager, physBA);
     176          jsonFlowCell.put("readString", readString);
     177          // Get flow cell lane info
     178          JSONObject jsonFlowCellLanes = new JSONObject();
     179          // Note: Lane positions start with 1, not 0
     180          for (int pos = 1; pos <= numLanes; pos++)
     181          {
     182            ItemResultList<Extract> fcExtractList = fc.getPhysicalBioAssay().getExtracts(pos).list(dc);
     183            for (Extract extract: fcExtractList)
     184            {
     185              jsonFlowCellLanes.put(pos, extract.getName());
     186            }
     187          }
     188          jsonFlowCell.put("numLanes", numLanes);
     189          jsonFlowCell.put("lanes", jsonFlowCellLanes);
     190          //
     191          jsonFlowCellInfo.add(jsonFlowCell);
     192        }
     193        json.put("flowCellInfo", jsonFlowCellInfo);
     194      }
    145195    }
    146196    catch (Throwable t)
Note: See TracChangeset for help on using the changeset viewer.