import org.apache.log4j.Logger;\r
\r
import com.indexdata.pz2utils4jsf.config.ConfigurationReader;\r
+import com.indexdata.pz2utils4jsf.pazpar2.commands.CommandParameter;\r
import com.indexdata.pz2utils4jsf.pazpar2.sp.ServiceProxyClient;\r
import com.indexdata.pz2utils4jsf.pazpar2.sp.ServiceProxyInterface;\r
import com.indexdata.pz2utils4jsf.pazpar2.sp.auth.ServiceProxyUser;\r
@Override\r
public String login(String navigateTo) {\r
logger.info("doing login");\r
- ((ServiceProxyClient)searchClient).authenticate(user);\r
+ ((ServiceProxyClient)searchClient).authenticate(user); \r
+ pzreq.getRecordInState().removeParametersSilently();\r
+ pzreq.getSearchInState().removeParametersSilently();\r
pzresp.reset();\r
- pzreq.getRecord().removeParameters();\r
- pzreq.getSearch().setQuery(null);\r
- \r
return navigateTo;\r
}\r
\r
public void setServiceProxyUrl(String url) {\r
logger.info("Setting Service Proxy url: " + url);\r
serviceProxyUrl = url;\r
- pzreq.getSearch().setQuery(null);\r
+ pzreq.getSearchInState().removeParametersSilently();\r
pzresp.reset();\r
}\r
\r
public SearchCommand getSearch() {\r
return (SearchCommand) (stateMgr.checkOut(SEARCH));\r
}\r
+ \r
+ /**\r
+ * Gets a mutable SearchCommand from current state (no checkout)\r
+ * Can be used for updating Search parameters without spawning new state.\r
+ * @return\r
+ */\r
+ public SearchCommand getSearchInState() {\r
+ return (SearchCommand) (stateMgr.getCurrentState().getCommand(SEARCH));\r
+ }\r
\r
public StatCommand getStat() {\r
return (StatCommand) (stateMgr.checkOut(STAT));\r
return (ShowCommand) (stateMgr.checkOut(SHOW));\r
}\r
\r
+ /**\r
+ * Gets a mutable ShowCommand from current state (no checkout)\r
+ * Can be used for updating show parameters without spawning new state.\r
+ * @return\r
+ */\r
public ShowCommand getShowInState () {\r
return (ShowCommand) (stateMgr.getCurrentState().getCommand(SHOW));\r
}\r
public RecordCommand getRecord() {\r
return (RecordCommand) (stateMgr.checkOut(RECORD));\r
}\r
- \r
+\r
+ /**\r
+ * Gets a mutable RecordCommand from current state (no checkout)\r
+ * Can be used for updating record parameters without spawning new state.\r
+ * @return\r
+ */ \r
public RecordCommand getRecordInState() {\r
return (RecordCommand)stateMgr.getCurrentState().getCommand(RECORD);\r
}\r