]> SALOME platform Git repositories - tools/siman.git/blobdiff - Workspace/Siman/src/org/splat/simer/OpenStudy.java
Salome HOME
New study creation is fixed. Search page is also accessible now.
[tools/siman.git] / Workspace / Siman / src / org / splat / simer / OpenStudy.java
index 30f40f56865c7c307b295b3ebed331332768dfef..92673d24305853dbdbef61994874d91d2343ffee 100644 (file)
@@ -27,6 +27,7 @@ import org.splat.dal.bo.som.DocumentType;
 import org.splat.dal.bo.som.KnowledgeElement;
 import org.splat.dal.bo.som.ProgressState;
 import org.splat.service.ProjectElementService;
+import org.splat.service.ScenarioService;
 import org.splat.service.technical.ProjectSettingsService;
 import org.splat.dal.bo.som.Publication;
 import org.splat.som.Revision;
@@ -50,6 +51,7 @@ public class OpenStudy extends OpenObject implements OpenStudyServices {
     private  Publication selecdoc;
        private ProjectSettingsService _projectSettingsService;
        private ProjectElementService _projectElementService;
+       private ScenarioService _scenarioService;
     
     protected final static Logger   logger = org.splat.simer.Action.logger;
     
@@ -57,12 +59,12 @@ public class OpenStudy extends OpenObject implements OpenStudyServices {
 //  Constructor
 //  ==============================================================================================================================
 
-    public OpenStudy (User user, Study study) {
+    public OpenStudy open (User user, Study study) {
 //  -----------------------------------------
       ResourceBundle    custom    = ResourceBundle.getBundle("som", ApplicationSettings.getCurrentLocale());
-         SimpleDateFormat  datstring = new SimpleDateFormat(custom.getString("date.format"));
+      SimpleDateFormat  datstring = new SimpleDateFormat(custom.getString("date.format"));
       Revision.Format   verstring = new Revision.Format(getProjectSettings().getRevisionPattern());
-
+        
       cuser       = user;                           // May be null if nobody connected
       mystudy     = study;
       selection   = "0.1";                          // Default selection
@@ -79,7 +81,7 @@ public class OpenStudy extends OpenObject implements OpenStudyServices {
       ustep.setActor(cuser);
       involving.add(ustep);
       for (Iterator<SimulationContext> i=ustep.getAllSimulationContexts().iterator(); i.hasNext(); ) {
-        context.add( new SimulationContextFacade(i.next()) );
+        context.add( new SimulationContextFacade(i.next(), getProjectSettings().getAllSteps()) );
       }
       if (mystudy.isStaffedBy(cuser) || mystudy.hasActor(cuser)) {
 //     ProgressState state = mystudy.getProgressState();
@@ -92,8 +94,11 @@ public class OpenStudy extends OpenObject implements OpenStudyServices {
       urightstep  = new StepRights(cuser, ustep);
 
       menu = new StudyMenu(mystudy);
+      ((StudyMenu)menu).setProjectElementService(getProjectElementService());
+      ((StudyMenu)menu).setScenarioService(getScenarioService());
       menu.selects(selection);                      // Initializes menu items to be displayed
       setupContents();                              // Initializes documents and knowledge at ustep
+      return this;
     }
 
 //  ==============================================================================================================================
@@ -285,7 +290,7 @@ public class OpenStudy extends OpenObject implements OpenStudyServices {
 
     protected void add (SimulationContext contex) {
 //  ---------------------------------------------
-      SimulationContextFacade  facade = new SimulationContextFacade(contex);
+      SimulationContextFacade  facade = new SimulationContextFacade(contex, getProjectSettings().getAllSteps());
 
       context.add(facade);
     }
@@ -377,7 +382,7 @@ public class OpenStudy extends OpenObject implements OpenStudyServices {
       context.clear();
       for (Iterator<Step> i=involving.iterator(); i.hasNext(); ) {
         for (Iterator<SimulationContext> j=i.next().getAllSimulationContexts().iterator(); j.hasNext(); ) {
-          context.add( new SimulationContextFacade(j.next()) );
+          context.add( new SimulationContextFacade(j.next(), getProjectSettings().getAllSteps()) );
         }
       }
     }
@@ -451,4 +456,23 @@ public class OpenStudy extends OpenObject implements OpenStudyServices {
                        ProjectElementService projectElementService) {
                _projectElementService = projectElementService;
        }
+
+       /**
+        * Get the scenarioService.
+        * 
+        * @return the scenarioService
+        */
+       public ScenarioService getScenarioService() {
+               return _scenarioService;
+       }
+
+       /**
+        * Set the scenarioService.
+        * 
+        * @param scenarioService
+        *            the scenarioService to set
+        */
+       public void setScenarioService(ScenarioService scenarioService) {
+               _scenarioService = scenarioService;
+       }
 }
\ No newline at end of file