From 7025b5bbe666dff7c10cb1200b1eaec66b7bc232 Mon Sep 17 00:00:00 2001 From: mka Date: Tue, 30 Oct 2012 08:04:55 +0000 Subject: [PATCH] Tool bar is improved. --- Workspace/Siman/WebContent/jsp/titlebar.jsp | 2 +- Workspace/Siman/WebContent/jsp/toolbar.jsp | 76 ++++---- Workspace/Siman/WebContent/menu.jsp | 4 +- .../WebContent/sadmin/approveKnowelm.jsp | 4 +- .../WebContent/sadmin/approveSContext.jsp | 4 +- .../Siman/WebContent/sadmin/displayUser.jsp | 4 +- .../Siman/WebContent/sadmin/indexStudies.jsp | 4 +- Workspace/Siman/WebContent/sadmin/upload.jsp | 4 +- .../WebContent/study/displayKnowledge.jsp | 4 +- .../study/displayStudyProperties.jsp | 4 +- .../WebContent/study/displayStudyStep.jsp | 11 +- .../study/editScenarioProperties.jsp | 4 +- .../WebContent/study/editStudyProperties.jsp | 4 +- Workspace/Siman/WebContent/study/error.jsp | 4 +- .../Siman/WebContent/study/importDocument.jsp | 11 +- .../Siman/WebContent/study/importError.jsp | 4 +- .../Siman/WebContent/study/newScenario.jsp | 4 +- Workspace/Siman/WebContent/study/newStudy.jsp | 4 +- .../WebContent/study/searchKnowledge.jsp | 4 +- .../Siman/WebContent/study/searchStudy.jsp | 4 +- Workspace/Siman/WebContent/study/upload.jsp | 4 +- .../WebContent/study/versionDocument.jsp | 11 +- .../Siman/src/org/splat/simer/Action.java | 78 +++++++- .../splat/simer/DisplayKnowledgeAction.java | 34 +++- .../splat/simer/DisplayStudyStepAction.java | 50 ++++- .../org/splat/simer/EditDocumentAction.java | 49 ++++- .../simer/EditKnowledgeElementAction.java | 55 +++++- .../simer/EditScenarioPropertiesAction.java | 33 +++- .../simer/EditSimulationContextAction.java | 56 +++++- .../src/org/splat/simer/EditStudyAction.java | 29 ++- .../org/splat/simer/ImportDocumentAction.java | 53 +++++- .../org/splat/simer/NewScenarioAction.java | 31 +++- .../src/org/splat/simer/NewStudyAction.java | 28 ++- .../splat/simer/NotYetImplementedAction.java | 25 ++- .../splat/simer/SearchKnowledgeAction.java | 25 ++- .../org/splat/simer/SearchStudyAction.java | 25 ++- .../src/org/splat/simer/StartAction.java | 25 ++- .../splat/simer/StudyPropertiesAction.java | 37 +++- .../src/org/splat/simer/TitleBarSettings.java | 20 ++ .../src/org/splat/simer/ToolBarSettings.java | 171 ++++++++++++++++++ .../src/org/splat/simer/UploadAction.java | 27 ++- .../org/splat/simer/UploadBaseNextAction.java | 7 + .../splat/simer/VersionDocumentAction.java | 56 +++++- .../simer/admin/DatabaseIndexingAction.java | 25 ++- .../splat/simer/admin/ImportUserAction.java | 25 ++- .../simer/admin/SimulationContextAction.java | 54 ++++++ .../Siman/src/spring/applicationContext.xml | 7 +- 47 files changed, 1013 insertions(+), 191 deletions(-) create mode 100644 Workspace/Siman/src/org/splat/simer/ToolBarSettings.java diff --git a/Workspace/Siman/WebContent/jsp/titlebar.jsp b/Workspace/Siman/WebContent/jsp/titlebar.jsp index 3de2ec6..2312284 100644 --- a/Workspace/Siman/WebContent/jsp/titlebar.jsp +++ b/Workspace/Siman/WebContent/jsp/titlebar.jsp @@ -30,7 +30,7 @@ -    +    diff --git a/Workspace/Siman/WebContent/jsp/toolbar.jsp b/Workspace/Siman/WebContent/jsp/toolbar.jsp index f1b2164..00c9795 100644 --- a/Workspace/Siman/WebContent/jsp/toolbar.jsp +++ b/Workspace/Siman/WebContent/jsp/toolbar.jsp @@ -1,23 +1,15 @@ <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %> -<%@ page import="org.splat.som.StudyRights"%> <%@ page import="org.splat.som.StepRights"%> <%@ page import="org.splat.simer.OpenStudy"%> <%@ page import="org.splat.wapp.ToolBar"%> <%@ page import="org.splat.wapp.ToolButton"%> -<%@ page import="org.splat.wapp.PopupMenu"%> <%@ page import="java.util.Iterator"%> <%@ taglib prefix="s" uri="/struts-tags" %> -<%!private enum Tool { none, standard, study, back };%> - -<% - String barname = request.getParameter("tools"); - Tool bar = Tool.valueOf(barname); -%> + configuration @@ -27,29 +19,29 @@
-<% - if (bar == Tool.study) { - OpenStudy study = (OpenStudy)session.getAttribute("study.open"); - PopupMenu popup = study.getPopup(); - StudyRights user = study.getStudyRights(); -%> + + + + " border="none" title="" /> + + + " border="none" title="" /> + + + + " border="none" title=""/> + + + " border="none" title="" /> + + + -<% } - else if (bar == Tool.standard) { -%> - -<% } - else if (bar == Tool.back) { -%> - -<% } -%> + + + + + + + + + +
-<% if (user.canEditProperties()) { -%> " border="none" title="" /> -<% } else { -%> " border="none" title="" /> -<% } -%> -<% if (popup.isEnabled("script")) { -%> " border="none" title=""/> -<% } else { -%> " border="none" title="" /> -<% } -%> " border="none" /> -<% ToolBar mbar = study.getModuleBar(); +<% OpenStudy study = (OpenStudy)session.getAttribute("study.open"); + ToolBar mbar = study.getModuleBar(); if (study.getSelectedStepRights().canCreateDocument() && mbar != null) { %> height=<%=mbar.getHeight()%>> @@ -69,18 +61,18 @@ " border="none" title="" /> - " border="none" title="" /> - - " border="none" title="" /> -
+ " border="none" title="" /> + + " border="none" title="" /> +
\ No newline at end of file diff --git a/Workspace/Siman/WebContent/menu.jsp b/Workspace/Siman/WebContent/menu.jsp index cecaa5b..173a937 100644 --- a/Workspace/Siman/WebContent/menu.jsp +++ b/Workspace/Siman/WebContent/menu.jsp @@ -29,9 +29,7 @@ ============================================================================================================================= -->
- - - +
diff --git a/Workspace/Siman/WebContent/sadmin/approveKnowelm.jsp b/Workspace/Siman/WebContent/sadmin/approveKnowelm.jsp index a5ff9bf..1d44ac0 100644 --- a/Workspace/Siman/WebContent/sadmin/approveKnowelm.jsp +++ b/Workspace/Siman/WebContent/sadmin/approveKnowelm.jsp @@ -23,9 +23,7 @@ ============================================================================================================================= -->
- - - +
diff --git a/Workspace/Siman/WebContent/sadmin/approveSContext.jsp b/Workspace/Siman/WebContent/sadmin/approveSContext.jsp index 0094b7f..4936bfb 100644 --- a/Workspace/Siman/WebContent/sadmin/approveSContext.jsp +++ b/Workspace/Siman/WebContent/sadmin/approveSContext.jsp @@ -26,9 +26,7 @@ ============================================================================================================================= -->
- - - +
diff --git a/Workspace/Siman/WebContent/sadmin/displayUser.jsp b/Workspace/Siman/WebContent/sadmin/displayUser.jsp index 6b9b4a6..3b519c6 100644 --- a/Workspace/Siman/WebContent/sadmin/displayUser.jsp +++ b/Workspace/Siman/WebContent/sadmin/displayUser.jsp @@ -23,9 +23,7 @@ ============================================================================================================================= -->
- - - +
diff --git a/Workspace/Siman/WebContent/sadmin/indexStudies.jsp b/Workspace/Siman/WebContent/sadmin/indexStudies.jsp index cc20770..125e254 100644 --- a/Workspace/Siman/WebContent/sadmin/indexStudies.jsp +++ b/Workspace/Siman/WebContent/sadmin/indexStudies.jsp @@ -24,9 +24,7 @@ ============================================================================================================================= -->
- - - +
diff --git a/Workspace/Siman/WebContent/sadmin/upload.jsp b/Workspace/Siman/WebContent/sadmin/upload.jsp index 59ac349..09c4cc7 100644 --- a/Workspace/Siman/WebContent/sadmin/upload.jsp +++ b/Workspace/Siman/WebContent/sadmin/upload.jsp @@ -30,9 +30,7 @@ ============================================================================================================================= -->
- - - +
diff --git a/Workspace/Siman/WebContent/study/displayKnowledge.jsp b/Workspace/Siman/WebContent/study/displayKnowledge.jsp index 3f3b7b8..c0db77d 100644 --- a/Workspace/Siman/WebContent/study/displayKnowledge.jsp +++ b/Workspace/Siman/WebContent/study/displayKnowledge.jsp @@ -27,9 +27,7 @@ ============================================================================================================================= -->
- - - +
diff --git a/Workspace/Siman/WebContent/study/displayStudyProperties.jsp b/Workspace/Siman/WebContent/study/displayStudyProperties.jsp index 08d4749..c0b955f 100644 --- a/Workspace/Siman/WebContent/study/displayStudyProperties.jsp +++ b/Workspace/Siman/WebContent/study/displayStudyProperties.jsp @@ -28,9 +28,7 @@ ============================================================================================================================= -->
- - - +
diff --git a/Workspace/Siman/WebContent/study/displayStudyStep.jsp b/Workspace/Siman/WebContent/study/displayStudyStep.jsp index 7ac24f2..26c49bc 100644 --- a/Workspace/Siman/WebContent/study/displayStudyStep.jsp +++ b/Workspace/Siman/WebContent/study/displayStudyStep.jsp @@ -113,16 +113,7 @@ ============================================================================================================================= -->
- - - - - - - - - - +
diff --git a/Workspace/Siman/WebContent/study/editScenarioProperties.jsp b/Workspace/Siman/WebContent/study/editScenarioProperties.jsp index 2eb4d12..95de82b 100644 --- a/Workspace/Siman/WebContent/study/editScenarioProperties.jsp +++ b/Workspace/Siman/WebContent/study/editScenarioProperties.jsp @@ -38,9 +38,7 @@ ============================================================================================================================= -->
- - - +
diff --git a/Workspace/Siman/WebContent/study/editStudyProperties.jsp b/Workspace/Siman/WebContent/study/editStudyProperties.jsp index a516e77..a60cd41 100644 --- a/Workspace/Siman/WebContent/study/editStudyProperties.jsp +++ b/Workspace/Siman/WebContent/study/editStudyProperties.jsp @@ -53,9 +53,7 @@ ============================================================================================================================= -->
- - - +
diff --git a/Workspace/Siman/WebContent/study/error.jsp b/Workspace/Siman/WebContent/study/error.jsp index 466d157..1388428 100644 --- a/Workspace/Siman/WebContent/study/error.jsp +++ b/Workspace/Siman/WebContent/study/error.jsp @@ -36,9 +36,7 @@ ============================================================================================================================= -->
- - - +
diff --git a/Workspace/Siman/WebContent/study/importDocument.jsp b/Workspace/Siman/WebContent/study/importDocument.jsp index 3f793a1..c162504 100644 --- a/Workspace/Siman/WebContent/study/importDocument.jsp +++ b/Workspace/Siman/WebContent/study/importDocument.jsp @@ -34,16 +34,7 @@ ============================================================================================================================= -->
- - - - - - - - - - +
diff --git a/Workspace/Siman/WebContent/study/importError.jsp b/Workspace/Siman/WebContent/study/importError.jsp index a29f5ee..37f943f 100644 --- a/Workspace/Siman/WebContent/study/importError.jsp +++ b/Workspace/Siman/WebContent/study/importError.jsp @@ -36,9 +36,7 @@ ============================================================================================================================= -->
- - - +
diff --git a/Workspace/Siman/WebContent/study/newScenario.jsp b/Workspace/Siman/WebContent/study/newScenario.jsp index a792bd5..a401e4e 100644 --- a/Workspace/Siman/WebContent/study/newScenario.jsp +++ b/Workspace/Siman/WebContent/study/newScenario.jsp @@ -37,9 +37,7 @@ ============================================================================================================================= -->
- - - +
diff --git a/Workspace/Siman/WebContent/study/newStudy.jsp b/Workspace/Siman/WebContent/study/newStudy.jsp index d8f196f..d227e8e 100644 --- a/Workspace/Siman/WebContent/study/newStudy.jsp +++ b/Workspace/Siman/WebContent/study/newStudy.jsp @@ -42,9 +42,7 @@ ============================================================================================================================= -->
- - - +
diff --git a/Workspace/Siman/WebContent/study/searchKnowledge.jsp b/Workspace/Siman/WebContent/study/searchKnowledge.jsp index bfbb3cf..0bf4027 100644 --- a/Workspace/Siman/WebContent/study/searchKnowledge.jsp +++ b/Workspace/Siman/WebContent/study/searchKnowledge.jsp @@ -50,9 +50,7 @@ ============================================================================================================================= -->
- - - +
diff --git a/Workspace/Siman/WebContent/study/searchStudy.jsp b/Workspace/Siman/WebContent/study/searchStudy.jsp index 2ec930f..7f9834d 100644 --- a/Workspace/Siman/WebContent/study/searchStudy.jsp +++ b/Workspace/Siman/WebContent/study/searchStudy.jsp @@ -50,9 +50,7 @@ ============================================================================================================================= -->
- - - +
diff --git a/Workspace/Siman/WebContent/study/upload.jsp b/Workspace/Siman/WebContent/study/upload.jsp index 4180ff9..fc18d12 100644 --- a/Workspace/Siman/WebContent/study/upload.jsp +++ b/Workspace/Siman/WebContent/study/upload.jsp @@ -34,9 +34,7 @@ ============================================================================================================================= -->
- - - +
diff --git a/Workspace/Siman/WebContent/study/versionDocument.jsp b/Workspace/Siman/WebContent/study/versionDocument.jsp index 8a44fe7..070bee3 100644 --- a/Workspace/Siman/WebContent/study/versionDocument.jsp +++ b/Workspace/Siman/WebContent/study/versionDocument.jsp @@ -34,16 +34,7 @@ ============================================================================================================================= -->
- - - - - - - - - - +
diff --git a/Workspace/Siman/src/org/splat/simer/Action.java b/Workspace/Siman/src/org/splat/simer/Action.java index 74517cd..dae6a9d 100644 --- a/Workspace/Siman/src/org/splat/simer/Action.java +++ b/Workspace/Siman/src/org/splat/simer/Action.java @@ -14,11 +14,13 @@ import org.apache.struts2.interceptor.SessionAware; import org.apache.log4j.Logger; import org.splat.dal.bo.kernel.User; import org.splat.som.ApplicationRights; +import org.splat.som.StudyRights; import org.splat.dal.bo.som.KnowledgeElement; import org.splat.dal.bo.som.SimulationContextType; import org.splat.dal.bo.som.Study; import org.splat.dal.bo.som.DocumentType; import org.splat.wapp.Menu; +import org.splat.wapp.PopupMenu; /** @@ -66,6 +68,11 @@ public class Action extends ActionSupport implements ServletRequestAware, Sessio * TitleBarSettings bean. */ private TitleBarSettings _titleBarSettings; + /** + * ToolBarSettings bean. + */ + private ToolBarSettings _toolBarSettings; + /** * Injected application settings bean. */ @@ -174,6 +181,27 @@ public class Action extends ActionSupport implements ServletRequestAware, Sessio getMenuBarSettings().setIsStudyNull(true); } else { getMenuBarSettings().setIsStudyNull(false); + + //for initialization ToolBarSettings.canUserEdit property + // and ToolBarSettings.isEnabledScript property. + + OpenStudy currentStudy = (OpenStudy)session.get("study.open"); + PopupMenu popup = currentStudy.getPopup(); + StudyRights user = currentStudy.getStudyRights(); + + if(user.canEditProperties()) { + getToolBarSettings().setCanUserEdit(true); + } else { + getToolBarSettings().setCanUserEdit(false); + } + + if (popup == null) { + getToolBarSettings().setIsEnabledScript(false); + } else if (popup.isEnabled("script")) { + getToolBarSettings().setIsEnabledScript(true); + } else { + getToolBarSettings().setIsEnabledScript(false); + } } if (session.get("knowledge.open") == null) { @@ -212,7 +240,8 @@ public class Action extends ActionSupport implements ServletRequestAware, Sessio getTitleBarSettings().setProgressState(entity.getProgressState().toString()); getTitleBarSettings().setSelectionState(entity.getSelection()); - getTitleBarSettings().setEntryType(entity.getType()); + getTitleBarSettings().setEntryType(entity.getType().toLowerCase()); + getTitleBarSettings().setEntryTypeTitle(entity.getType()); getTitleBarSettings().setEntryTitle(entity.getTitle()); getTitleBarSettings().setEditDisabledProperty(editDisabledProperty); } @@ -229,7 +258,7 @@ public class Action extends ActionSupport implements ServletRequestAware, Sessio } /** - * Initialization of the screen context for menu bar and tool bar. + * Initialization of the screen context for menu bar and title bar. * * @param menuProperty - the property of the menu bar. * @param titleProperty - The title of the open study/knowledge. @@ -241,6 +270,36 @@ public class Action extends ActionSupport implements ServletRequestAware, Sessio initializationContext(titleProperty, editDisabledProperty); getMenuBarSettings().intializeMenuBar(menuProperty); } + + /** + * Initialization of the screen context for menu bar, title bar and tool bar. + * + * @param menuProperty - the property of the menu bar. + * @param titleProperty - The title of the open study/knowledge. + * @param editDisabledProperty - Property that indicates whether the current open study is editable or not. + * @param toolProperty - the property of the tool bar. + */ + public void initializationScreenContext(final String menuProperty, + final String titleProperty, final String editDisabledProperty, + final String toolProperty) { + + initializationScreenContext(menuProperty, titleProperty, editDisabledProperty); + getToolBarSettings().intializeMenuBar(toolProperty); + } + + /** + * Initialization of the screen context for menu bar and tool bar. + * + * @param menuProperty - the property of the menu bar. + * @param toolProperty - the property of the tool bar. + */ + public void initializationScreenContext(final String menuProperty, + final String toolProperty) { + + initializationContext(); + getMenuBarSettings().intializeMenuBar(menuProperty); + getToolBarSettings().intializeMenuBar(toolProperty); + } // ============================================================================================================================== // Getters and setters // ============================================================================================================================== @@ -297,6 +356,21 @@ public class Action extends ActionSupport implements ServletRequestAware, Sessio public void setTitleBarSettings(TitleBarSettings titleBarSettings) { _titleBarSettings = titleBarSettings; } + /** + * Get the toolBarSettings. + * @return the toolBarSettings + */ + public final ToolBarSettings getToolBarSettings() { + return _toolBarSettings; + } + /** + * Set the toolBarSettings. + * @param toolBarSettings the toolBarSettings to set + */ + public final void setToolBarSettings(ToolBarSettings toolBarSettings) { + _toolBarSettings = toolBarSettings; + } + /** * Get the applicationSettings. * @return the applicationSettings diff --git a/Workspace/Siman/src/org/splat/simer/DisplayKnowledgeAction.java b/Workspace/Siman/src/org/splat/simer/DisplayKnowledgeAction.java index d15d903..61c2522 100644 --- a/Workspace/Siman/src/org/splat/simer/DisplayKnowledgeAction.java +++ b/Workspace/Siman/src/org/splat/simer/DisplayKnowledgeAction.java @@ -35,6 +35,12 @@ public class DisplayKnowledgeAction extends DisplayBaseAction { */ private String _titleProperty; + /** + * Value of the tool bar property. + * It can be: none, standard, study, back. + */ + private String _toolProperty; + /** * 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. @@ -73,7 +79,8 @@ public class DisplayKnowledgeAction extends DisplayBaseAction { setMenuProperty("knowledge"); setTitleProperty("knowledge"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + setToolProperty("none"); + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); return SUCCESS; } @@ -89,7 +96,8 @@ public class DisplayKnowledgeAction extends DisplayBaseAction { setMenuProperty("knowledge"); setTitleProperty("knowledge"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + setToolProperty("none"); + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); return SUCCESS; } @@ -106,7 +114,8 @@ public class DisplayKnowledgeAction extends DisplayBaseAction { setMenuProperty("knowledge"); setTitleProperty("knowledge"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + setToolProperty("none"); + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); return SUCCESS; } @@ -121,7 +130,8 @@ public class DisplayKnowledgeAction extends DisplayBaseAction { setMenuProperty("knowledge"); setTitleProperty("knowledge"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + setToolProperty("none"); + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); return SUCCESS; } @@ -227,5 +237,19 @@ public class DisplayKnowledgeAction extends DisplayBaseAction { 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; + } } \ No newline at end of file diff --git a/Workspace/Siman/src/org/splat/simer/DisplayStudyStepAction.java b/Workspace/Siman/src/org/splat/simer/DisplayStudyStepAction.java index c90f049..ff3b5de 100644 --- a/Workspace/Siman/src/org/splat/simer/DisplayStudyStepAction.java +++ b/Workspace/Siman/src/org/splat/simer/DisplayStudyStepAction.java @@ -44,6 +44,12 @@ public class DisplayStudyStepAction extends DisplayBaseAction { */ private String _titleProperty; + /** + * Value of the tool bar property. + * It can be: none, standard, study, back. + */ + private String _toolProperty; + /** * 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. @@ -101,7 +107,13 @@ public class DisplayStudyStepAction extends DisplayBaseAction { setMenuProperty("study"); setTitleProperty("study"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) { + setToolProperty("study"); + } else { + setToolProperty("standard"); + } + + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); return SUCCESS; } @@ -127,7 +139,12 @@ public class DisplayStudyStepAction extends DisplayBaseAction { setMenuProperty("study"); setTitleProperty("study"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) { + setToolProperty("study"); + } else { + setToolProperty("standard"); + } + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); return SUCCESS; } @@ -144,7 +161,12 @@ public class DisplayStudyStepAction extends DisplayBaseAction { setMenuProperty("study"); setTitleProperty("study"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) { + setToolProperty("study"); + } else { + setToolProperty("standard"); + } + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); return SUCCESS; } @@ -159,7 +181,12 @@ public class DisplayStudyStepAction extends DisplayBaseAction { setMenuProperty("study"); setTitleProperty("study"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) { + setToolProperty("study"); + } else { + setToolProperty("standard"); + } + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); return SUCCESS; } @@ -291,4 +318,19 @@ public class DisplayStudyStepAction extends DisplayBaseAction { _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; + } } \ No newline at end of file diff --git a/Workspace/Siman/src/org/splat/simer/EditDocumentAction.java b/Workspace/Siman/src/org/splat/simer/EditDocumentAction.java index ba8a295..80f7b0f 100644 --- a/Workspace/Siman/src/org/splat/simer/EditDocumentAction.java +++ b/Workspace/Siman/src/org/splat/simer/EditDocumentAction.java @@ -50,6 +50,12 @@ public class EditDocumentAction extends DisplayStudyStepAction { */ private String _titleProperty; + /** + * Value of the tool bar property. + * It can be: none, standard, study, back. + */ + private String _toolProperty; + /** * 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. @@ -78,7 +84,12 @@ public class EditDocumentAction extends DisplayStudyStepAction { setMenuProperty("study"); setTitleProperty("study"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) { + setToolProperty("study"); + } else { + setToolProperty("standard"); + } + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); return SUCCESS; } @@ -87,7 +98,12 @@ public class EditDocumentAction extends DisplayStudyStepAction { setMenuProperty("study"); setTitleProperty("study"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) { + setToolProperty("study"); + } else { + setToolProperty("standard"); + } + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); try { mystudy = getOpenStudy(); @@ -138,7 +154,12 @@ public class EditDocumentAction extends DisplayStudyStepAction { setMenuProperty("study"); setTitleProperty("study"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) { + setToolProperty("study"); + } else { + setToolProperty("standard"); + } + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); try { // Getting user inputs @@ -170,7 +191,12 @@ public class EditDocumentAction extends DisplayStudyStepAction { setMenuProperty("study"); setTitleProperty("study"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) { + setToolProperty("study"); + } else { + setToolProperty("standard"); + } + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); try { mystudy = getOpenStudy(); @@ -310,6 +336,21 @@ public class EditDocumentAction extends DisplayStudyStepAction { } + /** + * 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; + } } \ No newline at end of file diff --git a/Workspace/Siman/src/org/splat/simer/EditKnowledgeElementAction.java b/Workspace/Siman/src/org/splat/simer/EditKnowledgeElementAction.java index 177f5b4..5e839d7 100644 --- a/Workspace/Siman/src/org/splat/simer/EditKnowledgeElementAction.java +++ b/Workspace/Siman/src/org/splat/simer/EditKnowledgeElementAction.java @@ -61,6 +61,12 @@ public class EditKnowledgeElementAction extends DisplayStudyStepAction { * 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; // ============================================================================================================================== // Action methods @@ -76,7 +82,12 @@ public class EditKnowledgeElementAction extends DisplayStudyStepAction { setMenuProperty("study"); setTitleProperty("study"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) { + setToolProperty("study"); + } else { + setToolProperty("standard"); + } + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); return SUCCESS; } @@ -90,7 +101,12 @@ public class EditKnowledgeElementAction extends DisplayStudyStepAction { setMenuProperty("study"); setTitleProperty("study"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) { + setToolProperty("study"); + } else { + setToolProperty("standard"); + } + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); try { User user = getConnectedUser(); @@ -148,7 +164,12 @@ public class EditKnowledgeElementAction extends DisplayStudyStepAction { setMenuProperty("study"); setTitleProperty("study"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) { + setToolProperty("study"); + } else { + setToolProperty("standard"); + } + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); return SUCCESS; } @@ -284,7 +305,7 @@ public class EditKnowledgeElementAction extends DisplayStudyStepAction { * @param menuProperty * the menuProperty to set */ - public void setMenuProperty(String menuProperty) { + public void setMenuProperty(final String menuProperty) { this._menuProperty = menuProperty; } @@ -297,10 +318,10 @@ public class EditKnowledgeElementAction extends DisplayStudyStepAction { } /** - * Set the _titleProperty. - * @param _titleProperty the titleProperty to set + * Set the titleProperty. + * @param titleProperty the titleProperty to set */ - public void setTitleProperty(String titleProperty) { + public void setTitleProperty(final String titleProperty) { _titleProperty = titleProperty; } @@ -308,7 +329,7 @@ public class EditKnowledgeElementAction extends DisplayStudyStepAction { * Get the editDisabledProperty. * @return the editDisabledProperty */ - public final String getEditDisabledProperty() { + public String getEditDisabledProperty() { return _editDisabledProperty; } @@ -316,9 +337,25 @@ public class EditKnowledgeElementAction extends DisplayStudyStepAction { * Set the editDisabledProperty. * @param editDisabledProperty the editDisabledProperty to set */ - public final void setEditDisabledProperty(String editDisabledProperty) { + 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; + } + } \ No newline at end of file diff --git a/Workspace/Siman/src/org/splat/simer/EditScenarioPropertiesAction.java b/Workspace/Siman/src/org/splat/simer/EditScenarioPropertiesAction.java index dc3036b..884426e 100644 --- a/Workspace/Siman/src/org/splat/simer/EditScenarioPropertiesAction.java +++ b/Workspace/Siman/src/org/splat/simer/EditScenarioPropertiesAction.java @@ -36,6 +36,12 @@ public class EditScenarioPropertiesAction extends DisplayStudyStepAction { * 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; /** * Serial version ID. @@ -65,7 +71,8 @@ public class EditScenarioPropertiesAction extends DisplayStudyStepAction { setMenuProperty("study"); setTitleProperty("study"); setEditDisabledProperty("true"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + setToolProperty("back"); + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); return SUCCESS; } @@ -84,7 +91,13 @@ public class EditScenarioPropertiesAction extends DisplayStudyStepAction { getProjectElementService().getFirstStep(myscenario)); // For updating the scenario icon setMenuProperty("study"); - initializationScreenContext(_menuProperty); + if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) { + setToolProperty("study"); + } else { + setToolProperty("standard"); + } + initializationScreenContext(_menuProperty, _toolProperty); + return SUCCESS; } @@ -213,5 +226,19 @@ public class EditScenarioPropertiesAction extends DisplayStudyStepAction { _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; + } } \ No newline at end of file diff --git a/Workspace/Siman/src/org/splat/simer/EditSimulationContextAction.java b/Workspace/Siman/src/org/splat/simer/EditSimulationContextAction.java index fdc5d6e..fa96d37 100644 --- a/Workspace/Siman/src/org/splat/simer/EditSimulationContextAction.java +++ b/Workspace/Siman/src/org/splat/simer/EditSimulationContextAction.java @@ -50,6 +50,12 @@ public class EditSimulationContextAction extends DisplayStudyStepAction { */ private String _titleProperty; + /** + * Value of the tool bar property. + * It can be: none, standard, study, back. + */ + private String _toolProperty; + /** * 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. @@ -70,7 +76,12 @@ public class EditSimulationContextAction extends DisplayStudyStepAction { setMenuProperty("study"); setTitleProperty("study"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) { + setToolProperty("study"); + } else { + setToolProperty("standard"); + } + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); if (contype.isEmpty()) return "create"; @@ -83,7 +94,12 @@ public class EditSimulationContextAction extends DisplayStudyStepAction { setMenuProperty("study"); setTitleProperty("study"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) { + setToolProperty("study"); + } else { + setToolProperty("standard"); + } + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); int typid = Integer.valueOf(selectype); if (typid == 0) @@ -106,7 +122,12 @@ public class EditSimulationContextAction extends DisplayStudyStepAction { setMenuProperty("study"); setTitleProperty("study"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) { + setToolProperty("study"); + } else { + setToolProperty("standard"); + } + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); if (newtype.length() == 0 || value.length() == 0) return INPUT; @@ -139,7 +160,12 @@ public class EditSimulationContextAction extends DisplayStudyStepAction { setMenuProperty("study"); setTitleProperty("study"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) { + setToolProperty("study"); + } else { + setToolProperty("standard"); + } + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); try { mystudy = getOpenStudy(); @@ -170,7 +196,12 @@ public class EditSimulationContextAction extends DisplayStudyStepAction { setMenuProperty("study"); setTitleProperty("study"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) { + setToolProperty("study"); + } else { + setToolProperty("standard"); + } + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); try { mystudy = getOpenStudy(); @@ -418,5 +449,20 @@ public class EditSimulationContextAction extends DisplayStudyStepAction { _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; + } } \ No newline at end of file diff --git a/Workspace/Siman/src/org/splat/simer/EditStudyAction.java b/Workspace/Siman/src/org/splat/simer/EditStudyAction.java index 6a4f468..7c77a53 100644 --- a/Workspace/Siman/src/org/splat/simer/EditStudyAction.java +++ b/Workspace/Siman/src/org/splat/simer/EditStudyAction.java @@ -27,6 +27,12 @@ public class EditStudyAction extends DisplayStudyStepAction { */ private String _titleProperty; + /** + * Value of the tool bar property. + * It can be: none, standard, study, back. + */ + private String _toolProperty; + /** * 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. @@ -51,7 +57,12 @@ public class EditStudyAction extends DisplayStudyStepAction { setMenuProperty("study"); setTitleProperty("study"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) { + setToolProperty("study"); + } else { + setToolProperty("standard"); + } + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); return SUCCESS; } @@ -124,5 +135,21 @@ public class EditStudyAction extends DisplayStudyStepAction { public final void setEditDisabledProperty(String editDisabledProperty) { _editDisabledProperty = editDisabledProperty; } + + /** + * Get the toolProperty. + * @return the toolProperty + */ + public String getToolProperty() { + return _toolProperty; + } + + /** + * Set the toolProperty. + * @param toolProperty the toolProperty to set + */ + public void setToolProperty(final String toolProperty) { + _toolProperty = toolProperty; + } } \ No newline at end of file diff --git a/Workspace/Siman/src/org/splat/simer/ImportDocumentAction.java b/Workspace/Siman/src/org/splat/simer/ImportDocumentAction.java index 995ea70..d6af46b 100644 --- a/Workspace/Siman/src/org/splat/simer/ImportDocumentAction.java +++ b/Workspace/Siman/src/org/splat/simer/ImportDocumentAction.java @@ -77,6 +77,12 @@ public class ImportDocumentAction extends UploadBaseNextAction { */ private String _titleProperty; + /** + * Value of the tool bar property. + * It can be: none, standard, study, back. + */ + private String _toolProperty; + /** * 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. @@ -97,7 +103,12 @@ public class ImportDocumentAction extends UploadBaseNextAction { setMenuProperty("study"); setTitleProperty("study"); setEditDisabledProperty("true"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + if ("true".equals(getWriteAccess())) { + setToolProperty("study"); + } else { + setToolProperty("none"); + } + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); User user = getConnectedUser(); File updir = getRepositoryService().getDownloadDirectory(user); @@ -130,10 +141,18 @@ public class ImportDocumentAction extends UploadBaseNextAction { new Revision().toString()); if (slot == null) { setErrorCode("reference.undefined"); + + setToolProperty("none"); + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); + return ERROR; } else { if (!slot.isUndefined()) { setErrorCode("reference.duplicate"); + + setToolProperty("none"); + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); + return ERROR; } docref = fileref; // Disables document name and state fields @@ -153,6 +172,10 @@ public class ImportDocumentAction extends UploadBaseNextAction { docver = version.toString(); } catch (ParseException e) { setErrorCode("format.version"); + + setToolProperty("none"); + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); + return ERROR; } docname = tool.extractProperty("title"); // Property kept even if the file is not referenced @@ -166,6 +189,10 @@ public class ImportDocumentAction extends UploadBaseNextAction { check.parse(date); } catch (ParseException e) { setErrorCode("format.date"); + + setToolProperty("none"); + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); + return ERROR; } } else @@ -205,6 +232,10 @@ public class ImportDocumentAction extends UploadBaseNextAction { return "cancel"; if (doctype == 0) { setErrorCode("import.type"); + + setToolProperty("none"); + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); + return ERROR; } try { @@ -296,6 +327,10 @@ public class ImportDocumentAction extends UploadBaseNextAction { logger.error("Reason:", error); setErrorCode("internal"); } + + setToolProperty("none"); + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); + return ERROR; } @@ -521,5 +556,19 @@ public class ImportDocumentAction extends UploadBaseNextAction { _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; + } } \ No newline at end of file diff --git a/Workspace/Siman/src/org/splat/simer/NewScenarioAction.java b/Workspace/Siman/src/org/splat/simer/NewScenarioAction.java index dfe72de..45fdac9 100644 --- a/Workspace/Siman/src/org/splat/simer/NewScenarioAction.java +++ b/Workspace/Siman/src/org/splat/simer/NewScenarioAction.java @@ -49,6 +49,12 @@ public class NewScenarioAction extends Action { */ private String _titleProperty; + /** + * Value of the tool bar property. + * It can be: none, standard, study, back. + */ + private String _toolProperty; + /** * 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. @@ -90,7 +96,8 @@ public class NewScenarioAction extends Action { setMenuProperty("study"); setTitleProperty("study"); setEditDisabledProperty("true"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + setToolProperty("none"); + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); return SUCCESS; } @@ -110,7 +117,8 @@ public class NewScenarioAction extends Action { setMenuProperty("study"); setTitleProperty("study"); setEditDisabledProperty("true"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + setToolProperty("none"); + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); return SUCCESS; } @@ -159,7 +167,8 @@ public class NewScenarioAction extends Action { setMenuProperty("study"); setTitleProperty("study"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + setToolProperty("standard"); + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); return ERROR; } @@ -317,4 +326,20 @@ public class NewScenarioAction extends Action { public void setEditDisabledProperty(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; + } } \ No newline at end of file diff --git a/Workspace/Siman/src/org/splat/simer/NewStudyAction.java b/Workspace/Siman/src/org/splat/simer/NewStudyAction.java index aee3a75..55536d6 100644 --- a/Workspace/Siman/src/org/splat/simer/NewStudyAction.java +++ b/Workspace/Siman/src/org/splat/simer/NewStudyAction.java @@ -50,6 +50,12 @@ public class NewStudyAction extends Action { * 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; // ============================================================================================================================== // Action methods @@ -72,7 +78,8 @@ public class NewStudyAction extends Action { + String.valueOf(number + 1); setMenuProperty("create"); - initializationScreenContext(_menuProperty); + setToolProperty("none"); + initializationScreenContext(_menuProperty, _toolProperty); return SUCCESS; } @@ -133,7 +140,8 @@ public class NewStudyAction extends Action { open(study); // Opens the study, setMenuProperty("study"); - initializationScreenContext(_menuProperty); + setToolProperty("none"); + initializationScreenContext(_menuProperty, _toolProperty); return SUCCESS; } catch (Exception error) { @@ -245,4 +253,20 @@ public class NewStudyAction extends Action { public void setMenuProperty(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; + } } \ No newline at end of file diff --git a/Workspace/Siman/src/org/splat/simer/NotYetImplementedAction.java b/Workspace/Siman/src/org/splat/simer/NotYetImplementedAction.java index d174af4..97be0e6 100644 --- a/Workspace/Siman/src/org/splat/simer/NotYetImplementedAction.java +++ b/Workspace/Siman/src/org/splat/simer/NotYetImplementedAction.java @@ -26,6 +26,12 @@ public class NotYetImplementedAction extends Action { * 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; // ============================================================================================================================== // Action methods @@ -37,7 +43,8 @@ public class NotYetImplementedAction extends Action { setMenuProperty("study"); setTitleProperty("study"); setEditDisabledProperty("true"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + setToolProperty("none"); + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); return SUCCESS; } @@ -90,5 +97,19 @@ public class NotYetImplementedAction extends Action { _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; + } } \ No newline at end of file diff --git a/Workspace/Siman/src/org/splat/simer/SearchKnowledgeAction.java b/Workspace/Siman/src/org/splat/simer/SearchKnowledgeAction.java index 009f8c0..ac8b541 100644 --- a/Workspace/Siman/src/org/splat/simer/SearchKnowledgeAction.java +++ b/Workspace/Siman/src/org/splat/simer/SearchKnowledgeAction.java @@ -53,6 +53,12 @@ public class SearchKnowledgeAction extends SearchBaseAction { * 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; // ============================================================================================================================== // Action methods @@ -66,7 +72,8 @@ public class SearchKnowledgeAction extends SearchBaseAction { public String doInitialize() { setMenuProperty("open"); - initializationScreenContext(_menuProperty); + setToolProperty("none"); + initializationScreenContext(_menuProperty, _toolProperty); try { loadFilter(); @@ -351,4 +358,20 @@ public class SearchKnowledgeAction extends SearchBaseAction { public void setMenuProperty(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; + } } \ No newline at end of file diff --git a/Workspace/Siman/src/org/splat/simer/SearchStudyAction.java b/Workspace/Siman/src/org/splat/simer/SearchStudyAction.java index 68fcef2..02df3a3 100644 --- a/Workspace/Siman/src/org/splat/simer/SearchStudyAction.java +++ b/Workspace/Siman/src/org/splat/simer/SearchStudyAction.java @@ -50,6 +50,12 @@ public class SearchStudyAction extends SearchBaseAction { * 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; /** * Serial version ID. @@ -78,7 +84,8 @@ public class SearchStudyAction extends SearchBaseAction { setContextTypeOptions(getInvolvedContexts()); setMenuProperty("open"); - initializationScreenContext(_menuProperty); + setToolProperty("none"); + initializationScreenContext(_menuProperty, _toolProperty); return SUCCESS; } catch (Exception error) { @@ -353,4 +360,20 @@ public class SearchStudyAction extends SearchBaseAction { public void setMenuProperty(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; + } } \ No newline at end of file diff --git a/Workspace/Siman/src/org/splat/simer/StartAction.java b/Workspace/Siman/src/org/splat/simer/StartAction.java index 044ee57..bfd28f8 100644 --- a/Workspace/Siman/src/org/splat/simer/StartAction.java +++ b/Workspace/Siman/src/org/splat/simer/StartAction.java @@ -41,6 +41,12 @@ public class StartAction extends Action implements ServletRequestAware { * 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; /** * Serial version ID. @@ -91,7 +97,8 @@ public class StartAction extends Action implements ServletRequestAware { setMenuProperty("study"); setTitleProperty("study"); setEditDisabledProperty("true"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + setToolProperty("none"); + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); return ERROR; } @@ -185,4 +192,20 @@ public class StartAction extends Action implements ServletRequestAware { public final void setEditDisabledProperty(String editDisabledProperty) { _editDisabledProperty = editDisabledProperty; } + + /** + * Get the toolProperty. + * @return the toolProperty + */ + public String getToolProperty() { + return _toolProperty; + } + + /** + * Set the toolProperty. + * @param toolProperty the toolProperty to set + */ + public void setToolProperty(final String toolProperty) { + _toolProperty = toolProperty; + } } \ No newline at end of file diff --git a/Workspace/Siman/src/org/splat/simer/StudyPropertiesAction.java b/Workspace/Siman/src/org/splat/simer/StudyPropertiesAction.java index 7b855ae..370355c 100644 --- a/Workspace/Siman/src/org/splat/simer/StudyPropertiesAction.java +++ b/Workspace/Siman/src/org/splat/simer/StudyPropertiesAction.java @@ -72,6 +72,12 @@ public class StudyPropertiesAction extends DisplayStudyStepAction { */ private String _titleProperty; + /** + * Value of the tool bar property. + * It can be: none, standard, study, back. + */ + private String _toolProperty; + /** * 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. @@ -134,7 +140,8 @@ public class StudyPropertiesAction extends DisplayStudyStepAction { setMenuProperty("study"); setTitleProperty("study"); setEditDisabledProperty("true"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + setToolProperty("back"); + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); if (mystudy.isOpenForWriting() && user.canEditProperties()) { return "edit"; @@ -175,7 +182,8 @@ public class StudyPropertiesAction extends DisplayStudyStepAction { setMenuProperty("study"); setTitleProperty("study"); setEditDisabledProperty("true"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + setToolProperty("back"); + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); return SUCCESS; } @@ -218,7 +226,8 @@ public class StudyPropertiesAction extends DisplayStudyStepAction { setMenuProperty("study"); setTitleProperty("study"); setEditDisabledProperty("true"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + setToolProperty("back"); + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); return SUCCESS; } @@ -267,7 +276,8 @@ public class StudyPropertiesAction extends DisplayStudyStepAction { setMenuProperty("study"); setTitleProperty("study"); setEditDisabledProperty("true"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + setToolProperty("back"); + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); return SUCCESS; } @@ -350,7 +360,8 @@ public class StudyPropertiesAction extends DisplayStudyStepAction { setMenuProperty("study"); setTitleProperty("study"); setEditDisabledProperty("true"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + setToolProperty("back"); + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); return SUCCESS; } @@ -570,5 +581,19 @@ public class StudyPropertiesAction extends DisplayStudyStepAction { _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; + } } \ No newline at end of file diff --git a/Workspace/Siman/src/org/splat/simer/TitleBarSettings.java b/Workspace/Siman/src/org/splat/simer/TitleBarSettings.java index a739b3e..4f61a9b 100644 --- a/Workspace/Siman/src/org/splat/simer/TitleBarSettings.java +++ b/Workspace/Siman/src/org/splat/simer/TitleBarSettings.java @@ -31,6 +31,11 @@ public class TitleBarSettings { */ private String entryType; + /** + * The type title of the open study/knowledge. + */ + private String entryTypeTitle; + /** * The title of the open study/knowledge. */ @@ -91,6 +96,21 @@ public class TitleBarSettings { this.entryType = entryType; } + /** + * Get the entryTypeTitle. + * @return the entryTypeTitle + */ + public String getEntryTypeTitle() { + return entryTypeTitle; + } + + /** + * Set the entryTypeTitle. + * @param entryTypeTitle the entryTypeTitle to set + */ + public void setEntryTypeTitle(final String entryTypeTitle) { + this.entryTypeTitle = entryTypeTitle; + } /** * Get the entryTitle. diff --git a/Workspace/Siman/src/org/splat/simer/ToolBarSettings.java b/Workspace/Siman/src/org/splat/simer/ToolBarSettings.java new file mode 100644 index 0000000..5708481 --- /dev/null +++ b/Workspace/Siman/src/org/splat/simer/ToolBarSettings.java @@ -0,0 +1,171 @@ +/***************************************************************************** + * Company EURIWARE + * Application SIMAN + * File $Id$ + * Creation date 28.10.2012 + * @author Author: Maria KRUCHININA + * @version Revision: + *****************************************************************************/ + +package org.splat.simer; + +/** + * @author Maria KRUCHININA + * + */ +public class ToolBarSettings { + + //=== MENUS========================================== + + /** + * Property, is this tool the "None" one. + */ + private Boolean isToolNone; + + /** + * Property, is this tool the "Standard" one. + */ + private Boolean isToolStandard; + + /** + * Property, is this tool the "Study" one. + */ + private Boolean isToolStudy; + + /** + * Property, is this tool the "Back" one. + */ + private Boolean isToolBack; + + //=== OTHER OPERATIONS ============================ + + /** + * Can the given User edit the given Study/Knowledge. + */ + private Boolean canUserEdit; + + /** + * It's for (popup.isEnabled("script") operation on the toolbar.jsp. + */ + private Boolean isEnabledScript; + + /** + * Initialize the tool bar properties. + * @param toolProperty - parameter of tool bar. + */ + public void intializeMenuBar (final String toolProperty) { + + setIsToolNone(false); + setIsToolStandard(false); + setIsToolStudy(false); + setIsToolBack(false); + + if ("none".equals(toolProperty)) { + setIsToolNone(true); + } else if ("standard".equals(toolProperty)) { + setIsToolStandard(true); + } else if ("study".equals(toolProperty)) { + setIsToolStudy(true); + } else if ("back".equals(toolProperty)) { + setIsToolBack(true); + } + } + + //====== GETTERS AND SETERS ============== + + /** + * Get the isToolNone. + * @return the isToolNone + */ + public Boolean getIsToolNone() { + return isToolNone; + } + + /** + * Set the isToolNone. + * @param isToolNone the isToolNone to set + */ + public void setIsToolNone(final Boolean isToolNone) { + this.isToolNone = isToolNone; + } + + /** + * Get the isToolStandard. + * @return the isToolStandard + */ + public Boolean getIsToolStandard() { + return isToolStandard; + } + + /** + * Set the isToolStandard. + * @param isToolStandard the isToolStandard to set + */ + public void setIsToolStandard(final Boolean isToolStandard) { + this.isToolStandard = isToolStandard; + } + + /** + * Get the isToolStudy. + * @return the isToolStudy + */ + public Boolean getIsToolStudy() { + return isToolStudy; + } + + /** + * Set the isToolStudy. + * @param isToolStudy the isToolStudy to set + */ + public void setIsToolStudy(final Boolean isToolStudy) { + this.isToolStudy = isToolStudy; + } + + /** + * Get the isToolBack. + * @return the isToolBack + */ + public Boolean getIsToolBack() { + return isToolBack; + } + + /** + * Set the isToolBack. + * @param isToolBack the isToolBack to set + */ + public void setIsToolBack(final Boolean isToolBack) { + this.isToolBack = isToolBack; + } + + /** + * Get the canUserEdit. + * @return the canUserEdit + */ + public Boolean getCanUserEdit() { + return canUserEdit; + } + + /** + * Set the canUserEdit. + * @param canUserEdit the canUserEdit to set + */ + public void setCanUserEdit(final Boolean canUserEdit) { + this.canUserEdit = canUserEdit; + } + + /** + * Get the isEnabledScript. + * @return the isEnabledScript + */ + public Boolean getIsEnabledScript() { + return isEnabledScript; + } + + /** + * Set the isEnabledScript. + * @param isEnabledScript the isEnabledScript to set + */ + public void setIsEnabledScript(final Boolean isEnabledScript) { + this.isEnabledScript = isEnabledScript; + } +} diff --git a/Workspace/Siman/src/org/splat/simer/UploadAction.java b/Workspace/Siman/src/org/splat/simer/UploadAction.java index 0eb6ebb..a33fcdc 100644 --- a/Workspace/Siman/src/org/splat/simer/UploadAction.java +++ b/Workspace/Siman/src/org/splat/simer/UploadAction.java @@ -33,6 +33,11 @@ public class UploadAction extends Action { */ private String _titleProperty; + /** + * Value of the tool bar property. + * It can be: none, standard, study, back. + */ + private String _toolProperty; /** * 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. @@ -51,7 +56,8 @@ public class UploadAction extends Action { public String doInitialize () { // ----------------------------- setMenuProperty("study"); - initializationScreenContext(_menuProperty); + setToolProperty("none"); + initializationScreenContext(_menuProperty, _toolProperty); return SUCCESS; } @@ -85,7 +91,8 @@ public class UploadAction extends Action { setMenuProperty("none"); setTitleProperty("study"); setEditDisabledProperty("true"); - initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + setToolProperty("none"); + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); return "outofmemory"; } @@ -204,5 +211,19 @@ public class UploadAction extends Action { 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; + } } \ No newline at end of file diff --git a/Workspace/Siman/src/org/splat/simer/UploadBaseNextAction.java b/Workspace/Siman/src/org/splat/simer/UploadBaseNextAction.java index c47b322..f3e1b96 100644 --- a/Workspace/Siman/src/org/splat/simer/UploadBaseNextAction.java +++ b/Workspace/Siman/src/org/splat/simer/UploadBaseNextAction.java @@ -74,6 +74,13 @@ public abstract class UploadBaseNextAction extends Action { // ---------------------------------- this.action = ToDo.save; } + + public String getWriteAccess() { + if (mystudy == null) { + return "false"; + } + return String.valueOf(mystudy.isOpenForWriting()); + } // ============================================================================================================================== // Protected services // ============================================================================================================================== diff --git a/Workspace/Siman/src/org/splat/simer/VersionDocumentAction.java b/Workspace/Siman/src/org/splat/simer/VersionDocumentAction.java index 98550dc..6b879e6 100644 --- a/Workspace/Siman/src/org/splat/simer/VersionDocumentAction.java +++ b/Workspace/Siman/src/org/splat/simer/VersionDocumentAction.java @@ -78,18 +78,27 @@ public class VersionDocumentAction extends UploadBaseNextAction { */ private RepositoryService _repositoryService; /** - * Value of the menu property. It can be: none, create, open, study, knowledge, sysadmin, help. + * 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. + * 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. + * Value of the tool bar property. + * It can be: none, standard, study, back. + */ + private String _toolProperty; + + /** + * 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"; @@ -107,9 +116,13 @@ public class VersionDocumentAction extends UploadBaseNextAction { setMenuProperty("study"); setTitleProperty("study"); setEditDisabledProperty("true"); - initializationScreenContext(_menuProperty, _titleProperty, - _editDisabledProperty); - + if ("true".equals(getWriteAccess())) { + setToolProperty("study"); + } else { + setToolProperty("none"); + } + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); + User user = getConnectedUser(); File updir = getRepositoryService().getDownloadDirectory(user); File upfile = new File(updir.getPath() + "/" + filename); @@ -125,6 +138,10 @@ public class VersionDocumentAction extends UploadBaseNextAction { usedby = new Vector(); if (!extractProperties(upfile, doc)) { + if (!("none".equals(_toolProperty))) { + setToolProperty("none"); + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); + } return ERROR; } setupDefaultUses(deftype); @@ -214,9 +231,8 @@ public class VersionDocumentAction extends UploadBaseNextAction { setMenuProperty("study"); setTitleProperty("study"); setEditDisabledProperty("true"); - initializationScreenContext(_menuProperty, _titleProperty, - _editDisabledProperty); - + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty); + if (action == ToDo.cancel) return "cancel"; @@ -254,6 +270,10 @@ public class VersionDocumentAction extends UploadBaseNextAction { logger.error("Reason:", error); setErrorCode("internal"); } + + setToolProperty("none"); + initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty); + return ERROR; } @@ -438,4 +458,20 @@ public class VersionDocumentAction extends UploadBaseNextAction { public void setEditDisabledProperty(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; + } } \ No newline at end of file diff --git a/Workspace/Siman/src/org/splat/simer/admin/DatabaseIndexingAction.java b/Workspace/Siman/src/org/splat/simer/admin/DatabaseIndexingAction.java index 8fb35f3..881ca58 100644 --- a/Workspace/Siman/src/org/splat/simer/admin/DatabaseIndexingAction.java +++ b/Workspace/Siman/src/org/splat/simer/admin/DatabaseIndexingAction.java @@ -37,6 +37,12 @@ public class DatabaseIndexingAction extends Action { * 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; // ============================================================================================================================== // Action methods @@ -51,7 +57,8 @@ public class DatabaseIndexingAction extends Action { indices = ""; setMenuProperty("sysadmin"); - initializationScreenContext(_menuProperty); + setToolProperty("none"); + initializationScreenContext(_menuProperty, _toolProperty); return SUCCESS; } @@ -134,4 +141,20 @@ public class DatabaseIndexingAction extends Action { public void setMenuProperty(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; + } } \ No newline at end of file diff --git a/Workspace/Siman/src/org/splat/simer/admin/ImportUserAction.java b/Workspace/Siman/src/org/splat/simer/admin/ImportUserAction.java index e9e04ac..232bcb5 100644 --- a/Workspace/Siman/src/org/splat/simer/admin/ImportUserAction.java +++ b/Workspace/Siman/src/org/splat/simer/admin/ImportUserAction.java @@ -38,6 +38,12 @@ public class ImportUserAction extends UploadBaseNextAction { * 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; // ============================================================================================================================== // Action methods @@ -59,7 +65,8 @@ public class ImportUserAction extends UploadBaseNextAction { } setMenuProperty("sysadmin"); - initializationScreenContext(_menuProperty); + setToolProperty("none"); + initializationScreenContext(_menuProperty, _toolProperty); return SUCCESS; } @@ -129,4 +136,20 @@ public class ImportUserAction extends UploadBaseNextAction { public void setMenuProperty(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; + } } \ No newline at end of file diff --git a/Workspace/Siman/src/org/splat/simer/admin/SimulationContextAction.java b/Workspace/Siman/src/org/splat/simer/admin/SimulationContextAction.java index 38dc4c7..4366eb2 100644 --- a/Workspace/Siman/src/org/splat/simer/admin/SimulationContextAction.java +++ b/Workspace/Siman/src/org/splat/simer/admin/SimulationContextAction.java @@ -63,6 +63,18 @@ public class SimulationContextAction extends Action { * Injected simulation context service. */ 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; /** * Context name comparator. @@ -130,6 +142,10 @@ public class SimulationContextAction extends Action { selection = 0; edition = null; owner = null; + + setMenuProperty("study"); + setToolProperty("none"); + initializationScreenContext(_menuProperty, _toolProperty); return SUCCESS; } catch (Exception error) { @@ -140,6 +156,11 @@ public class SimulationContextAction extends Action { public String doSelect() { // ------------------------- + + setMenuProperty("study"); + setToolProperty("none"); + initializationScreenContext(_menuProperty, _toolProperty); + Session connex = Database.getCurSession(); Transaction transax = connex.beginTransaction(); try { @@ -342,4 +363,37 @@ public class SimulationContextAction extends Action { public void setSearchService(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; + } } \ No newline at end of file diff --git a/Workspace/Siman/src/spring/applicationContext.xml b/Workspace/Siman/src/spring/applicationContext.xml index 3902f45..544f791 100644 --- a/Workspace/Siman/src/spring/applicationContext.xml +++ b/Workspace/Siman/src/spring/applicationContext.xml @@ -46,6 +46,10 @@ http://www.springframework.org/schema/context/spring-context-3.0.xsd"> + + + + @@ -265,7 +270,7 @@ http://www.springframework.org/schema/context/spring-context-3.0.xsd"> + scope="prototype" parent="baseAction"> -- 2.30.2