* Injected scenario service.
*/
private ScenarioService _scenarioService;
+
+ /**
+ * Value of the menu property.
+ * It can be: none, create, open, study, knowledge, sysadmin, help.
+ */
+ private String _menuProperty;
// ==============================================================================================================================
// Action methods
ApplicationSettings.getCurrentLocale());
title = locale.getString("label.study") + " "
+ String.valueOf(number + 1);
+
+ setMenuProperty("create");
+ initializationScreenContext(_menuProperty);
return SUCCESS;
}
throw new Exception();
if (valid == 0) {
value = input[1].trim();
- if (value.length() == 0)
+ if (value.length() == 0) {
+
+ setMenuProperty("create");
+ initializationScreenContext(_menuProperty);
+
return INPUT; // No need to reinitialize the list of existing products
+ }
}
sprop.setTitle(title).setManager(getConnectedUser());
sprop.checkValidity();
.selectType("product");
contelm = getSimulationContextService()
.selectSimulationContextsWhere(cprop.setType(product));
+
+ setMenuProperty("create");
+ initializationScreenContext(_menuProperty);
+
return INPUT; // Title empty, simply wait for input without error message
}
try {
// Update of the session
number += 1;
open(study); // Opens the study,
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
+
return SUCCESS;
} catch (Exception error) {
logger.error("Unable to save the study, reason:", error);
+ setMenuProperty("none");
+ initializationScreenContext(_menuProperty);
return ERROR;
}
}
public void setScenarioService(ScenarioService scenarioService) {
_scenarioService = scenarioService;
}
+
+ /**
+ * Get the menuProperty.
+ * @return the menuProperty
+ */
+ public String getMenuProperty() {
+ return _menuProperty;
+ }
+
+ /**
+ * Set the menuProperty.
+ * @param menuProperty the menuProperty to set
+ */
+ public void setMenuProperty(String menuProperty) {
+ this._menuProperty = menuProperty;
+ }
}
\ No newline at end of file