From 205d00dde91e1c1b924c12f329ddb38940f0cb3b Mon Sep 17 00:00:00 2001 From: mka Date: Mon, 3 Dec 2012 07:32:04 +0000 Subject: [PATCH] Pop-up menus updated in accordance with the functional specification --- .../src/org/splat/som/DocumentRights.java | 9 +++++- Workspace/Siman/WebContent/jsp/menubar.jsp | 2 +- .../org/splat/simer/ApplicationSettings.java | 32 +++++++++++++------ .../org/splat/simer/NewScenarioAction.java | 14 +++----- 4 files changed, 37 insertions(+), 20 deletions(-) diff --git a/Workspace/Siman-Common/src/org/splat/som/DocumentRights.java b/Workspace/Siman-Common/src/org/splat/som/DocumentRights.java index dfe1cf4..6b50fe0 100644 --- a/Workspace/Siman-Common/src/org/splat/som/DocumentRights.java +++ b/Workspace/Siman-Common/src/org/splat/som/DocumentRights.java @@ -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; } diff --git a/Workspace/Siman/WebContent/jsp/menubar.jsp b/Workspace/Siman/WebContent/jsp/menubar.jsp index ff3d112..dce6d51 100644 --- a/Workspace/Siman/WebContent/jsp/menubar.jsp +++ b/Workspace/Siman/WebContent/jsp/menubar.jsp @@ -26,7 +26,7 @@ sysadmin - + diff --git a/Workspace/Siman/src/org/splat/simer/ApplicationSettings.java b/Workspace/Siman/src/org/splat/simer/ApplicationSettings.java index 0445fc5..cd4e68e 100644 --- a/Workspace/Siman/src/org/splat/simer/ApplicationSettings.java +++ b/Workspace/Siman/src/org/splat/simer/ApplicationSettings.java @@ -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; diff --git a/Workspace/Siman/src/org/splat/simer/NewScenarioAction.java b/Workspace/Siman/src/org/splat/simer/NewScenarioAction.java index 024b5fd..e93a67d 100644 --- a/Workspace/Siman/src/org/splat/simer/NewScenarioAction.java +++ b/Workspace/Siman/src/org/splat/simer/NewScenarioAction.java @@ -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; } /** -- 2.39.2