public SearchCommand(StateManager stateMgr) {\r
super("search",stateMgr);\r
}\r
- \r
- public void setSession (String sessionId) {\r
- setParameter(new CommandParameter("session","=",sessionId));\r
- }\r
- \r
+ \r
public void setQuery(String query) { \r
setParameter(new CommandParameter("query","=",query));\r
}\r
return getParameter("query") == null ? null : getParameter("query").getValueWithExpressions();\r
}\r
\r
+ public void setFilter(String filterExpression) {\r
+ setParameter(new CommandParameter("filter","=",filterExpression));\r
+ }\r
+ \r
+ public String getFilter() {\r
+ return getParameter("filter") == null ? null : getParameter("filter").getValueWithExpressions();\r
+ }\r
+ \r
+ public void addFilter(String filterExpression) {\r
+ // TODO: implement\r
+ if (hasParameterSet("filter")) {\r
+ setFilter(filterExpression);\r
+ } else {\r
+ getParameter("filter");\r
+ }\r
+ throw new UnsupportedOperationException("removeFilter(filterExpression) yet to be implemented.");\r
+ }\r
+ \r
+ public void removeFilters () {\r
+ removeParameter("filter");\r
+ }\r
+ \r
+ public void removeFilter(String filterExpression) {\r
+ // TODO: implement\r
+ throw new UnsupportedOperationException("removeFilter(filterExpression) yet to be implemented.");\r
+ }\r
+\r
+ public boolean hasFilter () {\r
+ return getFilter().length()>0;\r
+ }\r
+ \r
+ public void setLimit (String limitExpression) {\r
+ setParameter(new CommandParameter("limit","=",limitExpression));\r
+ }\r
+ \r
+ public String getLimit () {\r
+ return getParameterValue("limit");\r
+ }\r
+ \r
+ public void setStartrecs (String startrecs) {\r
+ setParameter(new CommandParameter("startrecs","=",startrecs));\r
+ }\r
+ \r
+ public String getStartrecs () {\r
+ return getParameterValue("startrecs");\r
+ }\r
+ \r
+ public void setMaxrecs (String maxrecs) {\r
+ setParameter(new CommandParameter("maxrecs","=",maxrecs));\r
+ }\r
+ \r
+ public String getMaxrecs () {\r
+ return getParameterValue("maxrecs");\r
+ }\r
+ \r
+ public void setSort () {\r
+ setParameter(new CommandParameter("sort","=","sort"));\r
+ }\r
+ \r
+ public String getSort () {\r
+ return getParameterValue("sort");\r
+ }\r
+ \r
/**\r
* Sets a facet, in CQL, to restrict the current results,\r
* then executes the search \r
}\r
}\r
\r
- public void setFilter(String filterExpression) {\r
- setParameter(new CommandParameter("filter","=",filterExpression));\r
- }\r
- \r
- public String getFilter() {\r
- return getParameter("filter") == null ? null : getParameter("filter").getValueWithExpressions();\r
- }\r
- \r
- public boolean hasFilter () {\r
- return getFilter().length()>0;\r
- }\r
\r
/**\r
* Adds a single target filter to restrict the current query by, \r
protected boolean hasSingleTargetFilter(SingleTargetFilter targetFilter) {\r
return hasSingleTargetFilter() && targetFilter.equals(this.singleTargetFilter);\r
}\r
-\r
- \r
- public void setLimit (String limit) {\r
- // TODO\r
- }\r
- \r
- public void addFilter(String filterExpression) {\r
- if (hasParameterSet("filter")) {\r
- setFilter(filterExpression);\r
- } else {\r
- //TODO\r
- getParameter("filter");\r
- }\r
- }\r
- \r
- public void removeFilters () {\r
- \r
- }\r
- \r
- public void removeFilter(String filterExpression) {\r
- \r
- }\r
\r
public SearchCommand copy () {\r
SearchCommand newCommand = new SearchCommand(stateMgr);\r
return newCommand;\r
}\r
\r
-\r
}\r