Show message about downloaded data after successful checkout.
<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>
<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
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.
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.
*/
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> :'.
*/
} 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()) {
// 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()));
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);
}
}
* 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.
*/
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