]> SALOME platform Git repositories - tools/siman.git/commitdiff
Salome HOME
Fix for mantis #0022086: After "rename the document" operation it's impossible to...
authorrkv <rkv@opencascade.com>
Tue, 5 Feb 2013 12:13:17 +0000 (12:13 +0000)
committerrkv <rkv@opencascade.com>
Tue, 5 Feb 2013 12:13:17 +0000 (12:13 +0000)
Workspace/Siman/WebContent/jsp/editContents.jsp
Workspace/Siman/WebContent/study/displayStudyStep.jsp
Workspace/Siman/src/org/splat/simer/AbstractDisplayAction.java
Workspace/Siman/src/org/splat/simer/EditDocumentAction.java

index 6929ecebc2e238857f5028e575c2338bec09115f..95bed8fa40445e8d8adc85ac952e5fb69d8004f0 100644 (file)
@@ -2,13 +2,7 @@
     pageEncoding="ISO-8859-1"
 %>
 <%@ taglib prefix="s" uri="/struts-tags"
-%><%
-    String action = request.getParameter("action");
-    String index  = request.getParameter("index");
 %>
-<s:set var="todo"><%=action%></s:set>
-<s:set var="edit"><%=index%></s:set>
-
 <s:url id="develop" namespace="/study" action="document-study">
   <s:param name="action">develop</s:param>
 </s:url>
@@ -30,7 +24,7 @@
     <td width=18></td>
     <td><s:text name="label.title"/></td>
     <td width=120 align=center>&nbsp;<s:text name="label.version"/>&nbsp;</td>
-    <td width=80 align=right><s:text name="label.size"/>&nbsp;&nbsp;&nbsp;</td>
+    <td width=80 align="right"><s:text name="label.size"/>&nbsp;&nbsp;&nbsp;</td>
     <td width=75 align=left>&nbsp;&nbsp;&nbsp;&nbsp;<s:text name="label.date"/><img src="<s:url value="/skin/icon.sortdown.png"/>" border="none"/></td>
   </tr>
   <tr height=1 bgcolor=#AAAAAA><td colspan=7></td></tr>
@@ -39,8 +33,8 @@
       <s:set var="docindex" value="%{index}"/>
       <tr height=18>
         <td>
-          <s:if test="%{#todo == 'renameDocument'}">
-            <s:if test="%{#edit == #docindex}">
+          <s:if test="%{curAction == 'renameDocument'}">
+            <s:if test="%{index == #docindex}">
               <s:a href="%{undo}"><img src="<s:url value="/skin/icon.undo.png"/>" border="none" title="<s:text name="tooltip.cancel"/>" /></s:a>
             </s:if><s:else>
               <img src="<s:url value="/skin/image.box.png"/>"  border="none" title=""/>
@@ -52,7 +46,7 @@
           </s:else>
         </td>
         <td>
-          <s:if test="%{#todo != 'renameDocument'}">
+          <s:if test="%{curAction != 'renameDocument'}">
             <div id="popdoc<s:property value="%{#docindex}"/>" style="position:absolute; display:none; top:0px; left:0px; z-index:10000;" onmouseover="javascript:_mouseOverContext=true;" onmouseout="javascript:_mouseOverContext=false;">
               <jsp:include page="/jsp/menupopup.jsp"/>
             </div>
         </td>
         <td><img src="<s:url value="/skin/%{fileIcon}"/>" border="none" title=""/></td>
         <td>
-          <s:if test="%{#todo == 'renameDocument'}">
-            <s:if test="%{#edit == #docindex}">
+          <s:if test="%{curAction == 'renameDocument'}">
+            <s:if test="%{index == #docindex}">
               <input type="hidden" name="action" value="renameDocument" />
-              <input type="hidden" name="index" value="<%=index%>" />
+              <input type="hidden" name="index" value="<s:property value="index"/>" />
               <input type="text"   name="documentTitle" size="60" value="<s:property value="title"/>" />
             </s:if><s:else>
               <s:property value="title"/>
@@ -90,8 +84,8 @@
           </table>
           </s:else>
         </td>
-        <td align=right><s:property value="size"/>&nbsp;&nbsp;</td>
-        <td align=right><s:property value="date"/></td>
+        <td align="right"><s:property value="size"/>&nbsp;&nbsp;</td>
+        <td align="right"><s:property value="date"/></td>
       </tr>
       <s:if test="%{presentationState == 'open' || presentationState == 'deepopen'}">
         <s:iterator value="uses">
             <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 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 align="right"><s:property value="size"/>&nbsp;&nbsp;</td>
+            <td align="right"><s:property value="date"/></td>
           </tr>
         </s:iterator>
         <s:iterator value="attachments">
               <s:property value="format"/>&nbsp;<s:property value="description"/>
             </td>
             <td align=center></td>
-            <td align=right><s:property value="size"/>&nbsp;&nbsp;</td>
-            <td align=right><s:property value="date"/></td>
+            <td align="right"><s:property value="size"/>&nbsp;&nbsp;</td>
+            <td align="right"><s:property value="date"/></td>
           </tr>
         </s:iterator>
         <s:if test="%{history != null}">
                   </tr>
                 </table>
               </td>
-              <td align=right><s:property value="size"/>&nbsp;&nbsp;</td>
-              <td align=right><s:property value="date"/></td>
+              <td align="right"><s:property value="size"/>&nbsp;&nbsp;</td>
+              <td align="right"><s:property value="date"/></td>
             </tr>
             </s:iterator>
           </s:if>
       </s:if>
     </s:iterator>
   </s:if>
-  <s:if test="%{#todo != 'renameDocument' && userRights.canCreateDocument()}">
+  <s:if test="%{curAction != 'renameDocument' && userRights.canCreateDocument()}">
     <tr height=22 valign=bottom>
       <td align=center>
         <s:a href="%{addocument}">
index 8039f65f6d2a165cc4cd15ec51ed8c77ce591bad..95b721d50d3b94b3bf2ade3be5d292b1e094dc97 100644 (file)
         <div id=article-body class=text>
           <s:if test="%{writeAccess == 'true' && stepEnabled == 'true'}">
             <form name="edoc" action="setDocument" method="post">
-            <jsp:include page="/jsp/editContents.jsp">
-              <jsp:param name="action" value="<%=action%>" />
-              <jsp:param name="index"  value="<%=type%>" />
-            </jsp:include>
+            <jsp:include page="/jsp/editContents.jsp"/>
             </form>
           </s:if>
           <s:else>
index e60f604c47dd37a08549da5c9deda96f37ae8900..6b03392b5425487d010fce0700591414a2a0a438 100644 (file)
@@ -53,4 +53,12 @@ public abstract class AbstractDisplayAction extends Action {
 //  ==============================================================================================================================
 
     public abstract String getWriteAccess ();
+
+       /**
+        * Get the action.
+        * @return the action
+        */
+       public String getCurAction() {
+               return _action;
+       }
 }
\ No newline at end of file
index 795572d80f3447fa2df9efa89e44c779a804abf7..135444c2cbeae4300d52fd8e31f2a12731a889aa 100644 (file)
@@ -75,6 +75,7 @@ public class EditDocumentAction extends DisplayStudyStepAction {
                        if (todo == Execute.renameDocument) {
                                getPublicationService().rename(doc, _title);
                                // Useless to update the document presentation
+                               setAction(null);
                        } else if (todo == Execute.accept) {
                                getPublicationService().actualize(doc);
                                _openStudy.update(doc);