+
+ /**
+ * Get the simulation context list for displaying drop-down list values populating
+ * on the "Create new study" screen.
+ * {@inheritDoc}
+ * @see org.splat.service.StudyService#getSimulationContextList()
+ */
+ public List<SimulationContext> getSimulationContextList() {
+ //TODO: remove the commit transaction ...
+ Session connex = Database.getSession();
+ Transaction transax = connex.beginTransaction();
+
+ SimulationContext.Properties cprop = new SimulationContext.Properties();
+ SimulationContextType product = SimulationContext.selectType("product");
+ List<SimulationContext> resList = Database.selectSimulationContextsWhere(cprop.setType(product));
+
+ transax.commit();
+
+ return resList;
+ }
+
+ public Study selectStudy(int index) {
+ // -------------------------------------------
+ StringBuffer query = new StringBuffer("from Study where rid='").append(
+ index).append("'");
+ Study result = (Study) Database.getSession().createQuery(
+ query.toString()).uniqueResult();
+
+ result.loadWorkflow();
+ return result;
+ }
+
+ public Study selectStudy(String refid) {
+ // ----------------------------------------------
+ StringBuffer query = new StringBuffer("from Study where sid='").append(
+ refid).append("'");
+ Study result = (Study) Database.getSession().createQuery(
+ query.toString()).uniqueResult();
+
+ result.loadWorkflow();
+ return result;
+ }