]> SALOME platform Git repositories - tools/siman.git/commitdiff
Salome HOME
Integration of ISR fixes:
authorrkv <rkv@opencascade.com>
Mon, 15 Apr 2013 08:47:06 +0000 (08:47 +0000)
committerrkv <rkv@opencascade.com>
Mon, 15 Apr 2013 08:47:06 +0000 (08:47 +0000)
1. External document versioning functionality;
2. Symer.admin consistent translation and openStudy clearing after logout fixes.

Workspace/Siman-Common/src/org/splat/service/DocumentServiceImpl.java
Workspace/Siman-Common/src/org/splat/service/PublicationServiceImpl.java
Workspace/Siman-Common/src/org/splat/som/Revision.java
Workspace/Siman/WebContent/jsp/menubar.jsp
Workspace/Siman/WebContent/study/displayStudyProperties.jsp
Workspace/Siman/WebContent/study/editStudyProperties.jsp
Workspace/Siman/src/org/splat/simer/ConnectionAction.java
Workspace/Siman/src/org/splat/simer/DocumentFacade.java
Workspace/Siman/src/org/splat/simer/VersionDocumentAction.java

index 98d952f487e8d05c354d7f544a488f7bab3fe20e..92067601fa7b113245e9dd2f4d9093e4d377df06 100644 (file)
@@ -537,11 +537,6 @@ public class DocumentServiceImpl implements DocumentService {
                Document previous = null;
 
                // Set of version number
-               if (state == ProgressState.EXTERN) {
-                       if (aDoc.getProgressState() != ProgressState.EXTERN) {
-                               aDoc.setVersion(null); // Strange use-case...
-                       }
-               } else {
                        Revision myvers = new Revision(aDoc.getVersion());
                        if (!myvers.isNull()) { // Versionning context
                                previous = aDoc.getPreviousVersion();
@@ -550,7 +545,7 @@ public class DocumentServiceImpl implements DocumentService {
                                myvers.incrementAs(state); // Incrementation if the reversion number is not imposed
                        }
                        aDoc.setVersion(myvers.toString());
-               }
+
                // Update this document and the previous version, if exist
                if (previous != null) {
                        previous.setHistory(previous.getHistory() + 1);
index 119a4fc29bde714727feda9f0152f9cd410a6fc6..a901160ce2db1139905cd1dd7e48963c42cf04af 100644 (file)
@@ -271,7 +271,8 @@ public class PublicationServiceImpl implements PublicationService {
                // TODO: Remove current document details from the contents of open study
 
                // Creation of uses relations
-               updateRelations(current, next, docuses, docusedby);
+               Publication syncronizedCurrent = _publicationDAO.get(current.getIndex());
+               updateRelations(syncronizedCurrent, next, docuses, docusedby);
        }
 
        /**
index 6e79a5890f5b7426d8f2ababed7c6d88d3154e4f..7ba7ed23ca529ce874545b839887fed8bb1b7b4e 100644 (file)
@@ -182,7 +182,7 @@ public class Revision {
 //  -------------------------------------------------
       if      (state == ProgressState.inWORK || state == ProgressState.inDRAFT) {
                _minor += 1;
-       } else if (state == ProgressState.inCHECK) {
+       } else if (state == ProgressState.inCHECK || state == ProgressState.EXTERN) {
         _major = _major + 1;
         _minor = 0;
       }
index dce6d5193b7d2404da7f1277d4e652e4bc8a809d..90b11cbcd7f2de0c7571861c08d114a5d060c96a 100644 (file)
                        <td><br />
                        <img src="<s:url value="/skin/image.user.png"/>" border="none" /></td>
                        <s:if test="connectedUser != null">
-                               <s:if test="connectedUser.roleNames == 'sysadmin'">
-                                       <td><s:text name="label.sysadmin" /></td>
-                               </s:if>
-                               <s:else>
-                                       <td><s:property value="connectedUser.displayName" /></td>
-                               </s:else>
+                           <td><s:property value="getText(connectedUser.displayName)" /></td>
                                <td>|&nbsp;&nbsp;<s:a href="%{logout}" cssClass="link">
                                        <s:text name="menu.logout" />
                                </s:a></td>
index b1a6708545cc70b880b9e10c48ba81b3b872daa6..ee2188ca00483e7ec86453c2262c974f87e7b97a 100644 (file)
               <td colspan=3>
                     <s:if test="contributors.size > 0">
                       <s:iterator value="contributors" status="counter">
-                        <s:if test="#counter.last"><s:property value="toString()"/></s:if>
-                        <s:else><s:property value="toString()"/>,</s:else>
+                        <s:if test="#counter.last"><s:property value="getText(displayName)"/></s:if>
+                        <s:else><s:property value="getText(displayName)"/>,</s:else>
                       </s:iterator>
                     </s:if><s:else>
                       <s:property value="%{'-'}"/>
                     </s:else>
               </td>
-              <td><s:property value="%{author.toString()}"/></td>
+              <td><s:property value="%{getText(author.displayName)}"/></td>
             </tr>
             
         <!-- Readers functionality -->
@@ -69,8 +69,8 @@
                 </td>
                 <td colspan="4">
                   <s:iterator value="readers" status="counter">
-                    <s:if test="#counter.last"><s:property value="%{displayName}"/></s:if>
-                    <s:else><s:property value="%{displayName}"/>,</s:else>
+                    <s:if test="#counter.last"><s:property value="%{getText(displayName)}"/></s:if>
+                    <s:else><s:property value="%{getText(displayName)}"/>,</s:else>
                   </s:iterator>
                 </td>
             </tr>
index 7ade4c75bb1fdfd658ac4e8954abb3a719e325fd..b51afebae8e3e8ba6cb48b6999da07b38eb63eef 100644 (file)
@@ -52,7 +52,7 @@
         </div>
         <div id=article-body class=text>
 
-          <form name="edit" action="valid-edit" method="post">
+          <s:form name="edit" action="valid-edit" method="post" validate="true">
           <table width=100% cellpadding=0 cellspacing=0 border=0 class=text>
 
             <tr height=10><td width=20></td></tr>
                 <s:a href="%{#undo}"><img src="<s:url value="/skin/icon.undo.png"/>" border="none" title="<s:text name="button.cancel"/>"/></s:a>
               </td>
               <td colspan=4>
-                <input type=text size="108" name=title value="<s:property value="studyTitle"/>">
+                <s:textfield size="108" name="title" value="%{studyTitle}" theme="simple"/>
               </td>
               <td align=right>
-                <button type="submit" name="saveTitle" value="" style="width:24px; height:16px; border:0; cursor:pointer; cursor:hand; background:transparent">
+                <s:submit type="button" name="saveTitle" value="" cssStyle="width:24px; height:16px; border:0; cursor:pointer; cursor:hand; background:transparent" theme="simple">
                   <img src="<s:url value="/skin/image.export.png"/>" title="<s:text name="button.save"/>"/>
-                </button>
+                </s:submit>
               </td>
               </s:if>
               <s:else>
             User  user = members.next();
             out.print("<td><input type=checkbox name=\"members\" value=\"" + String.valueOf(String.valueOf(user.getIndex())) + "\" checked/></td>");
             out.print("<td>");
-              out.print(user.toString());
+              out.print(controler.getText(user.getDisplayName()));
             out.print("</td>");
          } else {
             out.print("<td></td><td></td>");
           if (staff.hasNext()) {
                  User user = staff.next();
             out.print("<td><input type=checkbox name=\"candidates\" value=\"" + String.valueOf(user.getIndex()) + "\" />&nbsp;");
-              out.print(user.toString());
+              out.print(controler.getText(user.getDisplayName()));
             out.print("</td>");
           } else {
             out.print("<td></td>");
         out.print("<tr>");
           out.print("<td><input type=checkbox name=\"members\" value=\"" + String.valueOf(user.getIndex()) + "\" checked/></td>");
           out.print("<td>");
-            out.print(user.toString());
+            out.print(controler.getText(user.getDisplayName()));
           out.print("</td>");
         out.print("</tr>");
       }%>
               <td colspan=3>
                     <s:if test="contributors.size > 0">
                       <s:iterator value="contributors" status="counter">
-                        <s:if test="#counter.last"><s:property value="toString()"/></s:if>
-                        <s:else><s:property value="toString()"/>,</s:else>
+                        <s:if test="#counter.last"><s:property value="getText(displayName)"/></s:if>
+                        <s:else><s:property value="getText(displayName)"/>,</s:else>
                       </s:iterator>
                     </s:if><s:else>
                       <s:property value="%{'-'}"/>
                     </s:else>
               </td>
-              <td><s:property value="%{author.toString()}"/></td>
+              <td><s:property value="%{getText(author.displayName)}"/></td>
             </tr>
             </s:else>
 
                     <tr>
                       <td>
                         <s:checkbox name="readerIds" fieldValue="%{index}" theme="simple" checked="checked" /> &nbsp;
-                        <s:property value="%{displayName}"/>
+                        <s:property value="%{getText(displayName)}"/>
                       </td>
                     </tr>
                   </s:iterator>
                       <s:iterator value="candidates" status="status">
                         <td>
                           <s:checkbox name="readerIds" fieldValue="%{index}" theme="simple"/> &nbsp;
-                          <s:property value="%{displayName}"/>
+                          <s:property value="%{getText(displayName)}"/>
                         </td>
                         <s:if test="%{(#status.index + 1) % 3 == 0}">
                             </tr>
                 </td>
                 <td colspan="4">
                   <s:iterator value="readers" status="counter">
-                    <s:if test="#counter.last"><s:property value="%{displayName}"/></s:if>
-                    <s:else><s:property value="%{displayName}"/>,</s:else>
+                    <s:if test="#counter.last"><s:property value="%{getText(displayName)}"/></s:if>
+                    <s:else><s:property value="%{getText(displayName)}"/>,</s:else>
                   </s:iterator>
                 </td>
               </tr>
                 <select name="reviewer">
                   <option value="0">-&nbsp;<s:text name="label.skipped"/>&nbsp;-</option>
                   <s:iterator value="validationActors">         
-                    <s:if test="%{index == #selection}"><option value="<s:property value="index"/>" selected><s:property value="toString()"/></option></s:if>
-                    <s:else><option value="<s:property value="index"/>"><s:property value="toString()"/></option></s:else>
+                    <s:if test="%{index == #selection}"><option value="<s:property value="index"/>" selected><s:property value="getText(displayName)"/></option></s:if>
+                    <s:else><option value="<s:property value="index"/>"><s:property value="getText(displayName)"/></option></s:else>
                   </s:iterator>   
                 </select>
               </s:if><s:else>
                 <select name="approver">
                   <option value="0">-&nbsp;<s:text name="label.skipped"/>&nbsp;-</option>
                   <s:iterator value="validationActors">         
-                    <s:if test="%{index == #selection}"><option value="<s:property value="index"/>" selected><s:property value="toString()"/></option></s:if>
-                    <s:else><option value="<s:property value="index"/>"><s:property value="toString()"/></option></s:else>
+                    <s:if test="%{index == #selection}"><option value="<s:property value="index"/>" selected><s:property value="getText(displayName)"/></option></s:if>
+                    <s:else><option value="<s:property value="index"/>"><s:property value="getText(displayName)"/></option></s:else>
                   </s:iterator>   
                 </select>
               </s:if><s:else>
             </s:iterator>
             <tr height=3><td></td></tr>
             </table>
-          </form>
+          </s:form>
         </div>
       </div>
 
index 4f0531691a246336740b33b9499c5dcbb4f8b3c9..2b4f6d3fe15dba1500197d58daa1cc21a941c44e 100644 (file)
@@ -184,6 +184,7 @@ public class ConnectionAction extends Action {
                        LOG.error("Reason:", error);
                        res = ERROR;
                }
+               closeStudy();
                return res;
        }
 
index 25926be688d53caacafe9e14778a2779481c4f8d..260b2a32e85fef47ec62ffd09abe8b9e25d84876 100644 (file)
@@ -504,13 +504,10 @@ public class DocumentFacade implements HistoryFacade {
                        _description = versions.getDescription();
                }
                // File details
-               if (_state != ProgressState.EXTERN) {
                        Revision.Format verstring = new Revision.Format(
                                        getProjectSettings().getRevisionPattern());
                        _version = verstring.format(_version);
-               }
-               _size = sizstring
-                               .format(_mydoc.getSourceFile().asFile().length() / 1000);
+               _size = sizstring.format(_mydoc.getSourceFile().asFile().length() / 1000);
                _date = datstring.format(_mydoc.getLastModificationDate());
 
                // Refresh of the history in case of promotion
index 9bf95254904220d155609e52c3341f4d022a35f5..90fe6d9ccdb7fd71f72be758c2e1720f9ef0299c 100644 (file)
@@ -93,6 +93,9 @@ public class VersionDocumentAction extends BaseUploadDocumentAction {
                        _usedby.addAll(tag.getRelations(UsedByRelation.class));
 
                        // Initialize applicable states list
+                       if(tag.value().getProgressState() == ProgressState.EXTERN) {
+                               _documentStates.add(ProgressState.EXTERN);
+                       } else {
                        _documentStates.add(ProgressState.inWORK);
                        if (_deftype != null) {
                                // Check if the validation cycle of the document type can has a review state
@@ -102,7 +105,7 @@ public class VersionDocumentAction extends BaseUploadDocumentAction {
                                        _documentStates.add(ProgressState.inDRAFT);
                                }
                        }
-
+                       }
                } else {
                        if (!(Constants.NONE.equals(getToolProperty()))) {
                                initializationFullScreenContext(Constants.STUDY_MENU,