]> SALOME platform Git repositories - tools/siman.git/commitdiff
Salome HOME
newStudy includes copyStudy JSP now by means of tiles.
authorrkv <rkv@opencascade.com>
Mon, 25 Mar 2013 12:14:21 +0000 (12:14 +0000)
committerrkv <rkv@opencascade.com>
Mon, 25 Mar 2013 12:14:21 +0000 (12:14 +0000)
Workspace/Siman/WebContent/WEB-INF/tiles/tiles-defs.xml
Workspace/Siman/WebContent/study/copyStudy.jsp
Workspace/Siman/WebContent/study/newStudy.jsp

index 716d29dd479a5920121c36e065c2f2584378e340..8b95ac4cb8df7f8f758a1deba1c1b4fd1ae434e3 100644 (file)
        <put-attribute name="presentation_pane"   value="/study/error.jsp"/>
 </definition>
 
+<definition name="page.new.study" template="/study/newStudy.jsp">
+    <put-attribute name="input_action" value="new-study" type="string"/>
+    <put-attribute name="valid_action" value="valid-new" type="string"/>
+</definition>
+
+<definition name="page.copy.study" template="/study/newStudy.jsp">
+    <put-attribute name="input_action" value="new-copy" type="string"/>
+    <put-attribute name="valid_action" value="valid-copy" type="string"/>
+    <put-attribute name="source_study" value="/study/copyStudy.jsp"/>
+</definition>
+
 <definition name="page.newstudy" extends="baseLayoutWithoutTitleBar">
-    <put-attribute name="presentation_pane"   value="/study/newStudy.jsp"/>
+    <put-attribute name="presentation_pane"   value="page.new.study"/>
 </definition>
 
 <definition name="page.newcopy" extends="baseLayoutWithoutTitleBar">
-    <put-attribute name="presentation_pane"   value="/study/copyStudy.jsp"/>
+    <put-attribute name="presentation_pane"   value="page.copy.study"/>
 </definition>
 
 <definition name="page.searchstudy" extends="baseLayoutWithoutTitleBar">
index 66254583696c975584bb3dac26a3bff9040ef63e..cc6059c91dcb93fd014f4bd0a4e2fb000ec683d5 100644 (file)
 <%@ taglib prefix="s" uri="/struts-tags"%>
 
 <script language="JavaScript">
-       function initialize() {
-               create.elements[0].focus();
-       }
-
-       function setValue() {
-               var select = create.projectContextId.value; // contextValue select input
-               if (select == "0") { // Creation of a new context type
-                       tds = document.getElementById("select");
-                       tde = document.getElementById("enter");
-                       tds.style.display = "none"; // Hides the select input
-                       tde.style.display = "block"; // Displays the text input
-               }
-               create.projectContext.focus();
-       }
-
        function selectSourceStudy() {
                $("#create").submit();
        }
-       
-       $(document).ready(function () {
-           create.projectContextId.value = <s:property value="projectContextId"/>;
-           setValue();
-       });
 </script>
-
-<!-- New study dialog
-     ===========================================================================
-  -->
-<div id="article-box">
-       <div id="section">
-               <s:text name="title.newstudy" />
-       </div>
-       <div id="top-spacer"></div>
-       <form id="create" name="create" action="new-copy" method="post">
-               <table class="text">
-
-                       <tr class="error">
-                               <td colspan="3"><s:text name="%{error}" /></td>
-                       </tr>
-
-                       <tr>
-                               <td>&nbsp;<s:text name="field.studytitle" />*:&nbsp;
-                               </td>
-                               <td><s:textfield theme="simple" size="60" name="title" /></td>
-                       </tr>
-
-                       <tr>
-                               <td>&nbsp;<s:text name="field.product" />*:&nbsp;
-                               </td>
-                               <s:if test="projectContextValues.size > 0">
-                                       <td id="select"><select name="projectContextId"
-                                               style="width: 214px" onChange="setValue()">
-                                                       <option value="-1">
-                                                               <s:text name="menu.select" />
-                                                       </option>
-                                                       <option value="0">
-                                                               &nbsp;
-                                                               <s:text name="menu.newproduct" />
-                                                       </option>
-                                                       <optgroup label="&nbsp;<s:text name="label.products"/>">
-                                                               <s:iterator value="projectContextValues">
-                                                                       <option value="<s:property value="index"/>">
-                                                                               &nbsp;
-                                                                               <s:property value="value" />
-                                                                       </option>
-                                                               </s:iterator>
-                                                       </optgroup>
-                                       </select></td>
-                                       <td id="enter" style="display: none"><s:textfield
-                                                       theme="simple" size="30" name="projectContext" /></td>
-                               </s:if>
-                               <s:else>
-                                       <td><s:hidden name="projectContextId" value="0" /> <s:textfield
-                                                       size="30" name="projectContext" /></td>
-                               </s:else>
-                       </tr>
-                       <tr>
-                               <td>&nbsp;<s:text name="field.fromStudy" />*:&nbsp;
-                               </td>
-                               <td><s:select theme="simple" list="studies" name="fromStudyId"
-                                               onchange="selectSourceStudy()" /></td>
-                       </tr>
-                       <tr>
-                               <td>&nbsp;<s:text name="field.finalStep" />*:&nbsp;
-                               </td>
-                               <td><s:select theme="simple" list="steps" name="finalStep" /></td>
-                       </tr>
-                       <tr>
-                               <td>&nbsp;<s:text name="field.fromScenario" />*:&nbsp;
-                               </td>
-                               <td><s:select theme="simple" list="scenarios"
-                                               name="fromScenarioId" /></td>
-                       </tr>
-                       <tr>
-                               <td align="right" colspan="2"><s:submit action="valid-copy"
-                                               theme="simple" type="button" key="button.newstudy" /></td>
-                       </tr>
-
-               </table>
-       </form>
-       <div id="top-spacer"></div>
-</div>
-
-<!-- Reserved
-  -->
-<div id="right-pane"></div>
-<div id="bottom-spacer"></div>
+<tr>
+       <td>&nbsp;<s:text name="field.fromStudy" />*:&nbsp;
+       </td>
+       <td><s:select theme="simple" list="studies" name="fromStudyId"
+                       onchange="selectSourceStudy()" /></td>
+</tr>
+<tr>
+       <td>&nbsp;<s:text name="field.finalStep" />*:&nbsp;
+       </td>
+       <td><s:select theme="simple" list="steps" name="finalStep" /></td>
+</tr>
+<tr>
+       <td>&nbsp;<s:text name="field.fromScenario" />*:&nbsp;
+       </td>
+       <td><s:select theme="simple" list="scenarios"
+                       name="fromScenarioId" /></td>
+</tr>
index 29aca70561f0022e6462ca8bb1663154ecbf602c..34d5e8c13ed37aa614236004c6b7a5bef5e5c17b 100644 (file)
@@ -1,87 +1,95 @@
-<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
+<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
+    pageEncoding="ISO-8859-1"%>
 <%@ taglib prefix="s" uri="/struts-tags"%>
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%>
+<tiles:importAttribute name="valid_action" scope="request"/>
 
-
-    <script language="JavaScript">
-
-    function initialize () {
-//  ----------------------
-      create.elements[0].focus();
+<script language="JavaScript">
+    function initialize() {
+        create.elements[0].focus();
     }
 
-    function setValue () {
-//  -------------------
-      var select = create.elements[1].value;  // contextValue select input
-      if (select == "0") {                    // Creation of a new context type
-        tds = document.getElementById("select");
-        tde = document.getElementById("enter");
-        tds.style.display = "none";           // Hides the select input
-        tde.style.display = "block";          // Displays the text input
-      }
-      create.elements[2].focus();
+    function setValue() {
+        var select = create.projectContextId.value; // contextValue select input
+        if (select == "0") { // Creation of a new context type
+            tds = document.getElementById("select");
+            tde = document.getElementById("enter");
+            tds.style.display = "none"; // Hides the select input
+            tde.style.display = "block"; // Displays the text input
+        }
+        create.projectContext.focus();
     }
-    </script>
+    
+    $(document).ready(function () {
+        create.projectContextId.value = <s:property value="projectContextId"/>;
+        setValue();
+    });
+</script>
 
 <!-- New study dialog
-     =============================================================================================================================
+     ===========================================================================
   -->
-      <div id=article-box>
-        <div id=section><s:text name="title.newstudy"/></div>
-        <div id=top-spacer></div>
-        <form name="create" action="valid-new" method="post">
+<div id="article-box">
+    <div id="section">
+        <s:text name="title.newstudy" />
+    </div>
+    <div id="top-spacer"></div>
+    <form id="create" name="create" action="<tiles:getAsString name="input_action"/>" method="post">
         <table class="text">
 
-          <tr class="error">
-            <td colspan=3><s:text name="%{error}"/></td>
-          </tr>
+            <tr class="error">
+                <td colspan="3"><s:text name="%{error}" /></td>
+            </tr>
 
-          <tr>
-            <td>
-              &nbsp;<s:text name="field.studytitle"/>*:&nbsp;
-            </td>
-            <td colspan=2>
-              <input type=text size="60" name=title value="<s:property value="title"/>">
-            </td>
-          </tr>
+            <tr>
+                <td>&nbsp;<s:text name="field.studytitle" />*:&nbsp;
+                </td>
+                <td><s:textfield theme="simple" size="60" name="title" /></td>
+            </tr>
 
-          <tr>
-            <td>
-              &nbsp;<s:text name="field.product"/>*:&nbsp;
-            </td>
-            <s:if test="projectContextValues.size > 0">
-              <td id=select>
-                <select name="projectContext" style="width:214px" onChange="setValue()">
-                  <option value="-1"><s:text name="menu.select"/></option>
-                  <option value="0">&nbsp;<s:text name="menu.newproduct"/></option>
-                  <optgroup label="&nbsp;<s:text name="label.products"/>">
-                    <s:iterator value="projectContextValues">
-                      <option value="<s:property value="index"/>">&nbsp;<s:property value="value"/></option>
-                    </s:iterator>
-                  </optgroup>
-                </select>
-              </td>
-              <td id=enter style="display: none">
-                <input type=text size="30" name=projectContext>
-              </td>
-            </s:if>
-            <s:else>
-              <td>
-                <input type=hidden         name=projectContext value="0">
-                <input type=text size="30" name=projectContext>
-              </td>
-            </s:else>
-            <td align=right>
-              <input type="submit" value="<s:text name="button.newstudy"/>"/>
-            </td>
-          </tr>
+            <tr>
+                <td>&nbsp;<s:text name="field.product" />*:&nbsp;
+                </td>
+                <s:if test="projectContextValues.size > 0">
+                    <td id="select"><select name="projectContextId"
+                        style="width: 214px" onChange="setValue()">
+                            <option value="-1">
+                                <s:text name="menu.select" />
+                            </option>
+                            <option value="0">
+                                &nbsp;
+                                <s:text name="menu.newproduct" />
+                            </option>
+                            <optgroup label="&nbsp;<s:text name="label.products"/>">
+                                <s:iterator value="projectContextValues">
+                                    <option value="<s:property value="index"/>">
+                                        &nbsp;
+                                        <s:property value="value" />
+                                    </option>
+                                </s:iterator>
+                            </optgroup>
+                    </select></td>
+                    <td id="enter" style="display: none"><s:textfield
+                            theme="simple" size="30" name="projectContext" /></td>
+                </s:if>
+                <s:else>
+                    <td><s:hidden name="projectContextId" value="0" /> <s:textfield
+                            size="30" name="projectContext" /></td>
+                </s:else>
+            </tr>
+                <tiles:insertAttribute name="source_study" ignore="true" />
+            
+            <tr>
+                <td align="right" colspan="2"><s:submit action="%{#request.valid_action}"
+                        theme="simple" type="button" key="button.newstudy" /></td>
+            </tr>
 
         </table>
-        </form>
-        <div id=top-spacer></div>
-      </div>
+    </form>
+    <div id="top-spacer"></div>
+</div>
 
 <!-- Reserved
   -->
-    <div id=right-pane></div>
-    <div id=bottom-spacer></div>
+<div id="right-pane"></div>
+<div id="bottom-spacer"></div>