Salome HOME
JSP are updated to use more struts tags. Javadoc comments are added.
[tools/siman.git] / Workspace / Siman / WebContent / study / searchKnowledge.jsp
index a2fc8872dc8c3d2432679c802014365be9933924..301513c0b14ac83a267b0738cc6130b7fc43ad32 100644 (file)
@@ -1,38 +1,16 @@
 <%@page language="java" contentType="text/html; charset=ISO-8859-1"
     pageEncoding="ISO-8859-1"
 %>
-<%@page import="org.splat.som.ApplicationRights"%>
-<%@page import="java.util.ResourceBundle"%>
-<%@page import="java.text.SimpleDateFormat"%>
-<%@page import="org.splat.simer.Action"%>
-<%@page import="com.opensymphony.xwork2.ActionContext"%>
 <%@taglib prefix="s" uri="/struts-tags"%>
 
 <!-- Initialization of the context
      =============================================================================================================================
   -->
-<% 
-    ApplicationRights rights    = (ApplicationRights)session.getAttribute("user.rights");
-    Action anAction = (Action)ActionContext.getContext().getActionInvocation().getAction();
-    ResourceBundle    locale    = ResourceBundle.getBundle("som", 
-               anAction.getApplicationSettings().getCurrentLocale());
-    String            format    = locale.getString("date.format");
-    SimpleDateFormat  tostring  = new SimpleDateFormat(format);
-    String            result    = "uptodate";
-    boolean           connected = false;
-
-    if (rights.getUser() != null)                      connected = true;
-    if (session.getAttribute("search.result") == null) result    = "obsolete";
-%>
-
-<s:set var="user"><%=connected%></s:set>
-<s:set var="format"><%=format%></s:set>
-<s:set var="today"><%=tostring.format(java.util.Calendar.getInstance().getTime())%></s:set>
 <script language="JavaScript" type="text/javascript" src="../js/search.js"></script>
 
 <script>
 $(document).ready(function () {
-    initialize('<%=result%>');
+    initialize('<s:property value="resultState"/>');
 });
 </script>
 
@@ -43,49 +21,49 @@ $(document).ready(function () {
         <div id=section><s:text name="title.criteria"/></div>
         <div id="article-body">
           <form name="search" action="refresh-knowledge" method="post">
-          <input type=hidden name="contextIndex" />
+          <input type="hidden" name="contextIndex" />
           <s:set var="match1" value="criteriaMatch"/>
           <s:set var="match2" value="contextMatch"/>
           <s:set var="type"   value="state"/>
           <s:set var="him"    value="author"/>
 
-          <table width=100% cellpadding=0 cellspacing=0 border=0 class=text>
-            <tr height=20>
-              <td width=40%>
+          <table width="100%" cellpadding="0" cellspacing="0" border="0" class="text">
+            <tr height="20">
+              <td width="40%">
                 <b><s:text name="field.among"/></b>&nbsp;&nbsp;&nbsp;
                 <s:if test="%{#match1 == 'all'}">
-                <input type=radio name="criteriaMatch" value="all"  checked onClick="changeFilter()"><s:text name="field.matchall"/>
+                <input type="radio" name="criteriaMatch" value="all"  checked onClick="changeFilter()"><s:text name="field.matchall"/>
                 &nbsp;
-                <input type=radio name="criteriaMatch" value="any"          onClick="changeFilter()"><s:text name="field.matchany"/>
+                <input type="radio" name="criteriaMatch" value="any"          onClick="changeFilter()"><s:text name="field.matchany"/>
                 </s:if><s:else>
-                <input type=radio name="criteriaMatch" value="all"          onClick="changeFilter()"><s:text name="field.matchall"/>
+                <input type="radio" name="criteriaMatch" value="all"          onClick="changeFilter()"><s:text name="field.matchall"/>
                 &nbsp;
-                <input type=radio name="criteriaMatch" value="any"  checked onClick="changeFilter()"><s:text name="field.matchany"/>
+                <input type="radio" name="criteriaMatch" value="any"  checked onClick="changeFilter()"><s:text name="field.matchany"/>
                 </s:else>
               </td>
-              <td width=60%>|&nbsp;&nbsp;
+              <td width="60%">|&nbsp;&nbsp;
                 <b><s:text name="field.context"/></b>&nbsp;&nbsp;&nbsp;
                 <s:if test="%{#match2 == 'all'}">
-                <input type=radio name="contextMatch" value="all"  checked onClick="changeFilter()"><s:text name="field.matchall"/>
+                <input type="radio" name="contextMatch" value="all"  checked onClick="changeFilter()"><s:text name="field.matchall"/>
                 &nbsp;
-                <input type=radio name="contextMatch" value="any"          onClick="changeFilter()"><s:text name="field.matchany"/>
+                <input type="radio" name="contextMatch" value="any"          onClick="changeFilter()"><s:text name="field.matchany"/>
                 </s:if><s:else>
-                <input type=radio name="contextMatch" value="all"          onClick="changeFilter()"><s:text name="field.matchall"/>
+                <input type="radio" name="contextMatch" value="all"          onClick="changeFilter()"><s:text name="field.matchall"/>
                 &nbsp;
-                <input type=radio name="contextMatch" value="any"  checked onClick="changeFilter()"><s:text name="field.matchany"/>
+                <input type="radio" name="contextMatch" value="any"  checked onClick="changeFilter()"><s:text name="field.matchany"/>
                 </s:else>
               </td>
             </tr>
-            <tr height=1 bgcolor=#AAAAAA><td colspan=2></td></tr>
+            <tr height="1" bgcolor="#AAAAAA"><td colspan="2"></td></tr>
           </table>
 
-          <table width=100% cellpadding=0 cellspacing=0 border=0 class=text>
-            <tr valign=top>
-              <td width=40%>
-              <table cellpadding=0 cellspacing=0 border=0 class=text>
+          <table width="100%" cellpadding="0" cellspacing="0" border="0" class="text">
+            <tr valign="top">
+              <td width="40%">
+              <table cellpadding="0" cellspacing="0" border="0" class="text">
                 <tr>
-                  <td colspan=2><s:text name="criterion.knowledge"/>&nbsp;</td>
-                  <td colspan=3 align=center>
+                  <td colspan="2"><s:text name="criterion.knowledge"/>&nbsp;</td>
+                  <td colspan="3" align="center">
                 <select name="state" style="width: <s:text name="size.search.select"/>" onChange="changeFilter()">
                   <s:iterator value="knowledgeTypes">
                     <s:if test="%{index == #type}">
@@ -98,8 +76,8 @@ $(document).ready(function () {
                   </td>
                 </tr>
                 <tr>
-                  <td colspan=2><s:text name="criterion.author"/>&nbsp;</td>
-                  <td colspan=3 align=center>
+                  <td colspan="2"><s:text name="criterion.author"/>&nbsp;</td>
+                  <td colspan="3" align="center">
                 <select name="author" style="width: <s:text name="size.search.select"/>" onChange="changeFilter()">
                   <option value="0"><s:text name="criterion.anybody" /></option>
                   <s:iterator value="candidates">
@@ -115,33 +93,33 @@ $(document).ready(function () {
                 <tr>
                   <s:set var="tipdate">
                     <s:text name="help.search.date">
-                      <s:param><s:text name="%{#format}"/></s:param>
-                      <s:param><s:text name="%{#today}"/></s:param>
+                      <s:param><s:text name="%{format}"/></s:param>
+                      <s:param><s:text name="%{today}"/></s:param>
                     </s:text>
                   </s:set>
                   <td><s:text name="field.credate"/>&nbsp;</td>
                   <td><s:text name="field.after"/>&nbsp;</td>
-                  <td><input type=text name=after size=7 onKeydown="changeFilter()" title="<s:property value="%{#tipdate}"/>" />&nbsp;</td>
+                  <td><input type="text" name="after" size="7" onKeydown="changeFilter()" title="<s:property value="%{#tipdate}"/>" />&nbsp;</td>
                   <td><s:text name="field.before"/>&nbsp;</td>
-                  <td><input type=text name=before size=7 onKeydown="changeFilter()" title="<s:property value="%{#tipdate}"/>" /></td>
+                  <td><input type="text" name="before" size="7" onKeydown="changeFilter()" title="<s:property value="%{#tipdate}"/>" /></td>
                 </tr>
                 <tr height=26><td></td></tr>
               </table>
-              <table cellpadding=0 cellspacing=0 border=0 class=text>
+              <table cellpadding="0" cellspacing="0" border="0" class="text">
                 <tr>
                   <td><s:text name="field.contain"/>:&nbsp;</td>
-                  <td><input type=text name=words style="width: <s:text name="size.search.input"/>" value="<s:property value="%{words}"/>" onKeydown="changeFilter()" title="<s:text name="help.search.title"/>" /></td>
+                  <td><input type="text" name="words" style="width: <s:text name="size.search.input"/>" value="<s:property value="%{words}"/>" onKeydown="changeFilter()" title="<s:text name="help.search.title"/>" /></td>
                 </tr><tr>
                   <td><s:text name="field.reference"/>:&nbsp;</td>
-                  <td><input type=text name="reference" style="width: <s:text name="size.search.input"/>" value="<s:property value="%{reference}"/>" onKeydown="changeFilter()" title="<s:text name="help.search.refid"/>" /></td>
+                  <td><input type="text" name="reference" style="width: <s:text name="size.search.input"/>" value="<s:property value="%{reference}"/>" onKeydown="changeFilter()" title="<s:text name="help.search.refid"/>" /></td>
                 </tr>
               </table>
               </td>
-              <td width=60%>
-                <table cellpadding=0 cellspacing=0 border=0 class=text>
+              <td width="60%">
+                <table cellpadding="0" cellspacing="0" border="0" class="text">
                   <s:iterator value="simulationContexts">
                     <tr>
-                      <td><input type=checkbox checked onClick="removeContext('<s:property value="index"/>')">&nbsp;</td>
+                      <td><input type="checkbox" checked onClick="removeContext('<s:property value="index"/>')">&nbsp;</td>
                       <td>
                         <s:if test="%{type.isApproved()}"><s:text name="type.context.%{type.name}"/>:&nbsp;</s:if>
                         <s:else><s:property value="%{type.name}"/>:&nbsp;</s:else>
@@ -191,10 +169,10 @@ $(document).ready(function () {
             </tr>
           </table>
 
-          <table width=100% cellpadding=0 cellspacing=0 border=0 class=text>
+          <table width="100%" cellpadding="0" cellspacing="0" border="0" class="text">
             <tr>
-              <td width=40%></td>
-              <td width=60% align=left><input type="submit" name="refresh" value="<s:text name="button.result"/>" disabled/></td>
+              <td width="40%"></td>
+              <td width="60%" align="left"><input type="submit" name="refresh" value="<s:text name="button.result"/>" disabled/></td>
             </tr>
           </table>
 
@@ -205,23 +183,23 @@ $(document).ready(function () {
 <!-- Result list
      =============================================================================================================================
   -->
-      <div id=resulist>
-      <div id=article-box>
-        <div id=section><s:text name="title.result"/></div>
-        <div id=article-body class=text>
+      <div id="resulist">
+      <div id="article-box">
+        <div id="section"><s:text name="title.result"/></div>
+        <div id="article-body" class="text">
 
           <s:if test="result.size > 0">
-            <table width=100% cellpadding=0 cellspacing=0 border=0 class=text>
-            <tr height=20 valign=bottom>
-              <td width=20></td>
-              <td width=80><s:text name="label.reference"/></td>
+            <table width=100% cellpadding="0" cellspacing="0" border="0" class="text">
+            <tr height="20" valign="bottom">
+              <td width="20"></td>
+              <td width="80"><s:text name="label.reference"/></td>
               <td><s:text name="label.title"/><img src="<s:url value="/skin/icon.sortup.png"/>" border="none"/></td>
-              <td width=150><s:text name="label.author"/></td>
+              <td width="150"><s:text name="label.author"/></td>
             </tr>
-            <tr height=1 bgcolor=#AAAAAA><td colspan=4></td></tr>
+            <tr height="1" bgcolor="#AAAAAA"><td colspan="4"></td></tr>
               <s:iterator value="result">
                 <tr>
-                  <td><img src="<s:url value="/skin/icon.%{progressState}.png"/>" width=12 height=12 border="none" title=""/></td>
+                  <td><img src="<s:url value="/skin/icon.%{progressState}.png"/>" width="12" height="12" border="none" title=""/></td>
                   <td><s:property value="reference"/></td>
                   <td>
                       <s:url id="open" namespace="/study" action="open-knowledge?selection=0">