Salome HOME
Fix for mantis #0022066: Search form not conform to specifications (SC03): The "I...
authorrkv <rkv@opencascade.com>
Thu, 31 Jan 2013 12:34:34 +0000 (12:34 +0000)
committerrkv <rkv@opencascade.com>
Thu, 31 Jan 2013 12:34:34 +0000 (12:34 +0000)
Workspace/Siman/WebContent/WEB-INF/tiles/tiles-defs.xml
Workspace/Siman/WebContent/study/searchKnowledge.jsp
Workspace/Siman/WebContent/study/searchStudy.jsp
Workspace/Siman/src/org/splat/simer/SearchKnowledgeAction.java
Workspace/Siman/src/som.properties
Workspace/Siman/src/som_en.properties
Workspace/Siman/src/spring/applicationContext.xml

index 878eceb9db0b6757a556949980814946867da37a..897ce9b48ab747526169c48f539d4a10d0817547 100644 (file)
@@ -88,6 +88,7 @@
 </definition>
 
 <definition name="page.displayknowledge" extends="baseLayout">
+    <put-attribute name="study_properties"   value="/jsp/knowledgeProperties.jsp"/>
        <put-attribute name="presentation_pane"   value="/study/displayKnowledge.jsp"/>
 </definition>
 
index 5be4186e86ff0ff2452dfde1a381d29e1338e5f7..a2fc8872dc8c3d2432679c802014365be9933924 100644 (file)
@@ -1,16 +1,12 @@
 <%@page language="java" contentType="text/html; charset=ISO-8859-1"
     pageEncoding="ISO-8859-1"
 %>
-<%@page import="org.splat.dal.bo.som.KnowledgeElement"%>
 <%@page import="org.splat.som.ApplicationRights"%>
-<%@page import="org.splat.simer.ApplicationSettings"%>
 <%@page import="java.util.ResourceBundle"%>
-<%@page import="java.util.Calendar"%>
 <%@page import="java.text.SimpleDateFormat"%>
 <%@page import="org.splat.simer.Action"%>
 <%@page import="com.opensymphony.xwork2.ActionContext"%>
 <%@taglib prefix="s" uri="/struts-tags"%>
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 
 <!-- Initialization of the context
      =============================================================================================================================
 <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>
-<html>
+<script language="JavaScript" type="text/javascript" src="../js/search.js"></script>
 
-       <link href=<s:url value="/skin/default.css"/> rel="stylesheet" type="text/css">
-  
-    <script language="JavaScript" type="text/javascript" src="../js/search.js"></script>
-
-       <body onLoad="initialize('<%=result%>')">
+<script>
+$(document).ready(function () {
+    initialize('<%=result%>');
+});
+</script>
 
 <!-- Search criteria section
      =============================================================================================================================
                 </select>
                   </td>
                 </tr>
-                <tr>
-                  <td colspan=5 align=left>
-                    <s:if test="visibility == 'PRIVATE'">
-                      <input type=radio name="visibility" value="PRIVATE"    checked onClick="changeFilter()"><s:text name="field.private"/>&nbsp;&nbsp;
-                      <input type=radio name="visibility" value="PUBLIC"             onClick="changeFilter()"><s:text name="field.public"/>&nbsp;&nbsp;
-                      <input type=radio name="visibility" value="all"                onClick="changeFilter()"><s:text name="field.either"/>
-                    </s:if>
-                    <s:elseif test="visibility == 'PUBLIC'">
-                      <input type=radio name="visibility" value="PRIVATE"            onClick="changeFilter()"><s:text name="field.private"/>&nbsp;&nbsp;
-                      <input type=radio name="visibility" value="PUBLIC"     checked onClick="changeFilter()"><s:text name="field.public"/>&nbsp;&nbsp;
-                      <input type=radio name="visibility" value="all"                onClick="changeFilter()"><s:text name="field.either"/>
-                    </s:elseif>
-                    <s:elseif test="visibility == 'onlypublic'">
-                      <input type=radio name="visibility" value="PRIVATE"   disabled onClick="changeFilter()"><s:text name="field.private"/>&nbsp;&nbsp;
-                      <input type=radio name="visibility" value="onlypublic" checked onClick="changeFilter()"><s:text name="field.public"/>&nbsp;&nbsp;
-                      <input type=radio name="visibility" value="all"       disabled onClick="changeFilter()"><s:text name="field.either"/>
-                    </s:elseif>
-                    <s:else>
-                      <input type=radio name="visibility" value="PRIVATE"            onClick="changeFilter()"><s:text name="field.private"/>&nbsp;&nbsp;
-                      <input type=radio name="visibility" value="PUBLIC"             onClick="changeFilter()"><s:text name="field.public"/>&nbsp;&nbsp;
-                      <input type=radio name="visibility" value="all"        checked onClick="changeFilter()"><s:text name="field.either"/>
-                    </s:else>
-                  </td>
-                </tr>
                 <tr>
                   <td colspan=2><s:text name="criterion.author"/>&nbsp;</td>
                   <td colspan=3 align=center>
         </div>
       </div>
       </div>
-
-  </body>
-</html>
\ No newline at end of file
index 7ba827cd52787c3324f7b31ec8770e2b0ee1fac6..67166f5556169e0e3981f76210dfdb736898709a 100644 (file)
@@ -1,16 +1,12 @@
 <%@page language="java" contentType="text/html; charset=ISO-8859-1"
     pageEncoding="ISO-8859-1"
 %>
-<%@page import="org.splat.dal.bo.som.Study"%>
 <%@page import="org.splat.som.ApplicationRights"%>
-<%@page import="org.splat.simer.ApplicationSettings"%>
 <%@page import="java.util.ResourceBundle"%>
-<%@page import="java.util.Calendar"%>
 <%@page import="java.text.SimpleDateFormat"%>
 <%@page import="org.splat.simer.Action"%>
 <%@page import="com.opensymphony.xwork2.ActionContext"%>
 <%@taglib prefix="s" uri="/struts-tags"%>
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 
 <!-- Initialization of the context
      =============================================================================================================================
 <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>
-<html>
+<script language="JavaScript" type="text/javascript" src="../js/search.js"></script>
 
-  <link href=<s:url value="/skin/default.css"/> rel="stylesheet" type="text/css">
-
-  <script language="JavaScript" type="text/javascript" src="../js/search.js"></script>
-
-  <body onLoad="initialize('<%=result%>')">
+<script>
+$(document).ready(function () {
+    initialize('<%=result%>');
+});
+</script>
 
 <!-- Search criteria section
      =============================================================================================================================
         </div>
       </div>
       </div>
-
-  </body>
-</html>
\ No newline at end of file
index e4048726980758be29086e2e183e7b2bd575d3bc..035efd157a379e5fb87922baaf4bb453a7d559a0 100644 (file)
@@ -25,10 +25,6 @@ public class SearchKnowledgeAction extends AbstractSearchBaseAction {
         */
        private static final long serialVersionUID = -3104321907432838476L;
 
-       /**
-        * "Private", "Public", "All".
-        */
-       private String _visibility = null;
        /**
         * Knowledge type index when among all.
         */
@@ -119,7 +115,6 @@ public class SearchKnowledgeAction extends AbstractSearchBaseAction {
                        sprop.setAuthor(him);
                }
                // Set of the visibility
-               if ("all".equals(_visibility)) {
                        KnowledgeElement.Properties other = sprop.copy();
 
                        other.setVisibility(Visibility.PUBLIC);
@@ -128,20 +123,6 @@ public class SearchKnowledgeAction extends AbstractSearchBaseAction {
 
                        _result = getSearchService().selectKnowledgeElementsWhere(sprop,
                                        other);
-               } else {
-                       Visibility reparea;
-                       if ("onlypublic".equals(_visibility)) {
-                               reparea = Visibility.PUBLIC;
-                       } else {
-                               reparea = Visibility.valueOf(_visibility);
-                       }
-                       sprop.setVisibility(reparea);
-                       if (reparea == Visibility.PRIVATE) {
-                               sprop.setActor(getConnectedUser());
-                       }
-
-                       _result = getSearchService().selectKnowledgeElementsWhere(sprop);
-               }
                session.put(RESULT_KEY, _result); // For redisplaying the page without re-executing the search
                return "refresh";
        }
@@ -170,10 +151,6 @@ public class SearchKnowledgeAction extends AbstractSearchBaseAction {
                return _state;
        }
 
-       public String getVisibility() {
-               return _visibility;
-       }
-
        public String getWords() {
                return _words;
        }
@@ -198,10 +175,6 @@ public class SearchKnowledgeAction extends AbstractSearchBaseAction {
                this._state = value;
        }
 
-       public void setVisibility(final String value) {
-               this._visibility = value;
-       }
-
        public void setWords(final String value) {
                this._words = value;
        }
@@ -219,11 +192,9 @@ public class SearchKnowledgeAction extends AbstractSearchBaseAction {
        @SuppressWarnings("unchecked")
        protected void loadFilter() {
                Map<String, Object> session = getSession();
-               User user = getConnectedUser();
                Map<String, Object> filter = (Map<String, Object>) session
                                .get("knowledge.filter"); // A default filter is supposed being set at start
 
-               _visibility = (String) filter.get("visibility");
                _criteriaMatch = (String) filter.get("matchamong");
                _contextMatch = (String) filter.get("matcontext");
                _state = (String) filter.get("type");
@@ -231,10 +202,6 @@ public class SearchKnowledgeAction extends AbstractSearchBaseAction {
                _reference = (String) filter.get("reference");
                _words = (String) filter.get("title");
                _context = (List<SimulationContext>) filter.get("context");
-
-               if (user == null) {
-                       _visibility = "onlypublic";
-               }
        }
 
        @Override
@@ -244,7 +211,6 @@ public class SearchKnowledgeAction extends AbstractSearchBaseAction {
                Map<String, Object> filter = (Map<String, Object>) session
                                .get("knowledge.filter"); // A default filter is supposed being set at start
 
-               filter.put("visibility", this._visibility);
                filter.put("matchamong", this._criteriaMatch);
                filter.put("matcontext", this._contextMatch);
                filter.put("type", this._state);
index 61b0dce1ede4435ecd002b58fb6fb4a44cbdef43..e9b05e29b57e354197566c3bdbf8ea204fd1b46f 100644 (file)
@@ -55,6 +55,7 @@ type.context.platform        = Plate-forme logicielle
 type.context.module          = Module de calcul
 type.context.component       = Brique technologique
 
+type.knowledge.usecase       = Use case
 type.knowledge.bestpractice  = Bonne pratique
 type.knowledge.limitation    = Limitation
 type.knowledge.inconsistency = Incohérence
index 13cf269b817ce6bddf731057602aace73199ce7b..2d87e0a5abbe76accaa6012e0c77dc6cc0f30832 100644 (file)
@@ -56,6 +56,7 @@ type.context.platform        = Software platform
 type.context.module          = Solver
 type.context.component       = Software component
 
+type.knowledge.usecase       = Use case
 type.knowledge.bestpractice  = Best practice
 type.knowledge.limitation    = Limitation
 type.knowledge.inconsistency = Inconsistency
index fff1dff8469c3c24a6d5b011cb590bedb04ff94b..d3dfbf17ccc7db52a18ce54176323db1cbde0a37 100644 (file)
@@ -82,13 +82,13 @@ http://www.springframework.org/schema/context/spring-context-3.0.xsd">
                <property name="projectSettings" ref="projectSettings" />
                <property name="knowledgeElementTypeService"
                        ref="knowledgeElementTypeService" />
+        <property name="publicationService" ref="publicationService" />
        </bean>
 
        <bean id="openStudy" class="org.splat.simer.OpenStudy"
                parent="openObject" scope="session">
                <property name="projectElementService"
                        ref="projectElementService" />
-               <property name="publicationService" ref="publicationService" />
                <property name="studyService" ref="studyService" />
                <property name="stepService" ref="stepService" />
                <property name="repositoryService" ref="repositoryService" />