</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"/>
- <input type=radio name="visibility" value="PUBLIC" onClick="changeFilter()"><s:text name="field.public"/>
- <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"/>
- <input type=radio name="visibility" value="PUBLIC" checked onClick="changeFilter()"><s:text name="field.public"/>
- <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"/>
- <input type=radio name="visibility" value="onlypublic" checked onClick="changeFilter()"><s:text name="field.public"/>
- <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"/>
- <input type=radio name="visibility" value="PUBLIC" onClick="changeFilter()"><s:text name="field.public"/>
- <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"/> </td>
<td colspan=3 align=center>
*/
private static final long serialVersionUID = -1910481357051393077L;
- /**
- * "Private", "Public", "All".
- */
- private String _visibility = null;
/**
* "In-Work", "In-Draft", "In-Check"...
*/
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";
}
return _state;
}
- public String getVisibility() {
- return _visibility;
- }
-
public String getWords() {
return _words;
}
this._state = value;
}
- public void setVisibility(final String value) {
- this._visibility = value;
- }
-
public void setWords(final String value) {
this._words = value;
}
@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");
_reference = (String) filter.get("reference");
_words = (String) filter.get("title");
_context = (List<SimulationContext>) filter.get("context");
-
- if (user == null) {
- _visibility = "onlypublic";
- }
}
@Override
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);