/**\r
* Represents a query parameter as it applies to the Pazpar2 search command\r
* \r
- * <p>A query parameter can consists of a term value and/or one or more expressions \r
+ * <p>A query parameter can consist of a term value and/or one or more expressions \r
* separated by boolean operators.</p>\r
* \r
* <p>A complex query can be represented in the object as either one long string \r
\r
import com.indexdata.mkjsf.pazpar2.commands.sp.ServiceProxyCommand;\r
\r
+/**\r
+ * Represents a Pazpar2 <code>settings</code> command. \r
+ * \r
+ * @author Niels Erik\r
+ *\r
+ */\r
public class SettingsCommand extends Pazpar2Command implements ServiceProxyCommand {\r
\r
private static final long serialVersionUID = 2291179325470387102L;\r
\r
import com.indexdata.mkjsf.pazpar2.commands.sp.ServiceProxyCommand;\r
\r
+\r
+/**\r
+ * Represents a Pazpar2 <code>show</code> command. \r
+ * \r
+ * @author Niels Erik\r
+ *\r
+ */\r
public class ShowCommand extends Pazpar2Command implements ServiceProxyCommand {\r
\r
private static final long serialVersionUID = -8242768313266051307L;\r
}\r
\r
/**\r
- * Sets the sort order for results, the updates the 'show' data object\r
- * from pazpar2. Set valid sort options in the documentation for pazpar2.\r
- * \r
- * The parts of the UI that display 'show' data should be rendered following\r
- * this request.\r
- * \r
- * @param sortOption\r
+ * Sets Pazpar2 parameter <code>sort</code>. See Pazpar2 documentation for details. \r
*/\r
public void setSort (String sort) {\r
setParameter(new CommandParameter("sort","=",sort));\r
}\r
\r
/**\r
- * Retrieves the current sort order for results\r
- * @return sort order - i.e. 'relevance'\r
+ * Gets parameter value for <code>sort</cod>\r
*/\r
public String getSort () {\r
return getParameter("sort") != null ? getParameter("sort").value : "relevance";\r
}\r
\r
/**\r
- * Sets the first record to show - starting at record '0'. After setting\r
- * first record number, the 'show' data object will be updated from pazpar2,\r
- * and the parts of the UI displaying show data should be re-rendered.\r
- * \r
- * To be used by the UI for paging.\r
- * \r
- * @param start first record to show\r
+ * Sets Pazpar2 parameter <code>start</code>. See Pazpar2 documentation for details. \r
*/\r
public void setStart (int start) { \r
setParameter(new CommandParameter("start","=",start)); \r
return getParameter("start") != null ? Integer.parseInt(getParameter("start").value) : 0;\r
}\r
\r
+ /**\r
+ * Sets Pazpar2 parameter <code>num</code>. See Pazpar2 documentation for details. \r
+ */\r
public void setNum (int num) {\r
setParameter(new CommandParameter("num","=",num));\r
}\r
- \r
+ \r
+ /** \r
+ * Get the parameter value for <code>num</code>\r
+ */\r
public int getNum () {\r
return getParameter("num") != null ? Integer.parseInt(getParameter("num").value) : 0;\r
}\r
\r
+ /**\r
+ * Sets Pazpar2 parameter <code>block</code>. See Pazpar2 documentation for details. \r
+ */\r
public void setBlock(String block) {\r
setParameterInState(new CommandParameter("block","=",block));\r
}\r
- \r
+\r
+ /** \r
+ * Get the parameter value for <code>block</code>\r
+ */\r
public String getBlock() {\r
return getParameterValue("block");\r
}\r
\r
+ /**\r
+ * Sets Pazpar2 parameter <code>mergekey</code>. See Pazpar2 documentation for details. \r
+ */\r
public void setMergekey (String mergekey) {\r
setParameter(new CommandParameter("mergekey","=",mergekey));\r
}\r
\r
+ /** \r
+ * Get the parameter value for <code>mergekey</code>\r
+ */\r
public String getMergekey () {\r
return getParameterValue("mergekey");\r
}\r
\r
+ /**\r
+ * Sets Pazpar2 parameter <code>rank</code>. See Pazpar2 documentation for details. \r
+ */\r
public void setRank (String rank) {\r
setParameter(new CommandParameter("rank","=",rank));\r
}\r
\r
+ /** \r
+ * Get the parameter value for <code>rank</code>\r
+ */\r
public String getRank () {\r
return getParameterValue("rank");\r
}\r
\r
import com.indexdata.mkjsf.pazpar2.commands.sp.ServiceProxyCommand;\r
\r
+/**\r
+ * Represents a Pazpar2 <code>stat</code> command. \r
+ * \r
+ * @author Niels Erik\r
+ *\r
+ */\r
public class StatCommand extends Pazpar2Command implements ServiceProxyCommand {\r
\r
private static final long serialVersionUID = 3980630346114157336L;\r
\r
import com.indexdata.mkjsf.pazpar2.commands.sp.ServiceProxyCommand;\r
\r
+/**\r
+ * Represents a Pazpar2 <code>termlist</code> command. \r
+ * \r
+ * @author Niels Erik\r
+ *\r
+ */\r
public class TermlistCommand extends Pazpar2Command implements ServiceProxyCommand {\r
\r
private static final long serialVersionUID = -7067878552863021727L;\r
super("termlist");\r
}\r
\r
+ /**\r
+ * Sets Pazpar2 parameter <code>name</code>. See Pazpar2 documentation for details. \r
+ */\r
public void setName(String names) {\r
setParameter(new CommandParameter("name","=",names));\r
}\r
\r
+ /**\r
+ * Gets parameter value for <code>name</cod>\r
+ */\r
public String getName () {\r
return getParameterValue("name");\r
}\r
- \r
+ \r
+ /**\r
+ * Sets Pazpar2 parameter <code>num</code>. See Pazpar2 documentation for details. \r
+ */\r
public void setNum (String num) {\r
setParameter(new CommandParameter("num","=",num));\r
}\r
\r
+ /**\r
+ * Gets parameter value for <code>num</cod>\r
+ */\r
public String getNum () {\r
return getParameterValue("num");\r
}\r
import com.indexdata.mkjsf.pazpar2.data.sp.SpResponseDataObject;\r
\r
/**\r
- * Authenticates a user against a Pazpar2 Service Proxy\r
+ * Represents a Service Proxy <code>auth</code> command. \r
+ * \r
+ * <p>Authenticates a user against a Pazpar2 Service Proxy</p>\r
* \r
* @author Niels Erik\r
*\r
return responseObject;\r
}\r
\r
+ /**\r
+ * Normalizes the response XML for the benefit of the SAX parser that creates data objects. \r
+ * <p>The parser expects responses to have document element names corresponding to the names of\r
+ * the commands that created the responses.</p>\r
+ * \r
+ * @param responseString\r
+ * @param newName\r
+ * @return\r
+ */\r
private String renameResponseElement(String responseString, String newName) {\r
responseString = responseString.replace("<response>", "<" + newName + ">");\r
responseString = responseString.replace("</response>", "</" + newName + ">");\r
return responseString;\r
}\r
\r
- \r
+ /**\r
+ * Sets Service Proxy command parameter <code>action</code>. See Service Proxy documentation for details. \r
+ */\r
public void setAction (String action) {\r
setParameterInState(new CommandParameter("action","=",action));\r
} \r
\r
+ /**\r
+ * Gets parameter value for <code>action</cod>\r
+ */\r
public String getAction () {\r
return getParameterValue("action");\r
}\r
\r
+ /**\r
+ * Sets Service Proxy command parameter <code>username</code>. See Service Proxy documentation for details. \r
+ */\r
public void setUsername(String username) {\r
setParameterInState(new CommandParameter("username","=",username));\r
}\r
\r
+ /**\r
+ * Gets parameter value for <code>username</cod>\r
+ */\r
public String getUsername () {\r
return getParameterValue("username");\r
}\r
- \r
+ \r
+ /**\r
+ * Sets Service Proxy command parameter <code>password</code>. See Service Proxy documentation for details. \r
+ */\r
public void setPassword (String password) {\r
setParameterInState(new CommandParameter("password","=",password));\r
}\r
\r
+ /**\r
+ * Gets parameter value for <code>password</cod>\r
+ */\r
public String getPassword () {\r
return getParameterValue("password");\r
}\r
import com.indexdata.mkjsf.pazpar2.data.sp.CategoriesResponse;\r
\r
/**\r
- * Retrieves target categories available to the current Service Proxy user.\r
+ * Represents a Service Proxy <code>categories</code> command.\r
+ * \r
+ * <p>Retrieves target categories available to the current Service Proxy user.</p> \r
+ * <p>Target categories can be used to limit a search to resources tagged with the given \r
+ * category. The following request in a Faces page would obtain categories for display in, say, a select list:\r
* <p>\r
- * Target categories can be used to limit a search to resources tagged with the given \r
- * category. The following request in a Faces page would obtain categories for displaying, say, a select list:\r
- * <p>\r
- * pzreq.sp.categories.run().targetCategories \r
+ * <code>pzreq.sp.categories.run().targetCategories</code> \r
* <p>\r
* This would get the Service Proxy extension commands, pick the categories command, execute it, and retrieve\r
* a list of TargetCategory objects from the returned response data object. \r
import com.indexdata.mkjsf.pazpar2.data.sp.SpResponseDataObject;\r
\r
/**\r
- * Service Proxy extensions to the init command - specifically \r
+ * Service Proxy extensions to the Pazpar2 <code>init</code> command - specifically \r
* support for POSTing to the Service Proxy an init doc containing Pazpar2 \r
* definitions and settings. \r
* \r
+ * This feature, however, is not supported in the publicly released Service Proxy at this point. \r
+ * \r
* @author Niels Erik\r
*\r
*/\r
initDocUpload = new InitDocUpload();\r
}\r
\r
+ /**\r
+ * Sets Service Proxy command parameter <code>includeDebug</code>. \r
+ */\r
public void setIncludeDebug (String includeDebug) {\r
command.setParameterInState(new CommandParameter("includeDebug","=",includeDebug));\r
}\r
import com.indexdata.mkjsf.pazpar2.commands.RecordCommand;\r
\r
/**\r
- * Service Proxy extensions to the record command. \r
+ * Service Proxy extensions to the Papzar2 <code>record</code> command. \r
* \r
* @author Niels Erik\r
*\r
this.command = command;\r
}\r
\r
+ /**\r
+ * Sets Service Proxy command parameter <code>recordquery</code>. See Service Proxy documentation for details. \r
+ */\r
public void setRecordquery (String recordQuery) {\r
command.setParameter(new CommandParameter("recordquery","=",recordQuery));\r
}\r
\r
+ /**\r
+ * Gets parameter value for <code>recordquery</cod>\r
+ */\r
public String getRecordquery() {\r
return command.getParameterValue("recordquery");\r
}\r
\r
+ /**\r
+ * Sets Service Proxy command parameter <code>acefilter</code>. See Service Proxy documentation for details.\r
+ */\r
public void setAcefilter (String aceFilter) {\r
command.setParameter(new CommandParameter("acefilter","=",aceFilter));\r
}\r
\r
+ /**\r
+ * Gets parameter value for <code>acefilter</cod>\r
+ */\r
public String getAcefilter () {\r
return command.getParameterValue("acefilter");\r
}\r
\r
/**\r
* ServiceProxyCommands holds references to all commands that are \r
- * Service Proxy-only, that is, not supported by straight Pazpar2.\r
+ * Service Proxy-only, those that are NOT supported by straight Pazpar2, that is.\r
* \r
* @author Niels Erik\r
*\r
this.stateMgr = stateMgr;\r
}\r
\r
+ /**\r
+ * auth command - referenced from UI as <code>pzreq.sp.auth</code>\r
+ * \r
+ * @return auth command from current state\r
+ */\r
public AuthCommand getAuth() {\r
return (AuthCommand) (stateMgr.getCommand(AUTH));\r
}\r
\r
+ /**\r
+ * categories command - referenced from UI as <code>pzreq.sp.categories</code>\r
+ * \r
+ * @return categories command from current state\r
+ */ \r
public CategoriesCommand getCategories() {\r
return (CategoriesCommand) (stateMgr.getCommand(CATEGORIES));\r
}\r