From: rkv Date: Mon, 26 Nov 2012 08:48:05 +0000 (+0000) Subject: Applet is working now and calls runSalome with appropriate parameters. New ant target... X-Git-Tag: Root_Delivery1_2012_12_06~41 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=022b1132c1bb379b4408d335c50b20477784d9c7;p=tools%2Fsiman.git Applet is working now and calls runSalome with appropriate parameters. New ant target "launcher" is introduced to generate the unsigned applet jar. --- diff --git a/Workspace/Siman/WebContent/conf/my.xml b/Workspace/Siman/WebContent/conf/my.xml index 38f8d2c..8becf05 100644 --- a/Workspace/Siman/WebContent/conf/my.xml +++ b/Workspace/Siman/WebContent/conf/my.xml @@ -6,8 +6,8 @@ - - + + diff --git a/Workspace/Siman/WebContent/jap/psw.txt b/Workspace/Siman/WebContent/jap/psw.txt new file mode 100644 index 0000000..89f76d0 --- /dev/null +++ b/Workspace/Siman/WebContent/jap/psw.txt @@ -0,0 +1 @@ +launcher \ No newline at end of file diff --git a/Workspace/Siman/WebContent/jap/signlauncher.bat b/Workspace/Siman/WebContent/jap/signlauncher.bat new file mode 100644 index 0000000..bdb1f75 --- /dev/null +++ b/Workspace/Siman/WebContent/jap/signlauncher.bat @@ -0,0 +1,5 @@ +set path=%path%;"C:\Program Files\Java\jdk1.6.0_20\bin" + +delete splat-signedlauncher.jar + +jarsigner -verbose -keystore launcherkeystore -signedjar splat-signedlauncher.jar splat-launcher.jar launcheralias <%@ page import="org.splat.som.StepRights"%> <%@ page import="org.splat.simer.OpenStudy"%> +<%@ page import="org.splat.simer.Action"%> <%@ page import="org.splat.wapp.ToolBar"%> <%@ page import="org.splat.wapp.ToolButton"%> <%@ page import="java.util.Iterator"%> +<%@page import="com.opensymphony.xwork2.ActionContext"%> <%@ taglib prefix="s" uri="/struts-tags" %> @@ -42,22 +44,37 @@ " border="none" /> <% OpenStudy study = (OpenStudy)session.getAttribute("study.open"); ToolBar mbar = study.getModuleBar(); + Action anAction = (Action)ActionContext.getContext().getActionInvocation().getAction(); + if (study.getSelectedStepRights().canCreateDocument() && mbar != null) { %> - height=<%=mbar.getHeight()%>> + height=<%=mbar.getHeight()%>> <% Iterator item = mbar.asList().iterator(); for (int i=0; item.hasNext(); i++) { - ToolButton tool = item.next(); + ToolButton tool = item.next(); String arg = tool.getArgument(); %> -<% if (arg != null) { +<% + if ("runSalome".equals(tool.getAction())) { + // --siman --siman-study=s --siman-scenario=sc --siman-user=u -k + arg = "--siman --siman-study=" + study.getIndex() + + " --siman-scenario=" + study.getSelectedScenarioId() + + " --siman-user=" + anAction.getConnectedUser().getUsername() + + " -k"; + } + if (arg != null) { %> -<% } +<% } } %> <% } -%> +%> + + + + " border="none" title="" /> diff --git a/Workspace/Siman/applet_howto.txt b/Workspace/Siman/applet_howto.txt new file mode 100644 index 0000000..0c0a694 --- /dev/null +++ b/Workspace/Siman/applet_howto.txt @@ -0,0 +1,90 @@ +set path=%path%;C:\Program Files\Java\jdk1.6.0_03\bin + + +D:\users\rkv\SIMAN\SIMAN_SRC\Workspace\Siman\build\classes> +set path=%path%;"C:\Program Files\Java\jdk1.6.0_20\bin" + +C:\work\Siman\SIMAN_SRC\Workspace\Siman\build\classes> +jar cvf splat-launcher.jar org\splat\launcher\*.class + + +cd ..\..\WebContent\jap + +jarsigner -verbose -keystore launcherkeystore -signedjar splat-signedlauncher.jar splat-launcher.jar launcheralias + + + +For creation the applet please use the following java methods : + + //To get the SALOME_HOME environment variable + String SALOME_HOME = System.getenv("SALOME_ROOT_DIR"); + + If SALOME_ROOT_DIR does not exist the SALOME_HOME equals to _null_. + + //To execute the RunSalome script + Runtime runtime = Runtime.getRuntime(); + String pathToScript = SALOME_HOME+"\\runSalome" or pathToScript = SALOME_HOME+"runSalome" + + if (new File(pathToScript).exists()) { + Process process = runtime.exec(pathToScript); + } + + + + + + + + + + + +Dear Colleagues, + + + + Some more details about current procedure of SALOME running + + It probably will be updated in accordance with changes of SALOME directories + organizarion + + + + To check availability of SALOME environment, the applet should : + + - check existence of environment variable $SALOME_ROOT_DIR + + - check existence of environment file $SALOME_ROOT_DIR/env_build.sh + + - existence of run bash script $SALOME_ROOT_DIR/KERNEL/bin/salome/runSalome + + + + To run SALOME-SIMAN : + + - open bash shell + + bash + + - export SALOME environment variables + + . $SALOME_ROOT_DIR/env_build.sh + + - run bash shell script + + runSalome --siman --siman-study=s --siman-scenario=sc --siman-user=u -k + + + where : + + the SIMAN parameters are displayed as Title of the SALOME GUI Window + + "-k" is to kill previously run runSalome and all SALOME processes + + + + -- + + Best Regards, + + Alexander \ No newline at end of file diff --git a/Workspace/Siman/build.xml b/Workspace/Siman/build.xml index 1c35595..0cb3a8c 100644 --- a/Workspace/Siman/build.xml +++ b/Workspace/Siman/build.xml @@ -17,12 +17,29 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Workspace/Siman/src/hibernate.properties b/Workspace/Siman/src/hibernate.properties index 6c0cad6..326140a 100644 --- a/Workspace/Siman/src/hibernate.properties +++ b/Workspace/Siman/src/hibernate.properties @@ -1,4 +1,4 @@ -# Generated at 02/11/2012 05:50:20 +# Generated at 26/11/2012 09:23:45 # Don't edit manually. See the source in D:\users\rkv\SIMAN\SIMAN_SRC\Workspace\Siman\conf\templates. # Connection properties connection.driver_class=com.mysql.jdbc.Driver diff --git a/Workspace/Siman/src/jdbc.properties b/Workspace/Siman/src/jdbc.properties index 8404e7d..62a0c8b 100644 --- a/Workspace/Siman/src/jdbc.properties +++ b/Workspace/Siman/src/jdbc.properties @@ -1,4 +1,4 @@ -# Generated at 02/11/2012 05:50:20 +# Generated at 26/11/2012 09:23:45 # Don't edit manually. See the source in D:\users\rkv\SIMAN\SIMAN_SRC\Workspace\Siman\conf\templates. # Connection properties connection.url=jdbc:mysql://localhost/simer diff --git a/Workspace/Siman/src/org/splat/launcher/ToolbarApplet.java b/Workspace/Siman/src/org/splat/launcher/ToolbarApplet.java index c5bc176..183b0fe 100644 --- a/Workspace/Siman/src/org/splat/launcher/ToolbarApplet.java +++ b/Workspace/Siman/src/org/splat/launcher/ToolbarApplet.java @@ -4,18 +4,37 @@ import java.awt.ComponentOrientation; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.io.File; +import java.io.FileNotFoundException; import java.io.ObjectInputStream; import java.net.URL; import java.net.URLConnection; +/** + * Applet providing a set of buttons. Each button is defined by three parameters:
+ *
    + *
  • icon<i>
  • + *
  • tool<i>
  • + *
  • file<i>
  • - may be null + *
+ * where i is an index beginning from zero. + */ public class ToolbarApplet extends java.applet.Applet implements ActionListener { + /** + * Serialization version id. + */ private static final long serialVersionUID = 3243053622061086715L; // ============================================================================================================================== // Overridden functions // ============================================================================================================================== + /** + * {@inheritDoc} + * + * @see java.applet.Applet#init() + */ @Override public void init() { URL appurl = getCodeBase(); @@ -39,8 +58,12 @@ public class ToolbarApplet extends java.applet.Applet implements ActionListener applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + /** + * {@inheritDoc} + * + * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) + */ public void actionPerformed(final ActionEvent event) { - // ----------------------------------------------- if (event.getSource() instanceof ToolButton) { ToolButton clicked = (ToolButton) event.getSource(); String module = clicked.getTool(); @@ -53,8 +76,15 @@ public class ToolbarApplet extends java.applet.Applet implements ActionListener // Public member functions // ============================================================================================================================== + /** + * Launch an appropriate application for the given file. + * + * @param name + * module name + * @param filename + * file name + */ public void launch(final String name, final String filename) { - // ------------------------------------------------- String module = name; try { @@ -73,6 +103,53 @@ public class ToolbarApplet extends java.applet.Applet implements ActionListener } else // Opening an application on the local machine + + if (module.equals("runSalome")) { + // Run SALOME + // To get the SALOME_HOME environment variable + String SALOME_HOME = System.getenv("SALOME_ROOT_DIR"); + // If SALOME_ROOT_DIR does not exist the SALOME_HOME equals to null. + if (SALOME_HOME == null) { + // TODO: Use logger to be more user friendly + getAppletContext() + .showDocument( + new URL( + getCodeBase().toString() + + "error.jsp?message=launch&value=" + + "SALOME_ROOT_DIR environment variable is not defined."), + "_blank"); + throw new Exception( + "SALOME_ROOT_DIR nevironment variable is not defined."); + } else if (!SALOME_HOME.endsWith(File.separator)) { + SALOME_HOME += File.separator; + } + String pathToScript = SALOME_HOME + "runSalome"; + + File script = new File(pathToScript); + if (!script.exists()) { + script = new File(pathToScript + ".bat"); + if (!script.exists()) { + script = new File(pathToScript + ".cmd"); + } + } + + if (script.exists()) { + // Execute the runSalome script. + // filename here indeed a string containing parameters for runSalome. + Runtime.getRuntime().exec( + new String[] { script.getAbsolutePath(), filename }); + } else { + // TODO: Use logger to be more user friendly + getAppletContext().showDocument( + new URL(getCodeBase().toString() + + "error.jsp?message=launch&value=" + + "SALOME module is not found: " + + script.getAbsolutePath()), "_blank"); + throw new FileNotFoundException( + "SALOME module is not found: " + script.getAbsolutePath()); + } + } else + if (module.endsWith(".exe") || module.endsWith(".EXE")) { String applikey = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\Applications\\" + module; diff --git a/Workspace/Siman/src/org/splat/simer/AbstractOpenObject.java b/Workspace/Siman/src/org/splat/simer/AbstractOpenObject.java index a83ba4c..43a0391 100644 --- a/Workspace/Siman/src/org/splat/simer/AbstractOpenObject.java +++ b/Workspace/Siman/src/org/splat/simer/AbstractOpenObject.java @@ -216,6 +216,16 @@ public abstract class AbstractOpenObject implements Proxy { return _selection; } + public String getSelectedScenarioId() { + String res; + if (_selection == null) { + res = "0"; + } else { + res = _selection.substring(0, _selection.indexOf('.')); + } + return res; + } + public User getUser() { return _cuser; } diff --git a/Workspace/Siman/src/org/splat/simer/ApplicationSettings.java b/Workspace/Siman/src/org/splat/simer/ApplicationSettings.java index 9309647..0c30875 100644 --- a/Workspace/Siman/src/org/splat/simer/ApplicationSettings.java +++ b/Workspace/Siman/src/org/splat/simer/ApplicationSettings.java @@ -257,12 +257,12 @@ public class ApplicationSettings implements ServletContextAware { super("create"); addItem("new-empty", "menu.new.empty", "image.empty.png", "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") - .icon(IMG_HOLD)); - addItem("new-import", new MenuItem("menu.new.import") - .icon("icon.upload.png")); + addItem("new-copy", + new MenuItem("menu.new.copy").icon("image.copy.png")); + addItem("new-instance", + new MenuItem("menu.new.instance").icon(IMG_HOLD)); + addItem("new-import", + new MenuItem("menu.new.import").icon("icon.upload.png")); this.selects("new-empty"); } } @@ -274,8 +274,8 @@ public class ApplicationSettings implements ServletContextAware { "select?menu=search&item=search-study"); addItem("search-knowledge", "menu.search.idea", "image.idea.png", "select?menu=search&item=search-knowledge"); - addItem("search-document", new MenuItem("menu.search.document") - .icon("icon.any.png")); + addItem("search-document", + new MenuItem("menu.search.document").icon("icon.any.png")); this.selects("search-study"); } } @@ -303,8 +303,8 @@ public class ApplicationSettings implements ServletContextAware { "select?menu=datadmin&item=admin-scontext"); addItem("admin-knowelm", "menu.admin.knowledge", "image.idea.png", "select?menu=datadmin&item=admin-knowelm"); - addItem("admin-study", new MenuItem("menu.admin.study") - .icon("image.study.png")); + addItem("admin-study", + new MenuItem("menu.admin.study").icon("image.study.png")); } } @@ -329,26 +329,31 @@ public class ApplicationSettings implements ServletContextAware { private EditableStudyPopup() { super(); - addItem(MNU_PUBLISH, new PopupItem(MNU_NAME_PUBLISH).icon( - "image.publish.png").action("edit-study?action=publish") - .confirmation("message.publish.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")); addSeparator(); - addItem(MNU_EDIT, new PopupItem("menu.properties").icon( - "icon.ed.png").action("../select?menu=properties")); + 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_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)); addSeparator(); - 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) - .action(ACT_NOT_YET_IMPLEMENTED).confirmation( - "message.delete.study")); + 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) + .action(ACT_NOT_YET_IMPLEMENTED) + .confirmation("message.delete.study")); } @Override @@ -406,30 +411,36 @@ public class ApplicationSettings implements ServletContextAware { private EditableDocumentPopup() { super(); - addItem("accept", new PopupItem("menu.accept").icon( - "image.accept.png").action("setDocument?action=accept") - .confirmation("message.accept.document")); - addItem(MNU_PROMOTE, new PopupItem(MNU_NAME_PROMOTE).icon( - "image.publish.png").action("setDocument?action=promote") - .confirmation("message.promote.document")); + addItem("accept", + new PopupItem("menu.accept").icon("image.accept.png") + .action("setDocument?action=accept") + .confirmation("message.accept.document")); + addItem(MNU_PROMOTE, + new PopupItem(MNU_NAME_PROMOTE).icon("image.publish.png") + .action("setDocument?action=promote") + .confirmation("message.promote.document")); addSeparator(); - addItem(MNU_RENAME, new PopupItem(MNU_NAME_RENAME) - .action("edit-document?action=renameDocument")); + addItem(MNU_RENAME, + new PopupItem(MNU_NAME_RENAME) + .action("edit-document?action=renameDocument")); addItem(MNU_ATTACH, new PopupItem(MNU_NAME_ATTACH).icon(IMG_ATTACH) .action(ACT_ATTACH)); addSeparator(); - addItem(MNU_VERSION, new PopupItem(MNU_NAME_VERSION).icon( - IMG_VERSION).action(ACT_VERSION)); - addItem("replace", new PopupItem("menu.replace").icon( - "image.replace.png").action( - "select-file?nextAction=replace")); + addItem(MNU_VERSION, + new PopupItem(MNU_NAME_VERSION).icon(IMG_VERSION).action( + ACT_VERSION)); + addItem("replace", + new PopupItem("menu.replace").icon("image.replace.png") + .action("select-file?nextAction=replace")); addSeparator(); - addItem(MNU_PURGE, new PopupItem(MNU_NAME_PURGE).action( - ACT_NOT_YET_IMPLEMENTED).confirmation( - "message.purge.document")); - addItem(MNU_REMOVE, new PopupItem(MNU_NAME_REMOVE).icon(IMG_DELETE) - .action("remove-document").confirmation( - "message.delete.document")); + addItem(MNU_PURGE, + new PopupItem(MNU_NAME_PURGE).action( + ACT_NOT_YET_IMPLEMENTED).confirmation( + "message.purge.document")); + addItem(MNU_REMOVE, + new PopupItem(MNU_NAME_REMOVE).icon(IMG_DELETE) + .action("remove-document") + .confirmation("message.delete.document")); } @Override @@ -492,22 +503,26 @@ public class ApplicationSettings implements ServletContextAware { private ReviewableDocumentPopup() { super(); - addItem(MNU_DEMOTE, new PopupItem(MNU_NAME_DEMOTE).icon( - "image.demote.png").action("setDocument?action=demote") - .confirmation("message.demote.document")); - addItem(MNU_PROMOTE, new PopupItem("menu.review").icon( - "image.review.png").action("setDocument?action=review") - .confirmation("message.review.document")); + addItem(MNU_DEMOTE, + new PopupItem(MNU_NAME_DEMOTE).icon("image.demote.png") + .action("setDocument?action=demote") + .confirmation("message.demote.document")); + addItem(MNU_PROMOTE, + new PopupItem("menu.review").icon("image.review.png") + .action("setDocument?action=review") + .confirmation("message.review.document")); addSeparator(); addItem(MNU_ATTACH, new PopupItem(MNU_NAME_ATTACH).icon(IMG_ATTACH) .action(ACT_ATTACH)); addSeparator(); - addItem(MNU_VERSION, new PopupItem(MNU_NAME_VERSION).icon( - IMG_VERSION).action(ACT_VERSION)); + addItem(MNU_VERSION, + new PopupItem(MNU_NAME_VERSION).icon(IMG_VERSION).action( + ACT_VERSION)); addSeparator(); - addItem(MNU_PURGE, new PopupItem(MNU_NAME_PURGE).action( - ACT_NOT_YET_IMPLEMENTED).confirmation( - "message.purge.document")); + addItem(MNU_PURGE, + new PopupItem(MNU_NAME_PURGE).action( + ACT_NOT_YET_IMPLEMENTED).confirmation( + "message.purge.document")); } @Override @@ -551,22 +566,26 @@ public class ApplicationSettings implements ServletContextAware { private NotResultDocumentPopup() { super(); - addItem(MNU_DEMOTE, new PopupItem(MNU_NAME_DEMOTE).icon( - "image.demote.png").action("setDocument?action=demote") - .confirmation("message.demote.document")); + addItem(MNU_DEMOTE, + new PopupItem(MNU_NAME_DEMOTE).icon("image.demote.png") + .action("setDocument?action=demote") + .confirmation("message.demote.document")); addSeparator(); addItem(MNU_ATTACH, new PopupItem(MNU_NAME_ATTACH).icon(IMG_ATTACH) .action(ACT_ATTACH)); addSeparator(); - addItem(MNU_VERSION, new PopupItem(MNU_NAME_VERSION).icon( - IMG_VERSION).action(ACT_VERSION)); + addItem(MNU_VERSION, + new PopupItem(MNU_NAME_VERSION).icon(IMG_VERSION).action( + ACT_VERSION)); addSeparator(); - addItem(MNU_PURGE, new PopupItem(MNU_NAME_PURGE).action( - ACT_NOT_YET_IMPLEMENTED).confirmation( - "message.purge.document")); - addItem(MNU_REMOVE, new PopupItem(MNU_NAME_REMOVE).icon(IMG_DELETE) - .action("remove-document").confirmation( - "message.delete.document")); + addItem(MNU_PURGE, + new PopupItem(MNU_NAME_PURGE).action( + ACT_NOT_YET_IMPLEMENTED).confirmation( + "message.purge.document")); + addItem(MNU_REMOVE, + new PopupItem(MNU_NAME_REMOVE).icon(IMG_DELETE) + .action("remove-document") + .confirmation("message.delete.document")); } } @@ -578,16 +597,18 @@ public class ApplicationSettings implements ServletContextAware { private ApprovableDocumentPopup() { super(); - addItem("undo", new PopupItem(MNU_NAME_DEMOTE).icon( - "image.invalidate.png").action( - "setDocument?action=invalidate").confirmation( - "message.demote.document")); - addItem(MNU_DEMOTE, new PopupItem("menu.disapprove").icon( - "image.demote.png").action("setDocument?action=disapprove") - .confirmation("message.disapprove.document")); - addItem("approve", new PopupItem("menu.approve").icon( - "icon.APPROVED.png").action("setDocument?action=approve") - .confirmation("message.approve.document")); + addItem("undo", + new PopupItem(MNU_NAME_DEMOTE).icon("image.invalidate.png") + .action("setDocument?action=invalidate") + .confirmation("message.demote.document")); + addItem(MNU_DEMOTE, + new PopupItem("menu.disapprove").icon("image.demote.png") + .action("setDocument?action=disapprove") + .confirmation("message.disapprove.document")); + addItem("approve", + new PopupItem("menu.approve").icon("icon.APPROVED.png") + .action("setDocument?action=approve") + .confirmation("message.approve.document")); } @Override @@ -629,8 +650,9 @@ public class ApplicationSettings implements ServletContextAware { addItem(MNU_ATTACH, new PopupItem(MNU_NAME_ATTACH).icon(IMG_ATTACH) .action(ACT_ATTACH)); addSeparator(); - addItem(MNU_VERSION, new PopupItem(MNU_NAME_VERSION).icon( - IMG_VERSION).action(ACT_VERSION)); + addItem(MNU_VERSION, + new PopupItem(MNU_NAME_VERSION).icon(IMG_VERSION).action( + ACT_VERSION)); } } @@ -642,15 +664,17 @@ public class ApplicationSettings implements ServletContextAware { private ExternPopup() { super(); - addItem(MNU_RENAME, new PopupItem(MNU_NAME_RENAME) - .action("edit-document?action=renameDocument")); - addItem("replace", new PopupItem("menu.replace").icon( - "image.replace.png").action( - "select-file?nextAction=replace")); + addItem(MNU_RENAME, + new PopupItem(MNU_NAME_RENAME) + .action("edit-document?action=renameDocument")); + addItem("replace", + new PopupItem("menu.replace").icon("image.replace.png") + .action("select-file?nextAction=replace")); addSeparator(); - addItem(MNU_REMOVE, new PopupItem("menu.remove.document").icon( - IMG_DELETE).action("remove-document").confirmation( - "message.delete.document")); + addItem(MNU_REMOVE, + new PopupItem("menu.remove.document").icon(IMG_DELETE) + .action("remove-document") + .confirmation("message.delete.document")); } @Override @@ -689,14 +713,17 @@ public class ApplicationSettings implements ServletContextAware { private ScontextPopup() { super(); - addItem(MNU_RENAME, new PopupItem(MNU_NAME_RENAME) - .action("edit-context?action=renameContext")); - addItem(MNU_EDIT, new PopupItem(MNU_NAME_EDIT) - .action("edit-context?action=editContext")); + addItem(MNU_RENAME, + new PopupItem(MNU_NAME_RENAME) + .action("edit-context?action=renameContext")); + addItem(MNU_EDIT, + new PopupItem(MNU_NAME_EDIT) + .action("edit-context?action=editContext")); addSeparator(); - addItem(MNU_REMOVE, new PopupItem("menu.remove").icon(IMG_DELETE) - .action("remove-context").confirmation( - "message.delete.context")); + addItem(MNU_REMOVE, + new PopupItem("menu.remove").icon(IMG_DELETE) + .action("remove-context") + .confirmation("message.delete.context")); } @Override @@ -729,21 +756,26 @@ public class ApplicationSettings implements ServletContextAware { private FeedbexPopup() { super(); - addItem(MNU_PROMOTE, new PopupItem(MNU_NAME_PROMOTE).icon( - "image.review.png").action("promote-knowledge") - .confirmation("message.promote.knowledge")); - addItem(MNU_DEMOTE, new PopupItem(MNU_NAME_DEMOTE).icon( - "image.invalidate.png").action("demote-knowledge") - .confirmation("message.demote.knowledge")); + addItem(MNU_PROMOTE, + new PopupItem(MNU_NAME_PROMOTE).icon("image.review.png") + .action("promote-knowledge") + .confirmation("message.promote.knowledge")); + addItem(MNU_DEMOTE, + new PopupItem(MNU_NAME_DEMOTE).icon("image.invalidate.png") + .action("demote-knowledge") + .confirmation("message.demote.knowledge")); addSeparator(); - addItem(MNU_RENAME, new PopupItem(MNU_NAME_RENAME) - .action("edit-knowledge?action=renameKnowledge")); - addItem(MNU_EDIT, new PopupItem(MNU_NAME_EDIT) - .action("edit-knowledge?action=editKnowledge")); + addItem(MNU_RENAME, + new PopupItem(MNU_NAME_RENAME) + .action("edit-knowledge?action=renameKnowledge")); + addItem(MNU_EDIT, + new PopupItem(MNU_NAME_EDIT) + .action("edit-knowledge?action=editKnowledge")); addSeparator(); - addItem(MNU_REMOVE, new PopupItem("menu.remove").icon(IMG_DELETE) - .action("remove-knowledge").confirmation( - "message.delete.knowledge")); + addItem(MNU_REMOVE, + new PopupItem("menu.remove").icon(IMG_DELETE) + .action("remove-knowledge") + .confirmation("message.delete.knowledge")); } @Override @@ -895,8 +927,7 @@ public class ApplicationSettings implements ServletContextAware { ToolBar bar = new ToolBar(24); // Height of the module-bar Set module = new HashSet(); // For not duplicating modules - for (Iterator j = formats.iterator(); j.hasNext();) { - String format = j.next(); + for (String format : formats) { String command = getApplicationProperty("executable." + format); if (command == null) { continue; // Module not installed @@ -922,9 +953,8 @@ public class ApplicationSettings implements ServletContextAware { } else { icon = "tool." + icon.toLowerCase() + ".png"; } - File image = new File(ApplicationSettings - .getApplicationSkinPath() - + icon); + File image = new File( + ApplicationSettings.getApplicationSkinPath() + icon); if (!image.exists()) { icon = "tool.any.png"; } @@ -932,9 +962,8 @@ public class ApplicationSettings implements ServletContextAware { } else { docname = "/jsp/newDocument.jsp?type=" + docname; String icon = "tool." + name[0].toLowerCase() + ".png"; - File image = new File(ApplicationSettings - .getApplicationSkinPath() - + icon); + File image = new File( + ApplicationSettings.getApplicationSkinPath() + icon); if (!image.exists()) { icon = "tool.any.png"; } @@ -957,8 +986,8 @@ public class ApplicationSettings implements ServletContextAware { } public String getApplicationURL() { - StringBuffer url = new StringBuffer("http://").append( - MY_APP._wappserver).append("/").append(_wappname); + StringBuffer url = new StringBuffer("http://") + .append(MY_APP._wappserver).append("/").append(_wappname); return url.toString(); } @@ -1002,9 +1031,9 @@ public class ApplicationSettings implements ServletContextAware { } public static String getDownloadURL(final User user) { - StringBuffer url = new StringBuffer("http://").append( - MY_APP._wappserver).append("/download/").append( - user.getUsername()).append("/"); + StringBuffer url = new StringBuffer("http://") + .append(MY_APP._wappserver).append("/download/") + .append(user.getUsername()).append("/"); return url.toString(); // The download Tomcat context is supposed being defined }