]> SALOME platform Git repositories - tools/siman.git/commitdiff
Salome HOME
Menus are improved
authormka <mka@opencascade.com>
Thu, 25 Oct 2012 07:33:44 +0000 (07:33 +0000)
committermka <mka@opencascade.com>
Thu, 25 Oct 2012 07:33:44 +0000 (07:33 +0000)
50 files changed:
Workspace/Siman/WebContent/WEB-INF/tiles/tiles-defs.xml
Workspace/Siman/WebContent/home.jsp
Workspace/Siman/WebContent/jsp/menubar.jsp
Workspace/Siman/WebContent/layout/layoutLogin.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/WebContent/welcome.jsp
Workspace/Siman/src/org/splat/simer/Action.java
Workspace/Siman/src/org/splat/simer/ConnectionAction.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/MenuBarSettings.java [new file with mode: 0644]
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/OpenStudy.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/UploadAction.java
Workspace/Siman/src/org/splat/simer/UploadStudyAction.java [new file with mode: 0644]
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/spring/applicationContext.xml

index d17a6ae4d27f7155a367f2da9693eef163924de3..7a322b3b66d64d4679d152eae34e916fd4bec840 100644 (file)
@@ -6,7 +6,7 @@
 
 <tiles-definitions>
  
-<definition name="baseLayout" template="/WEB-INF/layout/baseLayout.jsp">
+<definition name="baseLayout" template="/layout/baseLayout.jsp">
        <put-attribute name="title" value="" type="string"/>
        <put-attribute name="menu_bar"  value="/jsp/menubar.jsp"/>
        <put-attribute name="title_bar" value="/jsp/titlebar.jsp"/>
index a845242d127ecb77c6df7d36675412c8b8bdea37..456ca4dd2a7ad40c296eb9e20aa366f3edf5f740 100644 (file)
   <body>
 <!-- Menu-bar
   -->
-    <jsp:include page="/jsp/menubar.jsp">
-        <jsp:param name="menu" value="none" />
-    </jsp:include>
 
+       <jsp:include page="/jsp/menubar.jsp" />
+    
     <s:if test="%{#error}">
       <s:set var="reason"><%=reason%></s:set>
       <table border="0" cellpadding="10" cellspacing="0" class="error">
index c9f862eb8e7ef01792c360a8fdda058f3611d388..62d9adbba32d652db194734c635d0c7da16b729f 100644 (file)
@@ -9,28 +9,22 @@
 <%@
     taglib prefix="s" uri="/struts-tags"
 %>
-<%! private enum Menu { none, create, open, study, knowledge, datadmin, sysadmin, help };
-%>
+
 <!-- Initialization of the context
   -->
 <%  String   login     = request.getParameter("login");     // Null or disabled
-    String   selection = request.getParameter("menu");      // Active menu
-    
-    Menu     selected  = Menu.valueOf(selection);
-    
-    ApplicationRights user  = (ApplicationRights)session.getAttribute("user.rights");  // Active user rights
-    Object            study = (Object)session.getAttribute("study.open");              // Active study, if exists
-    Object            known = (Object)session.getAttribute("knowledge.open");          // Active knowledge, if exists
+
+       ApplicationRights user  = (ApplicationRights)session.getAttribute("user.rights");  // Active user rights
+
 %>
 <!-- Set of actions associated to menus
   -->
-<s:set var="wurl"><%=ApplicationSettings.getWebSiteURL()%></s:set>
-<s:set var="hurl"><%=ApplicationSettings.getHelpURL()%></s:set>
+
 <s:url id="login"    namespace="/" action="login">
-  <s:param name="backMenu"><%=selection%></s:param>
+  <s:param name="backMenu" value="menuProperty"></s:param>
 </s:url>
 <s:url id="logout"   namespace="/" action="logout">
-  <s:param name="backMenu"><%=selection%></s:param>
+  <s:param name="backMenu" value="menuProperty"></s:param>
 </s:url>
 <s:url id="new"      namespace="/"  action="select">
   <s:param name="menu">create</s:param>
@@ -46,8 +40,8 @@
 <s:url id="sysadmin" namespace="/" action="select">
   <s:param name="menu">sysadmin</s:param>
 </s:url>
-<s:url id="site"     value="%{#wurl}"></s:url>
-<s:url id="help"     value="%{#hurl}"></s:url>
+<s:url id="site"     value="%{menuBarSettings.webSiteURL}" />
+<s:url id="help"     value="%{menuBarSettings.helpURL}"></s:url>
 
 <!-- Display of the menu-bar
   -->
   </div>
 
   <div id=menu-bar>
-<%
-    if (selected == Menu.create) {
-%>    <span id="menu-front"><img src="<s:url value="/skin/icon.new.png"/>" border="none" title="<s:text name="tooltip.new"/>" /></span>
-<%  } else if (user.canCreateStudy()) {
-%>    <span id="menu-back"><s:a href="%{new}"><img src="<s:url value="/skin/icon.new.png"/>" border="none" title="<s:text name="tooltip.new"/>" /></s:a></span>
-<%  } else {
-%>    <span id="menu-back"><img src="<s:url value="/skin/disabled.new.png"/>" border="none" /></span>
-<%  }
 
-    if (selected == Menu.open) {
-%>    <span id="menu-front"><img src="<s:url value="/skin/icon.open.png"/>" border="none" title="<s:text name="tooltip.open"/>" /></span>
-<%  } else {     // Accessible to everyone
-%>    <span id="menu-back"><s:a href="%{open}"><img src="<s:url value="/skin/icon.open.png"/>" border="none" title="<s:text name="tooltip.open"/>" /></s:a></span>
-<%  }
-    
-    if (selected == Menu.study) {
-%>    <span id="menu-front"><img src="<s:url value="/skin/icon.study.png"/>" border="none" /></span>
-<%  } else if (study == null) {
-%>    <span id="menu-back"><img src="<s:url value="/skin/disabled.study.png"/>" border="none" /></span>
-<%  } else {
-%>    <span id="menu-back"><s:a href="%{study}"><img src="<s:url value="/skin/icon.study.png"/>" border="none" title="<s:text name="tooltip.study"/>" /></s:a></span>
-<%  }
-    
-    if (selected == Menu.knowledge) {
-%>    <span id="menu-front"><img src="<s:url value="/skin/icon.idea.png"/>" border="none" /></span>
-<%  } else if (known == null) {
-%>    <span id="menu-back"><img src="<s:url value="/skin/disabled.idea.png"/>" border="none" /></span>
-<%  } else {
-%>    <span id="menu-back"><s:a href="%{idea}"><img src="<s:url value="/skin/icon.idea.png"/>" border="none" title="<s:text name="tooltip.idea"/>" /></s:a></span>
-<%  }
-    
-    if (selected == Menu.datadmin) {
-%>    <span id="menu-front"><img src="<s:url value="/skin/icon.books.png"/>" border="none" /></span>
-<%  } else if (user.canManageKnowledges()) {
-%>    <span id="menu-back"><s:a href="%{datadmin}"><img src="<s:url value="/skin/icon.books.png"/>" border="none" title="<s:text name="tooltip.datadmin"/>" /></s:a></span>
-<%  }
-    
-    if (selected == Menu.sysadmin) {
-%>    <span id="menu-front"><img src="<s:url value="/skin/icon.base.png"/>" border="none" /></span>
-<%  } else if (user.canManageDatabase()) {
-%>    <span id="menu-back"><s:a href="%{sysadmin}"><img src="<s:url value="/skin/icon.base.png"/>" border="none" title="<s:text name="tooltip.sysadmin"/>" /></s:a></span>
-<%  }
-    
-    if (selected == Menu.help) {
-%>    <span id="menu-front"><img src="<s:url value="/skin/icon.help.png"/>" border="none" /></span>
-<%  } else {     // Accessible to everyone
-%>    <span id="menu-back"><s:a href="%{help}" target="_new"><img src="<s:url value="/skin/icon.help.png"/>" border="none" title="<s:text name="tooltip.help"/>" /></s:a></span>
-<%  }
-%></div>
+       <s:if test="menuBarSettings.isMenuCreate">
+       <span id="menu-front"><img src="<s:url value="/skin/icon.new.png"/>" border="none" title="<s:text name="tooltip.new"/>" /></span>
+    </s:if>    
+       <s:elseif test="menuBarSettings.canUserCreateStudy">
+       <span id="menu-back"><s:a href="%{new}"><img src="<s:url value="/skin/icon.new.png"/>" border="none" title="<s:text name="tooltip.new"/>" /></s:a></span>
+    </s:elseif>
+       <s:else>
+           <span id="menu-back"><img src="<s:url value="/skin/disabled.new.png"/>" border="none" /></span>
+       </s:else>
+
+       <s:if test="menuBarSettings.isMenuOpen">
+       <span id="menu-front"><img src="<s:url value="/skin/icon.open.png"/>" border="none" title="<s:text name="tooltip.open"/>" /></span>
+    </s:if>
+       <s:else>
+          <span id="menu-back"><s:a href="%{open}"><img src="<s:url value="/skin/icon.open.png"/>" border="none" title="<s:text name="tooltip.open"/>" /></s:a></span>
+       </s:else>
+
+       <s:if test="menuBarSettings.isMenuStudy">
+       <span id="menu-front"><img src="<s:url value="/skin/icon.study.png"/>" border="none" /></span>
+       </s:if> 
+    <s:elseif test="menuBarSettings.isStudyNull">
+       <span id="menu-back"><img src="<s:url value="/skin/disabled.study.png"/>" border="none" /></span>
+    </s:elseif>
+    <s:else>
+          <span id="menu-back"><s:a href="%{study}"><img src="<s:url value="/skin/icon.study.png"/>" border="none" title="<s:text name="tooltip.study"/>" /></s:a></span>
+       </s:else>
+
+       <s:if test="menuBarSettings.isMenuKnowledge">
+           <span id="menu-front"><img src="<s:url value="/skin/icon.idea.png"/>" border="none" /></span>
+       </s:if>
+       <s:elseif test="menuBarSettings.isKnowledgeNull">
+       <span id="menu-back"><img src="<s:url value="/skin/disabled.idea.png"/>" border="none" /></span>
+       </s:elseif>
+       <s:else>
+           <span id="menu-back"><s:a href="%{idea}"><img src="<s:url value="/skin/icon.idea.png"/>" border="none" title="<s:text name="tooltip.idea"/>" /></s:a></span>
+       </s:else>
+       
+       <s:if test="menuBarSettings.isMenuSysAdmin">
+       <span id="menu-front"><img src="<s:url value="/skin/icon.base.png"/>" border="none" /></span>
+    </s:if>
+    <s:elseif test="menuBarSettings.canUserManageDatabase">
+           <span id="menu-back"><s:a href="%{sysadmin}"><img src="<s:url value="/skin/icon.base.png"/>" border="none" title="<s:text name="tooltip.sysadmin"/>" /></s:a></span>
+       </s:elseif>
+
+       <s:if test="menuBarSettings.isMenuHelp">
+           <span id="menu-front"><img src="<s:url value="/skin/icon.help.png"/>" border="none" /></span>
+       </s:if>
+       <s:else>
+       <span id="menu-back"><s:a href="%{help}" target="_new"><img src="<s:url value="/skin/icon.help.png"/>" border="none" title="<s:text name="tooltip.help"/>" /></s:a></span>
+    </s:else>
+
+</div>
 <!-- Display of the login menu
   -->
 <%if (login == null) {   // That is, not disabled (yes, null means enabled!)
index beb86c3111b57073fcd37350a81c3562a1b68aa3..8bd81193f3739660078bd81ee8cb3aff3eceee92 100644 (file)
@@ -1,6 +1,7 @@
 <%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
 <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
 <%@ taglib prefix="s" uri="/struts-tags"%>
+<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%>
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 
 <html>
@@ -17,9 +18,7 @@
 
        <!-- Menu-bar -->
        
-       <jsp:include page="/jsp/menubar.jsp">
-        <jsp:param name="menu" value="none" />
-    </jsp:include>
+       <jsp:include page="/jsp/menubar.jsp" />
 
        <div id=top-spacer>
        </div>
index 4b90ed5900c558bfaafc35faf29aed68a36a78b8..cecaa5b2961be54fd7cf5a2852f361c73de04df2 100644 (file)
@@ -22,9 +22,7 @@
 <!-- Menu-bar
      =============================================================================================================================
   -->
-    <jsp:include page="/jsp/menubar.jsp">
-        <jsp:param name="menu" value="<%=menu%>" />
-    </jsp:include>
+    <jsp:include page="/jsp/menubar.jsp" />
     <div id=top-spacer></div>
 
 <!-- Selected active menu
index 1cb6729301429ba1617804eb9412b5523fa5ebb4..a5ff9bfcf91681d5a8f7adffc883ed3499420549 100644 (file)
@@ -16,9 +16,7 @@
 <!-- Menu-bar
      =============================================================================================================================
   -->
-    <jsp:include page="/jsp/menubar.jsp">
-        <jsp:param name="menu" value="datadmin" />
-    </jsp:include>
+    <jsp:include page="/jsp/menubar.jsp" />
     <div id=top-spacer></div>
 
 <!-- Search menu
index f74d7e7ebcea60944eafdb58a2cb700ca463adc4..0094b7f8eb6afce82d01afff2048d6773b681191 100644 (file)
@@ -19,9 +19,7 @@
 <!-- Menu-bar
      =============================================================================================================================
   -->
-    <jsp:include page="/jsp/menubar.jsp">
-        <jsp:param name="menu" value="datadmin" />
-    </jsp:include>
+    <jsp:include page="/jsp/menubar.jsp" />
     <div id=top-spacer></div>
 
 <!-- Administration menu
index a1197f97f3c47f039268d3acce89f0cd788b12d8..6b9b4a6896a26d4fd031abf88b21031805df7a3e 100644 (file)
@@ -16,9 +16,7 @@
 <!-- Menu-bar
      =============================================================================================================================
   -->
-    <jsp:include page="/jsp/menubar.jsp">
-      <jsp:param name="menu" value="sysadmin" />
-    </jsp:include>
+    <jsp:include page="/jsp/menubar.jsp" />
     <div id=top-spacer></div>
 
 <!-- Left pane
index 0d0078a8660fb0a9afc5ca175bbce0230530f6e6..cc20770dfc510111c829044819afdc6f827eeaab 100644 (file)
@@ -16,9 +16,8 @@
 <!-- Menu-bar
      =============================================================================================================================
   -->
-    <jsp:include page="/jsp/menubar.jsp">
-      <jsp:param name="menu" value="sysadmin" />
-    </jsp:include>
+    <jsp:include page="/jsp/menubar.jsp" />
+
     <div id=top-spacer></div>
 
 <!-- Search menu
index 1d757d5add2e969035845ddf2f85844e57c1303f..59ac3492a3065b7a24e35dc7e0acc19611f50a48 100644 (file)
@@ -23,9 +23,7 @@
 <!-- Menu-bar
      =============================================================================================================================
   -->
-    <jsp:include page="/jsp/menubar.jsp">
-      <jsp:param name="menu" value="sysadmin" />
-    </jsp:include>
+    <jsp:include page="/jsp/menubar.jsp" />
     <div id=top-spacer></div>
 
 <!-- Left pane
index c13b63a5eaf26e2b8f53bd242232a24f268066e1..1f1331a362420a37176834db00975912351b0f0a 100644 (file)
@@ -16,9 +16,7 @@
 <!-- Menu-bar
      =============================================================================================================================
   -->
-    <jsp:include page="/jsp/menubar.jsp">
-      <jsp:param name="menu" value="knowledge" />
-    </jsp:include>
+    <jsp:include page="/jsp/menubar.jsp" />
 
 <!-- Title-bar
      =============================================================================================================================
index bfedb343255aa7f196eb24516291607fec86cf5f..6811face5e5cb02d92031373943c2580eb7ec1f3 100644 (file)
@@ -17,9 +17,7 @@
 <!-- Menu-bar
      =============================================================================================================================
   -->
-    <jsp:include page="/jsp/menubar.jsp">
-      <jsp:param name="menu" value="study" />
-    </jsp:include>
+    <jsp:include page="/jsp/menubar.jsp" />
 
 <!-- Title-bar
      =============================================================================================================================
index d85cff44fc6afe708ef8c00e0b59c4d4fb11a7a5..a6ffc547b83d8695ab32346b30f90ee5af5e138c 100644 (file)
 <!-- Menu-bar
      =============================================================================================================================
   -->
-    <jsp:include page="/jsp/menubar.jsp">
-      <jsp:param name="menu" value="study" />
-    </jsp:include>
+    <jsp:include page="/jsp/menubar.jsp" />
 
 <!-- Title-bar
      =============================================================================================================================
index 87011824210cf200c7ebef044ff483fecd0eb248..a4d0495cd2e5704d522a16305e3a849b14d6265e 100644 (file)
@@ -27,9 +27,7 @@
 <!-- Menu-bar
      =============================================================================================================================
   -->
-    <jsp:include page="/jsp/menubar.jsp">
-      <jsp:param name="menu" value="study" />
-    </jsp:include>
+    <jsp:include page="/jsp/menubar.jsp" />
 
 <!-- Title-bar
      =============================================================================================================================
index b974db774e01d8d0114d1e06a514a15dd34a7e47..aa58aee7441dcb2e761d57907b34aca0dc34fe4d 100644 (file)
@@ -42,9 +42,7 @@
 <!-- Menu-bar
      =============================================================================================================================
   -->
-    <jsp:include page="/jsp/menubar.jsp">
-      <jsp:param name="menu" value="study" />
-    </jsp:include>
+    <jsp:include page="/jsp/menubar.jsp" />
 
 <!-- Title-bar
      =============================================================================================================================
index 94b325f1fa5fc25c40464147e0a961bec5bc6e78..e894a61892f55e69759791013c2caa9728d4291c 100644 (file)
@@ -25,9 +25,7 @@
 <!-- Menu-bar
      =============================================================================================================================
   -->
-    <jsp:include page="/jsp/menubar.jsp">
-      <jsp:param name="menu" value="study" />
-    </jsp:include>
+    <jsp:include page="/jsp/menubar.jsp" />
 
 <!-- Title-bar
      =============================================================================================================================
index 9a65fd053611a0f9eaed254f0a588478dc2027ba..bec63696a01bc8d92307beac80fd621eb4285343 100644 (file)
@@ -23,9 +23,7 @@
 <!-- Menu-bar
      =============================================================================================================================
   -->
-    <jsp:include page="/jsp/menubar.jsp">
-      <jsp:param name="menu" value="study" />
-    </jsp:include>
+    <jsp:include page="/jsp/menubar.jsp" />
 
 <!-- Title-bar
      =============================================================================================================================
index 587f1c5be9b6d4d4bb500f6805b2ea52e42a3e7a..7fc623821f9ba127f65501006223921f017094b8 100644 (file)
@@ -25,9 +25,7 @@
 <!-- Menu-bar
      =============================================================================================================================
   -->
-    <jsp:include page="/jsp/menubar.jsp">
-      <jsp:param name="menu" value="study" />
-    </jsp:include>
+    <jsp:include page="/jsp/menubar.jsp" />
 
 <!-- Title-bar
      =============================================================================================================================
index f41f54c6c1b4937debbb56510ca758d98b3a35ee..197fa73c9f431de6986e5e982ad10bcc2d79bd87 100644 (file)
@@ -27,9 +27,7 @@
 <!-- Menu-bar
      =============================================================================================================================
   -->
-    <jsp:include page="/jsp/menubar.jsp">
-      <jsp:param name="menu" value="study" />
-    </jsp:include>
+    <jsp:include page="/jsp/menubar.jsp" />
 
 <!-- Title-bar
      =============================================================================================================================
index ff166d2104c6d1f1e8d4f13a8770af812e24283b..d8f196f1ce48be30e981af187d0987dffa55c9a8 100644 (file)
@@ -35,9 +35,7 @@
 <!-- Menu-bar
      =============================================================================================================================
   -->
-    <jsp:include page="/jsp/menubar.jsp">
-        <jsp:param name="menu" value="create" />
-    </jsp:include>
+    <jsp:include page="/jsp/menubar.jsp" />
     <div id=top-spacer></div>
 
 <!-- Creation menu
index af5cd0fa815c68c7abb566a73c82999b92db5242..bfbb3cf16dd03cd1807c071699e0c683a85d2bde 100644 (file)
@@ -43,9 +43,7 @@
 <!-- Menu-bar
      =============================================================================================================================
   -->
-    <jsp:include page="/jsp/menubar.jsp">
-        <jsp:param name="menu" value="open" />
-    </jsp:include>
+    <jsp:include page="/jsp/menubar.jsp" />
     <div id=top-spacer></div>
 
 <!-- Search menu
index 0a06b94c085870647dc745eecb17ccc31101d3f6..2ec930fca3c24b08fd457b7a9d7b3092ac8dbe70 100644 (file)
@@ -43,9 +43,7 @@
 <!-- Menu-bar
      =============================================================================================================================
   -->
-    <jsp:include page="/jsp/menubar.jsp">
-        <jsp:param name="menu" value="open" />
-    </jsp:include>
+    <jsp:include page="/jsp/menubar.jsp" />
     <div id=top-spacer></div>
 
 <!-- Search menu
index c931f855fd7e8e6cb7e3a4455b9ea18b2f2bb7d2..c00df6a846b48e575fda0ea5771d13809f43f576 100644 (file)
@@ -23,9 +23,7 @@
 <!-- Menu-bar
      =============================================================================================================================
   -->
-    <jsp:include page="/jsp/menubar.jsp">
-      <jsp:param name="menu" value="study" />
-    </jsp:include>
+    <jsp:include page="/jsp/menubar.jsp" />
 
 <!-- Title-bar
      =============================================================================================================================
index d62cb4cb0c718c2944163579b2c1f2f1ce8c768b..2b70e374804a149ad52febc0c5bbd4551e649312 100644 (file)
@@ -23,9 +23,7 @@
 <!-- Menu-bar
      =============================================================================================================================
   -->
-    <jsp:include page="/jsp/menubar.jsp">
-      <jsp:param name="menu" value="study" />
-    </jsp:include>
+    <jsp:include page="/jsp/menubar.jsp" />
 
 <!-- Title-bar
      =============================================================================================================================
index 45275c809c4b679b0f50234e862be508b4143bd9..ae6d2a6b0a2769b2fbbe0f93af1e521605a5e781 100644 (file)
   <body>
 <!-- Menu-bar
   -->
-    <jsp:include page="/jsp/menubar.jsp">
-        <jsp:param name="menu" value="none" />
-    </jsp:include>
-
+  
+    <jsp:include page="/jsp/menubar.jsp" />
+       
 <!-- Title-bar
   -->
     <div id=title-bar><s:text name="message.welcome"/></div>
index cf3137d0dfe1cf63516421ab5825775c6a8c5adf..57f84062a2f729a5732bc980673b966be85a1d37 100644 (file)
@@ -5,9 +5,12 @@ import java.util.Comparator;
 import java.util.ResourceBundle;
 
 import javax.security.auth.login.LoginContext;
+import javax.servlet.http.HttpServletRequest;
 
 import com.opensymphony.xwork2.ActionSupport;
 
+import org.apache.struts2.ServletActionContext;
+import org.apache.struts2.interceptor.ServletRequestAware;
 import org.apache.struts2.interceptor.SessionAware;
 import org.apache.log4j.Logger;
 import org.splat.dal.bo.kernel.User;
@@ -19,12 +22,16 @@ import org.splat.dal.bo.som.DocumentType;
 import org.splat.wapp.Menu;
 
 
-public class Action extends ActionSupport implements SessionAware {
+public class Action extends ActionSupport implements ServletRequestAware, SessionAware {
 
        private   Map<String, Object>  session;
        private   String               mercode;
        private OpenStudy _openStudy;
        private OpenKnowledge _openKnowledge;
+       
+       private MenuBarSettings _menuBarSettings;
+       
+       private HttpServletRequest  request;
 
        /**
         * Serial version ID.
@@ -137,9 +144,64 @@ public class Action extends ActionSupport implements SessionAware {
          session.put("study.open", open);
          return open;
     }
+    
+    /**
+     * Initialization the Context for menubar.
+     */
+    public void initializationContext() {
+       getMenuBarSettings().initializeInitialMenuProperties();
+       
+       if (session.get("study.open") == null) {
+               getMenuBarSettings().setIsStudyNull(true);
+               logger.debug("MKA: setIsStudyNull = true");
+       } else {
+               getMenuBarSettings().setIsStudyNull(false);
+               logger.debug("MKA: setIsStudyNull = false");
+       }
+       
+       if (session.get("knowledge.open") == null) {
+               getMenuBarSettings().setIsKnowledgeNull(true);
+               logger.debug("MKA: setIsKnowledgeNull = true");
+       } else {
+               getMenuBarSettings().setIsKnowledgeNull(false);
+               logger.debug("MKA: setIsKnowledgeNull = false");
+       }
+       
+       ApplicationRights userRights  = (ApplicationRights)session.get("user.rights");
+       
+       if (userRights.canCreateStudy()) {
+               getMenuBarSettings().setCanUserCreateStudy(true);
+       } else {
+               getMenuBarSettings().setCanUserCreateStudy(false);
+       }
+       
+       if (userRights.canManageDatabase()) {
+               getMenuBarSettings().setCanUserManageDatabase(true);
+       } else {
+               getMenuBarSettings().setCanUserManageDatabase(false);
+       } 
+       
+    }
+    
+    /**
+        * Initialization of the screen context for menu bar.
+        */
+       public void initializationScreenContext(final String menuProperty) {
+               
+               initializationContext();
+               getMenuBarSettings().intializeMenuBar(menuProperty);
+       }
 //  ==============================================================================================================================
 //  Getters and setters
 //  ==============================================================================================================================
+    
+       public void setServletRequest (HttpServletRequest request) {
+               this.request = request;
+       }
+       
+       public HttpServletRequest getServletRequest() {
+               return request;
+       }
 
     public String getErrorCode () {
 //  -----------------------------
@@ -158,4 +220,20 @@ public class Action extends ActionSupport implements SessionAware {
 //  ----------------------------------------------------               
          this.session = session;
        }
+       
+       /**
+        * Get the menuBarSettings.
+        * @return the menuBarSettings
+        */
+       public MenuBarSettings getMenuBarSettings() {
+               return _menuBarSettings;
+       }
+
+       /**
+        * Set the menuBarSettings.
+        * @param menuBarSettings the menuBarSettings to set
+        */
+       public void setMenuBarSettings(final MenuBarSettings menuBarSettings) {
+               _menuBarSettings = menuBarSettings;
+       }
 }
\ No newline at end of file
index e3114f734bc862bcd15283c5f3141e6a6adc0475..d588d946d119b5fbe0b70b6f35615acb49b57ad0 100644 (file)
@@ -18,6 +18,8 @@ public class ConnectionAction extends Action {
        private String username = null;
        private String password = null;
        private String backmenu = null;
+    
+    private String _menuProperty;
 
        /**
         * Serial version ID.
@@ -86,6 +88,10 @@ public class ConnectionAction extends Action {
                                        sfilter.put("author", String.valueOf(user.getIndex()));
                        }
                        this.connect(context, user); // Updates the session context
+                       
+                       setMenuProperty("none");
+                       initializationScreenContext(_menuProperty);
+                       
                        return backmenu;
                } catch (FailedLoginException error) {
                        setErrorCode("message.error.login." + error.getMessage());
@@ -96,6 +102,7 @@ public class ConnectionAction extends Action {
                }
        }
 
+
        @SuppressWarnings("unchecked")
        public String doLogout() {
                // -------------------------
@@ -115,6 +122,10 @@ public class ConnectionAction extends Action {
                        sfilter.put("author", "0");
 
                        this.disconnect(); // Updates the session context
+                       
+                       setMenuProperty("none");
+                       initializationScreenContext(_menuProperty);
+                       
                        return backmenu;
                } catch (Exception error) {
                        logger.error("Reason:", error);
@@ -122,32 +133,45 @@ public class ConnectionAction extends Action {
                }
        }
 
-       // ==============================================================================================================================
-       // Getters and setters
-       // ==============================================================================================================================
-
-       public String getUsername() {
-               // ----------------------------
-               return username;
-       }
-
-       public String getPassword() {
-               // ----------------------------
-               return password;
-       }
-
-       public void setUsername(String value) {
-               // --------------------------------------
-               this.username = value;
-       }
-
-       public void setPassword(String value) {
-               // --------------------------------------
-               this.password = value;
+//  ==============================================================================================================================
+//  Getters and setters
+//  ==============================================================================================================================
+       
+    public String getUsername () {
+//  ----------------------------       
+      return username;
+    }
+    public String getPassword () {
+//  ----------------------------
+      return password;
+    }
+
+    public void setUsername (String value) {
+//  --------------------------------------
+      this.username = value;
+    }
+    public void setPassword (String value) {
+//  --------------------------------------
+      this.password = value;
+    }
+    public void setBackMenu (String menu) {
+//  -------------------------------------
+      this.backmenu = menu;
+    }
+    
+    /**
+        * Get the menuProperty.
+        * @return the menuProperty
+        */
+       public String getMenuProperty() {
+               return _menuProperty;
        }
 
-       public void setBackMenu(String menu) {
-               // -------------------------------------
-               this.backmenu = menu;
+       /**
+        * Set the menuProperty.
+        * @param menuProperty the menuProperty to set
+        */
+       public void setMenuProperty(String menuProperty) {
+               this._menuProperty = menuProperty;
        }
 }
\ No newline at end of file
index eb21c3d845e43b2373e4b7d80b37da5373c1f4ef..d6c6c3d763589ffaa2054d6ade4eb432676f27e7 100644 (file)
@@ -22,6 +22,12 @@ public class DisplayKnowledgeAction extends DisplayBaseAction {
         * Injected knowledge element service.
         */
        private KnowledgeElementService _knowledgeElementService;
+       
+       /**
+        * Value of the menu property. 
+        * It can be: none, create, open, study, knowledge, sysadmin, help.
+        */
+       private String _menuProperty;
 
        // ==============================================================================================================================
        // Action methods
@@ -51,6 +57,9 @@ public class DisplayKnowledgeAction extends DisplayBaseAction {
                        myknelm.setSelection(selection);
                }
                getSession().put("menu.knowledge", myknelm.getMenu());
+               
+               setMenuProperty("knowledge");
+               initializationScreenContext(_menuProperty);
 
                return SUCCESS;
        }
@@ -63,6 +72,10 @@ public class DisplayKnowledgeAction extends DisplayBaseAction {
                } else { // Selection of a step of current study
                        myknelm.setSelection(selection);
                }
+               
+               setMenuProperty("knowledge");
+               initializationScreenContext(_menuProperty);
+               
                return SUCCESS;
        }
 
@@ -75,6 +88,10 @@ public class DisplayKnowledgeAction extends DisplayBaseAction {
                        myknelm.reduceHistory(myindex);
                else if (todo == Execute.reduceall)
                        myknelm.reduceDocument(myindex);
+               
+               setMenuProperty("knowledge");
+               initializationScreenContext(_menuProperty);
+               
                return SUCCESS;
        }
 
@@ -85,11 +102,19 @@ public class DisplayKnowledgeAction extends DisplayBaseAction {
                        myknelm.developKnowledge(myindex);
                else if (todo == Execute.reduce)
                        myknelm.reduceKnowledge(myindex);
+               
+               setMenuProperty("knowledge");
+               initializationScreenContext(_menuProperty);
+               
                return SUCCESS;
        }
 
        public String doClose() {
                closeKnowledge();
+               
+               setMenuProperty("none");
+               initializationScreenContext(_menuProperty);
+               
                return SUCCESS;
        }
 
@@ -136,4 +161,20 @@ public class DisplayKnowledgeAction extends DisplayBaseAction {
                        KnowledgeElementService knowledgeElementService) {
                _knowledgeElementService = knowledgeElementService;
        }
+       
+       /**
+        * Get the menuProperty.
+        * @return the menuProperty
+        */
+       public String getMenuProperty() {
+               return _menuProperty;
+       }
+
+       /**
+        * Set the menuProperty.
+        * @param menuProperty the menuProperty to set
+        */
+       public void setMenuProperty(String menuProperty) {
+               this._menuProperty = menuProperty;
+       }
 }
\ No newline at end of file
index a7cf86a6e4ecb976ea4ff015d21a3190f7f6f8cd..88603ff7cd3cb7f456311d68435e15b982070312 100644 (file)
@@ -26,6 +26,12 @@ public class DisplayStudyStepAction extends DisplayBaseAction {
         * Injected study service.
         */
        private StudyService _studyService;
+       
+       /**
+        * Value of the menu property. 
+        * It can be: none, create, open, study, knowledge, sysadmin, help.
+        */
+       private String _menuProperty;
 
        // ==============================================================================================================================
        // Action methods
@@ -74,6 +80,9 @@ public class DisplayStudyStepAction extends DisplayBaseAction {
                        menu.selects("prop-general");
                }
                getSession().put("menu.study", mystudy.getMenu());
+               
+               setMenuProperty("study");
+               initializationScreenContext(_menuProperty);
 
                return SUCCESS;
        }
@@ -96,6 +105,10 @@ public class DisplayStudyStepAction extends DisplayBaseAction {
                        menu.disables("prop-scenario");
                        menu.selects("prop-general");
                }
+               
+               setMenuProperty("study");
+               initializationScreenContext(_menuProperty);
+               
                return SUCCESS;
        }
 
@@ -108,6 +121,10 @@ public class DisplayStudyStepAction extends DisplayBaseAction {
                        mystudy.reduceHistory(myindex);
                else if (todo == Execute.reduceall)
                        mystudy.reduceDocument(myindex);
+               
+               setMenuProperty("study");
+               initializationScreenContext(_menuProperty);
+               
                return SUCCESS;
        }
 
@@ -118,11 +135,19 @@ public class DisplayStudyStepAction extends DisplayBaseAction {
                        mystudy.developKnowledge(myindex);
                else if (todo == Execute.reduce)
                        mystudy.reduceKnowledge(myindex);
+               
+               setMenuProperty("study");
+               initializationScreenContext(_menuProperty);
+               
                return SUCCESS;
        }
 
        public String doClose() {
                closeStudy();
+               
+               setMenuProperty("none");
+               initializationScreenContext(_menuProperty);
+               
                return SUCCESS;
        }
 
@@ -195,4 +220,20 @@ public class DisplayStudyStepAction extends DisplayBaseAction {
                super.setOpenStudy(study);
                mystudy = study;
        }
+       
+       /**
+        * Get the menuProperty.
+        * @return the menuProperty
+        */
+       public String getMenuProperty() {
+               return _menuProperty;
+       }
+
+       /**
+        * Set the menuProperty.
+        * @param menuProperty the menuProperty to set
+        */
+       public void setMenuProperty(String menuProperty) {
+               this._menuProperty = menuProperty;
+       }
 }
\ No newline at end of file
index ca7baa1c7a7c3d531ee20255a0a266e29f2ca7a4..f9362046b932e5e366d8cbefeabcecd2e5712ec5 100644 (file)
@@ -37,6 +37,12 @@ public class EditDocumentAction extends DisplayStudyStepAction {
         * Injected repository service.
         */
        private RepositoryService _repositoryService;
+       
+       /**
+        * Value of the menu property. 
+        * It can be: none, create, open, study, knowledge, sysadmin, help.
+        */
+       private String _menuProperty;
 
        /**
         * Operations enumeration.
@@ -56,10 +62,18 @@ public class EditDocumentAction extends DisplayStudyStepAction {
         */
        public String doInitialize() {
                mystudy = getOpenStudy();
+               
+               setMenuProperty("study");
+               initializationScreenContext(_menuProperty);
+               
                return SUCCESS;
        }
 
        public String doSetDocument() {
+               
+               setMenuProperty("study");
+               initializationScreenContext(_menuProperty);
+               
                try {
                        mystudy = getOpenStudy();
 
@@ -106,6 +120,10 @@ public class EditDocumentAction extends DisplayStudyStepAction {
                // -------------------------
 //             Session connex = Database.getCurSession();
 //             Transaction transax = connex.beginTransaction();
+               
+               setMenuProperty("study");
+               initializationScreenContext(_menuProperty);
+               
                try {
                        // Getting user inputs
                        mystudy = getOpenStudy();
@@ -133,6 +151,10 @@ public class EditDocumentAction extends DisplayStudyStepAction {
        }
 
        public String doDeleteDocument() {
+               
+               setMenuProperty("study");
+               initializationScreenContext(_menuProperty);
+               
                try {
                        mystudy = getOpenStudy();
 
@@ -221,4 +243,20 @@ public class EditDocumentAction extends DisplayStudyStepAction {
        public void setStepService(StepService stepService) {
                _stepService = stepService;
        }
+       
+       /**
+        * Get the menuProperty.
+        * @return the menuProperty
+        */
+       public String getMenuProperty() {
+               return _menuProperty;
+       }
+
+       /**
+        * Set the menuProperty.
+        * @param menuProperty the menuProperty to set
+        */
+       public void setMenuProperty(String menuProperty) {
+               this._menuProperty = menuProperty;
+       }
 }
\ No newline at end of file
index c4975d0b225c795601139ca5c08480948681928d..16f48baa66dd6178c4cdb0c7edd50462167eff10 100644 (file)
@@ -43,6 +43,12 @@ public class EditKnowledgeElementAction extends DisplayStudyStepAction {
         * Injected knowledge element type service.
         */
        private KnowledgeElementTypeService _knowledgeElementTypeService;
+       
+       /**
+        * Value of the menu property. 
+        * It can be: none, create, open, study, knowledge, sysadmin, help.
+        */
+       private String _menuProperty;
 
        // ==============================================================================================================================
        // Action methods
@@ -55,6 +61,10 @@ public class EditKnowledgeElementAction extends DisplayStudyStepAction {
         */
        public String doInitialize() {
                mystudy = getOpenStudy();
+               
+               setMenuProperty("study");
+               initializationScreenContext(_menuProperty);
+               
                return SUCCESS;
        }
 
@@ -64,6 +74,10 @@ public class EditKnowledgeElementAction extends DisplayStudyStepAction {
         * @return SUCCESS if operation succeeded, ERROR if Runtime exception, otherwise INPUT
         */
        public String doSetKnowledge() {
+               
+               setMenuProperty("study");
+               initializationScreenContext(_menuProperty);
+               
                try {
                        User user = getConnectedUser();
                        mystudy = getOpenStudy();
@@ -117,6 +131,9 @@ public class EditKnowledgeElementAction extends DisplayStudyStepAction {
 
                mystudy.remove(kelm);
                getMenu("study").selects(mystudy.getSelection()); // Updates the menu icon, in case of last removed document
+               
+               setMenuProperty("study");
+               initializationScreenContext(_menuProperty);
 
                return SUCCESS;
        }
@@ -233,4 +250,20 @@ public class EditKnowledgeElementAction extends DisplayStudyStepAction {
                        KnowledgeElementTypeService knowledgeElementTypeService) {
                _knowledgeElementTypeService = knowledgeElementTypeService;
        }
+       
+       /**
+        * Get the menuProperty.
+        * @return the menuProperty
+        */
+       public String getMenuProperty() {
+               return _menuProperty;
+       }
+
+       /**
+        * Set the menuProperty.
+        * @param menuProperty the menuProperty to set
+        */
+       public void setMenuProperty(String menuProperty) {
+               this._menuProperty = menuProperty;
+       }
 }
\ No newline at end of file
index 59ea206b944bdc27a6402aa3bc9d693294f8f8d1..311eb2a2816b719cf380ae0e08ee7d5821bbf41f 100644 (file)
@@ -17,6 +17,12 @@ public class EditScenarioPropertiesAction extends DisplayStudyStepAction {
        private String subject;
        private ScenarioService _scenarioService;
        private ProjectElementService _projectElementService;
+       
+       /**
+        * Value of the menu property. 
+        * It can be: none, create, open, study, knowledge, sysadmin, help.
+        */
+       private String _menuProperty;
 
        /**
         * Serial version ID.
@@ -42,6 +48,9 @@ public class EditScenarioPropertiesAction extends DisplayStudyStepAction {
                myscenario = (Scenario) step.getOwner(); // The selected step belong to a scenario
                lasdate = datstring.format(myscenario.getLastModificationDate());
                subject = label.getString("label.study") + " " + mystudy.getTitle();
+               
+               setMenuProperty("study");
+               initializationScreenContext(_menuProperty);
 
                return SUCCESS;
        }
@@ -58,6 +67,10 @@ public class EditScenarioPropertiesAction extends DisplayStudyStepAction {
 
                mystudy.getMenu().refreshGivenStepItem(
                                getProjectElementService().getFirstStep(myscenario)); // For updating the scenario icon
+               
+               setMenuProperty("study");
+               initializationScreenContext(_menuProperty);
+               
                return SUCCESS;
        }
 
@@ -136,4 +149,20 @@ public class EditScenarioPropertiesAction extends DisplayStudyStepAction {
                        ProjectElementService projectElementService) {
                _projectElementService = projectElementService;
        }
+       
+       /**
+        * Get the menuProperty.
+        * @return the menuProperty
+        */
+       public String getMenuProperty() {
+               return _menuProperty;
+       }
+
+       /**
+        * Set the menuProperty.
+        * @param menuProperty the menuProperty to set
+        */
+       public void setMenuProperty(String menuProperty) {
+               this._menuProperty = menuProperty;
+       }
 }
\ No newline at end of file
index 79718e2123d70ebef0c827b3c4536cfa37d85798..939d5d1ba1d4d2929ee83facb038721f913382db 100644 (file)
@@ -37,6 +37,12 @@ public class EditSimulationContextAction extends DisplayStudyStepAction {
         * Injected simulation context type service.
         */
        private SimulationContextTypeService _simulationContextTypeService;
+       
+       /**
+        * Value of the menu property. 
+        * It can be: none, create, open, study, knowledge, sysadmin, help.
+        */
+       private String _menuProperty;
 
        /**
         * Get the stepService.
@@ -67,6 +73,9 @@ public class EditSimulationContextAction extends DisplayStudyStepAction {
 
                mystudy = getOpenStudy();
                contype = getInvolvedContexts();
+               
+               setMenuProperty("study");
+               initializationScreenContext(_menuProperty);
 
                if (contype.isEmpty())
                        return "create";
@@ -76,6 +85,10 @@ public class EditSimulationContextAction extends DisplayStudyStepAction {
 
        public String doSelectContext() {
                mystudy = getOpenStudy();
+               
+               setMenuProperty("study");
+               initializationScreenContext(_menuProperty);
+               
                int typid = Integer.valueOf(selectype);
                if (typid == 0)
                        return "create";
@@ -94,6 +107,10 @@ public class EditSimulationContextAction extends DisplayStudyStepAction {
                // --------------------------------
                try {
                        mystudy = getOpenStudy();
+                       
+                       setMenuProperty("study");
+                       initializationScreenContext(_menuProperty);
+                       
                        if (newtype.length() == 0 || value.length() == 0)
                                return INPUT;
 
@@ -122,6 +139,10 @@ public class EditSimulationContextAction extends DisplayStudyStepAction {
        }
 
        public String doDeleteContext() {
+               
+               setMenuProperty("study");
+               initializationScreenContext(_menuProperty);
+               
                try {
                        mystudy = getOpenStudy();
 
@@ -148,6 +169,10 @@ public class EditSimulationContextAction extends DisplayStudyStepAction {
                String[] input = value.split(",");
 //             Session connex = Database.getCurSession();
 //             Transaction transax = connex.beginTransaction();
+               
+               setMenuProperty("study");
+               initializationScreenContext(_menuProperty);
+               
                try {
                        mystudy = getOpenStudy();
 
@@ -326,4 +351,20 @@ public class EditSimulationContextAction extends DisplayStudyStepAction {
                        SimulationContextTypeService simulationContextTypeService) {
                _simulationContextTypeService = simulationContextTypeService;
        }
+       
+       /**
+        * Get the menuProperty.
+        * @return the menuProperty
+        */
+       public String getMenuProperty() {
+               return _menuProperty;
+       }
+
+       /**
+        * Set the menuProperty.
+        * @param menuProperty the menuProperty to set
+        */
+       public void setMenuProperty(String menuProperty) {
+               this._menuProperty = menuProperty;
+       }
 }
\ No newline at end of file
index 76c546c425a8ed75378fdba0093fec65516ed63c..3fce95321c9f620a95edd04b150512d0aa98e170 100644 (file)
@@ -14,6 +14,12 @@ public class EditStudyAction extends DisplayStudyStepAction {
        private enum Execute { publish, promote }
 
        private StudyService _studyService;
+       
+       /**
+        * Value of the menu property. 
+        * It can be: none, create, open, study, knowledge, sysadmin, help.
+        */
+       private String _menuProperty;
 
 //  ==============================================================================================================================
 //  Action methods
@@ -29,6 +35,9 @@ public class EditStudyAction extends DisplayStudyStepAction {
         if      (todo == Execute.publish) getStudyService().moveToPublic(study);
         else if (todo == Execute.promote) getStudyService().moveToReference(study);
         mystudy.getPopup().setContext("study", mystudy.getStudyRights());   // The context has changed
+        
+        setMenuProperty("study");
+               initializationScreenContext(_menuProperty);
 
         return SUCCESS;
          }
@@ -55,4 +64,20 @@ public class EditStudyAction extends DisplayStudyStepAction {
        public void setStudyService(StudyService studyService) {
                _studyService = studyService;
        }
+       
+       /**
+        * Get the menuProperty.
+        * @return the menuProperty
+        */
+       public String getMenuProperty() {
+               return _menuProperty;
+       }
+
+       /**
+        * Set the menuProperty.
+        * @param menuProperty the menuProperty to set
+        */
+       public void setMenuProperty(String menuProperty) {
+               this._menuProperty = menuProperty;
+       }
 }
\ No newline at end of file
index e03049272e1d8f7e7b20ac8ea8ca6684e2ae01b7..2af91578508cfb1417a4ab441dd8728d81a443dd 100644 (file)
@@ -64,7 +64,12 @@ public class ImportDocumentAction extends UploadBaseNextAction {
        /**
         * Injected repository service.
         */
-       private RepositoryService _repositoryService;
+       private RepositoryService _repositoryService;   
+       /**
+        * Value of the menu property. 
+        * It can be: none, create, open, study, knowledge, sysadmin, help.
+        */
+       private String _menuProperty;
 
        // ==============================================================================================================================
        // Action methods
@@ -75,6 +80,10 @@ public class ImportDocumentAction extends UploadBaseNextAction {
         * @return SUCCESS in success, otherwise - ERROR
         */
        public String doInitialize() {
+               
+               setMenuProperty("study");
+           initializationScreenContext(_menuProperty);
+             
                User user = getConnectedUser();
                File updir = getRepositoryService().getDownloadDirectory(user);
                File upfile = new File(updir.getPath() + "/" + filename);
@@ -171,6 +180,10 @@ public class ImportDocumentAction extends UploadBaseNextAction {
         */
        public String doImport() {
                // -------------------------
+               
+               setMenuProperty("study");
+           initializationScreenContext(_menuProperty);
+           
                if (action == ToDo.cancel)
                        return "cancel";
                if (doctype == 0) {
@@ -442,4 +455,20 @@ public class ImportDocumentAction extends UploadBaseNextAction {
        public void setDocumentTypeService(DocumentTypeService documentTypeService) {
                _documentTypeService = documentTypeService;
        }
+       
+       /**
+        * Get the menuProperty.
+        * @return the menuProperty
+        */
+       public String getMenuProperty() {
+               return _menuProperty;
+       }
+
+       /**
+        * Set the menuProperty.
+        * @param menuProperty the menuProperty to set
+        */
+       public void setMenuProperty(String menuProperty) {
+               this._menuProperty = menuProperty;
+       }
 }
\ No newline at end of file
diff --git a/Workspace/Siman/src/org/splat/simer/MenuBarSettings.java b/Workspace/Siman/src/org/splat/simer/MenuBarSettings.java
new file mode 100644 (file)
index 0000000..22a9a65
--- /dev/null
@@ -0,0 +1,344 @@
+/*****************************************************************************
+ * Company         EURIWARE
+ * Application     SIMAN
+ * File            $Id$ 
+ * Creation date   19.10.2012
+ * @author         Author: Maria KRUCHININA
+ * @version        Revision: 
+ *****************************************************************************/
+
+package org.splat.simer; 
+
+/**
+ * Settings for menu bar.
+ * @author Maria KRUCHININA
+ *
+ */
+public class MenuBarSettings {
+       
+       /**
+        * The SALOME WEB-site URL.
+        */
+       private  String webSiteURL;
+
+       /**
+        * Help URL.
+        */
+       private  String helpURL;
+
+       //=== MENUS==========================================
+       /**
+        * Property, is this menu the "Create the Study" one.
+        */
+       private  Boolean isMenuCreate;
+       
+       /**
+        * Property, is this menu the "Open the Study" one.
+        */
+       private  Boolean isMenuOpen;
+       
+       /**
+        * Property, is this menu the "Display the Open Study" one.
+        */
+       private  Boolean isMenuStudy;
+       
+       /**
+        * Property, is this menu the "Display the Open Knowledge" one.
+        */
+       private  Boolean isMenuKnowledge;
+       
+       /**
+        * Property, is this menu the "Managing the database" one.
+        */
+       private  Boolean isMenuSysAdmin;
+       
+       /**
+        * Property, is this menu the "Help" one.
+        */
+       private  Boolean isMenuHelp;
+       
+       //=== OTHER OPERATIONS ============================
+       
+       /**
+        * Can the given User create the given Study. 
+        */
+       private  Boolean canUserCreateStudy;
+       
+       /**
+        * Is the given Study NULL. 
+        */
+       private  Boolean isStudyNull;
+       
+       /**
+        * Is the given Knowledge NULL. 
+        */
+       private  Boolean isKnowledgeNull;
+       
+       /**
+        * Can the given User manage the Database. 
+        */
+       private  Boolean canUserManageDatabase;
+       
+       /**
+     * Initialize the initial properties for menus.
+     */  
+    public void initializeInitialMenuProperties() {
+       
+       webSiteURL = ApplicationSettings.getWebSiteURL();
+       helpURL =  ApplicationSettings.getHelpURL();
+       
+    }
+    
+    /**
+     * Initialize the menu bar properties.
+     * @param menuProperty - parameter of menu bar.
+     */
+    public void intializeMenuBar (final String menuProperty) {
+       
+       if ("none".equals(menuProperty)) {
+               setIsMenuCreate(false);
+               setIsMenuOpen(false);
+               setIsMenuStudy(false);
+               setIsMenuKnowledge(false);
+               setIsMenuSysAdmin(false);
+               setIsMenuHelp(false);
+       } else if ("create".equals(menuProperty)) {
+               setIsMenuCreate(true);
+               setIsMenuOpen(false);
+               setIsMenuStudy(false);
+               setIsMenuKnowledge(false);
+               setIsMenuSysAdmin(false);
+               setIsMenuHelp(false);
+       } else if ("open".equals(menuProperty)) {
+               setIsMenuCreate(false);
+               setIsMenuOpen(true);
+               setIsMenuStudy(false);
+               setIsMenuKnowledge(false);
+               setIsMenuSysAdmin(false);
+               setIsMenuHelp(false);
+       } else if ("study".equals(menuProperty)) {
+               setIsMenuCreate(false);
+               setIsMenuOpen(false);
+               setIsMenuStudy(true);
+               setIsMenuKnowledge(false);
+               setIsMenuSysAdmin(false);
+               setIsMenuHelp(false);
+       } else if ("knowledge".equals(menuProperty)) {
+               setIsMenuCreate(false);
+               setIsMenuOpen(false);
+               setIsMenuStudy(false);
+               setIsMenuKnowledge(true);
+               setIsMenuSysAdmin(false);
+               setIsMenuHelp(false);
+       } else if ("sysadmin".equals(menuProperty)) {
+               setIsMenuCreate(false);
+               setIsMenuOpen(false);
+               setIsMenuStudy(false);
+               setIsMenuKnowledge(false);
+               setIsMenuSysAdmin(true);
+               setIsMenuHelp(false);
+       } else if ("help".equals(menuProperty)) {
+               setIsMenuCreate(false);
+               setIsMenuOpen(false);
+               setIsMenuStudy(false);
+               setIsMenuKnowledge(false);
+               setIsMenuSysAdmin(false);
+               setIsMenuHelp(true);
+       }       
+    }
+    
+    //====== GETTERS AND SETERS ==============
+    
+    /**
+        * Get the webSiteURL.
+        * @return the webSiteURL
+        */
+    public String getWebSiteURL() {
+               return webSiteURL;
+       }
+
+    /**
+        * Set the webSiteURL.
+        * @param webSiteURL the webSiteURL to set
+        */
+       public void setWebSiteURL(final String webSiteURL) {
+               this.webSiteURL = webSiteURL;
+       }
+
+       /**
+        * Get the helpURL.
+        * @return the helpURL
+        */
+       public String getHelpURL() {
+               return helpURL;
+       }
+
+       /**
+        * Set the helpURL.
+        * @param helpURL the helpURL to set
+        */
+       public void setHelpURL(final String helpURL) {
+               this.helpURL = helpURL;
+       }
+
+       /**
+        * Get the isMenuCreate.
+        * @return the isMenuCreate
+        */
+       public Boolean getIsMenuCreate() {
+               return isMenuCreate;
+       }
+
+       /**
+        * Set the isMenuCreate.
+        * @param isMenuCreate the isMenuCreate to set
+        */
+       public void setIsMenuCreate(final Boolean isMenuCreate) {
+               this.isMenuCreate = isMenuCreate;
+       }
+
+       /**
+        * Get the isMenuOpen.
+        * @return the isMenuOpen
+        */
+       public Boolean getIsMenuOpen() {
+               return isMenuOpen;
+       }
+
+       /**
+        * Set the isMenuOpen.
+        * @param isMenuOpen the isMenuOpen to set
+        */
+       public void setIsMenuOpen(final Boolean isMenuOpen) {
+               this.isMenuOpen = isMenuOpen;
+       }
+
+       /**
+        * Get the isMenuStudy.
+        * @return the isMenuStudy
+        */
+       public Boolean getIsMenuStudy() {
+               return isMenuStudy;
+       }
+
+       /**
+        * Set the isMenuStudy.
+        * @param isMenuStudy the isMenuStudy to set
+        */
+       public void setIsMenuStudy(final Boolean isMenuStudy) {
+               this.isMenuStudy = isMenuStudy;
+       }
+
+       /**
+        * Get the isMenuKnowledge.
+        * @return the isMenuKnowledge
+        */
+       public Boolean getIsMenuKnowledge() {
+               return isMenuKnowledge;
+       }
+
+       /**
+        * Set the isMenuKnowledge.
+        * @param isMenuKnowledge the isMenuKnowledge to set
+        */
+       public void setIsMenuKnowledge(final Boolean isMenuKnowledge) {
+               this.isMenuKnowledge = isMenuKnowledge;
+       }
+
+       /**
+        * Get the isMenuSysAdmin.
+        * @return the isMenuSysAdmin
+        */
+       public Boolean getIsMenuSysAdmin() {
+               return isMenuSysAdmin;
+       }
+
+       /**
+        * Set the isMenuSysAdmin.
+        * @param isMenuSysAdmin the isMenuSysAdmin to set
+        */
+       public void setIsMenuSysAdmin(final Boolean isMenuSysAdmin) {
+               this.isMenuSysAdmin = isMenuSysAdmin;
+       }
+
+       /**
+        * Get the isMenuHelp.
+        * @return the isMenuHelp
+        */
+       public Boolean getIsMenuHelp() {
+               return isMenuHelp;
+       }
+
+       /**
+        * Set the isMenuHelp.
+        * @param isMenuHelp the isMenuHelp to set
+        */
+       public void setIsMenuHelp(final Boolean isMenuHelp) {
+               this.isMenuHelp = isMenuHelp;
+       }
+
+       /**
+        * Get the canUserCreateStudy.
+        * @return the canUserCreateStudy
+        */
+       public Boolean getCanUserCreateStudy() {
+               return canUserCreateStudy;
+       }
+
+       /**
+        * Set the canUserCreateStudy.
+        * @param canUserCreateStudy the canUserCreateStudy to set
+        */
+       public void setCanUserCreateStudy(final Boolean canUserCreateStudy) {
+               this.canUserCreateStudy = canUserCreateStudy;
+       }
+
+       /**
+        * Get the isStudyNull.
+        * @return the isStudyNull
+        */
+       public Boolean getIsStudyNull() {
+               return isStudyNull;
+       }
+
+       /**
+        * Set the isStudyNull.
+        * @param isStudyNull the isStudyNull to set
+        */
+       public void setIsStudyNull(final Boolean isStudyNull) {
+               this.isStudyNull = isStudyNull;
+       }
+
+       /**
+        * Get the isKnowledgeNull.
+        * @return the isKnowledgeNull
+        */
+       public Boolean getIsKnowledgeNull() {
+               return isKnowledgeNull;
+       }
+
+       /**
+        * Set the isKnowledgeNull.
+        * @param isKnowledgeNull the isKnowledgeNull to set
+        */
+       public void setIsKnowledgeNull(final Boolean isKnowledgeNull) {
+               this.isKnowledgeNull = isKnowledgeNull;
+       }
+
+       /**
+        * Get the canUserManageDatabase.
+        * @return the canUserManageDatabase
+        */
+       public Boolean getCanUserManageDatabase() {
+               return canUserManageDatabase;
+       }
+
+       /**
+        * Set the canUserManageDatabase.
+        * @param canUserManageDatabase the canUserManageDatabase to set
+        */
+       public void setCanUserManageDatabase(final Boolean canUserManageDatabase) {
+               this.canUserManageDatabase = canUserManageDatabase;
+       }
+       
+}
index cc1b63406873401cc1facdfda6887d3db3ece397..246cb50deeda25e1ef8ada88718534efde33779b 100644 (file)
@@ -36,6 +36,12 @@ public class NewScenarioAction extends Action {
         */
        private ProjectElementService _projectElementService;
        private Menu _menu;
+       
+       /**
+        * Value of the menu property. 
+        * It can be: none, create, open, study, knowledge, sysadmin, help.
+        */
+       private String _menuProperty;
 
        /**
         * Serial version ID.
@@ -67,6 +73,10 @@ public class NewScenarioAction extends Action {
       Menu menu = ((NewScenarioMenu)getMenu()).init(study); //RKV
       menu.selects(selection);
       getSession().put("menu.scenario", menu);
+      
+      setMenuProperty("study");
+         initializationScreenContext(_menuProperty);
+               
       return SUCCESS;
     }
 
@@ -81,6 +91,10 @@ public class NewScenarioAction extends Action {
       action    = null;
         
       getMenu("scenario").selects(selection);
+      
+      setMenuProperty("study");
+      initializationScreenContext(_menuProperty);
+      
       return SUCCESS;
     }
 
@@ -125,6 +139,10 @@ public class NewScenarioAction extends Action {
          }
       catch (RuntimeException saverror) {
         logger.error("Reason:", saverror);
+        
+        setMenuProperty("study");
+               initializationScreenContext(_menuProperty);
+               
         return ERROR;
       }
          catch (Exception error) {
@@ -233,4 +251,20 @@ public class NewScenarioAction extends Action {
        public void setScenarioService(ScenarioService scenarioService) {
                _scenarioService = scenarioService;
        }
+       
+       /**
+        * Get the menuProperty.
+        * @return the menuProperty
+        */
+       public String getMenuProperty() {
+               return _menuProperty;
+       }
+
+       /**
+        * Set the menuProperty.
+        * @param menuProperty the menuProperty to set
+        */
+       public void setMenuProperty(String menuProperty) {
+               this._menuProperty = menuProperty;
+       }
 }
\ No newline at end of file
index 1a89f79a373e070b86bb9d533ba737dfad607887..df6211e979c82f639a6af9b9be6f51f00a883723 100644 (file)
@@ -32,6 +32,12 @@ public class NewStudyAction extends Action {
         * Injected scenario service.
         */
        private ScenarioService _scenarioService;
+       
+       /**
+        * Value of the menu property. 
+        * It can be: none, create, open, study, knowledge, sysadmin, help.
+        */
+       private String _menuProperty;
 
        // ==============================================================================================================================
        // Action methods
@@ -48,6 +54,9 @@ public class NewStudyAction extends Action {
                                ApplicationSettings.getCurrentLocale());
                title = locale.getString("label.study") + " "
                                + String.valueOf(number + 1);
+               
+               setMenuProperty("create");
+               initializationScreenContext(_menuProperty);
 
                return SUCCESS;
        }
@@ -65,8 +74,13 @@ public class NewStudyAction extends Action {
                                throw new Exception();
                        if (valid == 0) {
                                value = input[1].trim();
-                               if (value.length() == 0)
+                               if (value.length() == 0) {
+                                       
+                                       setMenuProperty("create");
+                                       initializationScreenContext(_menuProperty);
+                                       
                                        return INPUT; // No need to reinitialize the list of existing products
+                               }
                        }
                        sprop.setTitle(title).setManager(getConnectedUser());
                        sprop.checkValidity();
@@ -77,6 +91,10 @@ public class NewStudyAction extends Action {
                                        .selectType("product");
                        contelm = getSimulationContextService()
                                        .selectSimulationContextsWhere(cprop.setType(product));
+                       
+                       setMenuProperty("create");
+                       initializationScreenContext(_menuProperty);
+                       
                        return INPUT; // Title empty, simply wait for input without error message
                }
                try {
@@ -104,9 +122,15 @@ public class NewStudyAction extends Action {
                        // Update of the session
                        number += 1;
                        open(study); // Opens the study,
+                       
+                       setMenuProperty("study");
+                       initializationScreenContext(_menuProperty);
+                       
                        return SUCCESS;
                } catch (Exception error) {
                        logger.error("Unable to save the study, reason:", error);
+                       setMenuProperty("none");
+                       initializationScreenContext(_menuProperty);
                        return ERROR;
                }
        }
@@ -194,4 +218,20 @@ public class NewStudyAction extends Action {
        public void setScenarioService(ScenarioService scenarioService) {
                _scenarioService = scenarioService;
        }
+       
+       /**
+        * Get the menuProperty.
+        * @return the menuProperty
+        */
+       public String getMenuProperty() {
+               return _menuProperty;
+       }
+
+       /**
+        * Set the menuProperty.
+        * @param menuProperty the menuProperty to set
+        */
+       public void setMenuProperty(String menuProperty) {
+               this._menuProperty = menuProperty;
+       }
 }
\ No newline at end of file
index 9f5666e31053bf0bdcd53f1ddae67fcfcba440f1..e6ecc09e91d7f3bfcdee084048c6c1fe07e33e9d 100644 (file)
@@ -7,13 +7,39 @@ public class NotYetImplementedAction extends Action {
         * Serial version ID.
         */
        private static final long serialVersionUID = 3131921588316476454L;
+       
+       /**
+        * Value of the menu property. 
+        * It can be: none, create, open, study, knowledge, sysadmin, help.
+        */
+       private String _menuProperty;
 
 //  ==============================================================================================================================
 //  Action methods
 //  ==============================================================================================================================
 
     public String doInitialize () {
-//  -----------------------------      
+//  -----------------------------   
+       
+       setMenuProperty("study");
+               initializationScreenContext(_menuProperty);
+               
       return SUCCESS;
     }
+    
+    /**
+        * Get the menuProperty.
+        * @return the menuProperty
+        */
+       public String getMenuProperty() {
+               return _menuProperty;
+       }
+
+       /**
+        * Set the menuProperty.
+        * @param menuProperty the menuProperty to set
+        */
+       public void setMenuProperty(String menuProperty) {
+               this._menuProperty = menuProperty;
+       }
 }
\ No newline at end of file
index d572a408ee47b067239ad5eb8adb559a32269ec0..b28bc689d0ea50cbf96e0cca4caed2f72a8a03a5 100644 (file)
@@ -388,7 +388,10 @@ public class OpenStudy extends OpenObject implements OpenStudyServices {
                        popup = ApplicationSettings.getPopupMenu("steditable");
                        popup.setContext("study", new StudyRights(cuser, mystudy));
                }
-               ustep.setActor(cuser);
+               //ustep = getProjectElementService().getFirstStep(mystudy);
+               if (ustep != null) {
+                       ustep.setActor(cuser);
+               }
                urightstudy = new StudyRights(cuser, mystudy);
                urightstep = new StepRights(cuser, ustep);
        }
@@ -573,4 +576,12 @@ public class OpenStudy extends OpenObject implements OpenStudyServices {
        public void setDocumentService(DocumentService documentService) {
                _documentService = documentService;
        }
+       
+       public Study getMystudy() {
+               return mystudy;
+       }
+
+       public void setMystudy(Study mystudy) {
+               this.mystudy = mystudy;
+       }
 }
\ No newline at end of file
index 60bf70fdb2727ac0e7bc30052ee880a43a0f7387..009f8c03f00b429121e5c1d4aef01d6ac11b70e3 100644 (file)
@@ -47,6 +47,12 @@ public class SearchKnowledgeAction extends SearchBaseAction {
         * Injected user service.
         */
        private UserService _userService;
+       
+       /**
+        * Value of the menu property. 
+        * It can be: none, create, open, study, knowledge, sysadmin, help.
+        */
+       private String _menuProperty;
 
        // ==============================================================================================================================
        // Action methods
@@ -58,6 +64,10 @@ public class SearchKnowledgeAction extends SearchBaseAction {
         * @return SUCCESS if succeeded, ERROR if doSearch() is failed
         */
        public String doInitialize() {
+               
+               setMenuProperty("open");
+               initializationScreenContext(_menuProperty);
+               
                try {
                        loadFilter();
                        doSearch();
@@ -78,6 +88,9 @@ public class SearchKnowledgeAction extends SearchBaseAction {
 
        protected String doSearch() throws InvalidPropertyException {
                // ----------------------------
+               setMenuProperty("open");
+               initializationScreenContext(_menuProperty);
+               
                Map<String, Object> session = getSession();
                User user = getConnectedUser();
 
@@ -322,4 +335,20 @@ public class SearchKnowledgeAction extends SearchBaseAction {
        public void setUserService(UserService userService) {
                _userService = userService;
        }
+       
+       /**
+        * Get the menuProperty.
+        * @return the menuProperty
+        */
+       public String getMenuProperty() {
+               return _menuProperty;
+       }
+
+       /**
+        * Set the menuProperty.
+        * @param menuProperty the menuProperty to set
+        */
+       public void setMenuProperty(String menuProperty) {
+               this._menuProperty = menuProperty;
+       }
 }
\ No newline at end of file
index e6e8c06ff0a9dfcb1f2492b5916c2c041da83efd..68fcef2a8a7432802ebac92e166912c532936e38 100644 (file)
@@ -44,6 +44,12 @@ public class SearchStudyAction extends SearchBaseAction {
         * Injected user service.
         */
        private UserService _userService;
+       
+       /**
+        * Value of the menu property. 
+        * It can be: none, create, open, study, knowledge, sysadmin, help.
+        */
+       private String _menuProperty;
 
        /**
         * Serial version ID.
@@ -70,11 +76,18 @@ public class SearchStudyAction extends SearchBaseAction {
                        // Final initialization of the form
                        setCandidates();
                        setContextTypeOptions(getInvolvedContexts());
+                       
+                       setMenuProperty("open");
+                       initializationScreenContext(_menuProperty);
 
                        return SUCCESS;
                } catch (Exception error) {
                        // No need to roll back the transaction as it is read only
                        logger.error("Reason: ", error);
+                       
+                       setMenuProperty("none");
+                       initializationScreenContext(_menuProperty);
+                       
                        return ERROR;
                }
        }
@@ -324,4 +337,20 @@ public class SearchStudyAction extends SearchBaseAction {
        public void setUserService(UserService userService) {
                _userService = userService;
        }
+       
+       /**
+        * Get the menuProperty.
+        * @return the menuProperty
+        */
+       public String getMenuProperty() {
+               return _menuProperty;
+       }
+
+       /**
+        * Set the menuProperty.
+        * @param menuProperty the menuProperty to set
+        */
+       public void setMenuProperty(String menuProperty) {
+               this._menuProperty = menuProperty;
+       }
 }
\ No newline at end of file
index ae892fb3b517ff941cd37ea121fd76c0c6609eec..8e075b4ea35bd4a0ab6380ab16cd5d7939d81efb 100644 (file)
@@ -20,6 +20,13 @@ public class StartAction extends Action implements ServletRequestAware {
 
        private ProjectSettingsService _projectSettingsService;
        private ApplicationSettings _ApplicationSettings;
+       
+       /**
+        * Value of the menu property. 
+        * It can be: none, create, open, study, knowledge, sysadmin, help.
+        */
+       private String _menuProperty;
+
        /**
         * Serial version ID.
         */
@@ -56,10 +63,18 @@ public class StartAction extends Action implements ServletRequestAware {
                session.put("knowledge.filter", wapp.getFilter("knowledge"));
 
 //         transax.commit();
+           
+               setMenuProperty("none");
+               initializationScreenContext(_menuProperty);
+           
            return SUCCESS;
       }
       catch (Exception error) {
         logger.fatal("Reason:", error);
+        
+        setMenuProperty("study");
+               initializationScreenContext(_menuProperty);
+        
         return ERROR;
       }
        }
@@ -104,4 +119,20 @@ public class StartAction extends Action implements ServletRequestAware {
        public void setApplicationSettings(ApplicationSettings applicationSettings) {
                _ApplicationSettings = applicationSettings;
        }
+       
+       /**
+        * Get the menuProperty.
+        * @return the menuProperty
+        */
+       public String getMenuProperty() {
+               return _menuProperty;
+       }
+
+       /**
+        * Set the menuProperty.
+        * @param menuProperty the menuProperty to set
+        */
+       public void setMenuProperty(String menuProperty) {
+               this._menuProperty = menuProperty;
+       }
 }
\ No newline at end of file
index 07e84c455952d61b484f4c01ce3896ba2decd1f9..018497c9e5be133a852a04c7cf0827d00226a1de 100644 (file)
@@ -59,6 +59,12 @@ public class StudyPropertiesAction extends DisplayStudyStepAction {
         * Injected user service.
         */
        private UserService _userService;
+       
+       /**
+        * Value of the menu property. 
+        * It can be: none, create, open, study, knowledge, sysadmin, help.
+        */
+       private String _menuProperty;
 
        /**
         * Save operation type enumeration pointing which section of properties has been edited.
@@ -111,11 +117,16 @@ public class StudyPropertiesAction extends DisplayStudyStepAction {
                member = getStudyService().getContributors(study);
                staff = null;
                validor = null;
+               
+               setMenuProperty("study");
+               initializationScreenContext(_menuProperty);
 
-               if (mystudy.isOpenForWriting() && user.canEditProperties())
+               if (mystudy.isOpenForWriting() && user.canEditProperties()) {                   
                        return "edit";
-               else
+               }
+               else {
                        return "display";
+               }
        }
 
        public String doEditTitle() {
@@ -145,6 +156,10 @@ public class StudyPropertiesAction extends DisplayStudyStepAction {
                other = null;
 
 //             transax.commit();
+               
+               setMenuProperty("study");
+               initializationScreenContext(_menuProperty);
+               
                return SUCCESS;
        }
 
@@ -182,6 +197,10 @@ public class StudyPropertiesAction extends DisplayStudyStepAction {
                                i.remove();
                }
 //             transax.commit();
+               
+               setMenuProperty("study");
+               initializationScreenContext(_menuProperty);
+               
                return SUCCESS;
        }
 
@@ -225,6 +244,10 @@ public class StudyPropertiesAction extends DisplayStudyStepAction {
                        }
                }
 //             transax.commit();
+               
+               setMenuProperty("study");
+               initializationScreenContext(_menuProperty);
+               
                return SUCCESS;
        }
 
@@ -302,6 +325,7 @@ public class StudyPropertiesAction extends DisplayStudyStepAction {
 //             transax.commit();
 
                doInitialize(); // Re-initialization following the above edition
+               
                return SUCCESS;
        }
 
@@ -471,4 +495,20 @@ public class StudyPropertiesAction extends DisplayStudyStepAction {
        public void setUserService(UserService userService) {
                _userService = userService;
        }
+       
+       /**
+        * Get the menuProperty.
+        * @return the menuProperty
+        */
+       public String getMenuProperty() {
+               return _menuProperty;
+       }
+
+       /**
+        * Set the menuProperty.
+        * @param menuProperty the menuProperty to set
+        */
+       public void setMenuProperty(String menuProperty) {
+               this._menuProperty = menuProperty;
+       }
 }
\ No newline at end of file
index ad513195f7bb45f8eb49288f071b6a8c17cd29ad..4505ed2c653aab9bae282b19d27727b2ac22ef9a 100644 (file)
@@ -20,6 +20,12 @@ public class UploadAction extends Action {
         * Injected repository service.
         */
        private RepositoryService _repositoryService;
+       
+       /**
+        * Value of the menu property. 
+        * It can be: none, create, open, study, knowledge, sysadmin, help.
+        */
+       private String _menuProperty;
 
        private static final long serialVersionUID = 6003880772275115923L;
 
@@ -31,11 +37,17 @@ public class UploadAction extends Action {
 
     public String doInitialize () {
 //  -----------------------------
+       setMenuProperty("study");
+               initializationScreenContext(_menuProperty);
+               
       return SUCCESS;
     }
 
     public String doUpload () {
 //  -------------------------
+      setMenuProperty("study");
+      initializationScreenContext(_menuProperty);
+      
       if (action == ToDo.cancel) return "cancel";
       try {
        File    udir = getRepositoryService().getDownloadDirectory(getConnectedUser());
@@ -46,9 +58,18 @@ public class UploadAction extends Action {
        if (file.exists())  file.delete();
        Do.copy(upload, file);
         logger.info("Uploading \"" + uploadFileName + "\" " + uploadMimeType + " file.");
+        /*if (next == null || next.isEmpty()) {
+               next = "import";
+        }*/
+        
+        logger.info("MKA next = " + next);
         return next;
       }
       catch (OutOfMemoryError error) {
+         
+       setMenuProperty("none");
+               initializationScreenContext(_menuProperty);
+               
        return "outofmemory";
       }
       catch (Exception error) {
@@ -117,4 +138,20 @@ public class UploadAction extends Action {
        public void setRepositoryService(RepositoryService repositoryService) {
                _repositoryService = repositoryService;
        }
+       
+       /**
+        * Get the menuProperty.
+        * @return the menuProperty
+        */
+       public String getMenuProperty() {
+               return _menuProperty;
+       }
+
+       /**
+        * Set the menuProperty.
+        * @param menuProperty the menuProperty to set
+        */
+       public void setMenuProperty(String menuProperty) {
+               this._menuProperty = menuProperty;
+       }
 }
\ No newline at end of file
diff --git a/Workspace/Siman/src/org/splat/simer/UploadStudyAction.java b/Workspace/Siman/src/org/splat/simer/UploadStudyAction.java
new file mode 100644 (file)
index 0000000..b6d1994
--- /dev/null
@@ -0,0 +1,50 @@
+/*****************************************************************************
+ * Company         EURIWARE
+ * Application     SIMAN
+ * File            $Id$ 
+ * Creation date   24.10.2012
+ * @author         Author: Maria KRUCHININA
+ * @version        Revision: 
+ *****************************************************************************/
+
+package org.splat.simer; 
+
+/**
+ * Action class for uploading the study.
+ * @author Maria KRUCHININA
+ *
+ */
+public class UploadStudyAction extends Action {
+
+       /**
+        * Value of the menu property. 
+        * It can be: none, create, open, study, knowledge, sysadmin, help.
+        */
+       private String _menuProperty;
+
+       private static final long serialVersionUID = 6003880772275115924L;
+       
+       public String doInitialize () {
+
+           setMenuProperty("study");
+               initializationScreenContext(_menuProperty);
+                       
+       return SUCCESS;
+       }
+       
+       /**
+        * Get the menuProperty.
+        * @return the menuProperty
+        */
+       public String getMenuProperty() {
+               return _menuProperty;
+       }
+
+       /**
+        * Set the menuProperty.
+        * @param menuProperty the menuProperty to set
+        */
+       public void setMenuProperty(String menuProperty) {
+               this._menuProperty = menuProperty;
+       }
+}
index 1b02a876e626e75fb7267f229a15f2a054b82046..cd89a60733035822806e61d1a215001600ec8fd4 100644 (file)
@@ -46,6 +46,11 @@ public class VersionDocumentAction extends UploadBaseNextAction {
         * Injected repository service.
         */
        private RepositoryService _repositoryService;
+       /**
+        * Value of the menu property. 
+        * It can be: none, create, open, study, knowledge, sysadmin, help.
+        */
+       private String _menuProperty;
 
        /**
         * Serial version ID.
@@ -58,6 +63,10 @@ public class VersionDocumentAction extends UploadBaseNextAction {
 
        public String doInitialize() {
                // -----------------------------
+               
+               setMenuProperty("study");
+           initializationScreenContext(_menuProperty);
+           
                Session connex = Database.getCurSession();
                Transaction transax = connex.beginTransaction();
                User user = getConnectedUser();
@@ -134,6 +143,9 @@ public class VersionDocumentAction extends UploadBaseNextAction {
 
        public String doVersion() {
                // -------------------------
+               setMenuProperty("study");
+           initializationScreenContext(_menuProperty);
+           
                if (action == ToDo.cancel)
                        return "cancel";
 
@@ -370,4 +382,20 @@ public class VersionDocumentAction extends UploadBaseNextAction {
        public void setRepositoryService(RepositoryService repositoryService) {
                _repositoryService = repositoryService;
        }
+       
+       /**
+        * Get the menuProperty.
+        * @return the menuProperty
+        */
+       public String getMenuProperty() {
+               return _menuProperty;
+       }
+
+       /**
+        * Set the menuProperty.
+        * @param menuProperty the menuProperty to set
+        */
+       public void setMenuProperty(String menuProperty) {
+               this._menuProperty = menuProperty;
+       }
 }
\ No newline at end of file
index 0cdec2426423b065696bb1afcd59213b3c9585b1..8fb35f3c4d245e8c4fa000705880cd4a810c468f 100644 (file)
@@ -31,6 +31,12 @@ public class DatabaseIndexingAction extends Action {
         * Injected search service.
         */
        private SearchService _searchService;
+       
+       /**
+        * Value of the menu property. 
+        * It can be: none, create, open, study, knowledge, sysadmin, help.
+        */
+       private String _menuProperty;
 
        // ==============================================================================================================================
        // Action methods
@@ -43,6 +49,10 @@ public class DatabaseIndexingAction extends Action {
        public String doInitialize() {
                newstudies = getSearchService().selectStudies();
                indices = "";
+               
+               setMenuProperty("sysadmin");
+               initializationScreenContext(_menuProperty);
+               
                return SUCCESS;
        }
 
@@ -108,4 +118,20 @@ public class DatabaseIndexingAction 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(String menuProperty) {
+               this._menuProperty = menuProperty;
+       }
 }
\ No newline at end of file
index 14f772ddaf7fc0aa4a463439eb3fc675dbb03de3..e9e04ac108b63e57081f26608c6bdf859edb5828 100644 (file)
@@ -32,6 +32,12 @@ public class ImportUserAction extends UploadBaseNextAction {
         * Injected user service.
         */
        private UserService _userService;
+       
+       /**
+        * Value of the menu property. 
+        * It can be: none, create, open, study, knowledge, sysadmin, help.
+        */
+       private String _menuProperty;
 
 //  ==============================================================================================================================
 //  Action methods
@@ -51,13 +57,17 @@ public class ImportUserAction extends UploadBaseNextAction {
           i.remove();                                // Just for not showing the corresponding reserved username
           break;
         }
+        
+        setMenuProperty("sysadmin");
+        initializationScreenContext(_menuProperty);
+        
         return SUCCESS;
       }
       catch (Exception error) {
         return ERROR;          
       }
     }
-
+    
 //  ==============================================================================================================================
 //  Getters
 //  ==============================================================================================================================
@@ -103,4 +113,20 @@ public class ImportUserAction extends UploadBaseNextAction {
        public void setUserService(UserService userService) {
                _userService = userService;
        }
+       
+       /**
+        * Get the menuProperty.
+        * @return the menuProperty
+        */
+       public String getMenuProperty() {
+               return _menuProperty;
+       }
+
+       /**
+        * Set the menuProperty.
+        * @param menuProperty the menuProperty to set
+        */
+       public void setMenuProperty(String menuProperty) {
+               this._menuProperty = menuProperty;
+       }
 }
\ No newline at end of file
index e23007a57e4c9bd09148bbfe40d8447a7813a36d..78dd1492c651e099d60b9421eb39d9513e1be5c4 100644 (file)
@@ -38,6 +38,10 @@ http://www.springframework.org/schema/context/spring-context-3.0.xsd">
                <property name="projectSettings" ref="projectSettings" />
                <property name="documentTypeService" ref="documentTypeService" />
        </bean>
+       
+       <bean id="menuBarSettings"
+               class="org.splat.simer.MenuBarSettings" scope="session">
+       </bean>
 
        <bean id="slidMenu" scope="session" abstract="true">
                <property name="projectElementService"
@@ -81,6 +85,7 @@ http://www.springframework.org/schema/context/spring-context-3.0.xsd">
                scope="prototype" abstract="true">
                <property name="openStudy" ref="openStudy" />
                <property name="openKnowledge" ref="openKnowledge" />
+               <property name="menuBarSettings" ref="menuBarSettings" />
        </bean>
 
        <!--========= Inherited from baseAction ========= -->
@@ -171,12 +176,12 @@ http://www.springframework.org/schema/context/spring-context-3.0.xsd">
        <!-- End of Inherited from displayStudyStepAction -->
 
        <bean id="startAction" class="org.splat.simer.StartAction"
-               scope="prototype">
+               scope="prototype" parent ="baseAction">
                <property name="applicationSettings" ref="applicationSettings" />
                <property name="projectSettings" ref="projectSettings" />
        </bean>
        <bean id="connectionAction" class="org.splat.simer.ConnectionAction"
-               scope="prototype">
+               scope="prototype" parent ="baseAction">
        </bean>
 
        <bean id="menuAction" class="org.splat.simer.MenuAction"
@@ -184,11 +189,13 @@ http://www.springframework.org/schema/context/spring-context-3.0.xsd">
        </bean>
 
        <bean id="notYetImplementedAction"
-               class="org.splat.simer.NotYetImplementedAction" scope="prototype">
+               class="org.splat.simer.NotYetImplementedAction" 
+               scope="prototype" parent ="baseAction">
        </bean>
 
        <bean id="searchStudyAction"
-               class="org.splat.simer.SearchStudyAction" scope="prototype">
+               class="org.splat.simer.SearchStudyAction" 
+               scope="prototype" parent ="baseAction">
                <property name="projectSettings" ref="projectSettings" />
                <property name="searchService" ref="searchService" />
                <property name="simulationContextService"
@@ -197,7 +204,8 @@ http://www.springframework.org/schema/context/spring-context-3.0.xsd">
        </bean>
 
        <bean id="searchKnowledgeAction"
-               class="org.splat.simer.SearchKnowledgeAction" scope="prototype">
+               class="org.splat.simer.SearchKnowledgeAction" 
+               scope="prototype" parent ="baseAction">
                <property name="searchService" ref="searchService" />
                <property name="simulationContextService"
                        ref="simulationContextService" />
@@ -211,18 +219,24 @@ http://www.springframework.org/schema/context/spring-context-3.0.xsd">
        </bean>
 
        <bean id="displayKnowledgeAction"
-               class="org.splat.simer.DisplayKnowledgeAction" scope="prototype">
+               class="org.splat.simer.DisplayKnowledgeAction" 
+               scope="prototype"  parent ="baseAction">
                <property name="knowledgeElementService"
                        ref="knowledgeElementService" />
        </bean>
 
        <bean id="uploadAction" class="org.splat.simer.UploadAction"
-               scope="prototype">
+               scope="prototype" parent ="baseAction">
                <property name="repositoryService" ref="repositoryService" />
        </bean>
+       
+       <bean id="uploadStudyAction" class="org.splat.simer.UploadStudyAction"
+               scope="prototype" parent ="baseAction">
+       </bean>
 
        <bean id="versionDocumentAction"
-               class="org.splat.simer.VersionDocumentAction" scope="prototype">
+               class="org.splat.simer.VersionDocumentAction" 
+               scope="prototype" parent ="baseAction">
                <property name="projectSettings" ref="projectSettings" />
                <property name="publicationService" ref="publicationService" />
                <property name="stepService" ref="stepService" />
@@ -231,12 +245,13 @@ http://www.springframework.org/schema/context/spring-context-3.0.xsd">
 
        <bean id="databaseIndexingAction"
                class="org.splat.simer.admin.DatabaseIndexingAction"
-               scope="prototype">
+               scope="prototype" parent ="baseAction">
                <property name="searchService" ref="searchService" />
        </bean>
 
        <bean id="importUserAction"
-               class="org.splat.simer.admin.ImportUserAction" scope="prototype">
+               class="org.splat.simer.admin.ImportUserAction" 
+               scope="prototype" parent="baseAction">
                <property name="repositoryService" ref="repositoryService" />
                <property name="userService" ref="userService" />
        </bean>