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;
private Publication selecdoc;
private ProjectSettingsService _projectSettingsService;
private ProjectElementService _projectElementService;
+ private ScenarioService _scenarioService;
protected final static Logger logger = org.splat.simer.Action.logger;
// 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
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();
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;
}
// ==============================================================================================================================
protected void add (SimulationContext contex) {
// ---------------------------------------------
- SimulationContextFacade facade = new SimulationContextFacade(contex);
+ SimulationContextFacade facade = new SimulationContextFacade(contex, getProjectSettings().getAllSteps());
context.add(facade);
}
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()) );
}
}
}
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