Changeset 1745
- Timestamp:
- Nov 27, 2012, 1:06:55 PM (10 years ago)
- Location:
- extensions/net.sf.basedb.reggie/branches/ticket-422
- Files:
-
- 5 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/branches/ticket-422/.classpath
r1606 r1745 9 9 <classpathentry kind="lib" path="lib/compile/base-webclient-3.1.0.jar"/> 10 10 <classpathentry kind="lib" path="lib/compile/base-webservices-client-3.1.0.jar"/> 11 <classpathentry kind="output" path=" build"/>11 <classpathentry kind="output" path=".build"/> 12 12 </classpath> -
extensions/net.sf.basedb.reggie/branches/ticket-422/resources/index.jsp
r1742 r1745 289 289 <ul> 290 290 <li><a href="libprep/select_rna.jsp?ID=<%=ID%>">Create new mRNA plate</a> 291 <li><a href=" ?ID=<%=ID%>">Lab tracking protocol for mRNA and cDNA preparation</a>291 <li><a href="libprep/mrna_protocol.jsp?ID=<%=ID%>">Lab tracking protocol for mRNA and cDNA preparation</a> 292 292 <li><a href="?ID=<%=ID%>">Export files for mRNA quality control</a> 293 293 <li><a href="?ID=<%=ID%>">Import mRNA quality control results</a> -
extensions/net.sf.basedb.reggie/branches/ticket-422/src/net/sf/basedb/reggie/dao/Rna.java
r1742 r1745 69 69 } 70 70 71 public static Rna get(Extract extract) 72 { 73 return new Rna(extract); 74 } 71 75 72 76 public static List<Rna> toRna(Collection<Extract> extracts) -
extensions/net.sf.basedb.reggie/branches/ticket-422/src/net/sf/basedb/reggie/servlet/MRnaServlet.java
r1742 r1745 2 2 3 3 import java.io.IOException; 4 import java.io.Writer;5 import java.util.Date;6 4 import java.util.HashMap; 7 5 import java.util.List; … … 17 15 import org.json.simple.parser.JSONParser; 18 16 19 import net.sf.basedb.core.AnnotationType;20 17 import net.sf.basedb.core.Application; 21 18 import net.sf.basedb.core.BioMaterialEventSource; … … 28 25 import net.sf.basedb.core.DbControl; 29 26 import net.sf.basedb.core.Extract; 30 import net.sf.basedb.core.File;31 27 import net.sf.basedb.core.Include; 32 import net.sf.basedb.core.ItemNotFoundException;33 28 import net.sf.basedb.core.ItemQuery; 34 29 import net.sf.basedb.core.ItemSubtype; 35 import net.sf.basedb.core.Path;36 30 import net.sf.basedb.core.PlateGeometry; 37 import net.sf.basedb.core.PluginConfiguration;38 import net.sf.basedb.core.PluginDefinition;39 import net.sf.basedb.core.Protocol;40 31 import net.sf.basedb.core.SessionControl; 41 32 import net.sf.basedb.core.Type; 42 import net.sf.basedb.core.plugin.ParameterValues;43 33 import net.sf.basedb.core.query.Expressions; 44 34 import net.sf.basedb.core.query.Hql; … … 48 38 import net.sf.basedb.reggie.dao.Annotationtype; 49 39 import net.sf.basedb.reggie.dao.BioplateType; 50 import net.sf.basedb.reggie.dao. ReactionPlate;40 import net.sf.basedb.reggie.dao.MRna; 51 41 import net.sf.basedb.reggie.dao.Rna; 52 42 import net.sf.basedb.reggie.dao.Subtype; 53 import net.sf.basedb.reggie.plugins.CaliperPlateImporter;54 import net.sf.basedb.reggie.plugins.CaliperRunParametersExporter;55 import net.sf.basedb.reggie.plugins.CaliperSampleNameExporter;56 import net.sf.basedb.util.Coordinate;57 43 import net.sf.basedb.util.Values; 58 44 import net.sf.basedb.util.error.ThrowableUtil; … … 81 67 JSONObject json = new JSONObject(); 82 68 json.put("status", "ok"); 83 69 84 70 final SessionControl sc = Application.getSessionControl(ID, req.getRemoteAddr()); 85 71 DbControl dc = null; … … 95 81 json.put("name", bioPlateType.generateNextName(dc, 1)); 96 82 } 83 else if ("GetUnprocessedMRnaPlates".equals(cmd)) 84 { 85 dc = sc.newDbControl(); 86 87 ItemQuery<BioPlate> query = BioPlate.getQuery(); 88 query.setIncludes(Reggie.INCLUDE_IN_CURRENT_PROJECT); 89 query.restrict(Restrictions.eq(Hql.property("eventDate"), null)); 90 BioplateType.MRNA.addFilter(dc, query, true); 91 query.order(Orders.desc(Hql.property("id"))); 92 93 List<BioPlate> result = query.list(dc); 94 JSONArray jsonLists = new JSONArray(); 95 for (BioPlate plate: result) 96 { 97 JSONObject jsonList = new JSONObject(); 98 99 jsonList.put("id", plate.getId()); 100 jsonList.put("name", plate.getName()); 101 102 jsonLists.add(jsonList); 103 } 104 json.put("bioplates", jsonLists); 105 } 106 else if ("GetMRnaInfoForPlate".equals(cmd)) 107 { 108 int mRnaPlateId = Values.getInt(req.getParameter("bioplate")); 109 dc = sc.newDbControl(); 110 111 BioPlate mRnaPlate = BioPlate.getById(dc, mRnaPlateId); 112 113 ItemQuery<Extract> query = Extract.getQuery(); 114 query.join(Hql.innerJoin(null, "bioWell", "bw", true)); 115 query.join(Hql.innerJoin("bw", "bioPlate", "bp")); 116 query.restrict(Restrictions.eq(Hql.alias("bp"), Hql.entity(mRnaPlate))); 117 query.order(Orders.asc(Hql.property("bw", "column"))); 118 query.order(Orders.asc(Hql.property("bw", "row"))); 119 120 List<MRna> mrna = MRna.toList(query.list(dc)); 121 JSONArray jsonMRna = new JSONArray(); 122 123 for (MRna r : mrna) 124 { 125 r.loadBioPlateLocation(); 126 127 Rna rna = r.getRna(); 128 rna.loadBioPlateLocation(); 129 rna.loadAnnotations(dc, "NDConc", Annotationtype.ND_CONC, null); 130 131 Float used = r.getItem().getCreationEvent().getUsedQuantity(rna.getItem()); 132 Float remain = rna.getItem().getRemainingQuantity(); 133 rna.setAnnotation("usedQuantity", used); 134 if (used != null && remain != null) 135 { 136 rna.setAnnotation("remainingQuantity", remain+used); 137 } 138 139 r.setAnnotation("rna", rna.asJSONObject()); 140 jsonMRna.add(r.asJSONObject()); 141 142 } 143 144 json.put("mrna", jsonMRna); 145 } 146 97 147 98 148 }
Note: See TracChangeset
for help on using the changeset viewer.