]> SALOME platform Git repositories - tools/siman.git/commitdiff
Salome HOME
Fix for mantis #0022066: Search form not conform to specifications (SC03): The "I...
authorrkv <rkv@opencascade.com>
Wed, 30 Jan 2013 12:51:54 +0000 (12:51 +0000)
committerrkv <rkv@opencascade.com>
Wed, 30 Jan 2013 12:51:54 +0000 (12:51 +0000)
Workspace/Siman/WebContent/study/searchStudy.jsp
Workspace/Siman/src/org/splat/simer/SearchStudyAction.java

index f62b825fd39d2dd62ad77eac621e524b09ca94ce..7ba827cd52787c3324f7b31ec8770e2b0ee1fac6 100644 (file)
                   </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>
index 37beb4bebe0f74f5a0e09c9111d26f7ec5bacc9f..423e39c374d2f9f9c7def02e8e134f1a9807eb68 100644 (file)
@@ -24,10 +24,6 @@ public class SearchStudyAction extends AbstractSearchBaseAction {
         */
        private static final long serialVersionUID = -1910481357051393077L;
 
-       /**
-        * "Private", "Public", "All".
-        */
-       private String _visibility = null;
        /**
         * "In-Work", "In-Draft", "In-Check"...
         */
@@ -122,28 +118,13 @@ public class SearchStudyAction extends AbstractSearchBaseAction {
                        sprop.setManager(him);
                }
                // Set of the visibility
-               if ("all".equals(_visibility)) {
-                       Study.Properties other = sprop.copy();
-
-                       other.setVisibility(Visibility.PUBLIC);
-                       sprop.setVisibility(Visibility.PRIVATE);
-                       sprop.setActor(getConnectedUser());
-
-                       _result = getSearchService().selectStudiesWhere(sprop, other);
-               } else {
-                       Visibility reparea = null;
-                       if ("onlypublic".equals(_visibility)) {
-                               reparea = Visibility.PUBLIC;
-                       } else {
-                               reparea = Visibility.valueOf(_visibility);
-                       }
-                       sprop.setVisibility(reparea);
-                       if (reparea == Visibility.PRIVATE) {
-                               sprop.setActor(getConnectedUser());
-                       }
-
-                       _result = getSearchService().selectStudiesWhere(sprop);
-               }
+               Study.Properties other = sprop.copy();
+
+               other.setVisibility(Visibility.PUBLIC);
+               sprop.setVisibility(Visibility.PRIVATE);
+               sprop.setActor(getConnectedUser());
+
+               _result = getSearchService().selectStudiesWhere(sprop, other);
                session.put(RESULT_KEY, _result); // For redisplaying the page without re-executing the search
                return "refresh";
        }
@@ -168,10 +149,6 @@ public class SearchStudyAction extends AbstractSearchBaseAction {
                return _state;
        }
 
-       public String getVisibility() {
-               return _visibility;
-       }
-
        public String getWords() {
                return _words;
        }
@@ -196,10 +173,6 @@ public class SearchStudyAction extends AbstractSearchBaseAction {
                this._state = value;
        }
 
-       public void setVisibility(final String value) {
-               this._visibility = value;
-       }
-
        public void setWords(final String value) {
                this._words = value;
        }
@@ -222,11 +195,9 @@ public class SearchStudyAction extends AbstractSearchBaseAction {
        @SuppressWarnings("unchecked")
        protected void loadFilter() {
                Map<String, Object> session = getSession();
-               User user = getConnectedUser();
                Map<String, Object> filter = (Map<String, Object>) session
                                .get("study.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("state");
@@ -234,10 +205,6 @@ public class SearchStudyAction extends AbstractSearchBaseAction {
                _reference = (String) filter.get("reference");
                _words = (String) filter.get("title");
                _context = (List<SimulationContext>) filter.get("context");
-
-               if (user == null) {
-                       _visibility = "onlypublic";
-               }
        }
 
        @Override
@@ -247,7 +214,6 @@ public class SearchStudyAction extends AbstractSearchBaseAction {
                Map<String, Object> filter = (Map<String, Object>) session
                                .get("study.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("state", this._state);