X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=Workspace%2FSiman-Common%2Fsrc%2Forg%2Fsplat%2Fservice%2FStudyServiceImpl.java;h=0af12a2baf98965dc31336e154ba1ebaa28b9a80;hb=9a1c4c7c806a97eaa27baa9bb44257e91aca3117;hp=a9fe8b47155581055b4a83a0a6264b9c38d4b807;hpb=c2222cb9e47029b593395fbea2047d88d2172332;p=tools%2Fsiman.git diff --git a/Workspace/Siman-Common/src/org/splat/service/StudyServiceImpl.java b/Workspace/Siman-Common/src/org/splat/service/StudyServiceImpl.java index a9fe8b4..0af12a2 100644 --- a/Workspace/Siman-Common/src/org/splat/service/StudyServiceImpl.java +++ b/Workspace/Siman-Common/src/org/splat/service/StudyServiceImpl.java @@ -1,10 +1,10 @@ /***************************************************************************** * Company EURIWARE * Application SIMAN - * File $Id$ - * Creation date 06.10.2012 - * @author $Author$ - * @version $Revision$ + * File Id: + * Creation date 02.10.2012 + * @author Author: Maria KRUCHININA + * @version Revision: *****************************************************************************/ package org.splat.service; @@ -17,6 +17,7 @@ import java.util.List; import org.apache.log4j.Logger; import org.hibernate.Session; +import org.hibernate.Transaction; import org.splat.dal.bo.kernel.Relation; import org.splat.dal.bo.kernel.User; import org.splat.dal.bo.som.ActorRelation; @@ -31,6 +32,7 @@ import org.splat.dal.bo.som.ProgressState; import org.splat.dal.bo.som.Publication; import org.splat.dal.bo.som.Scenario; import org.splat.dal.bo.som.SimulationContext; +import org.splat.dal.bo.som.SimulationContextType; import org.splat.dal.bo.som.Study; import org.splat.dal.bo.som.ValidationCycle; import org.splat.dal.bo.som.ValidationCycleRelation; @@ -41,17 +43,22 @@ import org.splat.kernel.InvalidPropertyException; import org.splat.kernel.MissedPropertyException; import org.splat.kernel.MultiplyDefinedException; import org.splat.kernel.UserDirectory; +import org.splat.log.AppLogger; import org.splat.service.technical.IndexService; import org.splat.service.technical.ProjectSettingsService; import org.splat.som.Revision; /** - * @author RKV - * + * This class defines all methods for creation, modification the study. + * @author Maria KRUCHININA + * */ public class StudyServiceImpl implements StudyService { - public final static Logger logger = Logger.getLogger(org.splat.service.StudyServiceImpl.class); + /** + * logger for the service. + */ + public final static AppLogger logger = AppLogger.getLogger(StudyServiceImpl.class); private IndexService _indexService; @@ -62,7 +69,27 @@ public class StudyServiceImpl implements StudyService { private ProjectSettingsService _projectSettingsService; private ProjectElementService _projectElementService; - + + /** + * 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 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 resList = Database.selectSimulationContextsWhere(cprop.setType(product)); + + transax.commit(); + + return resList; + } + public Study selectStudy(int index) { // ------------------------------------------- StringBuffer query = new StringBuffer("from Study where rid='").append( @@ -122,17 +149,6 @@ public class StudyServiceImpl implements StudyService { return added; } - /** - * @return - */ - public StepService getStepService() { - return _stepService; - } - - public void setStepService(StepService stepService) { - _stepService = stepService; - } - public SimulationContext addProjectContext(Study aStudy, SimulationContext context) { // ---------------------------------------------------------------------- @@ -495,4 +511,20 @@ public class StudyServiceImpl implements StudyService { ProjectElementService projectElementService) { _projectElementService = projectElementService; } + + /** + * Get the stepService. + * @return the stepService + */ + public StepService getStepService() { + return _stepService; + } + + /** + * Set the stepService. + * @param stepService the stepService to set + */ + public void setStepService(StepService stepService) { + _stepService = stepService; + } }