import org.splat.dal.bo.som.DocumentType;
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.dao.som.Database;
String format = table[table.length - 1];
// Creation of the document
- getScenarioService().checkin((Scenario) step.getOwner()); // Modules necessarily save their data in a scenario step
+ getScenarioService().checkin(step.getOwner().getIndex()); // Modules necessarily save their data in a scenario step
connex.flush();
Document.Properties dprop = new Document.Properties();
* @param publicationService
* the publicationService to set
*/
- public void setPublicationService(final PublicationService publicationService) {
+ public void setPublicationService(
+ final PublicationService publicationService) {
_publicationService = publicationService;
}
* @param documentTypeService
* the documentTypeService to set
*/
- public void setDocumentTypeService(final DocumentTypeService documentTypeService) {
+ public void setDocumentTypeService(
+ final DocumentTypeService documentTypeService) {
_documentTypeService = documentTypeService;
}
}
\ No newline at end of file
* Injected application settings bean.
*/
private ApplicationSettings _applicationSettings;
+ /**
+ * Value of the menu property. It can be: none, create, open, study, knowledge, sysadmin, help.
+ */
+ private String _menuProperty;
+ /**
+ * Value of the tool bar property. It can be: none, standard, study, back.
+ */
+ private String _toolProperty;
/**
* Comparator for sorting document types with localized names.
public void initializationScreenContext(final String menuProperty) {
initializationContext();
+ setMenuProperty(menuProperty);
getMenuBarSettings().intializeMenuBar(menuProperty);
}
final String titleProperty, final String editDisabledProperty) {
initializationContext(titleProperty, editDisabledProperty);
+ setMenuProperty(menuProperty);
getMenuBarSettings().intializeMenuBar(menuProperty);
}
final String toolProperty) {
initializationContext();
+ setMenuProperty(menuProperty);
getMenuBarSettings().intializeMenuBar(menuProperty);
getToolBarSettings().intializeMenuBar(toolProperty);
}
initializationContext();
initializationContextLeftMenus(leftMenuProperty);
+ setMenuProperty(menuProperty);
getMenuBarSettings().intializeMenuBar(menuProperty);
getToolBarSettings().intializeMenuBar(toolProperty);
}
public void setMessage(final String message) {
_message = message;
}
+
+ /**
+ * Get the menuProperty.
+ *
+ * @return the menuProperty
+ */
+ public String getMenuProperty() {
+ return _menuProperty;
+ }
+
+ /**
+ * Get the toolProperty.
+ *
+ * @return the toolProperty
+ */
+ public String getToolProperty() {
+ return _toolProperty;
+ }
+
+ /**
+ * Set the menuProperty.
+ *
+ * @param menuProperty
+ * the menuProperty to set
+ */
+ public void setMenuProperty(final String menuProperty) {
+ this._menuProperty = menuProperty;
+ }
+
+ /**
+ * Set the toolProperty.
+ *
+ * @param toolProperty
+ * the toolProperty to set
+ */
+ public void setToolProperty(final String toolProperty) {
+ _toolProperty = toolProperty;
+ }
}
\ No newline at end of file
private String _password = null;
private transient String _backmenu = null;
- private String _menuProperty;
-
/**
* Serial version ID.
*/
}
this.connect(context, user); // Updates the session context
- setMenuProperty(Constants.NONE);
- initializationScreenContext(_menuProperty);
+ initializationScreenContext(Constants.NONE);
res = _backmenu;
if (res == null || "null".equals(res)) {
this.disconnect(); // Updates the session context
- setMenuProperty(Constants.NONE);
- initializationScreenContext(_menuProperty);
+ initializationScreenContext(Constants.NONE);
res = _backmenu;
if (res == null || "null".equals(res)) {
public void setBackMenu(final String menu) {
this._backmenu = menu;
}
-
- /**
- * Get the menuProperty.
- *
- * @return the menuProperty
- */
- public String getMenuProperty() {
- return _menuProperty;
- }
-
- /**
- * Set the menuProperty.
- *
- * @param menuProperty
- * the menuProperty to set
- */
- public void setMenuProperty(final String menuProperty) {
- this._menuProperty = menuProperty;
- }
}
\ No newline at end of file
* Injected knowledge element service.
*/
private KnowledgeElementService _knowledgeElementService;
-
- /**
- * Value of the menu property.
- * It can be: none, create, open, study, knowledge, sysadmin, help.
- */
- 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";
// ==============================================================================================================================
// Action methods
}
}
getSession().put("menu.knowledge", _myknelm.getMenu());
-
- setMenuProperty(Constants.KNOWLEDGE_MENU);
- setTitleProperty(Constants.KNOWLEDGE_MENU);
- setToolProperty(Constants.NONE);
- setLeftMenuProperty(Constants.KNOWLEDGE_MENU);
- initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
+
+ initializationFullScreenContext(Constants.KNOWLEDGE_MENU,
+ Constants.KNOWLEDGE_MENU, Constants.FALSE, Constants.NONE,
+ Constants.KNOWLEDGE_MENU);
return SUCCESS;
}
} else { // Selection of a step of current study
_myknelm.setSelection(_selection);
}
-
- setMenuProperty(Constants.KNOWLEDGE_MENU);
- setTitleProperty(Constants.KNOWLEDGE_MENU);
- setToolProperty(Constants.NONE);
- setLeftMenuProperty(Constants.KNOWLEDGE_MENU);
- initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
-
+
+ initializationFullScreenContext(Constants.KNOWLEDGE_MENU,
+ Constants.KNOWLEDGE_MENU, Constants.FALSE, Constants.NONE,
+ Constants.KNOWLEDGE_MENU);
+
return SUCCESS;
}
} else if (todo == Execute.reduceall) {
_myknelm.reduceDocument(_myindex);
}
-
- setMenuProperty(Constants.KNOWLEDGE_MENU);
- setTitleProperty(Constants.KNOWLEDGE_MENU);
- setToolProperty(Constants.NONE);
- setLeftMenuProperty(Constants.KNOWLEDGE_MENU);
- initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
-
+
+ initializationFullScreenContext(Constants.KNOWLEDGE_MENU,
+ Constants.KNOWLEDGE_MENU, Constants.FALSE, Constants.NONE,
+ Constants.KNOWLEDGE_MENU);
+
return SUCCESS;
}
} else if (todo == Execute.reduce) {
_myknelm.reduceKnowledge(_myindex);
}
-
- setMenuProperty(Constants.KNOWLEDGE_MENU);
- setTitleProperty(Constants.KNOWLEDGE_MENU);
- setToolProperty(Constants.NONE);
- setLeftMenuProperty(Constants.KNOWLEDGE_MENU);
- initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
-
+
+ initializationFullScreenContext(Constants.KNOWLEDGE_MENU,
+ Constants.KNOWLEDGE_MENU, Constants.FALSE, Constants.NONE,
+ Constants.KNOWLEDGE_MENU);
+
return SUCCESS;
}
public String doClose() {
closeKnowledge();
-
- setMenuProperty(Constants.NONE);
- initializationScreenContext(_menuProperty);
-
+
+ initializationScreenContext(Constants.NONE);
+
return SUCCESS;
}
final KnowledgeElementService knowledgeElementService) {
_knowledgeElementService = knowledgeElementService;
}
-
- /**
- * Get the menuProperty.
- * @return the menuProperty
- */
- public String getMenuProperty() {
- return _menuProperty;
- }
-
- /**
- * Set the menuProperty.
- * @param menuProperty the menuProperty to set
- */
- public void setMenuProperty(final 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(final 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(final String editDisabledProperty) {
- this._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
import org.splat.dal.bo.som.ProjectElement;
import org.splat.dal.bo.som.Scenario;
-import org.splat.dal.bo.som.Study;
import org.splat.service.StudyService;
import org.splat.som.StepRights;
import org.splat.wapp.Constants;
*/
private StudyService _studyService;
- /**
- * Value of the menu property. It can be: none, create, open, study, knowledge, sysadmin, help.
- */
- 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";
-
// ==============================================================================================================================
// Action methods
// ==============================================================================================================================
+ /**
+ * Open the selected study.
+ *
+ * @return SUCCESS if succeeded or ERROR if can't open
+ */
public String doOpen() {
- Study study;
String res = SUCCESS;
_openStudy = getOpenStudy();
if (_myindex == null) {
if (_selection == null) { // Opening a study just newed
_selection = _openStudy.getSelection(); // Default selection
- study = _openStudy.getStudyObject();
} else { // Re-opening (refreshing) the currently open study
- study = getStudyService().selectStudy(_openStudy.getIndex());
- _openStudy = open(study); // Closes the previously open study
+ _openStudy = open(getStudyService().selectStudy(
+ _openStudy.getIndex())); // Closes the previously open study
_openStudy.setSelection(_selection);
}
} else {
if (_openStudy != null && _openStudy.getStudyObject() != null
&& _openStudy.getIndex() == index) { // - The selected study is currently open
_selection = _openStudy.getSelection(); // Current selection
- study = _openStudy.getStudyObject(); // Current Study object
// RKV:BEGIN: put in session if necessary
if (!getSession().containsKey("study.open")) {
- open(study);
+ open(_openStudy.getStudyObject());
}
// RKV:END
} else { // - The selected study is new
- study = getStudyService().selectStudy(index);
- _openStudy = open(study);
+ _openStudy = open(getStudyService().selectStudy(index));
_selection = _openStudy.getSelection(); // Default selection
}
} catch (Exception error) {
}
getSession().put("menu.study", _openStudy.getMenu());
- setMenuProperty(Constants.STUDY_MENU);
- setTitleProperty(Constants.STUDY_MENU);
- if (Constants.TRUE.equals(getWriteAccess())
- && getUserRights().canCreateDocument()) {
- setToolProperty(Constants.STUDY_MENU);
- } else {
- setToolProperty(Constants.STANDARD_MENU);
- }
-
- setLeftMenuProperty(Constants.STUDY_MENU);
-
- initializationFullScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty, _toolProperty, _leftMenuProperty);
+ setMenu();
}
return res;
}
+ /**
+ * Set context menu.
+ */
+ protected void setMenu() {
+ if (Constants.TRUE.equals(getWriteAccess())
+ && getUserRights().canCreateDocument()) {
+ setToolProperty(Constants.STUDY_MENU);
+ } else {
+ setToolProperty(Constants.STANDARD_MENU);
+ }
+
+ initializationFullScreenContext(Constants.STUDY_MENU,
+ Constants.STUDY_MENU, "false", getToolProperty(),
+ Constants.STUDY_MENU);
+ }
+
public String doSelectStep() {
_openStudy = getOpenStudy();
menu.selects("prop-general");
}
- setMenuProperty(Constants.STUDY_MENU);
- setTitleProperty(Constants.STUDY_MENU);
- if (Constants.TRUE.equals(getWriteAccess())
- && getUserRights().canCreateDocument()) {
- setToolProperty(Constants.STUDY_MENU);
- } else {
- setToolProperty(Constants.STANDARD_MENU);
- }
-
- setLeftMenuProperty(Constants.STUDY_MENU);
- initializationFullScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty, _toolProperty, _leftMenuProperty);
+ setMenu();
return SUCCESS;
}
_openStudy.reduceDocument(_myindex);
}
- setMenuProperty(Constants.STUDY_MENU);
- setTitleProperty(Constants.STUDY_MENU);
- if (Constants.TRUE.equals(getWriteAccess())
- && getUserRights().canCreateDocument()) {
- setToolProperty(Constants.STUDY_MENU);
- } else {
- setToolProperty(Constants.STANDARD_MENU);
- }
- setLeftMenuProperty(Constants.STUDY_MENU);
- initializationFullScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty, _toolProperty, _leftMenuProperty);
+ setMenu();
return SUCCESS;
}
_openStudy.reduceKnowledge(_myindex);
}
- setMenuProperty(Constants.STUDY_MENU);
- setTitleProperty(Constants.STUDY_MENU);
- if (Constants.TRUE.equals(getWriteAccess())
- && getUserRights().canCreateDocument()) {
- setToolProperty(Constants.STUDY_MENU);
- } else {
- setToolProperty(Constants.STANDARD_MENU);
- }
- setLeftMenuProperty(Constants.STUDY_MENU);
- initializationFullScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty, _toolProperty, _leftMenuProperty);
+ setMenu();
return SUCCESS;
}
+ /**
+ * Close the currently open study.
+ *
+ * @return SUCCESS
+ */
public String doClose() {
closeStudy();
-
- setMenuProperty("none");
- initializationScreenContext(_menuProperty);
-
+ initializationScreenContext("none");
return SUCCESS;
}
super.setOpenStudy(study);
_openStudy = study;
}
-
- /**
- * Get the menuProperty.
- *
- * @return the menuProperty
- */
- public String getMenuProperty() {
- return _menuProperty;
- }
-
- /**
- * Set the menuProperty.
- *
- * @param menuProperty
- * the menuProperty to set
- */
- public void setMenuProperty(final 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(final String titleProperty) {
- _titleProperty = titleProperty;
- }
-
- /**
- * Get the editDisabledProperty.
- *
- * @return the editDisabledProperty
- */
- public String getEditDisabledProperty() {
- return _editDisabledProperty;
- }
-
- /**
- * Set the editDisabledProperty.
- *
- * @param editDisabledProperty
- * the editDisabledProperty to set
- */
- public void setEditDisabledProperty(final 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
*/
private static final long serialVersionUID = 4573036736137033679L;
- private String index = null;
- private String title = null;
- private String filename = null;
+ private transient String _index = null;
+ private transient String _title = null;
+ private transient String _filename = null;
/**
* Injected publication service.
*/
* Injected repository service.
*/
private RepositoryService _repositoryService;
-
- /**
- * Value of the menu property.
- * It can be: none, create, open, study, knowledge, sysadmin, help.
- */
- 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";
/**
* Operations enumeration.
*/
public String doInitialize() {
_openStudy = getOpenStudy();
-
- setMenuProperty("study");
- setTitleProperty("study");
- if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
- setToolProperty("study");
- } else {
- setToolProperty("standard");
- }
- setLeftMenuProperty("study");
- initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
-
+ setMenu();
return SUCCESS;
}
public String doSetDocument() {
-
- setMenuProperty("study");
- setTitleProperty("study");
- if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
- setToolProperty("study");
- } else {
- setToolProperty("standard");
- }
- setLeftMenuProperty("study");
- initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
+
+ setMenu();
try {
_openStudy = getOpenStudy();
Execute todo = Execute.valueOf(_action);
Step step = _openStudy.getSelectedStep();
- Publication doc = step.getDocument(Integer.valueOf(index));
+ Publication doc = step.getDocument(Integer.valueOf(_index));
if (todo == Execute.renameDocument) {
- getPublicationService().rename(doc, title);
+ getPublicationService().rename(doc, _title);
// Useless to update the document presentation
} else if (todo == Execute.accept) {
getPublicationService().actualize(doc);
}
public String doAttach() {
-
- setMenuProperty("study");
- setTitleProperty("study");
- if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
- setToolProperty("study");
- } else {
- setToolProperty("standard");
- }
- setLeftMenuProperty("study");
- initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
+
+ setMenu();
try {
// Getting user inputs
User user = getConnectedUser();
Step step = _openStudy.getSelectedStep();
File updir = getRepositoryService().getDownloadDirectory(user);
- File upfile = new File(updir.getPath() + "/" + filename);
- String[] parse = filename.split("\\x2E");
+ File upfile = new File(updir.getPath() + "/" + _filename);
+ String[] parse = _filename.split("\\x2E");
- Publication edited = step.getDocument(Integer.valueOf(index));
- ConvertsRelation export = getPublicationService().attach(edited, parse[parse.length - 1]);
+ Publication edited = step.getDocument(Integer.valueOf(_index));
+ ConvertsRelation export = getPublicationService().attach(edited,
+ parse[parse.length - 1]);
- if (LOG.isInfoEnabled())
+ if (LOG.isInfoEnabled()) {
LOG.info("Moving \"" + upfile.getName() + "\" to \""
+ updir.getPath() + "\".");
+ }
upfile.renameTo(export.getTo().asFile());
_openStudy.update(edited);
}
public String doDeleteDocument() {
-
- setMenuProperty("study");
- setTitleProperty("study");
- if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
- setToolProperty("study");
- } else {
- setToolProperty("standard");
- }
- setLeftMenuProperty("study");
- initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
+
+ setMenu();
try {
_openStudy = getOpenStudy();
Step step = _openStudy.getSelectedStep();
- Publication doctag = step.getDocument(Integer.valueOf(index));
+ Publication doctag = step.getDocument(Integer.valueOf(_index));
getStepService().removeDocument(step, doctag); // Updates the data structure
// Getters and setters
// ==============================================================================================================================
- public void setDocumentTitle(String title) {
- // -------------------------------------------
- this.title = title;
+ public void setDocumentTitle(final String title) {
+ this._title = title;
}
- public void setFileName(String filename) {
- // -----------------------------------------
- this.filename = filename;
+ public void setFileName(final String filename) {
+ this._filename = filename;
}
- public void setIndex(String index) {
- // -----------------------------------
- this.index = index;
+ @Override
+ public void setIndex(final String index) {
+ this._index = index;
}
/**
* @param publicationService
* the publicationService to set
*/
- public void setPublicationService(PublicationService publicationService) {
+ public void setPublicationService(
+ final PublicationService publicationService) {
_publicationService = publicationService;
}
* @param repositoryService
* the repositoryService to set
*/
- public void setRepositoryService(RepositoryService repositoryService) {
+ public void setRepositoryService(final RepositoryService repositoryService) {
_repositoryService = repositoryService;
}
/**
* Get the stepService.
+ *
* @return the stepService
*/
public StepService getStepService() {
/**
* Set the stepService.
- * @param stepService the stepService to set
+ *
+ * @param stepService
+ * the stepService to set
*/
- public void setStepService(StepService stepService) {
+ public void setStepService(final 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 String getEditDisabledProperty() {
- return _editDisabledProperty;
- }
-
- /**
- * Set the editDisabledProperty.
- * @param editDisabledProperty the editDisabledProperty to set
- */
- public 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
*/
private KnowledgeElementTypeService _knowledgeElementTypeService;
- /**
- * Value of the menu property. It can be: none, create, open, study, knowledge, sysadmin, help.
- */
- private String _menuProperty;
-
- /**
- * Value of the title bar property. It can be: study, knowledge.
- */
- private String _titleProperty;
-
- /**
- * 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";
-
- /**
- * 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;
-
// ==============================================================================================================================
// Action methods
// ==============================================================================================================================
*/
public String doInitialize() {
_openStudy = getOpenStudy();
-
- setMenuProperty(Constants.STUDY_MENU);
- setTitleProperty(Constants.STUDY_MENU);
- if ("true".equals(getWriteAccess())
- && getUserRights().canCreateDocument()) {
- setToolProperty(Constants.STUDY_MENU);
- } else {
- setToolProperty("standard");
- }
- setLeftMenuProperty(Constants.STUDY_MENU);
- initializationFullScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty, _toolProperty, _leftMenuProperty);
-
+ setMenu();
return SUCCESS;
}
public String doSetKnowledge() {
String res = SUCCESS;
- setMenuProperty(Constants.STUDY_MENU);
- setTitleProperty(Constants.STUDY_MENU);
- if ("true".equals(getWriteAccess())
- && getUserRights().canCreateDocument()) {
- setToolProperty(Constants.STUDY_MENU);
- } else {
- setToolProperty("standard");
- }
- setLeftMenuProperty(Constants.STUDY_MENU);
- initializationFullScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty, _toolProperty, _leftMenuProperty);
+ setMenu();
try {
_openStudy = getOpenStudy();
*/
private void updateMenu() {
getMenu(Constants.STUDY_MENU).selects(_openStudy.getSelection()); // Updates the menu icon, in case of last removed document
-
- setMenuProperty(Constants.STUDY_MENU);
- setTitleProperty(Constants.STUDY_MENU);
- if ("true".equals(getWriteAccess())
- && getUserRights().canCreateDocument()) {
- setToolProperty(Constants.STUDY_MENU);
- } else {
- setToolProperty("standard");
- }
- setLeftMenuProperty(Constants.STUDY_MENU);
- initializationFullScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty, _toolProperty, _leftMenuProperty);
-
+ setMenu();
}
// ==============================================================================================================================
_knowledgeElementTypeService = knowledgeElementTypeService;
}
- /**
- * Get the menuProperty.
- *
- * @return the menuProperty
- */
- @Override
- public String getMenuProperty() {
- return _menuProperty;
- }
-
- /**
- * Set the menuProperty.
- *
- * @param menuProperty
- * the menuProperty to set
- */
- @Override
- public void setMenuProperty(final String menuProperty) {
- this._menuProperty = menuProperty;
- }
-
- /**
- * Get the _titleProperty.
- *
- * @return the _titleProperty
- */
- @Override
- public String getTitleProperty() {
- return _titleProperty;
- }
-
- /**
- * Set the titleProperty.
- *
- * @param titleProperty
- * the titleProperty to set
- */
- @Override
- public void setTitleProperty(final String titleProperty) {
- _titleProperty = titleProperty;
- }
-
- /**
- * Get the editDisabledProperty.
- *
- * @return the editDisabledProperty
- */
- @Override
- public String getEditDisabledProperty() {
- return _editDisabledProperty;
- }
-
- /**
- * Set the editDisabledProperty.
- *
- * @param editDisabledProperty
- * the editDisabledProperty to set
- */
- @Override
- public void setEditDisabledProperty(final String editDisabledProperty) {
- _editDisabledProperty = editDisabledProperty;
- }
-
- /**
- * Get the toolProperty.
- *
- * @return the toolProperty
- */
- @Override
- public String getToolProperty() {
- return _toolProperty;
- }
-
- /**
- * Set the toolProperty.
- *
- * @param toolProperty
- * the toolProperty to set
- */
- @Override
- public void setToolProperty(final String toolProperty) {
- _toolProperty = toolProperty;
- }
-
- /**
- * Get the leftMenuProperty.
- *
- * @return the leftMenuProperty
- */
- @Override
- public String getLeftMenuProperty() {
- return _leftMenuProperty;
- }
-
- /**
- * Set the leftMenuProperty.
- *
- * @param leftMenuProperty
- * the leftMenuProperty to set
- */
- @Override
- public void setLeftMenuProperty(final String leftMenuProperty) {
- _leftMenuProperty = leftMenuProperty;
- }
-
/**
* Get the knowledgeValue.
*
public String getKnowledgeTitle() {
return _knowledgeTitle;
}
-
}
\ No newline at end of file
public class EditScenarioPropertiesAction extends DisplayStudyStepAction {
- private Scenario myscenario;
- private String lasdate;
- private String subject;
+ /**
+ * Serial version ID.
+ */
+ private static final long serialVersionUID = 4964740932426016171L;
+
+ private transient Scenario _myscenario;
+ private transient String _lasdate;
+ private transient String _subject;
/**
* The Scenario service.
*/
private ProjectElementService _projectElementService;
- /**
- * Value of the menu property. It can be: none, create, open, study, knowledge, sysadmin, help.
- */
- private String _menuProperty;
-
- /**
- * Value of the title bar property. It can be: study, knowledge.
- */
- private String _titleProperty;
-
- /**
- * 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";
-
- /**
- * 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;
-
- /**
- * Serial version ID.
- */
- private static final long serialVersionUID = 4964740932426016171L;
-
// ==============================================================================================================================
// Action methods
// ==============================================================================================================================
public String doInitialize() {
- // -----------------------------
ResourceBundle label = ResourceBundle.getBundle("labels",
getApplicationSettings().getCurrentLocale());
ResourceBundle custom = ResourceBundle.getBundle("som",
_openStudy = getOpenStudy();
step = _openStudy.getSelectedStep();
- myscenario = (Scenario) step.getOwner(); // The selected step belong to a scenario
- lasdate = datstring.format(myscenario.getLastModificationDate());
- subject = label.getString("label.study") + " " + _openStudy.getTitle();
+ _myscenario = (Scenario) step.getOwner(); // The selected step belong to a scenario
+ _lasdate = datstring.format(_myscenario.getLastModificationDate());
+ _subject = label.getString("label.study") + " " + _openStudy.getTitle();
- setMenuProperty(Constants.STUDY_MENU);
- setTitleProperty(Constants.STUDY_MENU);
- setEditDisabledProperty("true");
- setToolProperty("back");
- setLeftMenuProperty("open");
- initializationFullScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty, _toolProperty, _leftMenuProperty);
+ initializationFullScreenContext(Constants.STUDY_MENU,
+ Constants.STUDY_MENU, "true", "back", "open");
return SUCCESS;
}
_openStudy = getOpenStudy();
_selection = _openStudy.getSelection();
step = _openStudy.getSelectedStep();
- myscenario = (Scenario) step.getOwner(); // The selected step belong to a scenario
+ _myscenario = (Scenario) step.getOwner(); // The selected step belong to a scenario
- getScenarioService().checkin(myscenario.getIndex());
+ getScenarioService().checkin(_myscenario.getIndex());
// TODO: Do it in the business service after moving to DTO instead of id parameter
// or reread the scenario.
- myscenario.setUser(null);
+ _myscenario.setUser(null);
_openStudy.getMenu().refreshGivenStepItem(
- getProjectElementService().getFirstStep(myscenario)); // For updating the scenario icon
+ getProjectElementService().getFirstStep(_myscenario)); // For updating the scenario icon
- setMenuProperty(Constants.STUDY_MENU);
if ("true".equals(getWriteAccess())
&& getUserRights().canCreateDocument()) {
setToolProperty(Constants.STUDY_MENU);
} else {
- setToolProperty("standard");
+ setToolProperty(Constants.STANDARD_MENU);
}
- setLeftMenuProperty(Constants.STUDY_MENU);
- initializationFullScreenContext(_menuProperty, _toolProperty,
- _leftMenuProperty);
+ initializationFullScreenContext(Constants.STUDY_MENU,
+ getToolProperty(), Constants.STUDY_MENU);
return SUCCESS;
}
*/
public User getAuthor() {
User author;
- if (myscenario.isCheckedout()) {
- author = myscenario.getUser();
+ if (_myscenario.isCheckedout()) {
+ author = _myscenario.getUser();
} else {
- author = myscenario.getAuthor();
+ author = _myscenario.getAuthor();
}
return author;
}
public String getLastModificationDate() {
- return lasdate;
+ return _lasdate;
}
public StepRights getSelectedStep() {
}
public String getSubject() {
- return subject;
+ return _subject;
}
public String getTitle() {
- return myscenario.getTitle();
+ return _myscenario.getTitle();
}
public boolean isCheckedout() {
- return myscenario.isCheckedout();
+ return _myscenario.isCheckedout();
}
/**
final ProjectElementService projectElementService) {
_projectElementService = projectElementService;
}
-
- /**
- * Get the menuProperty.
- *
- * @return the menuProperty
- */
- @Override
- public String getMenuProperty() {
- return _menuProperty;
- }
-
- /**
- * Set the menuProperty.
- *
- * @param menuProperty
- * the menuProperty to set
- */
- @Override
- public void setMenuProperty(final String menuProperty) {
- this._menuProperty = menuProperty;
- }
-
- /**
- * Get the _titleProperty.
- *
- * @return the _titleProperty
- */
- @Override
- public String getTitleProperty() {
- return _titleProperty;
- }
-
- /**
- * Set the _titleProperty.
- *
- * @param _titleProperty
- * the titleProperty to set
- */
- @Override
- public void setTitleProperty(final String titleProperty) {
- _titleProperty = titleProperty;
- }
-
- /**
- * Get the editDisabledProperty.
- *
- * @return the editDisabledProperty
- */
- @Override
- public final String getEditDisabledProperty() {
- return _editDisabledProperty;
- }
-
- /**
- * Set the editDisabledProperty.
- *
- * @param editDisabledProperty
- * the editDisabledProperty to set
- */
- @Override
- public final void setEditDisabledProperty(final String editDisabledProperty) {
- _editDisabledProperty = editDisabledProperty;
- }
-
- /**
- * Get the toolProperty.
- *
- * @return the toolProperty
- */
- @Override
- public String getToolProperty() {
- return _toolProperty;
- }
-
- /**
- * Set the toolProperty.
- *
- * @param toolProperty
- * the toolProperty to set
- */
- @Override
- public void setToolProperty(final String toolProperty) {
- _toolProperty = toolProperty;
- }
-
- /**
- * Get the leftMenuProperty.
- *
- * @return the leftMenuProperty
- */
- @Override
- public String getLeftMenuProperty() {
- return _leftMenuProperty;
- }
-
- /**
- * Set the leftMenuProperty.
- *
- * @param leftMenuProperty
- * the leftMenuProperty to set
- */
- @Override
- public void setLeftMenuProperty(final String leftMenuProperty) {
- _leftMenuProperty = leftMenuProperty;
- }
}
\ No newline at end of file
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;
-import org.splat.wapp.Constants;
/**
* Action for simulation context selection or input.
* Context value.
*/
private transient String _value = null;
- /**
- * Injected study service.
- */
- private StudyService _studyService;
/**
* Injected step service.
*/
*/
private SimulationContextTypeService _simulationContextTypeService;
- /**
- * Value of the menu property. It can be: none, create, open, study, knowledge, sysadmin, help.
- */
- 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";
-
// ==============================================================================================================================
// Action methods
// ==============================================================================================================================
_openStudy = getOpenStudy();
_contype = getInvolvedContexts();
- setMenuProperty(Constants.STUDY_MENU);
- setTitleProperty(Constants.STUDY_MENU);
- if (Constants.TRUE.equals(getWriteAccess())
- && getUserRights().canCreateDocument()) {
- setToolProperty(Constants.STUDY_MENU);
- } else {
- setToolProperty(Constants.STANDARD_MENU);
- }
-
- setLeftMenuProperty(Constants.STUDY_MENU);
- initializationFullScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty, _toolProperty, _leftMenuProperty);
+ setMenu();
if (_contype.isEmpty()) {
res = "create";
String res = "set";
_openStudy = getOpenStudy();
- setMenuProperty(Constants.STUDY_MENU);
- setTitleProperty(Constants.STUDY_MENU);
- if (Constants.TRUE.equals(getWriteAccess())
- && getUserRights().canCreateDocument()) {
- setToolProperty(Constants.STUDY_MENU);
- } else {
- setToolProperty(Constants.STANDARD_MENU);
- }
- setLeftMenuProperty(Constants.STUDY_MENU);
- initializationFullScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty, _toolProperty, _leftMenuProperty);
+ setMenu();
int typid = Integer.valueOf(_selectype);
if (typid == 0) {
_contype = getInvolvedContexts();
_contelm = getSimulationContextService()
.selectSimulationContextsWhere(cprop.setType(_type));
-
+
setAction("setContext");
setIndex(String.valueOf(getContextType().getIndex()));
}
try {
_openStudy = getOpenStudy();
- setMenuProperty(Constants.STUDY_MENU);
- setTitleProperty(Constants.STUDY_MENU);
- if (Constants.TRUE.equals(getWriteAccess())
- && getUserRights().canCreateDocument()) {
- setToolProperty(Constants.STUDY_MENU);
- } else {
- setToolProperty(Constants.STANDARD_MENU);
- }
- setLeftMenuProperty(Constants.STUDY_MENU);
- initializationFullScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty, _toolProperty, _leftMenuProperty);
+ setMenu();
if (_newtype.length() == 0 || _value.length() == 0) {
res = INPUT;
public String doDeleteContext() {
String res = SUCCESS;
- setMenuProperty(Constants.STUDY_MENU);
- setTitleProperty(Constants.STUDY_MENU);
- if (Constants.TRUE.equals(getWriteAccess())
- && getUserRights().canCreateDocument()) {
- setToolProperty(Constants.STUDY_MENU);
- } else {
- setToolProperty(Constants.STANDARD_MENU);
- }
- setLeftMenuProperty(Constants.STUDY_MENU);
- initializationFullScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty, _toolProperty, _leftMenuProperty);
+ setMenu();
try {
_openStudy = getOpenStudy();
String res = SUCCESS;
String[] input = _value.split(",");
- setMenuProperty(Constants.STUDY_MENU);
- setTitleProperty(Constants.STUDY_MENU);
- if (Constants.TRUE.equals(getWriteAccess())
- && getUserRights().canCreateDocument()) {
- setToolProperty(Constants.STUDY_MENU);
- } else {
- setToolProperty(Constants.STANDARD_MENU);
- }
- setLeftMenuProperty(Constants.STUDY_MENU);
- initializationFullScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty, _toolProperty, _leftMenuProperty);
+ setMenu();
try {
_openStudy = getOpenStudy();
}
_openStudy.add(contex);
_contype = getInvolvedContexts();
-
+
setAction("setContext");
setIndex(String.valueOf(getContextType().getIndex()));
return contype;
}
- /**
- * Get the studyService.
- *
- * @return the studyService
- */
- @Override
- public StudyService getStudyService() {
- return _studyService;
- }
-
- /**
- * Set the studyService.
- *
- * @param studyService
- * the studyService to set
- */
- @Override
- public void setStudyService(final StudyService studyService) {
- _studyService = studyService;
- }
-
/**
* Get the simulationContextService.
*
public void setStepService(final StepService stepService) {
_stepService = stepService;
}
-
- /**
- * Get the menuProperty.
- *
- * @return the menuProperty
- */
- @Override
- public String getMenuProperty() {
- return _menuProperty;
- }
-
- /**
- * Set the menuProperty.
- *
- * @param menuProperty
- * the menuProperty to set
- */
- @Override
- public void setMenuProperty(final String menuProperty) {
- this._menuProperty = menuProperty;
- }
-
- /**
- * Get the _titleProperty.
- *
- * @return the _titleProperty
- */
- @Override
- public String getTitleProperty() {
- return _titleProperty;
- }
-
- /**
- * Set the titleProperty.
- *
- * @param titleProperty
- * the titleProperty to set
- */
- @Override
- public void setTitleProperty(final String titleProperty) {
- _titleProperty = titleProperty;
- }
-
- /**
- * Get the editDisabledProperty.
- *
- * @return the editDisabledProperty
- */
- @Override
- public final String getEditDisabledProperty() {
- return _editDisabledProperty;
- }
-
- /**
- * Set the editDisabledProperty.
- *
- * @param editDisabledProperty
- * the editDisabledProperty to set
- */
- @Override
- public final void setEditDisabledProperty(final String editDisabledProperty) {
- _editDisabledProperty = editDisabledProperty;
- }
-
- /**
- * Get the toolProperty.
- *
- * @return the toolProperty
- */
- @Override
- public String getToolProperty() {
- return _toolProperty;
- }
-
- /**
- * Set the toolProperty.
- *
- * @param toolProperty
- * the toolProperty to set
- */
- @Override
- public void setToolProperty(final String toolProperty) {
- _toolProperty = toolProperty;
- }
-
- /**
- * Get the leftMenuProperty.
- *
- * @return the leftMenuProperty
- */
- @Override
- public String getLeftMenuProperty() {
- return _leftMenuProperty;
- }
-
- /**
- * Set the leftMenuProperty.
- *
- * @param leftMenuProperty
- * the leftMenuProperty to set
- */
- @Override
- public void setLeftMenuProperty(final String leftMenuProperty) {
- _leftMenuProperty = leftMenuProperty;
- }
}
\ No newline at end of file
package org.splat.simer;
import org.splat.dal.bo.som.Study;
-import org.splat.service.StudyService;
-
public class EditStudyAction extends DisplayStudyStepAction {
-
- /**
- * Serial version ID.
- */
- private static final long serialVersionUID = -4865668290514118396L;
- private enum Execute { publish, promote }
-
- private StudyService _studyService;
-
- /**
- * Value of the menu property.
- * It can be: none, create, open, study, knowledge, sysadmin, help.
- */
- 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.
+ * Serial version ID.
*/
- private String _editDisabledProperty = "false";
+ private static final long serialVersionUID = -4865668290514118396L;
-// ==============================================================================================================================
-// Action methods
-// ==============================================================================================================================
-
- public String doEdition () {
- try {
- _openStudy = getOpenStudy();
-
- Execute todo = Execute.valueOf(_action);
- Study study = _openStudy.getStudyObject();
-
- if (todo == Execute.publish) getStudyService().moveToPublic(study);
- else if (todo == Execute.promote) getStudyService().moveToReference(study);
- _openStudy.getPopup().setContext("study", _openStudy.getStudyRights()); // The context has changed
-
- setMenuProperty("study");
- setTitleProperty("study");
- if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
- setToolProperty("study");
- } else {
- setToolProperty("standard");
- }
- setLeftMenuProperty("study");
- initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
-
- return SUCCESS;
- }
- catch (RuntimeException saverror) {
- LOG.error("Reason:", saverror);
- return ERROR;
- }
- }
- /**
- * Get the studyService.
- *
- * @return the studyService
- */
- public StudyService getStudyService() {
- return _studyService;
+ private enum Execute {
+ publish, promote
}
- /**
- * Set the studyService.
- *
- * @param studyService
- * the studyService to set
- */
- public void setStudyService(StudyService studyService) {
- _studyService = studyService;
- }
-
- /**
- * Get the menuProperty.
- * @return the menuProperty
- */
- public String getMenuProperty() {
- return _menuProperty;
- }
+ // ==============================================================================================================================
+ // Action methods
+ // ==============================================================================================================================
- /**
- * 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;
- }
+ public String doEdition() {
+ try {
+ _openStudy = getOpenStudy();
- /**
- * 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;
- }
+ Execute todo = Execute.valueOf(_action);
+ Study study = _openStudy.getStudyObject();
- /**
- * 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;
- }
+ if (todo == Execute.publish) {
+ getStudyService().moveToPublic(study);
+ } else if (todo == Execute.promote) {
+ getStudyService().moveToReference(study);
+ }
+ _openStudy.getPopup().setContext("study",
+ _openStudy.getStudyRights()); // The context has changed
- /**
- * Set the leftMenuProperty.
- * @param leftMenuProperty the leftMenuProperty to set
- */
- public void setLeftMenuProperty(final String leftMenuProperty) {
- _leftMenuProperty = leftMenuProperty;
- }
+ setMenu();
+ return SUCCESS;
+ } catch (RuntimeException saverror) {
+ LOG.error("Reason:", saverror);
+ return ERROR;
+ }
+ }
}
\ No newline at end of file
* Injected repository service.
*/
private RepositoryService _repositoryService;
- /**
- * Value of the menu property. It can be: none, create, open, study, knowledge, sysadmin, help.
- */
- 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";
// ==============================================================================================================================
// Action methods
*/
public String doInitialize() {
- setMenuProperty(Constants.STUDY_MENU);
- setTitleProperty(Constants.STUDY_MENU);
- setEditDisabledProperty("true");
- if ("true".equals(getWriteAccess())) {
+ if (Constants.TRUE.equals(getWriteAccess())) {
setToolProperty(Constants.STUDY_MENU);
} else {
setToolProperty(Constants.NONE);
}
- setLeftMenuProperty(Constants.STUDY_MENU);
- initializationFullScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty, _toolProperty, _leftMenuProperty);
+ initializationFullScreenContext(Constants.STUDY_MENU, Constants.STUDY_MENU,
+ Constants.FALSE, getToolProperty(), Constants.STUDY_MENU);
User user = getConnectedUser();
File updir = getRepositoryService().getDownloadDirectory(user);
private void setError(final String errorCode) {
setErrorCode(errorCode);
- setToolProperty(Constants.NONE);
- initializationFullScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty, _toolProperty, _leftMenuProperty);
+ initializationFullScreenContext(Constants.STUDY_MENU, Constants.STUDY_MENU,
+ Constants.FALSE, Constants.NONE, Constants.STUDY_MENU);
}
/**
*/
public String doImport() {
- setMenuProperty(Constants.STUDY_MENU);
- setTitleProperty(Constants.STUDY_MENU);
- setEditDisabledProperty("true");
- initializationScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty);
+ initializationScreenContext(Constants.STUDY_MENU, Constants.STUDY_MENU,
+ Constants.TRUE);
if (action == ToDo.cancel) {
return "cancel";
if (_documentType == 0) {
setErrorCode("message.error.import.type");
- setToolProperty(Constants.NONE);
- setLeftMenuProperty(Constants.STUDY_MENU);
- initializationFullScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty, _toolProperty, _leftMenuProperty);
+ initializationFullScreenContext(Constants.STUDY_MENU, Constants.STUDY_MENU,
+ Constants.TRUE, Constants.NONE, Constants.STUDY_MENU);
return ERROR;
}
setErrorCode("message.error.internal");
}
- setToolProperty(Constants.NONE);
- setLeftMenuProperty(Constants.STUDY_MENU);
- initializationFullScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty, _toolProperty, _leftMenuProperty);
+ initializationFullScreenContext(Constants.STUDY_MENU, Constants.STUDY_MENU,
+ Constants.TRUE, Constants.NONE, Constants.STUDY_MENU);
return ERROR;
}
final DocumentTypeService documentTypeService) {
_documentTypeService = documentTypeService;
}
-
- /**
- * Get the menuProperty.
- *
- * @return the menuProperty
- */
- public String getMenuProperty() {
- return _menuProperty;
- }
-
- /**
- * Set the menuProperty.
- *
- * @param menuProperty
- * the menuProperty to set
- */
- public void setMenuProperty(final 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(final 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(final 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
import org.splat.service.ProjectElementService;
import org.splat.service.ScenarioService;
import org.splat.som.Step;
+import org.splat.wapp.Constants;
import org.splat.wapp.Menu;
-
public class NewScenarioAction extends Action {
- private OpenStudy mystudy;
- private List<Scenario> myscene;
- private String mytitle;
- private String selection;
- private long scindex;
- private int bastep;
- private ToDo action;
+ private transient OpenStudy _mystudy;
+ private transient List<Scenario> _myscene;
+ private String _title;
+ private String _selection;
+ private transient long _scindex;
+ private transient int _bastep;
+ private transient ToDo _action;
/**
* Injected scenario service.
*/
*/
private ProjectElementService _projectElementService;
private Menu _menu;
-
- /**
- * Value of the menu property.
- * It can be: none, create, open, study, knowledge, sysadmin, help.
- */
- 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";
/**
* Serial version ID.
*/
private static final long serialVersionUID = -5586724442986956861L;
- protected enum ToDo { cancel, save };
-
-// ==============================================================================================================================
-// Action methods
-// ==============================================================================================================================
-
- public String doInitialize () {
-// -----------------------------
- mystudy = getOpenStudy();
- Study study = mystudy.getStudyObject();
- Scenario[] scene = study.getScenarii();
- Scenario base = scene[scene.length-1]; // Default base scenario
- ResourceBundle locale = ResourceBundle.getBundle("labels", getApplicationSettings().getCurrentLocale());
-
- myscene = Arrays.asList(scene);
- scindex = base.getIndex();
- mytitle = locale.getString("label.scenario") + " " + String.valueOf(scene.length+1);
- bastep = getProjectElementService().getFirstStep(base).getNumber(); // Better use the last current step ?
- selection = scindex + "." + bastep;
- action = null;
-
-//RKV Menu menu = new NewScenarioMenu(study);
- Menu menu = ((NewScenarioMenu)getMenu()).init(study); //RKV
- menu.selects(selection);
- getSession().put("menu.scenario", menu);
-
- setMenuProperty("study");
- setTitleProperty("study");
- setEditDisabledProperty("true");
- setToolProperty("none");
- setLeftMenuProperty("scenario");
- initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
-
- setActionType("focus");
-
- return SUCCESS;
- }
-
- public String doSelectStep () {
-// -----------------------------
- mystudy = getOpenStudy();
- Study study = mystudy.getStudyObject();
- Scenario[] scene = study.getScenarii();
-
- myscene = Arrays.asList(scene);
- bastep = getProjectElementService().getFirstStep(scene[0]).getNumber(); // All scenarios have the same first step number
- action = null;
-
- getMenu("scenario").selects(selection);
-
- setMenuProperty("study");
- setTitleProperty("study");
- setEditDisabledProperty("true");
- setToolProperty("none");
- setLeftMenuProperty("scenario");
- initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
-
- setActionType("none");
-
- return SUCCESS;
- }
-
- public String doCreate () {
-// -------------------------
- if (action == ToDo.cancel) return "cancel";
-
-// Session session = Database.getCurSession();
-// Transaction transax = session.beginTransaction();
- try { mystudy = getOpenStudy();
- selection = getMenu("scenario").getSelection();
- Study study = mystudy.getStudyObject();
- String[] parse = selection.split("\\x2E");
- int scindex = Integer.valueOf(parse[0]);
- int number = Integer.valueOf(parse[1]);
-
- Scenario[] scene = study.getScenarii();
- Scenario bascene = scene[0];
- for (int i=1; i<scene.length; i++) {
- bascene = scene[i];
- if (bascene.getIndex() == scindex) break;
- }
- Step[] step = null;
- Scenario.Properties sprop = new Scenario.Properties().setManager(getConnectedUser()).setTitle(mytitle).setInsertAfter(bascene);
-
- bastep = getProjectElementService().getFirstStep(bascene).getNumber();
- if (this.sharesStep()) {
- step = getProjectElementService().getSteps(bascene);
- sprop.setBaseStep(step[number-bastep]);
- }
- bascene = getScenarioService().addScenario(study, sprop);
-// transax.commit();
-
-// Update of the display
- if (step != null) for (int i=0; i<number-bastep+1; i++) {
- List<Publication> contents = step[i].getAllDocuments();
- for (Iterator<Publication> j=contents.iterator(); j.hasNext(); ) mystudy.update(j.next());
- }
- mystudy.setSelection(bascene.getIndex() + "." + number);
- getSession().remove("menu.scenario");
- return SUCCESS;
- }
- catch (RuntimeException saverror) {
- LOG.error("Reason:", saverror);
-
- setMenuProperty("study");
- setTitleProperty("study");
- setToolProperty("standard");
- setLeftMenuProperty("study");
- initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
-
- return ERROR;
- }
- catch (Exception error) {
- return INPUT;
- }
- }
-
-// ==============================================================================================================================
-// Getters and setters
-// ==============================================================================================================================
-
- public List<Scenario> getScenarii () {
-// ------------------------------------
- return myscene;
- }
- public long getSelectedScenarioIndex () {
-// --------------------------------------
- return scindex;
- }
- public String getSelection () {
-// -----------------------------
- return selection;
- }
- public String getSharedStep () {
-// -------------------------------
- String[] parse = selection.split("\\x2E");
- return parse[1];
- }
- public String getTitle () {
-// -------------------------
- return mytitle;
- }
-
- public void setCancel (final boolean cancel) {
-// --------------------------------------
- action = ToDo.cancel;
- }
- public void setSave (final boolean save) {
-// ----------------------------------
- action = ToDo.save;
- }
- public void setSelectedScenario (final String index) {
-// ----------------------------------------------
- scindex = Integer.valueOf(index);
- }
- public void setSelection (final String step) {
-// --------------------------------------
- selection = step;
- }
- public void setTitle (final String title) {
-// -----------------------------------
- mytitle = title;
- }
- public Boolean sharesStep () {
-// ----------------------------
- return (Integer.valueOf(getSharedStep()) > bastep);
- }
+ protected enum ToDo {
+ cancel, save
+ };
+
+ // ==============================================================================================================================
+ // Action methods
+ // ==============================================================================================================================
+
+ public String doInitialize() {
+ _mystudy = getOpenStudy();
+ Study study = _mystudy.getStudyObject();
+ Scenario[] scene = study.getScenarii();
+ Scenario base = scene[scene.length - 1]; // Default base scenario
+ ResourceBundle locale = ResourceBundle.getBundle("labels",
+ getApplicationSettings().getCurrentLocale());
+
+ _myscene = Arrays.asList(scene);
+ _scindex = base.getIndex();
+ _title = locale.getString("label.scenario") + " "
+ + String.valueOf(scene.length + 1);
+ _bastep = getProjectElementService().getFirstStep(base).getNumber(); // Better use the last current step ?
+ _selection = _scindex + "." + _bastep;
+ _action = null;
+
+ // RKV Menu menu = new NewScenarioMenu(study);
+ Menu menu = ((NewScenarioMenu) getMenu()).init(study); // RKV
+ menu.selects(_selection);
+ getSession().put("menu.scenario", menu);
+
+ initializationFullScreenContext(Constants.STUDY_MENU,
+ Constants.STUDY_MENU, Constants.TRUE, Constants.NONE,
+ Constants.SCENARIO_MENU);
+
+ setActionType("focus");
+
+ return SUCCESS;
+ }
+
+ public String doSelectStep() {
+ _mystudy = getOpenStudy();
+ Study study = _mystudy.getStudyObject();
+ Scenario[] scene = study.getScenarii();
+
+ _myscene = Arrays.asList(scene);
+ _bastep = getProjectElementService().getFirstStep(scene[0]).getNumber(); // All scenarios have the same first step number
+ _action = null;
+
+ getMenu("scenario").selects(_selection);
+
+ initializationFullScreenContext(Constants.STUDY_MENU,
+ Constants.STUDY_MENU, Constants.TRUE, Constants.NONE,
+ Constants.SCENARIO_MENU);
+
+ setActionType("none");
+
+ return SUCCESS;
+ }
+
+ public String doCreate() {
+ if (_action == ToDo.cancel) {
+ return "cancel";
+ }
+
+ try {
+ _mystudy = getOpenStudy();
+ _selection = getMenu("scenario").getSelection();
+ Study study = _mystudy.getStudyObject();
+ String[] parse = _selection.split("\\x2E");
+ int scindex = Integer.valueOf(parse[0]);
+ int number = Integer.valueOf(parse[1]);
+
+ Scenario[] scene = study.getScenarii();
+ Scenario bascene = scene[0];
+ for (int i = 1; i < scene.length; i++) {
+ bascene = scene[i];
+ if (bascene.getIndex() == scindex) {
+ break;
+ }
+ }
+ Step[] step = null;
+ Scenario.Properties sprop = new Scenario.Properties().setManager(
+ getConnectedUser()).setTitle(_title)
+ .setInsertAfter(bascene);
+
+ _bastep = getProjectElementService().getFirstStep(bascene)
+ .getNumber();
+ if (this.sharesStep()) {
+ step = getProjectElementService().getSteps(bascene);
+ sprop.setBaseStep(step[number - _bastep]);
+ }
+ bascene = getScenarioService().addScenario(study, sprop);
+ // transax.commit();
+
+ // Update of the display
+ if (step != null) {
+ for (int i = 0; i < number - _bastep + 1; i++) {
+ List<Publication> contents = step[i].getAllDocuments();
+ for (Iterator<Publication> j = contents.iterator(); j
+ .hasNext();) {
+ _mystudy.update(j.next());
+ }
+ }
+ }
+ _mystudy.setSelection(bascene.getIndex() + "." + number);
+ getSession().remove("menu.scenario");
+ return SUCCESS;
+ } catch (RuntimeException saverror) {
+ LOG.error("Reason:", saverror);
+
+ initializationFullScreenContext(Constants.STUDY_MENU,
+ Constants.STUDY_MENU, Constants.FALSE,
+ Constants.STANDARD_MENU, Constants.STUDY_MENU);
+
+ return ERROR;
+ } catch (Exception error) {
+ return INPUT;
+ }
+ }
+
+ // ==============================================================================================================================
+ // Getters and setters
+ // ==============================================================================================================================
+
+ public List<Scenario> getScenarii() {
+ return _myscene;
+ }
+
+ public long getSelectedScenarioIndex() {
+ return _scindex;
+ }
+
+ public String getSelection() {
+ return _selection;
+ }
+
+ public String getSharedStep() {
+ String[] parse = _selection.split("\\x2E");
+ return parse[1];
+ }
+
+ public String getTitle() {
+ return _title;
+ }
+
+ public void setCancel(final boolean cancel) {
+ _action = ToDo.cancel;
+ }
+
+ public void setSave(final boolean save) {
+ _action = ToDo.save;
+ }
+
+ public void setSelectedScenario(final String index) {
+ _scindex = Integer.valueOf(index);
+ }
+
+ public void setSelection(final String step) {
+ _selection = step;
+ }
+
+ public void setTitle(final String title) {
+ _title = title;
+ }
+
+ public Boolean sharesStep() {
+ return (Integer.valueOf(getSharedStep()) > _bastep);
+ }
+
/**
* Get the projectElementService.
*
/**
* Get the menu.
+ *
* @return the menu
*/
public Menu getMenu() {
/**
* Set the menu.
- * @param menu the menu to set
+ *
+ * @param menu
+ * the menu to set
*/
public void setMenu(final Menu menu) {
_menu = menu;
/**
* Get the scenarioService.
+ *
* @return the scenarioService
*/
public ScenarioService getScenarioService() {
/**
* Set the scenarioService.
- * @param scenarioService the scenarioService to set
+ *
+ * @param scenarioService
+ * the scenarioService to set
*/
public void setScenarioService(final 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(final 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(final String titleProperty) {
- _titleProperty = titleProperty;
- }
-
- /**
- * Get the _editDisabledProperty.
- * @return the _editDisabledProperty
- */
- public String getEditDisabledProperty() {
- return _editDisabledProperty;
- }
-
- /**
- * Set the _editDisabledProperty.
- * @param editDisabledProperty the editDisabledProperty to set
- */
- public void setEditDisabledProperty(final 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
import org.splat.kernel.MultiplyDefinedException;
import org.splat.service.ScenarioService;
import org.splat.service.SimulationContextService;
+import org.splat.wapp.Constants;
/**
* Action for creation of a new study.
*/
private ScenarioService _scenarioService;
- /**
- * Value of the menu property. It can be: none, create, open, study, knowledge, sysadmin, help.
- */
- private String _menuProperty;
-
- /**
- * 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;
-
// ==============================================================================================================================
// Action methods
// ==============================================================================================================================
_title = locale.getString("label.study") + " "
+ String.valueOf(number + 1);
- setMenuProperty("create");
- setToolProperty("none");
- setLeftMenuProperty("open");
- initializationFullScreenContext(_menuProperty, _toolProperty,
- _leftMenuProperty);
+ initializationFullScreenContext(Constants.CREATE_MENU, Constants.NONE,
+ Constants.OPEN);
return SUCCESS;
}
if (valid == 0) {
value = input[1].trim();
if (value.length() == 0) {
- setMenuProperty("create");
- initializationScreenContext(_menuProperty);
+ initializationScreenContext(Constants.CREATE_MENU);
return INPUT; // No need to reinitialize the list of existing products
}
}
number += 1;
open(study); // Opens the study,
- setMenuProperty("study");
- setToolProperty("none");
- setLeftMenuProperty("open");
- initializationFullScreenContext(_menuProperty, _toolProperty,
- _leftMenuProperty);
+ initializationFullScreenContext(Constants.STUDY_MENU,
+ Constants.NONE, Constants.OPEN);
return SUCCESS;
} catch (Exception error) {
LOG.error("Unable to save the study, reason:", error);
setErrorCode("message.error.newstudy");
- setMenuProperty("none");
- initializationScreenContext(_menuProperty);
+ initializationScreenContext(Constants.NONE);
return ERROR;
}
}
public void setScenarioService(final 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(final String menuProperty) {
- this._menuProperty = menuProperty;
- }
-
- /**
- * 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
package org.splat.simer;
+import org.splat.wapp.Constants;
+/**
+ * The action for not yet implemented functionality.
+ */
public class NotYetImplementedAction extends Action {
/**
* Serial version ID.
*/
private static final long serialVersionUID = 3131921588316476454L;
-
- /**
- * Value of the menu property.
- * It can be: none, create, open, study, knowledge, sysadmin, help.
- */
- private String _menuProperty;
-
- /**
- * Value of the title bar property.
- * It can be: study, knowledge.
- */
- private String _titleProperty;
-
- /**
- * 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";
-
- /**
- * 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;
-// ==============================================================================================================================
-// Action methods
-// ==============================================================================================================================
+ // ==============================================================================================================================
+ // Action methods
+ // ==============================================================================================================================
- public String doInitialize () {
-// -----------------------------
-
- setMenuProperty("study");
- setTitleProperty("study");
- setEditDisabledProperty("true");
- setToolProperty("none");
- setLeftMenuProperty("study");
- initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
-
- setErrorCode("message.error.notyetimplemented");
-
- return SUCCESS;
- }
-
- /**
- * Get the menuProperty.
- * @return the menuProperty
- */
- public String getMenuProperty() {
- return _menuProperty;
- }
-
- /**
- * Set the menuProperty.
- * @param menuProperty the menuProperty to set
- */
- public void setMenuProperty(final String menuProperty) {
- this._menuProperty = menuProperty;
- }
-
/**
- * Get the _titleProperty.
- * @return the _titleProperty
+ * Action initialization.
+ *
+ * @return SUCCESS
*/
- public String getTitleProperty() {
- return _titleProperty;
- }
+ public String doInitialize() {
+ initializationFullScreenContext(Constants.STUDY_MENU,
+ Constants.STUDY_MENU, Constants.TRUE, Constants.NONE,
+ Constants.STUDY_MENU);
- /**
- * Set the _titleProperty.
- * @param _titleProperty the titleProperty to set
- */
- public void setTitleProperty(final String titleProperty) {
- _titleProperty = titleProperty;
- }
+ setErrorCode("message.error.notyetimplemented");
- /**
- * 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(final 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;
+ return SUCCESS;
}
}
\ No newline at end of file
import org.splat.util.BeanHelper;
import org.splat.wapp.ToolBar;
+/**
+ * Presentation of the currently open study.
+ */
public class OpenStudy extends AbstractOpenObject implements OpenStudyServices {
/**
*/
protected final static Logger LOGGER = org.splat.simer.Action.LOG;
+ /**
+ * The currently open study.
+ */
private transient Study _mystudy;
/**
* User rights on the open study.
// ==============================================================================================================================
public String doInitialize () {
-// -----------------------------
return SUCCESS;
}
}
\ No newline at end of file
import org.splat.kernel.InvalidPropertyException;
import org.splat.service.KnowledgeElementTypeService;
import org.splat.service.SearchService;
-import org.splat.service.SimulationContextService;
-import org.splat.service.UserService;
+import org.splat.wapp.Constants;
/**
* Action for searching a knowledge in the database.
* Injected search service.
*/
private SearchService _searchService;
- /**
- * Injected simulation context service.
- */
- private SimulationContextService _simulationContextService;
/**
* Injected knowledge element service.
*/
private KnowledgeElementTypeService _knowledgeElementTypeService;
- /**
- * Injected user service.
- */
- private UserService _userService;
-
- /**
- * Value of the menu property.
- * It can be: none, create, open, study, knowledge, sysadmin, help.
- */
- private String _menuProperty;
-
- /**
- * 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;
-
// ==============================================================================================================================
// Action methods
// ==============================================================================================================================
* @return SUCCESS if succeeded, ERROR if doSearch() is failed
*/
public String doInitialize() {
-
- setMenuProperty("open");
- setToolProperty("none");
- setLeftMenuProperty("open");
- initializationFullScreenContext(_menuProperty, _toolProperty, _leftMenuProperty);
-
+
+ initializationFullScreenContext(Constants.OPEN, Constants.NONE,
+ Constants.OPEN);
+
String res = SUCCESS;
try {
loadFilter();
doSearch();
// Final initialization of the form
- _knowledgeTypes = getKnowledgeElementTypeService().selectTypesWhere(
- ProgressState.APPROVED);
+ _knowledgeTypes = getKnowledgeElementTypeService()
+ .selectTypesWhere(ProgressState.APPROVED);
setCandidates();
setContextTypeOptions(getInvolvedContexts());
} catch (Exception error) {
@Override
protected String doSearch() throws InvalidPropertyException {
- // ----------------------------
- setMenuProperty("open");
- initializationScreenContext(_menuProperty);
-
- Map<String, Object> session = getSession();
+ initializationScreenContext(Constants.OPEN);
+ Map<String, Object> session = getSession();
KnowledgeElement.Properties sprop = new KnowledgeElement.Properties();
// Search matching all criteria
// ==============================================================================================================================
public String getContextMatch() {
- // --------------------------------
return _contextMatch;
}
public String getCriteriaMatch() {
- // ---------------------------------
return _criteriaMatch;
}
public List<KnowledgeElementType> getKnowledgeTypes() {
- // ------------------------------------------------------
return _knowledgeTypes;
}
public String getReference() {
- // -----------------------------
return _reference;
}
public String getState() {
- // ------------------------
return _state;
}
public String getVisibility() {
- // ------------------------------
return _visibility;
}
public String getWords() {
- // -------------------------
return _words;
}
// ==============================================================================================================================
public void setContextMatch(final String value) {
- // ------------------------------------------
this._contextMatch = value;
}
public void setCriteriaMatch(final String value) {
- // -------------------------------------------
this._criteriaMatch = value;
}
public void setReference(final String value) {
- // ---------------------------------------
this._reference = value;
}
public void setState(final String value) {
- // ----------------------------------
this._state = value;
}
public void setVisibility(final String value) {
- // ----------------------------------------
this._visibility = value;
}
public void setWords(final String value) {
- // -----------------------------------
this._words = value;
}
@Override
protected List<SimulationContextType> getInvolvedContexts() {
- // ------------------------------------------------------------
return getSimulationContextService().selectAllTypes();
}
@Override
@SuppressWarnings("unchecked")
protected void loadFilter() {
- // ----------------------------
Map<String, Object> session = getSession();
User user = getConnectedUser();
Map<String, Object> filter = (Map<String, Object>) session
@Override
@SuppressWarnings("unchecked")
protected void saveFilter() {
- // ----------------------------
Map<String, Object> session = getSession();
Map<String, Object> filter = (Map<String, Object>) session
.get("knowledge.filter"); // A default filter is supposed being set at start
_context = (List<SimulationContext>) filter.get("context"); // Only criteria not part of the form
// Initialization required by all do functions
- _knowledgeTypes = getKnowledgeElementTypeService().selectTypesWhere(ProgressState.APPROVED);
+ _knowledgeTypes = getKnowledgeElementTypeService().selectTypesWhere(
+ ProgressState.APPROVED);
}
/**
_searchService = searchService;
}
- /**
- * Get the simulationContextService.
- *
- * @return the simulationContextService
- */
- @Override
- public SimulationContextService getSimulationContextService() {
- return _simulationContextService;
- }
-
- /**
- * Set the simulationContextService.
- *
- * @param simulationContextService
- * the simulationContextService to set
- */
- @Override
- public void setSimulationContextService(
- final SimulationContextService simulationContextService) {
- _simulationContextService = simulationContextService;
- }
-
/**
* Get the knowledgeElementTypeService.
*
final KnowledgeElementTypeService knowledgeElementTypeService) {
_knowledgeElementTypeService = knowledgeElementTypeService;
}
-
- /**
- * Get the userService.
- * @return the userService
- */
- @Override
- public UserService getUserService() {
- return _userService;
- }
-
- /**
- * Set the userService.
- * @param userService the userService to set
- */
- @Override
- public void setUserService(final UserService userService) {
- _userService = userService;
- }
-
- /**
- * Get the menuProperty.
- * @return the menuProperty
- */
- public String getMenuProperty() {
- return _menuProperty;
- }
-
- /**
- * Set the menuProperty.
- * @param menuProperty the menuProperty to set
- */
- public void setMenuProperty(final String menuProperty) {
- this._menuProperty = menuProperty;
- }
-
- /**
- * 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
import org.splat.dal.bo.som.Visibility;
import org.splat.kernel.InvalidPropertyException;
import org.splat.service.SearchService;
-import org.splat.service.SimulationContextService;
-import org.splat.service.UserService;
import org.splat.service.technical.ProjectSettingsService;
+import org.splat.wapp.Constants;
/**
* Search studies form action.
*/
public class SearchStudyAction extends AbstractSearchBaseAction {
+ /**
+ * Serial version ID.
+ */
+ private static final long serialVersionUID = -1910481357051393077L;
+
/**
* "Private", "Public", "All".
*/
* Injected search service.
*/
private SearchService _searchService;
- /**
- * Injected simulation context service.
- */
- private SimulationContextService _simulationContextService;
- /**
- * Injected user service.
- */
- private UserService _userService;
-
- /**
- * Value of the menu property.
- * It can be: none, create, open, study, knowledge, sysadmin, help.
- */
- private String _menuProperty;
-
- /**
- * 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;
-
- /**
- * Serial version ID.
- */
- private static final long serialVersionUID = -1910481357051393077L;
enum UserAction {
refreshResult, selectContextType, selectContextValue, cancelSelect, removeContext
/**
* Initialize study search form.
+ *
* @return SUCCESS if no exception, otherwise return ERROR
*/
public String doInitialize() {
// Final initialization of the form
setCandidates();
setContextTypeOptions(getInvolvedContexts());
-
- setMenuProperty("open");
- setToolProperty("none");
- setLeftMenuProperty("open");
- initializationFullScreenContext(_menuProperty, _toolProperty, _leftMenuProperty);
+ initializationFullScreenContext(Constants.OPEN, Constants.NONE,
+ Constants.OPEN);
+
} catch (Exception error) {
// No need to roll back the transaction as it is read only
LOG.error("Reason: ", error);
-
- setMenuProperty("none");
- initializationScreenContext(_menuProperty);
-
+
+ initializationScreenContext(Constants.NONE);
+
res = ERROR;
}
return res;
}
- /**
+ /**
* {@inheritDoc}
+ *
* @see org.splat.simer.AbstractSearchBaseAction#doSearch()
*/
@Override
* @param projectSettingsService
* project settings service
*/
- public void setProjectSettings(final ProjectSettingsService projectSettingsService) {
+ public void setProjectSettings(
+ final ProjectSettingsService projectSettingsService) {
_projectSettings = projectSettingsService;
}
-
- /**
- * Get the simulationContextService.
- *
- * @return the simulationContextService
- */
- @Override
- public SimulationContextService getSimulationContextService() {
- return _simulationContextService;
- }
-
- /**
- * Set the simulationContextService.
- *
- * @param simulationContextService
- * the simulationContextService to set
- */
- @Override
- public void setSimulationContextService(
- final SimulationContextService simulationContextService) {
- _simulationContextService = simulationContextService;
- }
-
- /**
- * Get the userService.
- *
- * @return the userService
- */
- @Override
- public UserService getUserService() {
- return _userService;
- }
-
- /**
- * Set the userService.
- *
- * @param userService
- * the userService to set
- */
- @Override
- public void setUserService(final UserService userService) {
- _userService = userService;
- }
-
- /**
- * Get the menuProperty.
- * @return the menuProperty
- */
- public String getMenuProperty() {
- return _menuProperty;
- }
-
- /**
- * Set the menuProperty.
- * @param menuProperty the menuProperty to set
- */
- public void setMenuProperty(final String menuProperty) {
- this._menuProperty = menuProperty;
- }
-
- /**
- * 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
import java.util.Map;
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.struts2.interceptor.ServletRequestAware;
import org.splat.service.technical.ProjectSettingsService;
import org.splat.som.ApplicationRights;
import org.splat.wapp.Constants;
/**
* Start application action.
*/
-public class StartAction extends Action implements ServletRequestAware {
+public class StartAction extends Action {
/**
* Serial version ID.
*/
private static final long serialVersionUID = 5875058140682652964L;
- /**
- * HTTP request.
- */
- private transient HttpServletRequest _request = null;
-
/**
* Injected project settings service.
*/
private ProjectSettingsService _projectSettings;
- /**
- * Injected application settings service.
- */
- private ApplicationSettings _applicationSettings;
-
- /**
- * Value of the menu property. It can be: none, create, open, study, knowledge, sysadmin, help.
- */
- private String _menuProperty;
-
- /**
- * Value of the title bar property. It can be: study, knowledge.
- */
- private String _titleProperty;
-
- /**
- * 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";
-
- /**
- * 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;
// ==============================================================================================================================
// Action execution
/**
* Initialize application.
+ *
* @return SUCCESS if succeeded, ERROR - if exception is caught
*/
public String doInitialize() {
- StringBuffer wappurl = _request.getRequestURL(); // "http://{server}:{port}/{webapp}/", including the leading '/'
+ StringBuffer wappurl = getServletRequest().getRequestURL(); // "http://{server}:{port}/{webapp}/", including the leading '/'
String res = SUCCESS;
-
+
LOG.info(new StringBuffer("Initializing ").append(wappurl)
.append("...").toString());
try {
// Database configuration
project.configure(root
- + ApplicationSettings.getApplicationProperty("wapp.configuration"));
+ + ApplicationSettings
+ .getApplicationProperty("wapp.configuration"));
// Configure menus for the current user
wapp.configure();
-
+
// Initialization of the user session
Map<String, Object> session = getSession();
session.put("knowledge.filter", wapp
.getFilter(Constants.KNOWLEDGE_MENU));
- setMenuProperty(Constants.NONE);
- initializationScreenContext(_menuProperty);
-
+ initializationScreenContext(Constants.NONE);
+
} catch (Exception error) {
LOG.fatal("Reason:", error);
- setMenuProperty(Constants.STUDY_MENU);
- setTitleProperty(Constants.STUDY_MENU);
- setEditDisabledProperty("true");
- setToolProperty(Constants.NONE);
- setLeftMenuProperty(Constants.STUDY_MENU);
- initializationFullScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty, _toolProperty, _leftMenuProperty);
+ initializationFullScreenContext(Constants.STUDY_MENU,
+ Constants.STUDY_MENU, Constants.TRUE, Constants.NONE,
+ Constants.STUDY_MENU);
res = ERROR;
}
// Setter
// ==============================================================================================================================
- /**
- * {@inheritDoc}
- * @see org.splat.simer.Action#setServletRequest(javax.servlet.http.HttpServletRequest)
- */
- @Override
- public void setServletRequest(final HttpServletRequest request) {
- this._request = request;
- }
-
/**
* Get project settings.
*
final ProjectSettingsService projectSettingsService) {
_projectSettings = projectSettingsService;
}
-
- /**
- * Get the applicationSettings.
- *
- * @return the applicationSettings
- */
- @Override
- public ApplicationSettings getApplicationSettings() {
- return _applicationSettings;
- }
-
- /**
- * Set the applicationSettings.
- *
- * @param applicationSettings
- * the applicationSettings to set
- */
- @Override
- public void setApplicationSettings(
- final ApplicationSettings applicationSettings) {
- _applicationSettings = applicationSettings;
- }
-
- /**
- * Get the menuProperty.
- *
- * @return the menuProperty
- */
- public String getMenuProperty() {
- return _menuProperty;
- }
-
- /**
- * Set the menuProperty.
- *
- * @param menuProperty
- * the menuProperty to set
- */
- public void setMenuProperty(final 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(final 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(final 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
package org.splat.simer;
+import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-import java.util.Vector;
import org.splat.dal.bo.kernel.User;
import org.splat.dal.bo.som.DocumentType;
import org.splat.kernel.InvalidPropertyException;
import org.splat.kernel.Name;
import org.splat.service.DocumentTypeService;
-import org.splat.service.StudyService;
import org.splat.service.UserService;
import org.splat.som.ApplicationRights;
import org.splat.som.StudyRights;
+import org.splat.wapp.Constants;
/**
* Edit/display study properties (study configuration) screen action.
private static final long serialVersionUID = 4210696018741092900L;
// Presentation fields
- private List<User> staff;
- private List<User> member;
- private List<Name> validor;
- private List<ValidationFacade> validation;
- private ValidationFacade validefault;
- private List<DocumentType> other;
+ private transient List<User> _staff;
+ private transient List<User> _member;
+ private transient List<Name> _validor;
+ private transient List<ValidationFacade> _validation;
+ private transient ValidationFacade _validefault;
+ private transient List<DocumentType> _other;
// User input fields
- private Save tosave; // Edition action (title, contributors or cycle)
- private String edicycle;
- private String stitle; // Title of the study
- private String contributors; // List of existing contributors, some of them may have been removed
- private String candidates; // List of added contributors
- private long type; // Type of document to be included in the validation process
- private int publisher;
- private int reviewer;
- private int approver;
-
/**
- * Injected study service.
+ * Edition action (title, contributors or cycle).
*/
- private StudyService _studyService;
+ private transient Save _tosave;
+ private transient String _edicycle;
/**
- * Injected document type service.
+ * Title of the study.
*/
- private DocumentTypeService _documentTypeService;
-
+ private transient String _stitle;
/**
- * Injected user service.
+ * List of existing contributors, some of them may have been removed.
*/
- private UserService _userService;
-
+ private transient String _contributors;
/**
- * Value of the menu property. It can be: none, create, open, study, knowledge, sysadmin, help.
+ * List of added contributors.
*/
- private String _menuProperty;
-
+ private transient String _candidates;
/**
- * Value of the title bar property. It can be: study, knowledge.
+ * Type of document to be included in the validation process.
*/
- private String _titleProperty;
+ private transient long _type;
+ private transient int _publisher;
+ private transient int _reviewer;
+ private transient int _approver;
/**
- * 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.
+ * Injected document type service.
*/
- private String _leftMenuProperty;
+ private DocumentTypeService _documentTypeService;
/**
- * 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.
+ * Injected user service.
*/
- private String _editDisabledProperty = "false";
+ private UserService _userService;
/**
* Save operation type enumeration pointing which section of properties has been edited.
*/
public String doInitialize() {
+ String res;
_openStudy = getOpenStudy();
- validation = new Vector<ValidationFacade>();
- validefault = null;
- other = getDocumentTypeService().selectResultTypes();
+ _validation = new ArrayList<ValidationFacade>();
+ _validefault = null;
+ _other = getDocumentTypeService().selectResultTypes();
Study study = _openStudy.getStudyObject();
StudyRights user = _openStudy.getStudyRights();
- for (Iterator<DocumentType> i = other.iterator(); i.hasNext();) {
+ for (Iterator<DocumentType> i = _other.iterator(); i.hasNext();) {
DocumentType type = i.next();
ValidationCycle cycle = getStudyService().getValidationCycleOf(
study, type);
if (cycle.isDefault()) {
- validefault = new ValidationFacade(cycle,
+ _validefault = new ValidationFacade(cycle,
getApplicationSettings().getCurrentLocale());
continue;
}
- validation.add(new ValidationFacade(cycle, getApplicationSettings()
- .getCurrentLocale()));
+ _validation.add(new ValidationFacade(cycle,
+ getApplicationSettings().getCurrentLocale()));
i.remove();
}
- if (validefault != null) {
- validation.add(validefault); // In order to be at the end
+ if (_validefault != null) {
+ _validation.add(_validefault); // In order to be at the end
}
- member = getStudyService().getContributors(study);
- staff = null;
- validor = null;
-
- setMenuProperty("study");
- setTitleProperty("study");
- setEditDisabledProperty("true");
- setToolProperty("back");
- setLeftMenuProperty("open");
- initializationFullScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty, _toolProperty, _leftMenuProperty);
+ _member = getStudyService().getContributors(study);
+ _staff = null;
+ _validor = null;
+
+ initializationFullScreenContext(Constants.STUDY_MENU,
+ Constants.STUDY_MENU, Constants.TRUE, Constants.BACK,
+ Constants.OPEN);
if (_openStudy.isOpenForWriting() && user.canEditProperties()) {
- return "edit";
+ res = "edit";
} else {
- return "display";
+ res = "display";
}
+ return res;
}
public String doEditTitle() {
- // Session connex = Database.getCurSession();
- // Transaction transax = connex.beginTransaction();
_openStudy = getOpenStudy();
- validation = new Vector<ValidationFacade>();
- validefault = null;
- other = getDocumentTypeService().selectResultTypes();
+ _validation = new ArrayList<ValidationFacade>();
+ _validefault = null;
+ _other = getDocumentTypeService().selectResultTypes();
Study study = _openStudy.getStudyObject();
- for (Iterator<DocumentType> i = other.iterator(); i.hasNext();) {
+ for (Iterator<DocumentType> i = _other.iterator(); i.hasNext();) {
DocumentType type = i.next();
ValidationCycle cycle = getStudyService().getValidationCycleOf(
study, type);
if (cycle.isDefault()) {
- validefault = new ValidationFacade(cycle,
+ _validefault = new ValidationFacade(cycle,
getApplicationSettings().getCurrentLocale());
continue;
}
- validation.add(new ValidationFacade(cycle, getApplicationSettings()
- .getCurrentLocale()));
+ _validation.add(new ValidationFacade(cycle,
+ getApplicationSettings().getCurrentLocale()));
}
- if (validefault != null) {
- validation.add(validefault); // In order to be at the end
+ if (_validefault != null) {
+ _validation.add(_validefault); // In order to be at the end
}
- member = getStudyService().getContributors(study);
- staff = null;
- validor = null;
- other = null;
-
- // transax.commit();
-
- setMenuProperty("study");
- setTitleProperty("study");
- setEditDisabledProperty("true");
- setToolProperty("back");
- setLeftMenuProperty("open");
- initializationFullScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty, _toolProperty, _leftMenuProperty);
+ _member = getStudyService().getContributors(study);
+ _staff = null;
+ _validor = null;
+ _other = null;
+
+ initializationFullScreenContext(Constants.STUDY_MENU,
+ Constants.STUDY_MENU, Constants.TRUE, Constants.BACK,
+ Constants.OPEN);
setActionType("edititle");
return SUCCESS;
}
public String doEditContributors() {
- // Session connex = Database.getCurSession();
- // Transaction transax = connex.beginTransaction();
_openStudy = getOpenStudy();
- validation = new Vector<ValidationFacade>();
- validefault = null;
- other = getDocumentTypeService().selectAllTypes();
+ _validation = new ArrayList<ValidationFacade>();
+ _validefault = null;
+ _other = getDocumentTypeService().selectAllTypes();
Study study = _openStudy.getStudyObject();
- for (Iterator<DocumentType> i = other.iterator(); i.hasNext();) {
+ for (Iterator<DocumentType> i = _other.iterator(); i.hasNext();) {
DocumentType type = i.next();
ValidationCycle cycle = getStudyService().getValidationCycleOf(
study, type);
if (cycle.isDefault()) {
- validefault = new ValidationFacade(cycle,
+ _validefault = new ValidationFacade(cycle,
getApplicationSettings().getCurrentLocale());
continue;
}
- validation.add(new ValidationFacade(cycle, getApplicationSettings()
- .getCurrentLocale()));
+ _validation.add(new ValidationFacade(cycle,
+ getApplicationSettings().getCurrentLocale()));
}
- if (validefault != null) {
- validation.add(validefault); // In order to be at the end
+ if (_validefault != null) {
+ _validation.add(_validefault); // In order to be at the end
}
- member = getStudyService().getContributors(study);
- staff = getUserService().selectAllUsers();
- validor = null;
- other = null;
+ _member = getStudyService().getContributors(study);
+ _staff = getUserService().selectAllUsers();
+ _validor = null;
+ _other = null;
User me = this.getConnectedUser();
- for (Iterator<User> i = staff.iterator(); i.hasNext();) {
+ for (Iterator<User> i = _staff.iterator(); i.hasNext();) {
User next = i.next();
ApplicationRights he = new ApplicationRights(next);
- if (next.equals(me) || member.contains(next)
+ if (next.equals(me) || _member.contains(next)
|| !he.canContributeToStudy()) {
i.remove();
}
}
- // transax.commit();
- setMenuProperty("study");
- setTitleProperty("study");
- setEditDisabledProperty("true");
- setToolProperty("back");
- setLeftMenuProperty("open");
- initializationFullScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty, _toolProperty, _leftMenuProperty);
+ initializationFullScreenContext(Constants.STUDY_MENU,
+ Constants.STUDY_MENU, Constants.TRUE, Constants.BACK,
+ Constants.OPEN);
setActionType("edibutor");
return SUCCESS;
}
public String doEditCycle() {
- // Session connex = Database.getCurSession();
- // Transaction transax = connex.beginTransaction();
_openStudy = getOpenStudy();
- validation = new Vector<ValidationFacade>();
- validefault = null;
- other = getDocumentTypeService().selectResultTypes();
+ _validation = new ArrayList<ValidationFacade>();
+ _validefault = null;
+ _other = getDocumentTypeService().selectResultTypes();
Study study = _openStudy.getStudyObject();
- for (Iterator<DocumentType> i = other.iterator(); i.hasNext();) {
+ for (Iterator<DocumentType> i = _other.iterator(); i.hasNext();) {
DocumentType type = i.next();
ValidationCycle cycle = getStudyService().getValidationCycleOf(
study, type);
if (cycle.isDefault()) {
- validefault = new ValidationFacade(cycle,
+ _validefault = new ValidationFacade(cycle,
getApplicationSettings().getCurrentLocale());
continue;
}
- if (type.getName().equals(edicycle)) {
- this.type = type.getIndex();
+ if (type.getName().equals(_edicycle)) {
+ this._type = type.getIndex();
}
- validation.add(new ValidationFacade(cycle, getApplicationSettings()
- .getCurrentLocale()));
+ _validation.add(new ValidationFacade(cycle,
+ getApplicationSettings().getCurrentLocale()));
i.remove();
}
- if (validefault != null) {
- validation.add(validefault); // In order to be at the end
+ if (_validefault != null) {
+ _validation.add(_validefault); // In order to be at the end
}
- member = getStudyService().getContributors(study);
- validor = new Vector<Name>();
- staff = null;
+ _member = getStudyService().getContributors(study);
+ _validor = new ArrayList<Name>();
+ _staff = null;
List<User> user = getUserService().selectAllUsers();
for (Iterator<User> i = user.iterator(); i.hasNext();) {
User next = i.next();
ApplicationRights he = new ApplicationRights(next);
if (he.canValidate()) {
if (next.equals(study.getAuthor())) {
- validor.add(new ValidationFacade.ByManager(next,
+ _validor.add(new ValidationFacade.ByManager(next,
getApplicationSettings().getCurrentLocale()));
} else {
- validor.add(next);
+ _validor.add(next);
}
}
}
- // transax.commit();
- setMenuProperty("study");
- setTitleProperty("study");
- setEditDisabledProperty("true");
- setToolProperty("back");
- setLeftMenuProperty("open");
- initializationFullScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty, _toolProperty, _leftMenuProperty);
+ initializationFullScreenContext(Constants.STUDY_MENU,
+ Constants.STUDY_MENU, Constants.TRUE, Constants.BACK,
+ Constants.OPEN);
setActionType("edicycle");
}
public String doEdition() {
- // --------------------------
- // Session connex = Database.getCurSession();
- // Transaction transax = connex.beginTransaction();
Study study = getOpenStudy().getStudyObject();
- if (tosave == Save.title) {
+ if (_tosave == Save.title) {
// Edition of the title
Study.Properties sprop = new Study.Properties();
try {
- getStudyService().update(study, sprop.setTitle(stitle));
+ getStudyService().update(study, sprop.setTitle(_stitle));
} catch (InvalidPropertyException e) {
// TODO
}
- } else if (tosave == Save.contributor) {
+ } else if (_tosave == Save.contributor) {
// Edition of contributors
- if (contributors == null) {
- contributors = "";
+ if (_contributors == null) {
+ _contributors = "";
}
- if (candidates == null) {
- candidates = "";
+ if (_candidates == null) {
+ _candidates = "";
}
- String[] parsekept = contributors.split(",");
- String[] parsenew = candidates.split(",");
- Vector<User> toremove = new Vector<User>(getStudyService()
+ String[] parsekept = _contributors.split(",");
+ String[] parsenew = _candidates.split(",");
+ List<User> toremove = new ArrayList<User>(getStudyService()
.getContributors(study));
for (int i = 0; i < parsekept.length; i++) {
getStudyService().addContributor(study, newser);
}
- } else if (tosave == Save.cycle) {
+ } else if (_tosave == Save.cycle) {
// Addition of a document validation cycle
- DocumentType apply = getDocumentTypeService().selectType(type);
+ DocumentType apply = getDocumentTypeService().selectType(_type);
ValidationCycle.Properties vprop = new ValidationCycle.Properties();
- if (publisher > 0) {
- User actor = getUserService().selectUser(publisher);
+ if (_publisher > 0) {
+ User actor = getUserService().selectUser(_publisher);
vprop.setActor(ValidationStep.PROMOTION, actor);
}
- if (reviewer > 0) {
- User actor = getUserService().selectUser(reviewer);
+ if (_reviewer > 0) {
+ User actor = getUserService().selectUser(_reviewer);
vprop.setActor(ValidationStep.REVIEW, actor);
}
- if (approver > 0) {
- User actor = getUserService().selectUser(approver);
+ if (_approver > 0) {
+ User actor = getUserService().selectUser(_approver);
vprop.setActor(ValidationStep.APPROVAL, actor);
}
getStudyService().setValidationCycle(study, apply, vprop);
}
- // transax.commit();
doInitialize(); // Re-initialization following the above edition
- setMenuProperty("study");
- setTitleProperty("study");
- setEditDisabledProperty("true");
- setToolProperty("back");
- setLeftMenuProperty("open");
- initializationFullScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty, _toolProperty, _leftMenuProperty);
+ initializationFullScreenContext(Constants.STUDY_MENU,
+ Constants.STUDY_MENU, Constants.TRUE, Constants.BACK,
+ Constants.OPEN);
return SUCCESS;
}
// ==============================================================================================================================
public User getAuthor() {
- // ------------------------
return _openStudy.getStudyObject().getAuthor();
}
public List<User> getCandidates() {
- // ----------------------------------
- return staff;
+ return _staff;
}
public String getCycle() {
- // -------------------------
- return edicycle;
+ return _edicycle;
}
public List<User> getContributors() {
- // ------------------------------------
- return member;
+ return _member;
}
public ValidationFacade getDefaultValidation() {
- // -----------------------------------------------
- return validefault;
+ return _validefault;
}
public long getDocumentTypeIndex() {
- // ----------------------------------
- return type;
+ return _type;
}
public List<DocumentType> getOtherDocumentTypes() {
- // --------------------------------------------------
- return other;
+ return _other;
}
public String getStudyTitle() {
- // ------------------------------
return _openStudy.getTitle();
}
public List<ValidationFacade> getValidations() {
- // -----------------------------------------------
- return validation;
+ return _validation;
}
public List<Name> getValidationActors() {
- // ----------------------------------------
- return validor;
+ return _validor;
}
// ==============================================================================================================================
// ==============================================================================================================================
public void setCandidates(final String indices) {
- // ------------------------------------------
- candidates = indices;
+ _candidates = indices;
}
public void setCycle(final String type) {
- // ----------------------------------
- edicycle = type;
+ _edicycle = type;
}
public void setMembers(final String indices) {
- // ---------------------------------------
- contributors = indices;
+ _contributors = indices;
}
public void setDocumentType(final String index) {
- // ------------------------------------------
- type = Integer.valueOf(index);
+ _type = Integer.valueOf(index);
}
public void setApprover(final String index) {
- // --------------------------------------
- approver = Integer.valueOf(index);
+ _approver = Integer.valueOf(index);
}
public void setPublisher(final String index) {
- // ---------------------------------------
- publisher = Integer.valueOf(index);
+ _publisher = Integer.valueOf(index);
}
public void setReviewer(final String index) {
- // --------------------------------------
- reviewer = Integer.valueOf(index);
+ _reviewer = Integer.valueOf(index);
}
public void setTitle(final String title) {
- // -----------------------------------
- stitle = title;
+ _stitle = title;
}
public void setSaveTitle(final String save) {
- // --------------------------------------
- tosave = Save.title;
+ _tosave = Save.title;
}
public void setSaveContributors(final String save) {
- // ---------------------------------------------
- tosave = Save.contributor;
+ _tosave = Save.contributor;
}
public void setSaveCycle(final String save) {
- // --------------------------------------
- tosave = Save.cycle;
- }
-
- /**
- * Get the studyService.
- *
- * @return the studyService
- */
- @Override
- public StudyService getStudyService() {
- return _studyService;
- }
-
- /**
- * Set the studyService.
- *
- * @param studyService
- * the studyService to set
- */
- @Override
- public void setStudyService(final StudyService studyService) {
- _studyService = studyService;
+ _tosave = Save.cycle;
}
/**
public void setUserService(final UserService userService) {
_userService = userService;
}
-
- /**
- * Get the menuProperty.
- *
- * @return the menuProperty
- */
- @Override
- public String getMenuProperty() {
- return _menuProperty;
- }
-
- /**
- * Set the menuProperty.
- *
- * @param menuProperty
- * the menuProperty to set
- */
- @Override
- public void setMenuProperty(final String menuProperty) {
- this._menuProperty = menuProperty;
- }
-
- /**
- * Get the _titleProperty.
- *
- * @return the _titleProperty
- */
- @Override
- public String getTitleProperty() {
- return _titleProperty;
- }
-
- /**
- * Set the _titleProperty.
- *
- * @param _titleProperty
- * the titleProperty to set
- */
- @Override
- public void setTitleProperty(final String titleProperty) {
- _titleProperty = titleProperty;
- }
-
- /**
- * Get the editDisabledProperty.
- *
- * @return the editDisabledProperty
- */
- @Override
- public final String getEditDisabledProperty() {
- return _editDisabledProperty;
- }
-
- /**
- * Set the editDisabledProperty.
- *
- * @param editDisabledProperty
- * the editDisabledProperty to set
- */
- @Override
- public final void setEditDisabledProperty(final String editDisabledProperty) {
- _editDisabledProperty = editDisabledProperty;
- }
-
- /**
- * Get the toolProperty.
- *
- * @return the toolProperty
- */
- @Override
- public String getToolProperty() {
- return _toolProperty;
- }
-
- /**
- * Set the toolProperty.
- *
- * @param toolProperty
- * the toolProperty to set
- */
- @Override
- public void setToolProperty(final String toolProperty) {
- _toolProperty = toolProperty;
- }
-
- /**
- * Get the leftMenuProperty.
- *
- * @return the leftMenuProperty
- */
- @Override
- public String getLeftMenuProperty() {
- return _leftMenuProperty;
- }
-
- /**
- * Set the leftMenuProperty.
- *
- * @param leftMenuProperty
- * the leftMenuProperty to set
- */
- @Override
- public void setLeftMenuProperty(final String leftMenuProperty) {
- _leftMenuProperty = leftMenuProperty;
- }
}
\ No newline at end of file
*/
private RepositoryService _repositoryService;
- /**
- * Value of the menu property. It can be: none, create, open, study, knowledge, sysadmin, help.
- */
- 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";
-
/**
* Action modes enumeration.
*/
* @return SUCCESS
*/
public String doInitialize() {
- setMenuProperty(Constants.STUDY_MENU);
- setToolProperty(Constants.NONE);
- setLeftMenuProperty("open");
- setTitleProperty(Constants.STUDY_MENU);
- setEditDisabledProperty("true");
- initializationFullScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty, _toolProperty, _leftMenuProperty);
+ initializationFullScreenContext(Constants.STUDY_MENU,
+ Constants.STUDY_MENU, Constants.TRUE, Constants.NONE,
+ Constants.OPEN);
return SUCCESS;
}
* file or ERROR otherwise
*/
public String doUpload() {
- setMenuProperty(Constants.STUDY_MENU);
- setTitleProperty(Constants.STUDY_MENU);
- setEditDisabledProperty("true");
- initializationScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty);
+ initializationScreenContext(Constants.STUDY_MENU, Constants.STUDY_MENU,
+ Constants.TRUE);
String res;
if (_action == ToDo.cancel) {
res = _nextAction;
} catch (OutOfMemoryError error) {
- setMenuProperty(Constants.NONE);
- setTitleProperty(Constants.STUDY_MENU);
- setEditDisabledProperty("true");
- setToolProperty(Constants.NONE);
- setLeftMenuProperty(Constants.STUDY_MENU);
- initializationFullScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty, _toolProperty, _leftMenuProperty);
+ initializationFullScreenContext(Constants.NONE,
+ Constants.STUDY_MENU, Constants.TRUE, Constants.NONE,
+ Constants.STUDY_MENU);
setErrorCode("message.error.outofmemory");
public void setRepositoryService(final RepositoryService repositoryService) {
_repositoryService = repositoryService;
}
-
- /**
- * Get the menuProperty.
- *
- * @return the menuProperty
- */
- public String getMenuProperty() {
- return _menuProperty;
- }
-
- /**
- * Set the menuProperty.
- *
- * @param menuProperty
- * the menuProperty to set
- */
- public void setMenuProperty(final 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(final String titleProperty) {
- _titleProperty = titleProperty;
- }
-
- /**
- * Get the _editDisabledProperty.
- *
- * @return the _editDisabledProperty
- */
- public String getEditDisabledProperty() {
- return _editDisabledProperty;
- }
-
- /**
- * Set the editDisabledProperty.
- *
- * @param editDisabledProperty
- * the editDisabledProperty to set
- */
- public void setEditDisabledProperty(final String editDisabledProperty) {
- this._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
* @version Revision:
*****************************************************************************/
-package org.splat.simer;
+package org.splat.simer;
+
+import org.splat.wapp.Constants;
/**
* Action class for uploading the study.
+ *
* @author Maria KRUCHININA
- *
+ *
*/
public class UploadStudyAction extends Action {
/**
- * Value of the menu property.
- * It can be: none, create, open, study, knowledge, sysadmin, help.
+ * Serialization version id.
*/
- private String _menuProperty;
-
private static final long serialVersionUID = 6003880772275115924L;
-
- public String doInitialize () {
- setMenuProperty("study");
- initializationScreenContext(_menuProperty);
-
- return SUCCESS;
- }
-
- /**
- * 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;
+ public String doInitialize() {
+ initializationScreenContext(Constants.STUDY_MENU);
+ return SUCCESS;
}
}
* Injected repository service.
*/
private RepositoryService _repositoryService;
- /**
- * Value of the menu property. It can be: none, create, open, study, knowledge, sysadmin, help.
- */
- 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";
// ==============================================================================================================================
// Action methods
*/
public String doInitialize() {
- setMenuProperty(Constants.STUDY_MENU);
- setTitleProperty(Constants.STUDY_MENU);
- setEditDisabledProperty("true");
if ("true".equals(getWriteAccess())) {
setToolProperty(Constants.STUDY_MENU);
} else {
setToolProperty(Constants.NONE);
}
- setLeftMenuProperty(Constants.STUDY_MENU);
- initializationFullScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty, _toolProperty, _leftMenuProperty);
+ initializationFullScreenContext(Constants.STUDY_MENU,
+ Constants.STUDY_MENU, Constants.TRUE, getToolProperty(),
+ Constants.STUDY_MENU);
User user = getConnectedUser();
File updir = getRepositoryService().getDownloadDirectory(user);
// Setup dependencies
_usedby.addAll(tag.getRelations(UsedByRelation.class));
} else {
- if (!(Constants.NONE.equals(_toolProperty))) {
- setToolProperty(Constants.NONE);
- setLeftMenuProperty(Constants.STUDY_MENU);
- initializationFullScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty, _toolProperty, _leftMenuProperty);
+ if (!(Constants.NONE.equals(getToolProperty()))) {
+ initializationFullScreenContext(Constants.STUDY_MENU,
+ Constants.STUDY_MENU, Constants.TRUE, Constants.NONE,
+ Constants.STUDY_MENU);
}
res = ERROR;
}
*/
public String doVersion() {
String res = ERROR;
- setMenuProperty(Constants.STUDY_MENU);
- setTitleProperty(Constants.STUDY_MENU);
- setEditDisabledProperty("true");
- initializationScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty);
+ initializationScreenContext(Constants.STUDY_MENU, Constants.STUDY_MENU,
+ Constants.TRUE);
if (action == ToDo.cancel) {
res = "cancel";
setErrorCode("message.error.internal");
}
if (!SUCCESS.equals(res)) {
- setToolProperty(Constants.NONE);
-
- setLeftMenuProperty(Constants.STUDY_MENU);
- initializationFullScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty, _toolProperty, _leftMenuProperty);
+ initializationFullScreenContext(Constants.STUDY_MENU,
+ Constants.STUDY_MENU, Constants.TRUE, Constants.NONE,
+ Constants.STUDY_MENU);
}
}
return res;
public void setRepositoryService(final RepositoryService repositoryService) {
_repositoryService = repositoryService;
}
-
- /**
- * Get the menuProperty.
- *
- * @return the menuProperty
- */
- public String getMenuProperty() {
- return _menuProperty;
- }
-
- /**
- * Set the menuProperty.
- *
- * @param menuProperty
- * the menuProperty to set
- */
- public void setMenuProperty(final 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(final String titleProperty) {
- _titleProperty = titleProperty;
- }
-
- /**
- * Get the _editDisabledProperty.
- *
- * @return the _editDisabledProperty
- */
- public String getEditDisabledProperty() {
- return _editDisabledProperty;
- }
-
- /**
- * Set the editDisabledProperty.
- *
- * @param editDisabledProperty
- * the editDisabledProperty to set
- */
- public void setEditDisabledProperty(final String editDisabledProperty) {
- this._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
*/
private SearchService _searchService;
- /**
- * Value of the menu property.
- * It can be: none, create, open, study, knowledge, sysadmin, help.
- */
- private String _menuProperty;
-
- /**
- * 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;
-
// ==============================================================================================================================
// Action methods
// ==============================================================================================================================
_newstudies = getSearchService().selectStudies();
_indices = "";
- setMenuProperty("sysadmin");
- setToolProperty("none");
- setLeftMenuProperty("open");
- initializationFullScreenContext(_menuProperty, _toolProperty, _leftMenuProperty);
+ initializationFullScreenContext("sysadmin", "none", "open");
return SUCCESS;
}
public void setSearchService(final SearchService searchService) {
_searchService = searchService;
}
-
- /**
- * Get the menuProperty.
- * @return the menuProperty
- */
- public String getMenuProperty() {
- return _menuProperty;
- }
-
- /**
- * Set the menuProperty.
- * @param menuProperty the menuProperty to set
- */
- public void setMenuProperty(final String menuProperty) {
- this._menuProperty = menuProperty;
- }
-
- /**
- * 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
*/
private UserService _userService;
- /**
- * Value of the menu property.
- * It can be: none, create, open, study, knowledge, sysadmin, help.
- */
- private String _menuProperty;
-
- /**
- * 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;
-
// ==============================================================================================================================
// Action methods
// ==============================================================================================================================
break;
}
- setMenuProperty("sysadmin");
- setToolProperty("none");
- setLeftMenuProperty("open");
- initializationFullScreenContext(_menuProperty, _toolProperty, _leftMenuProperty);
+ initializationFullScreenContext("sysadmin", "none", "open");
}
catch (Exception error) {
res = ERROR;
public void setUserService(final UserService userService) {
_userService = userService;
}
-
- /**
- * Get the menuProperty.
- * @return the menuProperty
- */
- public String getMenuProperty() {
- return _menuProperty;
- }
-
- /**
- * Set the menuProperty.
- * @param menuProperty the menuProperty to set
- */
- public void setMenuProperty(final String menuProperty) {
- this._menuProperty = menuProperty;
- }
-
- /**
- * 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
// ==============================================================================================================================
public String doInitialize () {
-// -----------------------------
return SUCCESS;
}
// ==============================================================================================================================
public ProjectElementFacade (final Study represented, final ProjectSettingsService.Step at) {
-// ------------------------------------------------------------------------
_index = represented.getIndex(); // The index of scenarios AND studies are unique
_my = represented;
_subtitle = "";
_step = "0." + at.getNumber();
}
public ProjectElementFacade (final Scenario represented, final ProjectSettingsService.Step at) {
-// ---------------------------------------------------------------------------
_index = represented.getIndex(); // The index of scenarios AND studies are unique
_my = represented.getOwnerStudy();
_subtitle = ", " + represented.getTitle();
@Override
public boolean equals (final Object other) {
-// ------------------------------------
return (this.hashCode() == other.hashCode());
}
@Override
public int hashCode () {
-// ----------------------
return (int) _index;
}
// ==============================================================================================================================
public String getAuthorName () {
-// ------------------------------
return _my.getAuthor().getDisplayName();
}
public ProgressState getProgressState () {
-// ----------------------------------------
return _my.getProgressState();
}
public String getReference () {
-// -----------------------------
return _my.getReference();
}
public String getSelection () {
-// -----------------------------
return _step;
}
public String getStudyIndex () {
-// ------------------------------
return String.valueOf(_my.getIndex());
}
public String getTitle () {
-// -------------------------
return _my.getTitle() + _subtitle;
}
}
\ No newline at end of file
*/
private SimulationContextService _simulationContextService;
- /**
- * Value of the menu property. It can be: none, create, open, study, knowledge, sysadmin, help.
- */
- private String _menuProperty;
-
- /**
- * 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;
-
/**
* Context name comparator.
*/
_edition = null;
_owner = null;
- setMenuProperty("study");
- setToolProperty("none");
- setLeftMenuProperty("open");
- initializationFullScreenContext(_menuProperty, _toolProperty,
- _leftMenuProperty);
+ initializationFullScreenContext("study", "none", "open");
} catch (Exception error) {
LOG.error("Reason:", error);
res = ERROR; // No need to roll-back the transaction as it is read-only
public String doSelect() {
String res = SUCCESS;
- setMenuProperty("study");
- setToolProperty("none");
- setLeftMenuProperty("open");
- initializationFullScreenContext(_menuProperty, _toolProperty,
- _leftMenuProperty);
+ initializationFullScreenContext("study", "none", "open");
Session connex = Database.getCurSession();
Transaction transax = connex.beginTransaction();
public void setSearchService(final SearchService searchService) {
_searchService = searchService;
}
-
- /**
- * Get the menuProperty.
- *
- * @return the menuProperty
- */
- public String getMenuProperty() {
- return _menuProperty;
- }
-
- /**
- * Set the menuProperty.
- *
- * @param menuProperty
- * the menuProperty to set
- */
- public void setMenuProperty(final String menuProperty) {
- this._menuProperty = menuProperty;
- }
-
- /**
- * 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
* @copyright OPEN CASCADE 2012
*****************************************************************************/
-package org.splat.wapp;
+package org.splat.wapp;
/**
* SIMAN constants.
*/
public class Constants {
+ /**
+ * Create menu key.
+ */
+ public final static String CREATE_MENU = "create";
/**
* Standard menu key.
*/
* Study menu key.
*/
public final static String STUDY_MENU = "study";
+ /**
+ * Scenario menu key.
+ */
+ public final static String SCENARIO_MENU = "scenario";
/**
* Knowledge menu key.
*/
* TRUE literal constant.
*/
public final static String TRUE = "true";
+ /**
+ * FALSE literal constant.
+ */
+ public final static String FALSE = "false";
/**
* Scenario properties menu key.
*/
public final static String PROP_SCENARIO = "prop-scenario";
+ /**
+ * Tool property "back".
+ */
+ public final static String BACK = "back";
+ /**
+ * Left menu property "open".
+ */
+ public final static String OPEN = "open";
}