Salome HOME
Validation of the screens' input fields are implemented.
authormka <mka@opencascade.com>
Mon, 6 May 2013 12:24:35 +0000 (12:24 +0000)
committermka <mka@opencascade.com>
Mon, 6 May 2013 12:24:35 +0000 (12:24 +0000)
27 files changed:
Workspace/Siman-Common/src/test/labels.properties
Workspace/Siman-Common/src/test/labels_en.properties
Workspace/Siman-WS/src/labels.properties
Workspace/Siman-WS/src/labels_en.properties
Workspace/Siman/WebContent/WEB-INF/tiles/tiles-defs.xml
Workspace/Siman/WebContent/jsp/editKnowledge.jsp
Workspace/Siman/WebContent/sadmin/upload.jsp
Workspace/Siman/WebContent/skin/default.css
Workspace/Siman/WebContent/study/copyStudy.jsp
Workspace/Siman/WebContent/study/displayStudyStep.jsp
Workspace/Siman/WebContent/study/editScenarioProperties.jsp
Workspace/Siman/WebContent/study/editStudyProperties.jsp
Workspace/Siman/WebContent/study/importDocument.jsp
Workspace/Siman/WebContent/study/newScenario.jsp
Workspace/Siman/WebContent/study/newStudy.jsp
Workspace/Siman/WebContent/study/upload.jsp
Workspace/Siman/src/labels.properties
Workspace/Siman/src/labels_en.properties
Workspace/Siman/src/org/splat/simer/CopyStudyAction-valid-copy-validation.xml [new file with mode: 0644]
Workspace/Siman/src/org/splat/simer/CopyStudyAction.java
Workspace/Siman/src/org/splat/simer/EditKnowledgeElementAction-setKnowledge-validation.xml [new file with mode: 0644]
Workspace/Siman/src/org/splat/simer/EditScenarioPropertiesAction-valid-rename-validation.xml [new file with mode: 0644]
Workspace/Siman/src/org/splat/simer/ImportDocumentAction-valid-import-validation.xml [new file with mode: 0644]
Workspace/Siman/src/org/splat/simer/NewScenarioAction-valid-add-validation.xml [new file with mode: 0644]
Workspace/Siman/src/org/splat/simer/NewStudyAction-valid-new-validation.xml
Workspace/Siman/src/org/splat/simer/StudyPropertiesAction-valid-edit-validation.xml [new file with mode: 0644]
Workspace/Siman/src/struts.xml

index 784d347f2cf9b7c583ecab19270d46fc3f658bb9..8611df4522d19bad9a37744a4ba7c7b1bc5c462d 100644 (file)
@@ -163,6 +163,8 @@ field.password      = Mot de passe
 field.studytitle    = Titre de l''étude
 field.scenariotitle = Titre du scénario
 field.documentitle  = Titre du document
+field.knowledgetitle= Title of the knowledge
+field.knowledgevalue= Value of the knowledge
 field.product       = Produit étudié
 field.among         = Parmi
 field.context       = Contexte
@@ -277,6 +279,11 @@ message.noindex           = Aucune 
 message.nocontext         = Aucun contexte de simulation n''est en attente d''approbation.
 message.emptydocument     = Aucun document n''a été créé à cette étape.
 message.accept.document   = Voulez-vous accepter les modifications des documents utilisés ?
+message.promote.study     = Voulez-vous avancer l&#146;état de cette étude ?
+message.review.study      = Voulez-vous valider cette étude ?
+message.demote.study      = Voulez-vous reculer l&#146;état de cette étude ?
+message.disapprove.study  = Voulez-vous vraiment refuser l'approbation de cette étude?
+message.approve.study     = All knowledge attached to the study will also be approved. Did you review these knowledge ?
 message.publish.study     = All knowledge attached to the study will also be published. Did you review these knowledge ?
 message.protect.study     = Do you really want to protect the study ?
 message.promote.document  = Voulez-vous promouvoir ce document ?
index c355396387fd9bc00bb8340424cce8a3e116e866..1acbfa6a2c031ed409653a1bee0de44f79a4dfd8 100644 (file)
@@ -164,6 +164,8 @@ field.password      = Password
 field.studytitle    = Title of the study
 field.scenariotitle = Title of the scenario
 field.documentitle  = Title of the document
+field.knowledgetitle= Title of the knowledge
+field.knowledgevalue= Value of the knowledge
 field.product       = Studied product
 field.among         = Among
 field.context       = Context
@@ -278,6 +280,11 @@ message.noindex           = All existing studies are already indexed.
 message.nocontext         = No simulation context is pending for approval.
 message.emptydocument     = No document has been created at this step.
 message.accept.document   = Do you really want to accept the modifications of dependent documents ?
+message.promote.study     = Do you really want to promote this study ?
+message.review.study      = Do you really want to validate this study ?
+message.demote.study      = Do you really want to demote this study ?
+message.disapprove.study  = Do you really want to refuse approval of this study ?
+message.approve.study     = All knowledge attached to the study will also be approved. Did you review these knowledge ?
 message.publish.study     = All knowledge attached to the study will also be published. Did you review these knowledge ?
 message.protect.study     = Do you really want to protect the study ?
 message.promote.document  = Do you really want to promote this document ?
index a40cc51bb7f7769d23210e29e48ac463ae4f916a..8611df4522d19bad9a37744a4ba7c7b1bc5c462d 100644 (file)
@@ -163,6 +163,8 @@ field.password      = Mot de passe
 field.studytitle    = Titre de l''étude
 field.scenariotitle = Titre du scénario
 field.documentitle  = Titre du document
+field.knowledgetitle= Title of the knowledge
+field.knowledgevalue= Value of the knowledge
 field.product       = Produit étudié
 field.among         = Parmi
 field.context       = Contexte
index bad1cf7b9f997e4ffa48c4202a0a6ae86f8ee760..1acbfa6a2c031ed409653a1bee0de44f79a4dfd8 100644 (file)
@@ -164,6 +164,8 @@ field.password      = Password
 field.studytitle    = Title of the study
 field.scenariotitle = Title of the scenario
 field.documentitle  = Title of the document
+field.knowledgetitle= Title of the knowledge
+field.knowledgevalue= Value of the knowledge
 field.product       = Studied product
 field.among         = Among
 field.context       = Context
index 8b95ac4cb8df7f8f758a1deba1c1b4fd1ae434e3..b6cadead55d70f827ab6118e808b8616328911f0 100644 (file)
 </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>
index 5aa5f603d0b553ba8853a1df1bd8f4cf5cb6369c..80979a22c0741ad0e2f970564ece97fe1da3c855 100644 (file)
@@ -9,6 +9,21 @@
 <%@ page import="org.splat.simer.AbstractOpenObject"%>
 <%@ page import="org.splat.simer.OpenStudy"%>
 <%@ page import="org.splat.simer.KnowledgeElementFacade"%>
+
+<script language="JavaScript">
+    //Knowledge value validation
+    $(document).ready(function() {
+        $('#setKnowledge').submit(function(event) {
+            field = document.getElementById('hdnknowledgeValue');
+            document.getElementById('knowledgeValueErrorMessage').style.display = 'none';
+            if(field.value != null && (field.value == "" || field.value.replace(/^\s+|\s+$/g,"").length == 0)) {
+                event.preventDefault();
+                document.getElementById('knowledgeValueErrorMessage').style.display = 'table-row';
+            }
+        });
+    });
+</script>
+
 <%!
     private enum Action { addKnowledge, renameKnowledge, editKnowledge };
 %><%
@@ -21,8 +36,8 @@
 %>
 <s:url id="undo" namespace="/study" action="step-study"></s:url>
 
+<s:form name="edit" action="setKnowledge" method="post" validate="true" cssClass="text">
 <input type=hidden name=knowledgeType value="<%=typenumber%>"/>
-<table width=100% cellpadding=0 cellspacing=0 border=0 class=text>
 <%
     for (Iterator<AbstractOpenObject.KnowledgeIterator> knowtypes = knowlist.iterator(); knowtypes.hasNext(); ) {
        AbstractOpenObject.KnowledgeIterator type = knowtypes.next();
       List<KnowledgeElementFacade> knowelms = type.getKnowledgeElements();
       for (Iterator<KnowledgeElementFacade> iterator = knowelms.iterator(); iterator.hasNext(); ) {
         KnowledgeElementFacade kelm = iterator.next();
+        if (kelm.getIndex().equals(typenumber)) {
+%>          <tr id="knowledgeValueErrorMessage" style="display: none">
+              <td align="center" colspan="2" class="errorMessage">
+                <s:property value='%{getText("message.error.noenteredvalue", "-", getText("field.knowledgevalue"))}'/> 
+              </td>
+            </tr>
+<%      }
 %>
   <tr height=20 valign=top>
 
     <td>
 <%      if (kelm.getPresentationState().equals("open")) {
 %>          <img src="<s:url value="/skin/image.hold.gif"/>" border="none" width=18 height=12/>
-<%      }%> <table cellpadding=0 cellspacing=0 border=0>
-              <tr>
-<%
+<%      }
         if (todo == Action.renameKnowledge && kelm.getIndex().equals(typenumber)) {
-%>              <td width=18>
-                  <s:a href="%{undo}"><img src="<s:url value="/skin/icon.undo.png"/>" border="none" title="<s:text name="tooltip.cancel"/>" /></s:a>
-                </td>
-                <td>
-                  <input type=text size="35" name=knowledgeTitle value="<%=kelm.getTitle()%>" />
-                  <button type="submit" value="" style="width:24px; height:16px; border:0; cursor:pointer; cursor:hand; background:transparent">
-                    <img src="<s:url value="/skin/image.export.png"/>" title="<s:text name="button.save"/>"/>
-                  </button>
-                </td>
-<%      } else
-             if (todo == Action.editKnowledge && kelm.getIndex().equals(typenumber)) {
-%>              <td width=18>
-                  <s:a href="%{undo}"><img src="<s:url value="/skin/icon.undo.png"/>" border="none" title="<s:text name="tooltip.cancel"/>" /></s:a>
-                </td>
-                <td><%=kelm.getTitle()%></td>
+%>          
+            <s:a href="%{undo}"><img src="<s:url value="/skin/icon.undo.png"/>" border="none" title="<s:text name="tooltip.cancel"/>" /></s:a>
+            <s:set var="kelmTitle"><%=kelm.getTitle()%></s:set>
+            <s:textfield size="35" name="knowledgeTitle" value="%{kelmTitle}" theme="simple"/>
+            <button type="submit" value="" style="width:24px; height:16px; border:0; cursor:pointer; cursor:hand; background:transparent">
+            <img src="<s:url value="/skin/image.export.png"/>" title="<s:text name="button.save"/>"/>
+            </button>
+<%      } else if (todo == Action.editKnowledge && kelm.getIndex().equals(typenumber)) {
+%>          
+            <s:a href="%{undo}"><img src="<s:url value="/skin/icon.undo.png"/>" border="none" title="<s:text name="tooltip.cancel"/>" /></s:a>
+               <%=kelm.getTitle()%>
 <%      } else {
-%>              <td width=18>
-                  <s:set var="path">/skin/icon.<%=kelm.getProgressState()%>.png</s:set>
-                  <img src="<s:url value="%{#path}"/>" width=14 height=14 border="none" title=""/>
-                </td>
-                <td><%=kelm.getTitle()%></td>
+%>          
+            <s:set var="path">/skin/icon.<%=kelm.getProgressState()%>.png</s:set>
+            <img src="<s:url value="%{#path}"/>" width=14 height=14 border="none" title=""/>
+            <%=kelm.getTitle()%>
 <%      }
-%>            </tr>
-            </table>
+%>            
     </td>
 
 <!--    Value
       }
       if (todo == Action.addKnowledge && type.getIndex().equals(typenumber)) {
 %>  <tr height=5><td></td></tr>
+    <tr id="knowledgeValueErrorMessage" style="display: none">
+      <td align="center" colspan="2" class="errorMessage">
+        <s:property value='%{getText("message.error.noenteredvalue", "-", getText("field.knowledgevalue"))}'/> 
+      </td>
+    </tr>
     <tr valign=top>
       <td>
-        <table cellpadding=0 cellspacing=0 border=0>
-          <tr>
-            <td width=18>
-              <s:a href="%{undo}"><img src="<s:url value="/skin/icon.undo.png"/>" border="none" title="<s:text name="tooltip.cancel"/>" /></s:a>
-            </td>
-            <td><input type=text size="35" name=knowledgeTitle></td>
-          </tr>
-        </table>
+        <s:a href="%{undo}"><img src="<s:url value="/skin/icon.undo.png"/>" border="none" title="<s:text name="tooltip.cancel"/>" /></s:a>
+        <s:textfield size="35" name="knowledgeTitle" theme="simple"/>
       </td>
       <td>
         <script language='JavaScript' type='text/javascript'>
 <%    }
     }
 %>  <tr height=30 valign=middle><td></td></tr>
-
-</table>
\ No newline at end of file
+</s:form>
\ No newline at end of file
index 6723844010bf4b7ddd4aa37bb78ec1140d80b4a9..a8f11a541e63f37462a0a5fae32672b35afd37f2 100644 (file)
@@ -7,9 +7,12 @@
     <link href=<s:url value="/skin/default.css"/> rel="stylesheet" type="text/css">
     <script language="JavaScript">
   
-    function enableUpload () {
-//  ------------------------
-      upform.doIt.disabled = false;
+    function updateUploadButton() {
+      if(upform.upload.value == null || upform.upload.value == '') {
+        upform.doIt.disabled = true;
+      } else {
+        upform.doIt.disabled = false;
+      }
     }
     </script>
   </head>
               <tr height=10><td></td></tr>
               <s:hidden name="nextAction" value="%{nextAction}" />
               <s:hidden name="index"      value="%{index}" />
-              <s:file   name="upload" key="field.upload" onchange="enableUpload()" />
+                     <tr>
+                       <td><s:property value='getText("field.upload")'/>:&nbsp;<span class="error">*</span></td>
+                       <td><input type="file" name="upload" onchange="updateUploadButton()" /></td>
+                     </tr>
               <tr height=10><td></td></tr>
               <tr>
                 <td></td>
index d2fb58dd8cb1042d35e60422996339690ae17f2e..b78075827a4a84703fffe7f7effa0522f17da290 100644 (file)
@@ -249,7 +249,7 @@ body {
   color: #000000;
   text-decoration: none;
 }
-.error {
+.error, .errorMessage {
   font-family: Arial, Helvetica, sans-serif;
   font-size: 13px;
   font-weight: bold;
index cc6059c91dcb93fd014f4bd0a4e2fb000ec683d5..9a9403a4f2a95b0b347abc63ca04e67f4a937a85 100644 (file)
@@ -4,22 +4,23 @@
 
 <script language="JavaScript">
        function selectSourceStudy() {
+        document.forms["create"].action="new-copy";
                $("#create").submit();
        }
 </script>
 <tr>
-       <td>&nbsp;<s:text name="field.fromStudy" />*:&nbsp;
+       <td>&nbsp;<s:text name="field.fromStudy" />:&nbsp;<span class="error">*</span>
        </td>
        <td><s:select theme="simple" list="studies" name="fromStudyId"
                        onchange="selectSourceStudy()" /></td>
 </tr>
 <tr>
-       <td>&nbsp;<s:text name="field.finalStep" />*:&nbsp;
+       <td>&nbsp;<s:text name="field.finalStep" />:&nbsp;<span class="error">*</span>
        </td>
        <td><s:select theme="simple" list="steps" name="finalStep" /></td>
 </tr>
 <tr>
-       <td>&nbsp;<s:text name="field.fromScenario" />*:&nbsp;
+       <td>&nbsp;<s:text name="field.fromScenario" />:&nbsp;<span class="error">*</span>
        </td>
        <td><s:select theme="simple" list="scenarios"
                        name="fromScenarioId" /></td>
index aa4e86c75a63afc8c67da95bc8cfe5cb84ceb446..9683fcf3e042fb5b1acf4d72468d077c13d7a12f 100644 (file)
         <div id=section><s:text name="title.knowledge"/></div>
         <div id=article-body class=text>
           <s:if test="%{#todo == 'addKnowledge' || #todo == 'renameKnowledge' || #todo == 'editKnowledge'}">
-            <form name="edit" action="setKnowledge" method="post">
             <jsp:include page="/jsp/editKnowledge.jsp">
               <jsp:param name="action" value="<%=action%>" />
               <jsp:param name="index"  value="<%=type%>" />
             </jsp:include>
-            </form>
           </s:if>
           <s:else>
             <jsp:include page="/jsp/readKnowledge.jsp">
index 0913a60e4b346519983688acf7455beee0c5e24f..65de3ba044a603070203a08856097ed249a3a929 100644 (file)
 
 <!-- Scenario ckecked-in (editable)
   -->   <s:else>
-        <s:form name="property" action="%{rename_scenario}" method="post">
+        <s:form name="property" action="valid-rename" method="post" validate="true">
           <table class="text">
             <tr>
-              <td><s:text name="field.scenariotitle"/>*:&nbsp;</td>
+              <td><s:text name="field.scenariotitle"/>:&nbsp;<span class="error">*</span></td>
               <td>
-                <input type=text" size="25" name="selectedScenarioTitle" value="<s:property value="selectedScenarioTitle"/>">
+                <s:textfield size="25" name="selectedScenarioTitle" value="%{selectedScenarioTitle}" theme="simple"/>
               </td>
               <td>
                 <input type="submit" name="save"   value="<s:text name="button.save"/>"/>
index 47d8917b644a5636b48298a4fcfd5349442a693e..11a738cc6f8934817548edcb0d7776eb91b49008 100644 (file)
@@ -38,8 +38,7 @@
         </div>
         <div id=article-body class=text>
 
-          <s:form name="edit" action="valid-edit" method="post" validate="true">
-          <table width=100% cellpadding=0 cellspacing=0 border=0 class=text>
+          <s:form name="edit" action="valid-edit" method="post" validate="true" cssClass="text">
 
             <tr height=10><td width=20></td></tr>
             <tr>
             </tr>
             </s:iterator>
             <tr height=3><td></td></tr>
-            </table>
           </s:form>
         </div>
       </div>
index 8c7d22aa4303913358e69961f4d69d9974637653..899b182f8cc16bbfb66ba051ac39a4644170de44 100644 (file)
@@ -30,6 +30,17 @@ $(document).ready(function () {
                  $("#bring #documentState option[value='inDRAFT']").hide();
                }
        }).change();
+       
+    //hack for displaying document title error message above field labels
+       var done=false;
+       bring.addEventListener("DOMNodeInserted", function(e) {
+          if(done) {
+           done = false;
+          } else {
+           done = true;
+              $('[errorfor="documentName"]').insertAfter($('#fieldError'));
+          }
+       });
 });
 </script>
 
@@ -53,19 +64,19 @@ $(document).ready(function () {
        </tr>
 </table>
 
-<form name="bring" id="bring" action="valid-import" method="post">
+<s:form name="bring" id="bring" action="valid-import" method="post" validate="true" cssClass="text">
 <s:hidden name="fileName" /> <s:hidden name="reference" /> <s:hidden
        name="documentTitle" value="%{documentName}" /> <s:hidden
        name="defaultDocumentType" value="%{documentType}" /> <s:hidden
        name="defaultDocumentState" value="%{documentState}" /> <s:hidden
        name="version" /> <s:hidden name="documentDate" />
-<table cellpadding="0" cellspacing="0" border="0" class="text">
        <tr height="15">
                <td></td>
        </tr>
+    <tr id="fieldError"/>
        <tr>
                <td align="right"><s:text name="field.documentype" />&nbsp;&nbsp;</td>
-               <td align="left">&nbsp;<s:text name="field.documentitle" /></td>
+               <td align="left">&nbsp;<s:text name="field.documentitle" />&nbsp;<span class="error">*</span></td>
        </tr>
        <tr>
                <td><s:select theme="simple" name="documentType"
@@ -97,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 6c5d9229a9544044c72f468eab3193a4fccbce6d..fa866fd280c7a5ad45bd432fc9cd509dba8fe34b 100644 (file)
       <div id=article-box>
         <div id=section><s:text name="title.newscenario"/></div>
         <div id=article-body class=text>
-        <form name="create" action="valid-add" method="post">
-          <table class="text">
+        <s:form name="create" action="valid-add" method="post" cssClass="text" validate="true">
             <tr>
-              <td><s:text name="field.scenariotitle"/>*:&nbsp;</td>
+              <td><s:text name="field.scenariotitle"/>:&nbsp;<span class="error">*</span></td>
               <td>
-                <input type=text size="25" name=title value="<s:property value="title"/>">
+                <s:textfield size="25" name="title" value="%{title}" theme="simple"/>
               </td>
             </tr>
             <tr>
-              <td><s:text name="field.scenario"/>*:&nbsp;</td>
+              <td><s:text name="field.scenario"/>:&nbsp;<span class="error">*</span></td>
               <td>
                 <s:set var="previous" value="selectedScenarioIndex"/>
                 <select name="selectedScenario" style="width:204px">
@@ -74,8 +73,7 @@
                 <input type="submit" name="save"   value="<s:text name="button.newscenario"/>"/>
               </td>
             </tr>
-          </table>
-        </form>
+        </s:form>
         </div>
       </div>
   </body>
index 7fada946e6fd08c1f39864fcd492be8186658557..1d0148a26352825ef6794790bc4369ba63a9b699 100644 (file)
                create.projectContextId.value = <s:property value="projectContextId"/>;
         </s:if>
                setValue();
+               
+               //Studied product validation (based on struts-generated validation)
+           //relies on javascript included by 'validate="true"' for displaying error messages
+           document.getElementById("create").addEventListener('submit', function(event) {   //cross-browser solution
+               form = document.getElementById("create");
+       
+               var errors = false;
+               var continueValidation = true;
+                       
+               // field name: product
+               // custom validation function
+               if (form.elements['projectContext'] && form.elements['projectContextId']) {
+                   field = form.elements['projectContext'];
+                   id = form.elements['projectContextId'];
+                   var error = "The field \'Studied product\' must be filled";
+                   if (continueValidation
+                           && id.value != null && (
+                               (id.value == 0
+                                  && field.value != null 
+                                  && (field.value == "" || field.value.replace(/^\s+|\s+$/g,"").length == 0)
+                               )
+                               || id.value == -1
+                           )
+                       ) {
+                       addError(field, error);
+                       errors = true;
+                   }
+               }
+               if(errors) {
+                   event.preventDefault();    //cross-browser solution
+               }
+           });
+           
+           function setDefaultSelection()(event) {
+            tds = document.getElementById("select");
+            tde = document.getElementById("enter");
+            tds.style.display = "block"; // Hides the select input
+            tde.style.display = "none"; // Displays the text input
+            
+               create.projectContextId.value = -1;
+               create.projectContextId.focus();
+               
+               //hide back button
+           }
        });
+    
+    
 </script>
 
 <!-- New study dialog
                <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">
+       <s:form id="create" name="create"
+               action="%{#request.valid_action}" method="post" validate="true" cssClass="text">
 
                        <tr class="error">
                                <td colspan="3"><s:text name="%{error}" /></td>
                        </tr>
 
                        <tr>
-                               <td>&nbsp;<s:text name="field.studytitle" />*:&nbsp;
+                               <td>&nbsp;<s:text name="field.studytitle" />:&nbsp;<span class="error">*</span>
                                </td>
                                <td><s:textfield theme="simple" size="60" name="title" /></td>
                        </tr>
 
                        <tr>
-                               <td>&nbsp;<s:text name="field.product" />*:&nbsp;
+                               <td>&nbsp;<s:text name="field.product" />:&nbsp;<span class="error">*</span>
                                </td>
                                <s:if test="projectContextValues.size > 0">
                                        <td id="select"><select name="projectContextId"
 
                        <tr>
                                <td align="right" colspan="2"><s:submit
-                                               action="%{#request.valid_action}" theme="simple" type="button"
+                                               theme="simple" type="button"
                                                key="button.newstudy" /></td>
                        </tr>
 
-               </table>
-       </form>
+       </s:form>
        <div id="top-spacer"></div>
 </div>
 
index 3bc423466913e401d54eaf4a26e4c0d609a6cd11..c311f5fe041f56e0a3c256e8f0352abc75d02119 100644 (file)
@@ -3,8 +3,12 @@
 %>
 <%@taglib prefix="s" uri="/struts-tags"%>
 <script language="JavaScript">
-    function enableUpload () {
-      upform.doIt.disabled = false;
+    function updateUploadButton() {
+      if(upform.upload.value == null || upform.upload.value == '') {
+        upform.doIt.disabled = true;
+      } else {
+        upform.doIt.disabled = false;
+      }
     }
 </script>
 <!-- Updload dialog
         <tr height=10><td></td></tr>
         <s:hidden name="nextAction" value="%{nextAction}" />
         <s:hidden name="index"      value="%{index}" />
-        <s:file   name="upload" key="field.upload" onchange="enableUpload()" />
+        <tr>
+          <td><s:property value='getText("field.upload")'/>:&nbsp;<span class="error">*</span></td>
+          <td><input type="file" name="upload" onchange="updateUploadButton()" /></td>
+        </tr>
         <tr height=10><td></td></tr>
         <tr>
           <td></td>
index a40cc51bb7f7769d23210e29e48ac463ae4f916a..8611df4522d19bad9a37744a4ba7c7b1bc5c462d 100644 (file)
@@ -163,6 +163,8 @@ field.password      = Mot de passe
 field.studytitle    = Titre de l''étude
 field.scenariotitle = Titre du scénario
 field.documentitle  = Titre du document
+field.knowledgetitle= Title of the knowledge
+field.knowledgevalue= Value of the knowledge
 field.product       = Produit étudié
 field.among         = Parmi
 field.context       = Contexte
index bad1cf7b9f997e4ffa48c4202a0a6ae86f8ee760..1acbfa6a2c031ed409653a1bee0de44f79a4dfd8 100644 (file)
@@ -164,6 +164,8 @@ field.password      = Password
 field.studytitle    = Title of the study
 field.scenariotitle = Title of the scenario
 field.documentitle  = Title of the document
+field.knowledgetitle= Title of the knowledge
+field.knowledgevalue= Value of the knowledge
 field.product       = Studied product
 field.among         = Among
 field.context       = Context
diff --git a/Workspace/Siman/src/org/splat/simer/CopyStudyAction-valid-copy-validation.xml b/Workspace/Siman/src/org/splat/simer/CopyStudyAction-valid-copy-validation.xml
new file mode 100644 (file)
index 0000000..c0e0339
--- /dev/null
@@ -0,0 +1,13 @@
+<!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="title">
+       <field-validator type="requiredstring">
+            <message>${getText("message.error.noenteredvalue", "-", getText("field.studytitle"))}</message>
+        </field-validator>
+    </field>
+    <field name="fromStudyId">
+        <field-validator type="required">
+            <message>${getText("message.error.noenteredvalue", "-", getText("field.fromStudy"))}</message>
+        </field-validator>
+    </field>
+</validators>
\ No newline at end of file
index edd7643621d5a7092f97928fb3a10609987cfdd1..549deb4d678a7a9f9a868092ffc7171fd5bcb5c5 100644 (file)
@@ -107,7 +107,7 @@ public class CopyStudyAction extends NewStudyAction {
                List<Proxy> studies = getSearchService().selectStudiesWhere(filter);
 
                // Fill the studies list
-               _studies.put(0L, "");
+               _studies.put(null, "");
                for (Proxy study : studies) {
                        _studies.put(study.getIndex(), study.getTitle());
                }
diff --git a/Workspace/Siman/src/org/splat/simer/EditKnowledgeElementAction-setKnowledge-validation.xml b/Workspace/Siman/src/org/splat/simer/EditKnowledgeElementAction-setKnowledge-validation.xml
new file mode 100644 (file)
index 0000000..356ae72
--- /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="knowledgeTitle">
+       <field-validator type="requiredstring">
+            <message>${getText("message.error.noenteredvalue", "-", getText("field.knowledgetitle"))}</message>
+        </field-validator>
+    </field>
+</validators>
\ No newline at end of file
diff --git a/Workspace/Siman/src/org/splat/simer/EditScenarioPropertiesAction-valid-rename-validation.xml b/Workspace/Siman/src/org/splat/simer/EditScenarioPropertiesAction-valid-rename-validation.xml
new file mode 100644 (file)
index 0000000..30e2ffc
--- /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="selectedScenarioTitle">
+        <field-validator type="requiredstring">
+            <message>${getText("message.error.noenteredvalue", "-", getText("field.scenariotitle"))}</message>
+        </field-validator>
+    </field>
+</validators>
\ No newline at end of file
diff --git a/Workspace/Siman/src/org/splat/simer/ImportDocumentAction-valid-import-validation.xml b/Workspace/Siman/src/org/splat/simer/ImportDocumentAction-valid-import-validation.xml
new file mode 100644 (file)
index 0000000..2a33b4c
--- /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="documentName">
+       <field-validator type="requiredstring">
+            <message>${getText("message.error.noenteredvalue", "-", getText("field.documentitle"))}</message>
+        </field-validator>
+    </field>
+</validators>
\ No newline at end of file
diff --git a/Workspace/Siman/src/org/splat/simer/NewScenarioAction-valid-add-validation.xml b/Workspace/Siman/src/org/splat/simer/NewScenarioAction-valid-add-validation.xml
new file mode 100644 (file)
index 0000000..53cb2d5
--- /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="title">
+       <field-validator type="requiredstring">
+            <message>${getText("message.error.noenteredvalue", "-", getText("field.scenariotitle"))}</message>
+        </field-validator>
+    </field>
+</validators>
\ No newline at end of file
index 6dc567ee4f8c5558d2793053c4fb11ba05255824..14ca5ce06ec46aba477147c0271276c4cfe20593 100644 (file)
@@ -5,9 +5,4 @@
             <message>${getText("message.error.noenteredvalue", "-", getText("field.studytitle"))}</message>
         </field-validator>
     </field>
-    <field name="projectContext">
-       <field-validator type="requiredstring">
-            <message>${getText("message.error.noenteredvalue", "-", getText("field.product"))}</message>
-        </field-validator>
-    </field>
 </validators>
\ No newline at end of file
diff --git a/Workspace/Siman/src/org/splat/simer/StudyPropertiesAction-valid-edit-validation.xml b/Workspace/Siman/src/org/splat/simer/StudyPropertiesAction-valid-edit-validation.xml
new file mode 100644 (file)
index 0000000..dc09a75
--- /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="title">
+        <field-validator type="requiredstring">
+            <message>${getText("message.error.noenteredvalue", "-", getText("field.studytitle"))}</message>
+        </field-validator>
+    </field>
+</validators>
\ No newline at end of file
index 12a20f32886521e2e478081675805245df5ea651..135496fc7dd0e711faa2a2831f3619c5eb9d4a4e 100644 (file)
                </action>
                <action name="valid-new" class="newStudyAction"
                        method="create">
-                       <!--interceptor-ref name="siman-validation" /-->
+            <interceptor-ref name="simanBasicStack"/>
+            <interceptor-ref name="siman-validation"/>
                        <result name="success" type="redirectAction">
                                open-study?selection=0.1
                        </result>
         </action>
         <action name="valid-copy" class="copyStudyAction"
             method="create">
+            <interceptor-ref name="simanBasicStack"/>
+            <interceptor-ref name="siman-validation"/>
             <result name="success" type="redirectAction">
                 open-study?selection=0.1
             </result>
                </action>
                <action name="valid-add" class="newScenarioAction"
                        method="create">
+            <interceptor-ref name="simanBasicStack"/>
+            <interceptor-ref name="siman-validation"/>
                        <result name="cancel" type="redirectAction">
                                step-study
                        </result>
                </action>
                <action name="valid-edit" class="studyPropertiesAction"
                        method="edition">
+            <interceptor-ref name="simanBasicStack"/>
+            <interceptor-ref name="siman-validation"/>
                        <result name="success" type="tiles">
                                page.editstudyproperties
                        </result>
                </action>
                <action name="valid-import" class="importDocumentAction"
                        method="import">
+            <interceptor-ref name="simanBasicStack"/>
+            <interceptor-ref name="siman-validation"/>
                        <result name="success" type="redirectAction">
                                step-study
                        </result>
                </action>
                <action name="setKnowledge" class="editKnowledgeElementAction"
                        method="setKnowledge">
+            <interceptor-ref name="simanBasicStack"/>
+            <interceptor-ref name="siman-validation"/>
                        <result name="success" type="redirectAction">
                 study/open-study
             </result>