if (hasSingleTargetFilter(new SingleTargetFilter(targetId,targetName))) {\r
logger.debug("Already using target filter " + this.singleTargetFilter.getFilterExpression());\r
} else { \r
+ logger.debug("Setting new single target filter for [" + targetName + "]");\r
this.singleTargetFilter = new SingleTargetFilter(targetId,targetName);\r
setParameter(new CommandParameter("filter","=",this.singleTargetFilter.getFilterExpression())); \r
} \r
}\r
\r
public SingleTargetFilter getSingleTargetFilter () {\r
- logger.debug("request to get the current single target filter");\r
+ logger.debug("request to get the current single target filter " + singleTargetFilter);\r
return singleTargetFilter;\r
}\r
\r
* Removes the current target filter from the search\r
* \r
*/\r
- public void removeSingleTargetFilter () {\r
+ public String removeSingleTargetFilter () {\r
logger.debug("Removing target filter " + singleTargetFilter.getFilterExpression());\r
this.singleTargetFilter = null;\r
- removeParameter("filter"); \r
+ removeParameter("filter");\r
+ return null;\r
}\r
\r
/**\r
logger.debug("Checking if a single target filter is set: " + (singleTargetFilter != null));\r
return singleTargetFilter != null; \r
}\r
-\r
+ \r
/**\r
* Resolves if the current search command has a target filter - to\r
* be used by the UI for conditional rendering of target filter info.\r
* filter\r
*/\r
protected boolean hasSingleTargetFilter(SingleTargetFilter targetFilter) {\r
+ logger.debug("Checking if target filter for [" + targetFilter.getTargetName() + "] is set.");\r
return hasSingleTargetFilter() && targetFilter.equals(this.singleTargetFilter);\r
}\r
\r
\r
private static final long serialVersionUID = 2389085467202526537L;\r
\r
- private String targetName;\r
- private String targetId;\r
+ private String targetName = "";\r
+ private String targetId = "";\r
\r
public SingleTargetFilter (String targetId, String targetName) {\r
this.targetId = targetId;\r
return (targetId+targetName).hashCode();\r
}\r
\r
+ @Override\r
+ public String toString () {\r
+ return targetName + " (" + targetId + ")";\r
+ }\r
\r
}\r