import org.splat.dal.bo.som.SimulationContext;
import org.splat.dal.bo.som.SimulationContextType;
import org.splat.service.SimulationContextService;
+import org.splat.service.SimulationContextTypeService;
import org.splat.service.StepService;
import org.splat.service.StudyService;
import org.splat.som.Step;
* Injected simulation context service.
*/
private SimulationContextService _simulationContextService;
-
/**
- * Get the stepService.
- *
- * @return the stepService
+ * Injected simulation context type service.
*/
- public StepService getStepService() {
- return _stepService;
- }
-
+ private SimulationContextTypeService _simulationContextTypeService;
+
/**
- * Set the stepService.
- *
- * @param stepService
- * the stepService to set
+ * Value of the menu property.
+ * It can be: none, create, open, study, knowledge, sysadmin, help.
*/
- public void setStepService(StepService stepService) {
- _stepService = stepService;
- }
+ private String _menuProperty;
+
+ /**
+ * Value of the title bar property.
+ * It can be: study, knowledge.
+ */
+ private String _titleProperty;
+
+ /**
+ * Value of the tool bar property.
+ * It can be: none, standard, study, back.
+ */
+ private String _toolProperty;
+
+ /**
+ * Value of the left menu property.
+ * It can be: open, study, knowledge, scenario.
+ */
+ private String _leftMenuProperty;
+
+ /**
+ * Property that indicates whether the current open study is editable or not.
+ * On the screen it looks like pen on the status icon, pop-up menu also can be called.
+ * It is necessary for correct building the title bar.
+ */
+ private String _editDisabledProperty = "false";
private static final long serialVersionUID = -641719644024601042L;
mystudy = getOpenStudy();
contype = getInvolvedContexts();
+
+ setMenuProperty("study");
+ setTitleProperty("study");
+ if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
+ setToolProperty("study");
+ } else {
+ setToolProperty("standard");
+ }
+
+ setLeftMenuProperty("study");
+ initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
if (contype.isEmpty())
return "create";
public String doSelectContext() {
mystudy = getOpenStudy();
+
+ setMenuProperty("study");
+ setTitleProperty("study");
+ if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
+ setToolProperty("study");
+ } else {
+ setToolProperty("standard");
+ }
+ setLeftMenuProperty("study");
+ initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
+
int typid = Integer.valueOf(selectype);
if (typid == 0)
return "create";
// --------------------------------
try {
mystudy = getOpenStudy();
+
+ setMenuProperty("study");
+ setTitleProperty("study");
+ if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
+ setToolProperty("study");
+ } else {
+ setToolProperty("standard");
+ }
+ setLeftMenuProperty("study");
+ initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
+
if (newtype.length() == 0 || value.length() == 0)
return INPUT;
SimulationContext.Properties cprop = new SimulationContext.Properties();
SimulationContext contex = null;
- type = getSimulationContextService().createType(newtype,
+ type = getSimulationContextTypeService().createType(newtype,
step.getStep());
cprop.setType(type).setValue(value);
if (owner instanceof Study)
}
public String doDeleteContext() {
+
+ setMenuProperty("study");
+ setTitleProperty("study");
+ if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
+ setToolProperty("study");
+ } else {
+ setToolProperty("standard");
+ }
+ setLeftMenuProperty("study");
+ initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
+
try {
mystudy = getOpenStudy();
String[] input = value.split(",");
// Session connex = Database.getCurSession();
// Transaction transax = connex.beginTransaction();
+
+ setMenuProperty("study");
+ setTitleProperty("study");
+ if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
+ setToolProperty("study");
+ } else {
+ setToolProperty("standard");
+ }
+ setLeftMenuProperty("study");
+ initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
+
try {
mystudy = getOpenStudy();
SimulationContextService simulationContextService) {
_simulationContextService = simulationContextService;
}
+
+ /**
+ * Get the simulationContextTypeService.
+ * @return the simulationContextTypeService
+ */
+ public SimulationContextTypeService getSimulationContextTypeService() {
+ return _simulationContextTypeService;
+ }
+
+ /**
+ * Set the simulationContextTypeService.
+ * @param simulationContextTypeService the simulationContextTypeService to set
+ */
+ public void setSimulationContextTypeService(
+ SimulationContextTypeService simulationContextTypeService) {
+ _simulationContextTypeService = simulationContextTypeService;
+ }
+
+ /**
+ * 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;
+ }
+
+ /**
+ * 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;
+ }
+
+ /**
+ * Get the _titleProperty.
+ * @return the _titleProperty
+ */
+ public String getTitleProperty() {
+ return _titleProperty;
+ }
+
+ /**
+ * Set the _titleProperty.
+ * @param _titleProperty the titleProperty to set
+ */
+ public void setTitleProperty(String titleProperty) {
+ _titleProperty = titleProperty;
+ }
+
+ /**
+ * Get the editDisabledProperty.
+ * @return the editDisabledProperty
+ */
+ public final String getEditDisabledProperty() {
+ return _editDisabledProperty;
+ }
+
+ /**
+ * Set the editDisabledProperty.
+ * @param editDisabledProperty the editDisabledProperty to set
+ */
+ public final void setEditDisabledProperty(String editDisabledProperty) {
+ _editDisabledProperty = editDisabledProperty;
+ }
+
+ /**
+ * Get the toolProperty.
+ * @return the toolProperty
+ */
+ public String getToolProperty() {
+ return _toolProperty;
+ }
+
+ /**
+ * Set the toolProperty.
+ * @param toolProperty the toolProperty to set
+ */
+ public void setToolProperty(final String toolProperty) {
+ _toolProperty = toolProperty;
+ }
+
+ /**
+ * Get the leftMenuProperty.
+ * @return the leftMenuProperty
+ */
+ public String getLeftMenuProperty() {
+ return _leftMenuProperty;
+ }
+
+ /**
+ * Set the leftMenuProperty.
+ * @param leftMenuProperty the leftMenuProperty to set
+ */
+ public void setLeftMenuProperty(final String leftMenuProperty) {
+ _leftMenuProperty = leftMenuProperty;
+ }
}
\ No newline at end of file