Salome HOME
During checkout call run_salome_siman.sh.
authorrkv <rkv@opencascade.com>
Wed, 5 Dec 2012 11:52:02 +0000 (11:52 +0000)
committerrkv <rkv@opencascade.com>
Wed, 5 Dec 2012 11:52:02 +0000 (11:52 +0000)
Show message about downloaded data after successful  checkout.

Workspace/Siman/WebContent/jap/splat-launcher.jar
Workspace/Siman/WebContent/jap/splat-signedlauncher.jar
Workspace/Siman/WebContent/jsp/toolbar.jsp
Workspace/Siman/WebContent/layout/baseLayout.jsp
Workspace/Siman/src/labels.properties
Workspace/Siman/src/labels_en.properties
Workspace/Siman/src/org/splat/launcher/ToolbarApplet.java
Workspace/Siman/src/org/splat/simer/Action.java

index 40a4ad46303911f414c277b276b7c34590d3f527..4c5e772c785da1a1248c278a6dfc1e6c02e21520 100644 (file)
Binary files a/Workspace/Siman/WebContent/jap/splat-launcher.jar and b/Workspace/Siman/WebContent/jap/splat-launcher.jar differ
index 7b9637f7bfe635ba0885c2333180354d336bd130..c4f5926e7e8e1744eba0f0c6d66332c8acf44d55 100644 (file)
Binary files a/Workspace/Siman/WebContent/jap/splat-signedlauncher.jar and b/Workspace/Siman/WebContent/jap/splat-signedlauncher.jar differ
index 369aa47c9d44547a5c4fa0fe3eaa8228e0ea3d78..d6cab32d7e542e8ed5cae7c6b81874adea2945a2 100644 (file)
                                <img src="<s:url value="/skin/disabled.scenario.png"/>"
                                        border="none" title="" />
                        </s:else></td>
+                       
+                       <s:set var="mess">
+                               <s:text name="message.info.data">
+                                       <s:param>/tmp/SimanSalome/<s:property
+                                                       value="connectedUser.index" />/download</s:param>
+                               </s:text>
+                       </s:set>
                        <%-- URL for refreshing scenario view after checkin --%>
                        <s:url id="refresh" forceAddSchemeHostAndPort="true"
-                               namespace="/study" action="open-%{#entitype}">
+                               namespace="/study" action="open-%{#entitype}" includeParams="none" escapeAmp="no">
                                <s:param name="selection" value="titleBarSettings.selectionState" />
+                               <s:param name="message" value="#mess" />
                        </s:url>
+                       
                        <td align=right><img
                                src="<s:url value="/skin/image.vseparator.png"/>" border="none" />
                        <s:if
                                                        <%-- 
                        --siman --siman-study=s --siman-scenario=sc --siman-user=u -k
                        --%>
-                                                       <s:set var="arg">--siman --siman-study=<s:property
+                                                       <s:set var="arg">--siman-study=<s:property
                                                                        value="openStudy.index" /> --siman-scenario=<s:property
                                                                        value="openStudy.selectedScenarioId" /> --siman-user=<s:property
-                                                                       value="connectedUser.username" /> -k</s:set>
+                                                                       value="connectedUser.username" />
+                                                       </s:set>
                                                </s:if>
                                                <s:if test="#arg != null">
                                                        <param name="file<s:property value="#stat.index" />"
                        </s:a></td>
                </s:elseif>
        </tr>
-</table>
\ No newline at end of file
+</table>
index ffbc1e32dd05675b6bd3fc6908043b950649927f..7356f060c751631524895d0fa2686c318be6a3c7 100644 (file)
     <div id=main-pane>
        <tiles:insertAttribute name="presentation_pane" ignore="true" />
     </div>
-
+<s:if test="message != ''">
+<script>
+    alert("<s:property value="message"/>");
+</script>
+</s:if>
   </body>
   
\ No newline at end of file
index ccdb36116bebcf92dae7715f029edee5bfb3e0c4..b826000a0f3baa24a6c1c8e7a0adb4f6f8f4200a 100644 (file)
@@ -294,6 +294,7 @@ message.info.type         = Si besoin, modifiez le nom ci-dessous, 
 message.info.step         = Si besoin, sélectionnez une autre activité ci-dessous:
 message.info.value        = Si besoin, modifiez la valeur ci-dessous:
 message.info.context      = ou sélectionnez une valeur déjà utilisée.
+message.info.data         = You can find checked out data in the directory {0}.
 
 message.error.internal            = Erreur interne. Contactez votre administrateur.
 message.error.launch              = Erreur fatale lors du démarrage de l''application {0}. Contactez votre administrateur.
index a62244db61f914bdb31449f64bbb233c44f7ab9b..09111f5a4b28a89a087c0f57601f8cdb540084f1 100644 (file)
@@ -295,6 +295,7 @@ message.info.type         = If needed, edit the name below, providing that it is
 message.info.step         = If needed, select another activity below:
 message.info.value        = If needed, change the value below:
 message.info.context      = or select a value already used.
+message.info.data         = You can find checked out data in the directory {0}.
 
 message.error.internal            = Internal error. Contact your system administrator.
 message.error.launch              = Fatal error when starting {0}. Contact your system administrator.
index dd4d35633bb5b8106e8145191f6f4c9a4dc342d5..92632e2b4b71c0e81ddde55d1d2f5f3e0cb4f27b 100644 (file)
@@ -32,6 +32,14 @@ public class ToolbarApplet extends java.applet.Applet implements ActionListener
         */
        private static final long serialVersionUID = 3243053622061086715L;
 
+       /**
+        * The name of the script to run Salome.
+        */
+       private static final String RUN_SALOME_SCRIPT = "run_salome_siman";
+       /**
+        * Possible script extensions.
+        */
+       private static final String[] SCRIPT_EXT = { "", ".sh", ".bat", ".cmd" };
        /**
         * The response key string: '<i>"canCheckout"</i> :'.
         */
@@ -198,16 +206,16 @@ public class ToolbarApplet extends java.applet.Applet implements ActionListener
                } else if (!SALOME_HOME.endsWith(File.separator)) {
                        SALOME_HOME += File.separator;
                }
-               String pathToScript = SALOME_HOME + "KERNEL" + File.separator + "bin"
-                               + File.separator + "salome" + File.separator + "runSalome";
-
-               // Look for the launching script in the file system
+               String pathToScript = SALOME_HOME + File.separator + RUN_SALOME_SCRIPT;
                File script = new File(pathToScript);
-               if (!script.exists()) {
-                       script = new File(pathToScript + ".bat");
-                       if (!script.exists()) {
-                               script = new File(pathToScript + ".cmd");
+               String extensions = "";
+               // Look for the launching script in the file system
+               for (String ext : SCRIPT_EXT) {
+                       script = new File(pathToScript + ext); //RKV: NOPMD: There are not so much extensions
+                       if (script.exists()) {
+                               break;
                        }
+                       extensions += "|" + ext;
                }
 
                if (script.exists()) {
@@ -215,8 +223,7 @@ public class ToolbarApplet extends java.applet.Applet implements ActionListener
                        // Call to the Siman server to checkout the scenario
                        URL checkoutUrl = new URL(getCodeBase().toString()
                                        + "checkout.action?"
-                                       + params.replaceAll("siman-", "").replaceAll("--", "-")
-                                                       .replaceAll("-", "&").replaceAll("\\s", ""));
+                                       + params.replaceAll("--siman-", "&").replaceAll("\\s", ""));
 
                        BufferedReader buffer = new BufferedReader(new InputStreamReader(
                                        checkoutUrl.openStream()));
@@ -252,9 +259,10 @@ public class ToolbarApplet extends java.applet.Applet implements ActionListener
                                showError(response);
                        }
                } else {
-                       showError("SALOME module is not found: " + script.getAbsolutePath());
+                       extensions = "[" + extensions.replaceAll("\\|\\|", "") + "]";
+                       showError("SALOME module is not found: " + pathToScript + extensions);
                        throw new ConfigurationException("SALOME module is not found: "
-                                       + script.getAbsolutePath());
+                                       + pathToScript + extensions);
                }
        }
 
index a6eb8c3b0e04999b6343be4dd0152531f11b1645..04a62538b6c01b8916b5b3b8e46f6c0efc3e2a64 100644 (file)
@@ -69,6 +69,10 @@ public class Action extends ActionSupport implements ServletRequestAware,
         * Error code.
         */
        private String _errorCode;
+       /**
+        * The message to show when the page is loaded.
+        */
+       private String _message = "";
        /**
         * ActionType for specifying the type of the operaion.
         */
@@ -683,4 +687,20 @@ public class Action extends ActionSupport implements ServletRequestAware,
        public void setActionType(final String actionType) {
                _actionType = actionType;
        }
+
+       /**
+        * Get the message.
+        * @return the message
+        */
+       public String getMessage() {
+               return _message;
+       }
+
+       /**
+        * Set the message.
+        * @param message the message to set
+        */
+       public void setMessage(final String message) {
+               _message = message;
+       }
 }
\ No newline at end of file