Salome HOME
Pop-up menus updated in accordance with the functional specification
authormka <mka@opencascade.com>
Mon, 3 Dec 2012 07:32:04 +0000 (07:32 +0000)
committermka <mka@opencascade.com>
Mon, 3 Dec 2012 07:32:04 +0000 (07:32 +0000)
Workspace/Siman-Common/src/org/splat/som/DocumentRights.java
Workspace/Siman/WebContent/jsp/menubar.jsp
Workspace/Siman/src/org/splat/simer/ApplicationSettings.java
Workspace/Siman/src/org/splat/simer/NewScenarioAction.java

index dfe1cf4e004d1c613df3db044f4d72173bf9eb6e..6b50fe0520b1ccb27ee4e96ddc9e645f5a8bb052 100644 (file)
@@ -415,7 +415,14 @@ public class DocumentRights {
        if (_isauthor) {
                        return true;
                }
-      }
+      //MKA TODO:
+      //Will be returned when "Version the external document" functionality is implemented
+      /*else 
+      if (state == ProgressState.EXTERN) {
+       if (_isauthor || _user.equals(manager)) {
+               return true;
+       }*/
+      }   
       return false;
  }
 
index ff3d1120b5481842d26cd4f9d8258638a303f92d..dce6d5193b7d2404da7f1277d4e652e4bc8a809d 100644 (file)
@@ -26,7 +26,7 @@
        <s:param name="menu">sysadmin</s:param>
 </s:url>
 <s:url id="site" value="%{menuBarSettings.webSiteURL}" />
-<s:url id="help" value="%{menuBarSettings.helpURL}"></s:url>
+<s:url id="help" value="%{menuBarSettings.helpURL}" />
 
 <!-- Display of the menu-bar
   -->
index 0445fc5718844df2286b80e769e837b62555a258..cd4e68e5a05e5a35faf9b3302bd2f2c67ec8c4f1 100644 (file)
@@ -228,7 +228,11 @@ public class ApplicationSettings {
        /**
         * Rename menu item name.
         */
-       private static final String MNU_NAME_RENAME = "menu.rename";
+       private static final String MNU_NAME_RENAME = "menu.rename";    
+       /**
+        * Publish menu item name.
+        */
+       private static final String MNU_MARK_AS_REFERENCE = "menu.markasreference";
        /**
         * Not yet implemented action name.
         */
@@ -315,10 +319,10 @@ public class ApplicationSettings {
                                        "select?menu=create&item=new-empty");
                        addItem("new-copy", new MenuItem("menu.new.copy")
                                        .icon("image.copy.png"));
-                       addItem("new-instance", new MenuItem("menu.new.instance")
+                       /*addItem("new-instance", new MenuItem("menu.new.instance")
                                        .icon(IMG_HOLD));
                        addItem("new-import", new MenuItem("menu.new.import")
-                                       .icon("icon.upload.png"));
+                                       .icon("icon.upload.png"));*/
                        this.selects("new-empty");
                }
        }
@@ -385,24 +389,27 @@ public class ApplicationSettings {
 
                private EditableStudyPopup() {
                        super();
+                       addItem(MNU_MARK_AS_REFERENCE, new PopupItem(MNU_MARK_AS_REFERENCE)
+                                       .action(ACT_NOT_YET_IMPLEMENTED)
+                                       .confirmation("message.markasreference.study"));
                        addItem(MNU_PUBLISH, new PopupItem(MNU_NAME_PUBLISH).icon(
                                        "image.publish.png").action("edit-study?action=publish")
                                        .confirmation("message.publish.study"));
-                       addItem(MNU_PROMOTE, new PopupItem("menu.archive"));
+                       /*addItem(MNU_PROMOTE, new PopupItem("menu.archive"));*/
                        addSeparator();
                        addItem(MNU_EDIT, new PopupItem("menu.properties").icon(
                                        "icon.ed.png").action("../select?menu=properties"));
                        addSeparator();
                        addItem(MNU_SCRIPT, new PopupItem(MNU_NAME_SCRIPT)
                                        .action("add-scenario"));
-                       addItem(MNU_VERSION, new PopupItem(MNU_NAME_VERSION).icon(
-                                       IMG_VERSION).action(ACT_NOT_YET_IMPLEMENTED));
+                       /*addItem(MNU_VERSION, new PopupItem(MNU_NAME_VERSION).icon(
+                                       IMG_VERSION).action(ACT_NOT_YET_IMPLEMENTED));*/
                        addSeparator();
-                       addItem(MNU_PURGE, new PopupItem(MNU_NAME_PURGE)
+                       /*addItem(MNU_PURGE, new PopupItem(MNU_NAME_PURGE)
                                        .confirmation("message.purge.study"));
                        addItem("export", new PopupItem("menu.export")
                                        .icon("image.export.png")); // For future needs
-                       addItem(MNU_REMOVE, new PopupItem(MNU_NAME_REMOVE).icon(IMG_DELETE)
+*/                     addItem(MNU_REMOVE, new PopupItem(MNU_NAME_REMOVE).icon(IMG_DELETE)
                                        .action(ACT_NOT_YET_IMPLEMENTED).confirmation(
                                                        "message.delete.study"));
                }
@@ -681,7 +688,7 @@ public class ApplicationSettings {
         */
        private static class ApprovedPopup extends PopupMenu {
                private ApprovedPopup() {
-                       super();
+                       super(); 
                        addItem(MNU_ATTACH, new PopupItem(MNU_NAME_ATTACH).icon(IMG_ATTACH)
                                        .action(ACT_ATTACH));
                        addSeparator();
@@ -700,6 +707,10 @@ public class ApplicationSettings {
                        super();
                        addItem(MNU_RENAME, new PopupItem(MNU_NAME_RENAME)
                                        .action("edit-document?action=renameDocument"));
+                       addSeparator();
+                       addItem(MNU_VERSION, new PopupItem(MNU_NAME_VERSION).icon(
+                                       IMG_VERSION).action(ACT_VERSION));
+                       addSeparator();
                        addItem("replace", new PopupItem("menu.replace").icon(
                                        "image.replace.png").action(
                                        "select-file?nextAction=replace"));
@@ -718,6 +729,9 @@ public class ApplicationSettings {
                                        case rename:
                                                res = _user.canRename();
                                                break;
+                                       case version:
+                                               res = _user.canVersion();
+                                               break;  
                                        case replace:
                                                res = _user.canReplace();
                                                break;
index 024b5fd345a8569654fc35642d86648761c7a7ac..e93a67d1e11a3452a2a301c5986e264f740db364 100644 (file)
@@ -5,16 +5,12 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.ResourceBundle;
 
-import org.hibernate.HibernateException;
-import org.hibernate.Session;
-import org.hibernate.Transaction;
-import org.splat.dal.dao.som.Database;
 import org.splat.dal.bo.som.Publication;
 import org.splat.dal.bo.som.Scenario;
+import org.splat.dal.bo.som.Study;
 import org.splat.service.ProjectElementService;
 import org.splat.service.ScenarioService;
 import org.splat.som.Step;
-import org.splat.dal.bo.som.Study;
 import org.splat.wapp.Menu;
 
 
@@ -318,7 +314,7 @@ public class NewScenarioAction extends Action {
 
        /**
         * Set the _titleProperty.
-        * @param _titleProperty the titleProperty to set
+        * @param titleProperty the titleProperty to set
         */
        public void setTitleProperty(final String titleProperty) {
                _titleProperty = titleProperty;
@@ -334,10 +330,10 @@ public class NewScenarioAction extends Action {
 
        /**
         * Set the _editDisabledProperty.
-        * @param _editDisabledProperty the _editDisabledProperty to set
+        * @param editDisabledProperty the editDisabledProperty to set
         */
-       public void setEditDisabledProperty(final String _editDisabledProperty) {
-               this._editDisabledProperty = _editDisabledProperty;
+       public void setEditDisabledProperty(final String editDisabledProperty) {
+               _editDisabledProperty = editDisabledProperty;
        }
        
        /**