]> SALOME platform Git repositories - tools/siman.git/commitdiff
Salome HOME
Tool bar is improved.
authormka <mka@opencascade.com>
Tue, 30 Oct 2012 08:04:55 +0000 (08:04 +0000)
committermka <mka@opencascade.com>
Tue, 30 Oct 2012 08:04:55 +0000 (08:04 +0000)
47 files changed:
Workspace/Siman/WebContent/jsp/titlebar.jsp
Workspace/Siman/WebContent/jsp/toolbar.jsp
Workspace/Siman/WebContent/menu.jsp
Workspace/Siman/WebContent/sadmin/approveKnowelm.jsp
Workspace/Siman/WebContent/sadmin/approveSContext.jsp
Workspace/Siman/WebContent/sadmin/displayUser.jsp
Workspace/Siman/WebContent/sadmin/indexStudies.jsp
Workspace/Siman/WebContent/sadmin/upload.jsp
Workspace/Siman/WebContent/study/displayKnowledge.jsp
Workspace/Siman/WebContent/study/displayStudyProperties.jsp
Workspace/Siman/WebContent/study/displayStudyStep.jsp
Workspace/Siman/WebContent/study/editScenarioProperties.jsp
Workspace/Siman/WebContent/study/editStudyProperties.jsp
Workspace/Siman/WebContent/study/error.jsp
Workspace/Siman/WebContent/study/importDocument.jsp
Workspace/Siman/WebContent/study/importError.jsp
Workspace/Siman/WebContent/study/newScenario.jsp
Workspace/Siman/WebContent/study/newStudy.jsp
Workspace/Siman/WebContent/study/searchKnowledge.jsp
Workspace/Siman/WebContent/study/searchStudy.jsp
Workspace/Siman/WebContent/study/upload.jsp
Workspace/Siman/WebContent/study/versionDocument.jsp
Workspace/Siman/src/org/splat/simer/Action.java
Workspace/Siman/src/org/splat/simer/DisplayKnowledgeAction.java
Workspace/Siman/src/org/splat/simer/DisplayStudyStepAction.java
Workspace/Siman/src/org/splat/simer/EditDocumentAction.java
Workspace/Siman/src/org/splat/simer/EditKnowledgeElementAction.java
Workspace/Siman/src/org/splat/simer/EditScenarioPropertiesAction.java
Workspace/Siman/src/org/splat/simer/EditSimulationContextAction.java
Workspace/Siman/src/org/splat/simer/EditStudyAction.java
Workspace/Siman/src/org/splat/simer/ImportDocumentAction.java
Workspace/Siman/src/org/splat/simer/NewScenarioAction.java
Workspace/Siman/src/org/splat/simer/NewStudyAction.java
Workspace/Siman/src/org/splat/simer/NotYetImplementedAction.java
Workspace/Siman/src/org/splat/simer/SearchKnowledgeAction.java
Workspace/Siman/src/org/splat/simer/SearchStudyAction.java
Workspace/Siman/src/org/splat/simer/StartAction.java
Workspace/Siman/src/org/splat/simer/StudyPropertiesAction.java
Workspace/Siman/src/org/splat/simer/TitleBarSettings.java
Workspace/Siman/src/org/splat/simer/ToolBarSettings.java [new file with mode: 0644]
Workspace/Siman/src/org/splat/simer/UploadAction.java
Workspace/Siman/src/org/splat/simer/UploadBaseNextAction.java
Workspace/Siman/src/org/splat/simer/VersionDocumentAction.java
Workspace/Siman/src/org/splat/simer/admin/DatabaseIndexingAction.java
Workspace/Siman/src/org/splat/simer/admin/ImportUserAction.java
Workspace/Siman/src/org/splat/simer/admin/SimulationContextAction.java
Workspace/Siman/src/spring/applicationContext.xml

index 3de2ec6f245d0c7ba8c19a7b1ab64f962dd6f6b5..2312284b3edbb07d0ac160a6cc1b8281d57a0da7 100644 (file)
@@ -30,7 +30,7 @@
         </s:else>
       </td>
       <td>   
-        <b><s:property value="titleBarSettings.entryType"/>:&nbsp;</b><s:property value="titleBarSettings.entryTitle"/>&nbsp;&nbsp;
+        <b><s:property value="titleBarSettings.entryTypeTitle"/>:&nbsp;</b><s:property value="titleBarSettings.entryTitle"/>&nbsp;&nbsp;
       </td>
       <td align=right>
         <table border="0" cellpadding="0" cellspacing="0" class="text">
index f1b216452e14ebaa610f5748d41cb258e849532c..00c9795d2057fec4e4d540eb8ee9deec1cf312d5 100644 (file)
@@ -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 };%>
-<!-- Initialization of the context
-  -->
-<%
-       String  barname = request.getParameter("tools");
-    Tool    bar     = Tool.valueOf(barname);
-%>
+
 <s:url id="properties" namespace="/" action="select">
   <s:param name="menu">configuration</s:param>
 </s:url>
 
 <table width=100% border=0 cellspacing=0 cellpadding=0>
   <tr height=30 valign=middle>
-<%
-       if (bar == Tool.study) {
-      OpenStudy    study = (OpenStudy)session.getAttribute("study.open");
-      PopupMenu    popup = study.getPopup();
-      StudyRights  user  = study.getStudyRights();
-%>
+  
+       <s:if test="toolBarSettings.isToolStudy">
     <td width=30 align=left>
-<%    if (user.canEditProperties()) {
-%>    <s:a href="%{#properties}"><img src="<s:url value="/skin/tool.property.png"/>" border="none" title="<s:text name="tooltip.property"/>" /></s:a>
-<%    } else {
-%>    <s:a href="%{#properties}"><img src="<s:url value="/skin/tool.property.png"/>" border="none" title="<s:text name="tooltip.details"/>" /></s:a>
-<%    }
-%>  </td>  
+               <s:if test="toolBarSettings.canUserEdit">
+               <s:a href="%{#properties}"><img src="<s:url value="/skin/tool.property.png"/>" border="none" title="<s:text name="tooltip.property"/>" /></s:a>
+       </s:if>
+               <s:else>
+                   <s:a href="%{#properties}"><img src="<s:url value="/skin/tool.property.png"/>" border="none" title="<s:text name="tooltip.details"/>" /></s:a>
+               </s:else>
+    </td>  
     <td width=30 align=left>
-<%    if (popup.isEnabled("script")) {
-%>      <s:a href="%{#scenario}"><img src="<s:url value="/skin/tool.scenario.png"/>" border="none" title="<s:text name="tooltip.scenario"/>"/></s:a>
-<%    } else {
-%>    <img src="<s:url value="/skin/disabled.scenario.png"/>" border="none" title="" />
-<%    }
-%>  </td>
+               <s:if test="toolBarSettings.isEnabledScript">
+               <s:a href="%{#scenario}"><img src="<s:url value="/skin/tool.scenario.png"/>" border="none" title="<s:text name="tooltip.scenario"/>"/></s:a>
+       </s:if> 
+               <s:else>
+                   <img src="<s:url value="/skin/disabled.scenario.png"/>" border="none" title="" />
+               </s:else>
+
+    </td>
     <td align=right>
       <img src="<s:url value="/skin/image.vseparator.png"/>" border="none" />
-<%    ToolBar  mbar = study.getModuleBar();
+<%    OpenStudy    study = (OpenStudy)session.getAttribute("study.open");
+         ToolBar  mbar = study.getModuleBar();
       if (study.getSelectedStepRights().canCreateDocument() && mbar != null) {
 %>
       <applet name="perform" id="perform" code="org.splat.launcher.ToolbarApplet.class" archive="../jap/splat-signedlauncher.jar" width=<%=mbar.getWidth()%> height=<%=mbar.getHeight()%>>
     <td width=30 align=right>
       <s:a href="%{#idea}"><img src="<s:url value="/skin/icon.idea.png"/>" border="none" title="<s:text name="tooltip.search"/>" /></s:a>
     </td>
-<%  }
-    else if (bar == Tool.standard) {
-%>
-    <td width=30 align=left>
-      <s:a href="%{#properties}"><img src="<s:url value="/skin/tool.property.png"/>" border="none" title="<s:text name="tooltip.details"/>" /></s:a>
-    </td>
-<%  }
-    else if (bar == Tool.back) {
-%>
-    <td width=30 align=left>
-      <s:a href="%{#back}"><img src="<s:url value="/skin/icon.back.png"/>" border="none" title="<s:text name="tooltip.back"/>" /></s:a>
-    </td>
-<%  }
-%></tr>
+       </s:if>
+       
+       <s:elseif test="toolBarSettings.isToolStandard">
+           <td width=30 align=left>
+             <s:a href="%{#properties}"><img src="<s:url value="/skin/tool.property.png"/>" border="none" title="<s:text name="tooltip.details"/>" /></s:a>
+           </td>
+       </s:elseif>
+       
+       <s:elseif test="toolBarSettings.isToolBack">
+           <td width=30 align=left>
+             <s:a href="%{#back}"><img src="<s:url value="/skin/icon.back.png"/>" border="none" title="<s:text name="tooltip.back"/>" /></s:a>
+           </td>
+       </s:elseif>
+</tr>
 </table>
\ No newline at end of file
index cecaa5b2961be54fd7cf5a2852f361c73de04df2..173a937f05b26fe9e5fbb32a5fc6251702b321d2 100644 (file)
@@ -29,9 +29,7 @@
      =============================================================================================================================
   -->
     <div id=left-pane>
-      <jsp:include page="/jsp/toolbar.jsp">
-        <jsp:param name="tools" value="none" />
-      </jsp:include>
+      <jsp:include page="/jsp/toolbar.jsp" />
       <div id=top-spacer></div>
       <jsp:include page="/jsp/menuitem.jsp">
         <jsp:param name="menu" value="open" />
index a5ff9bfcf91681d5a8f7adffc883ed3499420549..1d44ac01ed8e29613fda023664f58b8b2a7447de 100644 (file)
@@ -23,9 +23,7 @@
      =============================================================================================================================
   -->
     <div id=left-pane>
-      <jsp:include page="/jsp/toolbar.jsp">
-        <jsp:param name="tools" value="none" />
-      </jsp:include>
+      <jsp:include page="/jsp/toolbar.jsp" />
       <div id=top-spacer></div>
       <jsp:include page="/jsp/menuitem.jsp">
         <jsp:param name="menu" value="open" />
index 0094b7f8eb6afce82d01afff2048d6773b681191..4936bfbb33b3acc5cde195c54cd9ae8db335ab3c 100644 (file)
@@ -26,9 +26,7 @@
      =============================================================================================================================
   -->
     <div id=left-pane>
-      <jsp:include page="/jsp/toolbar.jsp">
-        <jsp:param name="tools" value="none" />
-      </jsp:include>
+      <jsp:include page="/jsp/toolbar.jsp" />
       <div id=top-spacer></div>
       <jsp:include page="/jsp/menuitem.jsp">
         <jsp:param name="menu" value="open" />
index 6b9b4a6896a26d4fd031abf88b21031805df7a3e..3b519c6fe4e02497c963c4fbdd4ce361edfd49b4 100644 (file)
@@ -23,9 +23,7 @@
      =============================================================================================================================
   -->
     <div id=left-pane>
-      <jsp:include page="/jsp/toolbar.jsp">
-        <jsp:param name="tools" value="none" />
-      </jsp:include>
+      <jsp:include page="/jsp/toolbar.jsp" />
       <div id=top-spacer></div>
       <jsp:include page="/jsp/menuitem.jsp">
         <jsp:param name="menu" value="open" />
index cc20770dfc510111c829044819afdc6f827eeaab..125e2548ca6578f8dfd67dc2c8aa0f6d0f29ee04 100644 (file)
@@ -24,9 +24,7 @@
      =============================================================================================================================
   -->
     <div id=left-pane>
-      <jsp:include page="/jsp/toolbar.jsp">
-        <jsp:param name="tools" value="none" />
-      </jsp:include>
+      <jsp:include page="/jsp/toolbar.jsp" />
       <div id=top-spacer></div>
       <jsp:include page="/jsp/menuitem.jsp">
         <jsp:param name="menu" value="open" />
index 59ac3492a3065b7a24e35dc7e0acc19611f50a48..09c4cc7e0c720214f7d157db25d73fda32de336a 100644 (file)
@@ -30,9 +30,7 @@
      =============================================================================================================================
   -->
     <div id=left-pane>
-      <jsp:include page="/jsp/toolbar.jsp">
-        <jsp:param name="tools" value="none" />
-      </jsp:include>
+      <jsp:include page="/jsp/toolbar.jsp" />
       <div id=top-spacer></div>
       <jsp:include page="/jsp/menuitem.jsp">
         <jsp:param name="menu" value="open" />
index 3f3b7b848297b6911a75bbb2a1584e2b8f8c6866..c0db77d95ca3ed19fe162f454b053d675ee1174d 100644 (file)
@@ -27,9 +27,7 @@
      =============================================================================================================================
   -->
     <div id=left-pane>
-      <jsp:include page="/jsp/toolbar.jsp">
-        <jsp:param name="tools" value="none" />
-      </jsp:include>
+      <jsp:include page="/jsp/toolbar.jsp" />
       <div id=top-spacer></div>
       <jsp:include page="/jsp/menuitem.jsp">
         <jsp:param name="menu" value="knowledge" />
index 08d47495b3c9bf09e0cee88095bfb80a55d0abef..c0b955f78db63f8fbeb06afc2e102d56702b9aab 100644 (file)
@@ -28,9 +28,7 @@
      =============================================================================================================================
   -->
     <div id=left-pane>
-      <jsp:include page="/jsp/toolbar.jsp">
-        <jsp:param name="tools" value="back" />
-      </jsp:include>
+      <jsp:include page="/jsp/toolbar.jsp" />
       <div id=top-spacer></div>
       <jsp:include page="/jsp/menuitem.jsp">
         <jsp:param name="menu" value="open" />
index 7ac24f221705bb48c9129c9e313e6b26d629041c..26c49bc60d0cecb65c9fc8b533bf8c3bbb0877da 100644 (file)
      =============================================================================================================================
   -->
     <div id=left-pane>
-      <s:if test="%{writeAccess && userRights.canCreateDocument()}">
-        <jsp:include page="/jsp/toolbar.jsp">
-          <jsp:param name="tools" value="study" />
-        </jsp:include>
-      </s:if>
-      <s:else>
-        <jsp:include page="/jsp/toolbar.jsp">
-          <jsp:param name="tools" value="standard" />
-        </jsp:include>
-      </s:else>
+      <jsp:include page="/jsp/toolbar.jsp" />          
       <div id=top-spacer></div>
       <jsp:include page="/jsp/menuitem.jsp">
         <jsp:param name="menu" value="study" />
index 2eb4d12f6b4d442a8f91806457353374bb852de5..95de82b733d4a09688070ce15efc51f0ccb6a042 100644 (file)
@@ -38,9 +38,7 @@
      =============================================================================================================================
   -->
     <div id=left-pane>
-      <jsp:include page="/jsp/toolbar.jsp">
-        <jsp:param name="tools" value="back" />
-      </jsp:include>
+      <jsp:include page="/jsp/toolbar.jsp" />
       <div id=top-spacer></div>
       <jsp:include page="/jsp/menuitem.jsp">
         <jsp:param name="menu" value="open" />
index a516e77a2a1517bb4b77a8e7ef25caa31432bef7..a60cd416cb40a98823e6b3526112209f44c5839b 100644 (file)
@@ -53,9 +53,7 @@
      =============================================================================================================================
   -->
     <div id=left-pane>
-      <jsp:include page="/jsp/toolbar.jsp">
-        <jsp:param name="tools" value="back" />
-      </jsp:include>
+      <jsp:include page="/jsp/toolbar.jsp" />
       <div id=top-spacer></div>
       <jsp:include page="/jsp/menuitem.jsp">
         <jsp:param name="menu" value="open" />
index 466d157de7b79a4f685087b9c0445e8b95e1a3c2..1388428fdcd0cb4afb276ed9c36eab6a929292e3 100644 (file)
@@ -36,9 +36,7 @@
      =============================================================================================================================
   -->
     <div id=left-pane>
-      <jsp:include page="/jsp/toolbar.jsp">
-        <jsp:param name="tools" value="none" />
-      </jsp:include>
+      <jsp:include page="/jsp/toolbar.jsp" />
       <div id=top-spacer></div>
       <jsp:include page="/jsp/menuitem.jsp">
         <jsp:param name="menu" value="study" />
index 3f793a1ca60def2f3e2bbd9275cc5835694df72c..c16250435a90c1e7abe0b8359d4896691aa1d74b 100644 (file)
      =============================================================================================================================
   -->
     <div id=left-pane>
-      <s:if test="writeAccess">
-        <jsp:include page="/jsp/toolbar.jsp">
-          <jsp:param name="tools" value="study" />
-        </jsp:include>
-      </s:if>
-      <s:else>
-        <jsp:include page="/jsp/toolbar.jsp">
-          <jsp:param name="tools" value="none" />
-        </jsp:include>
-      </s:else>
+      <jsp:include page="/jsp/toolbar.jsp" />
       <div id=top-spacer></div>
       <jsp:include page="/jsp/menuitem.jsp">
         <jsp:param name="menu" value="study" />
index a29f5eed34bd4eed0cce1dc014d2b8af2e5f5c1a..37f943f7a83d015dc03aacb3f5852c43d6715303 100644 (file)
@@ -36,9 +36,7 @@
      =============================================================================================================================
   -->
     <div id=left-pane>
-      <jsp:include page="/jsp/toolbar.jsp">
-        <jsp:param name="tools" value="none" />
-      </jsp:include>
+      <jsp:include page="/jsp/toolbar.jsp" />
       <div id=top-spacer></div>
       <jsp:include page="/jsp/menuitem.jsp">
         <jsp:param name="menu" value="study" />
index a792bd58ed9472f6ba43a13c032de352ec846573..a401e4e757e4b9548f7857071e042d50d5b97771 100644 (file)
@@ -37,9 +37,7 @@
      =============================================================================================================================
   -->
     <div id=left-pane>
-      <jsp:include page="/jsp/toolbar.jsp">
-        <jsp:param name="tools" value="none" />
-      </jsp:include>
+      <jsp:include page="/jsp/toolbar.jsp" />
       <div id=top-spacer></div>
       <jsp:include page="/jsp/menuitem.jsp">
         <jsp:param name="menu" value="scenario" />
index d8f196f1ce48be30e981af187d0987dffa55c9a8..d227e8e7f373b4e9da07636d486e3066a15829da 100644 (file)
@@ -42,9 +42,7 @@
      =============================================================================================================================
   -->
     <div id=left-pane>
-      <jsp:include page="/jsp/toolbar.jsp">
-        <jsp:param name="tools" value="none" />
-      </jsp:include>
+      <jsp:include page="/jsp/toolbar.jsp" />
       <div id=top-spacer></div>
       <jsp:include page="/jsp/menuitem.jsp">
         <jsp:param name="menu" value="open" />
index bfbb3cf16dd03cd1807c071699e0c683a85d2bde..0bf40279f0dfd97513e7e84060c0c2cb66f1b49c 100644 (file)
@@ -50,9 +50,7 @@
      =============================================================================================================================
   -->
     <div id=left-pane>
-      <jsp:include page="/jsp/toolbar.jsp">
-        <jsp:param name="tools" value="none" />
-      </jsp:include>
+      <jsp:include page="/jsp/toolbar.jsp" />
       <div id=top-spacer></div>
       <jsp:include page="/jsp/menuitem.jsp">
         <jsp:param name="menu" value="open" />
index 2ec930fca3c24b08fd457b7a9d7b3092ac8dbe70..7f9834d10629bc68c18a94acee506c2e8736184a 100644 (file)
@@ -50,9 +50,7 @@
      =============================================================================================================================
   -->
     <div id=left-pane>
-      <jsp:include page="/jsp/toolbar.jsp">
-        <jsp:param name="tools" value="none" />
-      </jsp:include>
+      <jsp:include page="/jsp/toolbar.jsp" />
       <div id=top-spacer></div>
       <jsp:include page="/jsp/menuitem.jsp">
         <jsp:param name="menu" value="open" />
index 4180ff9ea639ab3f4ea2f1138e2b50f30e274182..fc18d1217ba69604195a6b4b17dc257342af9a01 100644 (file)
@@ -34,9 +34,7 @@
      =============================================================================================================================
   -->
     <div id=left-pane>
-      <jsp:include page="/jsp/toolbar.jsp">
-        <jsp:param name="tools" value="none" />
-      </jsp:include>
+      <jsp:include page="/jsp/toolbar.jsp" />
       <div id=top-spacer></div>
       <jsp:include page="/jsp/menuitem.jsp">
         <jsp:param name="menu" value="study" />
index 8a44fe78e90695938bf2db3c6e2e4e9b9826886c..070bee3f3715b8213dea7c517cc99c9be0955e5d 100644 (file)
      =============================================================================================================================
   -->
     <div id=left-pane>
-      <s:if test="writeAccess">
-        <jsp:include page="/jsp/toolbar.jsp">
-          <jsp:param name="tools" value="study" />
-        </jsp:include>
-      </s:if>
-      <s:else>
-        <jsp:include page="/jsp/toolbar.jsp">
-          <jsp:param name="tools" value="none" />
-        </jsp:include>
-      </s:else>
+      <jsp:include page="/jsp/toolbar.jsp" />
       <div id=top-spacer></div>
       <jsp:include page="/jsp/menuitem.jsp">
         <jsp:param name="menu" value="study" />
index 74517cd57e92daf89ed2701c9d8610e74b355b66..dae6a9d5f84d54ad94082c5f53b3d75ce185144e 100644 (file)
@@ -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
index d15d903c2349a647b5670fd9753783bc8e0107b8..61c252279661e987cbb59198c941ae0a9fc2bfde 100644 (file)
@@ -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
index c90f0497684a23d12ac7b7c5118bb6ad4d88740f..ff3b5de00120379c92b16776fb50378a7c36e39a 100644 (file)
@@ -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
index ba8a295fac3ebcb8df46a5831fa464320f55d152..80f7b0fad44a14229e86aa6bb10c4930f5f0bcd0 100644 (file)
@@ -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
index 177f5b41defe59accd85f28e8ca37a19a532e819..5e839d72c37943efa28907deeeedb7dec2dbd9c9 100644 (file)
@@ -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
index dc3036ba3394c136834726db18c49fb14405d26e..884426e3882c7f1572f2dd301a0de923673ea5c3 100644 (file)
@@ -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
index fdc5d6ed3e4b433a8bfba873484f2a3e0f44f0d9..fa96d379e1b8ef4a5f7b0fb4333c8aa20767123f 100644 (file)
@@ -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
index 6a4f468dbf22752f1bdfc17945bfba4708bd83fb..7c77a53a78883d36b5c402e1104585548c49850d 100644 (file)
@@ -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
index 995ea703d995b983e5dbace5300888b99ca276c5..d6af46bcf4a4608bd413a62f5ad6a2ec153559f3 100644 (file)
@@ -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
index dfe72decbc13d76098c5e8b1e257c1b79e65d08e..45fdac90827a37b7fdf6bd0d7619244511d975f4 100644 (file)
@@ -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
index aee3a7546407796e960872163eae860602d5b9d1..55536d67b23277ce6d274ffe47e86351f04ca3af 100644 (file)
@@ -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
index d174af43ec6b5e4fe3ed88237e624c6e7ce567c3..97be0e680e287391cfad67617c8db0ee92309091 100644 (file)
@@ -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
index 009f8c03f00b429121e5c1d4aef01d6ac11b70e3..ac8b541a790824f7e85c6da7eaa379fbb2be0c99 100644 (file)
@@ -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
index 68fcef2a8a7432802ebac92e166912c532936e38..02df3a3559d4b9a873eedcd52a3ce9006ae3db6f 100644 (file)
@@ -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
index 044ee57f329698e68de87f001a83f718db958c95..bfd28f85c887567dd9ef362c7856abc5391c73e9 100644 (file)
@@ -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
index 7b855ae0a74f27f39042b79bc89f07999b172e02..370355cbe6488b31b7df9bb73e5519bd0eb37e29 100644 (file)
@@ -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
index a739b3ec71bb7912205e1886f6cbb9b4db6f89b7..4f61a9b9973c8ad4fa93f1364f608f9622aaafe0 100644 (file)
@@ -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 (file)
index 0000000..5708481
--- /dev/null
@@ -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;
+       }
+}
index 0eb6ebbd18f01902d102ba3d055c7e58bcf2d17f..a33fcdcf7531457bedbbbcff5c21289e64997352 100644 (file)
@@ -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
index c47b322e205c21155419d33eb9ff770a40feddf2..f3e1b96af3c0be37a9ee528729b435dbe6047dcb 100644 (file)
@@ -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
 //  ==============================================================================================================================
index 98550dc2488e751476a50474ea7e1a51f46cd3b5..6b879e6c2407d66a661839cb076758af1ba6bb95 100644 (file)
@@ -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<Publication>();
 
                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
index 8fb35f3c4d245e8c4fa000705880cd4a810c468f..881ca58b5bc278bb67227b342a593601738369e3 100644 (file)
@@ -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
index e9e04ac108b63e57081f26608c6bdf859edb5828..232bcb5f17ac7b6fe0012e45316b8114323caffb 100644 (file)
@@ -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
index 38dc4c72cc1b3f74b5f317ffab63b08f2f438e03..4366eb204f056b706828120484cc6fb6bfa7a602 100644 (file)
@@ -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
index 3902f455a9b900bf4a29adbf51d44b103bc995f9..544f7914297e236cbea90187a2a1e21513e5cf36 100644 (file)
@@ -46,6 +46,10 @@ http://www.springframework.org/schema/context/spring-context-3.0.xsd">
        <bean id="titleBarSettings" class="org.splat.simer.TitleBarSettings"
                scope="session">
        </bean>
+       
+       <bean id="toolBarSettings"
+               class="org.splat.simer.ToolBarSettings" scope="session">
+       </bean>
 
        <bean id="slidMenu" scope="session" abstract="true">
                <property name="projectElementService"
@@ -93,6 +97,7 @@ http://www.springframework.org/schema/context/spring-context-3.0.xsd">
                <property name="openKnowledge" ref="openKnowledge" />
                <property name="menuBarSettings" ref="menuBarSettings" />
                <property name="titleBarSettings" ref="titleBarSettings" />
+               <property name="toolBarSettings" ref="toolBarSettings" />
        </bean>
 
        <!--========= Inherited from baseAction ========= -->
@@ -265,7 +270,7 @@ http://www.springframework.org/schema/context/spring-context-3.0.xsd">
 
        <bean id="simulationContextAction"
                class="org.splat.simer.admin.SimulationContextAction"
-               scope="prototype">
+               scope="prototype" parent="baseAction">
                <property name="knowledgeElementService"
                        ref="knowledgeElementService" />
                <property name="searchService" ref="searchService" />