]> SALOME platform Git repositories - tools/siman.git/commitdiff
Salome HOME
Show URLs for previous versions of the document's files.
authormka <mka@opencascade.com>
Wed, 18 Sep 2013 07:15:20 +0000 (07:15 +0000)
committermka <mka@opencascade.com>
Wed, 18 Sep 2013 07:15:20 +0000 (07:15 +0000)
Workspace/Siman/WebContent/jsp/editContents.jsp
Workspace/Siman/WebContent/jsp/readContents.jsp
Workspace/Siman/WebContent/study/versionDocument.jsp
Workspace/Siman/src/labels.properties
Workspace/Siman/src/labels_en.properties
Workspace/Siman/src/org/splat/simer/FileFacade.java
Workspace/Siman/src/org/splat/simer/VersionDocumentAction-valid-version-validation.xml [new file with mode: 0644]
Workspace/Siman/src/struts.xml

index c32ca889feee6fcdd791dd8f33f09faccdeca020..f443ec255b0d7cdc46f218b16b882d98949cd36c 100644 (file)
             <td></td>
             <td></td>
             <td><img src="<s:url value="/skin/icon.relation.png"/>" border="none" title=""/></td>
-            <td><i><s:text name="label.uses"/>:</i>&nbsp;<s:property value="title"/></td>
+            <td>
+              <s:a href="%{URL}" target="_blank" cssClass="link">
+                <i><s:text name="label.uses"/>:</i>&nbsp;<s:property value="title"/>
+              </s:a>
+            </td>
             <td align=center><s:property value="version"/></td>
             <td align="right"><s:property value="size"/>&nbsp;&nbsp;</td>
             <td align="right"><s:property value="date"/></td>
             <td></td>
             <td><img src="<s:url value="/skin/image.attach.png"/>" border="none" title=""/></td>
             <td>
-              <i><s:text name="label.converts"/>:</i>&nbsp;
-              <s:property value="format"/>&nbsp;<s:property value="description"/>
+              <s:a href="%{URL}" target="_blank" cssClass="link">
+                <i><s:text name="label.converts"/>:</i>&nbsp;
+                <s:property value="format"/>&nbsp;<s:property value="description"/>
+              </s:a>
             </td>
             <td align=center></td>
             <td align="right"><s:property value="size"/>&nbsp;&nbsp;</td>
                 <table cellpadding=0 cellspacing=0 border=0>
                   <tr>
                     <td width=18><img src="<s:url value="/skin/%{fileIcon}"/>" border="none" title=""/></td>
-                    <td><s:property value="description"/></td>
+                    <td>
+                      <s:if test="%{!URL.equals(prevUrl)}">
+                          <s:a href="%{URL}" target="_blank" cssClass="link">
+                            <s:property value="description"/>
+                          </s:a>
+                      </s:if><s:else>
+                        <s:property value="description"/>
+                      </s:else>
+                    </td>
+                    <s:set name="prevUrl" value="%{URL}"/>
                   </tr>
                 </table>
               </td>
index 29cca49671d78f2f931d34fe92b00e8045630012..6286a60ec0b33e75489d60e6bee2a11c422d7bee 100644 (file)
             <td></td>
             <td></td>
             <td><img src="<s:url value="/skin/icon.relation.png"/>" border="none" title=""/></td>
-            <td><i><s:text name="label.uses"/>:</i>&nbsp;<s:property value="title"/></td>
+            <td>
+              <s:a href="%{URL}" target="_blank" cssClass="link">
+                <i><s:text name="label.uses"/>:</i>&nbsp;<s:property value="title"/>
+              </s:a>
+            </td>
             <td align=center><s:property value="version"/></td>
             <td align=right><s:property value="size"/>&nbsp;&nbsp;</td>
             <td align=right><s:property value="date"/></td>
             <td></td>
             <td><img src="<s:url value="/skin/image.attach.png"/>" border="none" title=""/></td>
             <td>
-              <i><s:text name="label.converts"/>:</i>&nbsp;
-              <s:property value="format"/>&nbsp;<s:property value="description"/>
+              <s:a href="%{URL}" target="_blank" cssClass="link">
+                <i><s:text name="label.converts"/>:</i>&nbsp;
+                <s:property value="format"/>&nbsp;<s:property value="description"/>
+              </s:a>
             </td>
             <td align=center></td>
             <td align=right><s:property value="size"/>&nbsp;&nbsp;</td>
                 <table>
                   <tr>
                     <td><img src="<s:url value="/skin/%{fileIcon}"/>" border="none" title=""/></td>
-                    <td><s:property value="description"/></td>
+                    <td>
+                      <s:if test="%{!URL.equals(prevUrl)}">
+                             <s:a href="%{URL}" target="_blank" cssClass="link">
+                               <s:property value="description"/>
+                             </s:a>
+                         </s:if><s:else>
+                           <s:property value="description"/>
+                         </s:else>
+                       </td>
+                    <s:set name="prevUrl" value="%{URL}"/>
                   </tr>
                 </table>
               </td>
index d8ee105c3326687bc9d0c224d141b7648ac94b3a..e56bcd4448d1bc25faf56357c05cd6dea06080ed 100644 (file)
@@ -34,11 +34,11 @@ $(document).ready(function () {
        </tr>
 </table>
 
-<form name="version" id="version" action="valid-version" method="post"><s:hidden
-       name="fileName" /> <s:hidden name="index" /> <s:hidden name="version" />
+<s:form name="version" id="version" action="valid-version" method="post"
+    validate="true">
+<s:hidden name="fileName" /> <s:hidden name="index" /> <s:hidden name="version" />
 <s:hidden name="documentDate" /> <s:hidden name="defaultDescription"
        value="%{description}" />
-<table cellpadding="0" cellspacing="0" border="0" class="text">
        <tr height="15">
                <td></td>
        </tr>
@@ -73,7 +73,8 @@ $(document).ready(function () {
        <tr>
                <td align="right"><s:text name="label.modifications" />:</td>
                <td><s:textfield theme="simple" id="description"
-                       name="description" disabled="true" size="60" /></td>
+                       name="description" disabled="true" size="60"
+                       value='%{getText("default.versioning.description")}'/></td>
        </tr>
        <s:if test="dependencies.size > 0">
                <tr height="10">
@@ -107,7 +108,6 @@ $(document).ready(function () {
                        name="documentState" list="documentStates" listKey="value"
                        listValue="%{getText(key)}" disabled="" /></td>
        </tr>
-</table>
-</form>
+</s:form>
 </div>
 </div>
index 72d8d3e6813807124b76137ea2fa22f6b70bfb41..c61d70bb76b252caefffe5008a2e8e35fb65e1cd 100644 (file)
@@ -44,6 +44,7 @@ menu.remove.study     = Supprimer l''
 menu.remove.document  = Supprimer ce document
 menu.remove.version   = Supprimer cette version
 menu.purge            = Supprimer l''historique
+menu.actualize           = Set up-to-date
 
 menu.admin.indexing   = Indexer les études
 menu.admin.importuser = Importer des utilisateurs
@@ -311,6 +312,7 @@ message.upload            = Le fichier "{0}" a 
 message.checkedout        = Ce scénario a été réservé par {0} le {1}. Pour pouvoir en modifier les propriétés, {2} doit donc préalablement restituer ses modifications.</br>Du coup, voulez-vous :
 message.checkin           = Voulez-vous vraiment abandonner les modifications en cours ?
 message.dependencies      = Les documents suivants devront a priori être mis à jour car ils utilisent le document en cours de versionnement.</br>Si certains d''entre eux ne sont PAS IMPACTÉS par ce versionnement, ils doivent être COCHÉS.
+message.actualize.document= Do you really want to set this documents state to up-to-date ?
 
 message.info.contact      = Contactez votre administrateur système.
 message.info.scename      = Si besoin, changez le titre du scénario ci-dessous.
@@ -345,4 +347,5 @@ message.error.version.mismatch    = Ce document porte un num
 message.error.comparison                 = Invalid comparison input data. Select at least one document; all selected documents should have compatible format.
 
 #Validation errors
-message.error.noenteredvalue=The field ''{0}'' must be filled
\ No newline at end of file
+message.error.noenteredvalue=The field ''{0}'' must be filled
+default.versioning.description = A new Version
\ No newline at end of file
index bb1a0f16107108f6f90579dc44c652bc8f245463..c6979b0544ceb73e8a9aac2f71753a50c3f98575 100644 (file)
@@ -46,6 +46,7 @@ menu.remove.version   = Remove this version
 menu.purge            = Remove the history
 menu.markasreference  = Mark as Reference
 menu.removeasreference  = Remove as Reference
+menu.actualize           = Set up-to-date
 menu.reject           = Reject
 
 menu.admin.indexing   = Index the studies
@@ -312,6 +313,7 @@ message.upload            = The file "{0}" has been successfully uploaded.
 message.checkedout        = This scenario has been checked-out by {0} on {1}. For being able to edit the properties, {2} must first check-in his/her modifications.</br>Then, do you want :
 message.checkin           = Do you really want to forget the on-going modifications ?
 message.dependencies      = The documents below will must probably be updated because they use the document being versioned.</br>Those which are NOT IMPACTED by this versioning must be CHECKED.
+message.actualize.document= Do you really want to set this documents state to up-to-date ?
 
 message.info.contact      = Contact your system administrator.
 message.info.scename      = If needed, change below the title of the scenario.
@@ -346,4 +348,5 @@ message.error.version.mismatch    = The revision number of this document is illi
 message.error.comparison                 = Invalid comparison input data. Select at least one document; all selected documents should have compatible format.
 
 #Validation errors
-message.error.noenteredvalue=The field ''{0}'' must be filled
\ No newline at end of file
+message.error.noenteredvalue=The field ''{0}'' must be filled
+default.versioning.description = A new Version
\ No newline at end of file
index 0b5b484b11e899c22a741559be02987816b37f2e..0c75f1fdee7a1f8a9b739803fd3d82cbf014bc64 100644 (file)
@@ -26,8 +26,8 @@ public class FileFacade {
                        final ApplicationSettings applicationSettings) {
                ResourceBundle custom = ResourceBundle.getBundle("som",
                                applicationSettings.getCurrentLocale());
-               File export = represented.getTo().asFile();
-               String path = export.getPath();
+               org.splat.dal.bo.som.File export = represented.getTo();
+               String path = export.getRelativePath();
                String[] table = path.split("\\x2E");
                DecimalFormat tostring = new DecimalFormat(custom
                                .getString("size.format")); // Locale size display format
@@ -38,7 +38,7 @@ public class FileFacade {
                _surl = applicationSettings.getRepositoryURL() + path;
                _surl = _surl.replaceAll("'", "\\\\'");
                _format = table[table.length - 1].toUpperCase();
-               _size = tostring.format(export.length() / 1000);
+               _size = tostring.format(export.asFile().length() / 1000);
                _date = convert.format(represented.getTo().getDate());
                _comment = represented.getDescription();
                if (_comment == null) {
diff --git a/Workspace/Siman/src/org/splat/simer/VersionDocumentAction-valid-version-validation.xml b/Workspace/Siman/src/org/splat/simer/VersionDocumentAction-valid-version-validation.xml
new file mode 100644 (file)
index 0000000..50134fc
--- /dev/null
@@ -0,0 +1,8 @@
+<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
+<validators>
+    <field name="description">
+        <field-validator type="requiredstring">
+            <message>${getText("message.error.noenteredvalue", "-", getText("field.description"))}</message>
+        </field-validator>
+    </field>
+</validators>
\ No newline at end of file
index f1f7ea5637bec81553e7f29d9a4d5c7df149dea3..172b88ff1bf9b07d16f424860b24b273b42273b6 100644 (file)
                </action>
                <action name="valid-version" class="versionDocumentAction"
                        method="version">
+                       <interceptor-ref name="simanBasicStack"/>
+            <interceptor-ref name="siman-validation"/>
                        <result name="success" type="redirectAction">
                                step-study
                        </result>