Javadoc
authorNiels Erik G. Nielsen <nielserik@indexdata.com>
Thu, 6 Jun 2013 14:15:44 +0000 (10:15 -0400)
committerNiels Erik G. Nielsen <nielserik@indexdata.com>
Thu, 6 Jun 2013 14:15:44 +0000 (10:15 -0400)
13 files changed:
overview.html
src/main/java/com/indexdata/mkjsf/pazpar2/Pz2Service.java
src/main/java/com/indexdata/mkjsf/pazpar2/commands/BytargetCommand.java
src/main/java/com/indexdata/mkjsf/pazpar2/commands/CommandParameter.java
src/main/java/com/indexdata/mkjsf/pazpar2/commands/Expression.java
src/main/java/com/indexdata/mkjsf/pazpar2/commands/FilterParameter.java
src/main/java/com/indexdata/mkjsf/pazpar2/commands/InitCommand.java
src/main/java/com/indexdata/mkjsf/pazpar2/commands/LimitParameter.java
src/main/java/com/indexdata/mkjsf/pazpar2/commands/Pazpar2Commands.java
src/main/java/com/indexdata/mkjsf/pazpar2/commands/PingCommand.java
src/main/java/com/indexdata/mkjsf/pazpar2/commands/RecordCommand.java
src/main/java/com/indexdata/mkjsf/pazpar2/commands/SearchCommand.java
src/main/java/com/indexdata/mkjsf/pazpar2/commands/package-info.java

index 17f74dd..c58dd54 100644 (file)
@@ -1,4 +1,7 @@
 <html>\r
+  <head>\r
+    <title>MKJSF - JavaServer Faces library for MasterKey</title>\r
+  </head>\r
   <body>\r
     Overview\r
   </body>\r
index 734d177..fea4a44 100644 (file)
@@ -178,7 +178,7 @@ public class Pz2Service implements StateListener, Configurable, Serializable {
      \r
   \r
   /**\r
-   * Updates display data objects by simultaneously issuing the following pazpar2 commands: \r
+   * Updates display data objects by simultaneously issuing the following Pazpar2 commands: \r
    * 'show', 'stat', 'termlist' and 'bytarget'. \r
    * <p>\r
    * If there are outstanding changes to the search command, a search\r
@@ -232,7 +232,7 @@ public class Pz2Service implements StateListener, Configurable, Serializable {
    * Simultaneously refreshes the data objects listed in 'commands' from pazpar2, potentially running a\r
    * search or a record command first if any of these two commands have outstanding parameter changes.\r
    * \r
-   * @param commands comma separated list of Pazpar2 commands to execute\r
+   * @param commands, a comma-separated list of Pazpar2 commands to execute\r
    * \r
    * @return Number of activeclients at the time of the 'show' command,\r
    *         or 'new' if search was just initiated.\r
index daea58a..02a2307 100644 (file)
@@ -3,7 +3,7 @@ package com.indexdata.mkjsf.pazpar2.commands;
 import com.indexdata.mkjsf.pazpar2.commands.sp.ServiceProxyCommand;\r
 \r
 /**\r
- * Represents a Pazpar2 'bytarget' command\r
+ * Represents a Pazpar2 <code>bytarget</code> command\r
  * \r
  * @author Niels Erik\r
  *\r
index eaff692..6c6df86 100644 (file)
@@ -13,11 +13,11 @@ import org.apache.log4j.Logger;
 /**\r
  * Represents a Pazpar2 command parameter with a name, an operator, \r
  * a simple value and/or one or more complex values (expressions).\r
- * <p>Examples</p>\r
+ * <p><i>Examples:</i></p>\r
  * <ul>\r
- *  <li>{name}{=}{value}</li>\r
- *  <li>{name}{=}{value} AND {expr1=value1} AND {expr2=value2}</li>\r
- *  <li>{name}{=}{expr1~value1},{expr2~value2}</li> \r
+ *  <li><code>{name}{=}{value}</code></li>\r
+ *  <li><code>{name}{=}{value} AND {expr1=value1} AND {expr2=value2}</code></li>\r
+ *  <li><code>{name}{=}{expr1~value1},{expr2~value2}</code></li> \r
  * </ul> \r
  * @author Niels Erik\r
  *\r
index 67cc3d4..1961bae 100644 (file)
@@ -11,11 +11,11 @@ import org.apache.log4j.Logger;
  * An expression consist of a left-of-operator field or key, an equality operator (= or ~), \r
  * a right-of-operator value, and optionally a label describing the value for UI display.\r
  * </p> \r
- * Examples:\r
+ * <p>Examples:</p>\r
  * <ul>\r
- *  <li>pz:id=1234 "My Target"</li>\r
- *  <li>category~libcatalog "Library Catalogs"</li>\r
- *  <li>author="Steinbeck, John"</li>\r
+ *  <li><code>pz:id=1234</code> "My Target"</li>\r
+ *  <li><code>category~libcatalog</code> "Library Catalogs"</li>\r
+ *  <li><code>author="Steinbeck, John"</code></li>\r
  * </ul>\r
  * @author Niels Erik\r
  *\r
index 0d540a2..6841d36 100644 (file)
@@ -2,6 +2,14 @@ package com.indexdata.mkjsf.pazpar2.commands;
 \r
 import org.apache.log4j.Logger;\r
 \r
+/**\r
+ * Represents a filter parameter as it applies to the Pazpar2 search command\r
+ * \r
+ * <p>A filter parameter consists of one or more expressions separated by commas.</p> \r
+ *  \r
+ * @author Niels Erik\r
+ *\r
+ */\r
 public class FilterParameter extends CommandParameter {\r
 \r
   private static final long serialVersionUID = -3697328835895528654L;\r
@@ -28,7 +36,13 @@ public class FilterParameter extends CommandParameter {
     return completeValue.toString();    \r
   }  \r
   \r
-  public String pz2escape (String expressionString) {\r
+  /**\r
+   * Escapes backslash (\), comma (,) and pipe (|) from an expression string.\r
+   *  \r
+   * @param expressionString\r
+   * @return escaped expressionString\r
+   */\r
+  private String pz2escape (String expressionString) {\r
     String escaped = expressionString.replaceAll("\\\\","\\\\\\\\");\r
     escaped = escaped.replaceAll(",","\\\\,");\r
     escaped = escaped.replaceAll("\\|", "\\\\|");\r
index d52ec51..e98a5cf 100644 (file)
@@ -5,6 +5,12 @@ import org.apache.log4j.Logger;
 import com.indexdata.mkjsf.pazpar2.commands.sp.InitCommandSp;\r
 import com.indexdata.mkjsf.pazpar2.commands.sp.ServiceProxyCommand;\r
 \r
+/**\r
+ * Represents a Pazpar2 <code>init</code> command.\r
+ * \r
+ * @author Niels Erik\r
+ *\r
+ */\r
 public class InitCommand extends Pazpar2Command implements ServiceProxyCommand {\r
 \r
   private static final long serialVersionUID = -4915976465898889987L;\r
@@ -15,27 +21,48 @@ public class InitCommand extends Pazpar2Command implements ServiceProxyCommand {
     super("init");\r
   }\r
   \r
+  /**\r
+   * Sets the <code>clear</code> parameter. See Pazpar2 documentation for details.\r
+   * \r
+   * @param clear\r
+   */\r
   public void setClear(String clear) { \r
     setParameterInState(new CommandParameter("clear","=",clear));\r
   }\r
-  \r
+\r
+  /**\r
+   * Returns the <code>clear</code> parameter value.\r
+   */\r
   public String getClear() {\r
     return getParameterValue("clear");\r
   }\r
   \r
+  /**\r
+   * Sets the <code>service</code> parameter. See Pazpar2 documentation for details.\r
+   * @param serviceId\r
+   */\r
   public void setService(String serviceId) {    \r
     setParameterInState(new CommandParameter("service","=",serviceId));\r
   }\r
   \r
+  /**\r
+   * Returns the <code>service</code> parameter value.\r
+   */  \r
   public String getService() {\r
     return getParameterValue("service");\r
   }\r
   \r
+  /**\r
+   * Disabled, not supported for <code>init</code>\r
+   */\r
   @Override\r
   public void setSession (String sessionId) {\r
     throw new UnsupportedOperationException("Cannot set session id on init command");\r
   }\r
-  \r
+\r
+  /**\r
+   * Disabled, not supported for <code>init</code>\r
+   */\r
   @Override\r
   public String getSession () {\r
     throw new UnsupportedOperationException("Cannot set or get session id on init command");\r
index b86c27f..0b98956 100644 (file)
@@ -2,6 +2,14 @@ package com.indexdata.mkjsf.pazpar2.commands;
 \r
 import org.apache.log4j.Logger;\r
 \r
+/**\r
+ * Represents a limit parameter as it applies to the Pazpar2 search command\r
+ * \r
+ * <p>A limit parameter consists of one or more expressions separated by commas.</p> \r
+ *  \r
+ * @author Niels Erik\r
+ *\r
+ */\r
 public class LimitParameter extends CommandParameter {\r
 \r
   private static final long serialVersionUID = -1410691265213389826L;\r
@@ -29,7 +37,7 @@ public class LimitParameter extends CommandParameter {
     return completeValue.toString();    \r
   }\r
   \r
-  public String pz2escape (String expressionString) {\r
+  private String pz2escape (String expressionString) {\r
     String escaped = expressionString.replaceAll("\\\\","\\\\\\\\");\r
     escaped = escaped.replaceAll(",","\\\\,");\r
     escaped = escaped.replaceAll("\\|", "\\\\|");\r
index c9dc4c0..b847e17 100644 (file)
@@ -14,17 +14,17 @@ import com.indexdata.mkjsf.utils.Utils;
 /**\r
  * Pazpar2Commands holds references to all Pazpar2 commands. \r
  * <p>\r
- * The Pazpar2Commands object itself is exposed to the UI as 'pzreq'. \r
+ * The Pazpar2Commands object itself is exposed to the UI as <code>pzreq</code>. \r
  * </p>\r
  * <p>\r
  * When the UI request a command it will be retrieved from the current state\r
  * through the state manager, so that the command can trigger a mutation of \r
  * the state if the user/UI modifies its parameters. \r
  * </p>\r
- * Examples:\r
+ * <p>Examples:</p>\r
  * <ul>\r
- *  <li>pzreq.show    - will retrieve the show command for editing or execution\r
- *  <li>pzreq.sp.auth - will retrieve the Service Proxy extension command 'auth'\r
+ *  <li><code>pzreq.show</code>    - will retrieve the show command for editing or execution\r
+ *  <li><code>pzreq.sp.auth</code> - will retrieve the Service Proxy extension command 'auth'\r
  * </ul>\r
  * \r
  * @author Niels Erik\r
@@ -52,6 +52,7 @@ public class Pazpar2Commands implements Serializable {
   }\r
   \r
   /**\r
+   * init command - referenced from UI as <code>pzreq.init</code>\r
    * \r
    * @return init command from current state\r
    */\r
@@ -60,6 +61,7 @@ public class Pazpar2Commands implements Serializable {
   }\r
     \r
   /** \r
+   * ping command - referenced from UI as <code>pzreq.ping</code>\r
    * \r
    * @return ping command from current state \r
    */\r
@@ -68,6 +70,7 @@ public class Pazpar2Commands implements Serializable {
   }\r
   \r
   /**\r
+   * settings command - referenced from UI as <code>pzreq.settings</code>\r
    * \r
    * @return settings command from current state\r
    */\r
index 8dbf348..6d3d024 100644 (file)
@@ -2,6 +2,12 @@ package com.indexdata.mkjsf.pazpar2.commands;
 \r
 import com.indexdata.mkjsf.pazpar2.commands.sp.ServiceProxyCommand;\r
 \r
+/**\r
+ * Represents a Pazpar2 <code>ping</code> command.\r
+ * \r
+ * @author Niels Erik\r
+ *\r
+ */\r
 public class PingCommand extends Pazpar2Command implements ServiceProxyCommand {\r
 \r
   private static final long serialVersionUID = 8876721711326535847L;\r
index c9df610..d453b75 100644 (file)
@@ -11,6 +11,12 @@ import com.indexdata.mkjsf.pazpar2.data.RecordResponse;
 import com.indexdata.mkjsf.pazpar2.data.ResponseDataObject;\r
 import com.indexdata.mkjsf.pazpar2.data.ResponseParser;\r
 \r
+/**\r
+ * Represents a Pazpar2 <code>record</code> command. \r
+ * \r
+ * @author Niels Erik\r
+ *\r
+ */\r
 public class RecordCommand extends Pazpar2Command implements ServiceProxyCommand {\r
 \r
   private static final long serialVersionUID = 2817539422114569506L;\r
@@ -57,58 +63,102 @@ public class RecordCommand extends Pazpar2Command implements ServiceProxyCommand
     return responseObject;\r
   }\r
   \r
+  /**\r
+   * Sets the <code>id</code> parameter. See Pazpar2 documentation for details.\r
+   * \r
+   * @param recId record ID\r
+   */\r
   public void setId(String recId) {\r
     setParameter(new CommandParameter("id","=",recId));\r
   }\r
-  \r
+\r
+  /** \r
+   * Returns the <code>id</code> parameter value.\r
+   */\r
   public String getId () {\r
     return getParameterValue("id");\r
   }\r
-  \r
+\r
+  /**\r
+   * Sets the <code>offset</code> parameter. See Pazpar2 documentation for details.\r
+   */  \r
   public void setOffset (String offset) {\r
     setParameter(new CommandParameter("offset","=",offset));\r
   }\r
-  \r
+\r
+  /** \r
+   * Returns the <code>offset</code> parameter value.\r
+   */\r
   public String getOffset () {\r
     return getParameterValue("offset");\r
   }\r
   \r
+  /**\r
+   * Sets the <code>checksum</code> parameter. See Pazpar2 documentation for details.\r
+   */  \r
   public void setChecksum (String checksum) {\r
     setParameter(new CommandParameter("checksum","=",checksum));\r
   }\r
   \r
+  /** \r
+   * Returns the <code>checksum</code> parameter value.\r
+   */\r
   public String getChecksum () {\r
     return getParameterValue("checksum");\r
   }\r
   \r
+  /**\r
+   * Sets the <code>nativesyntax</code> parameter. See Pazpar2 documentation for details.\r
+   */    \r
   public void setNativesyntax (String nativesyntax) {\r
     setParameterInState(new CommandParameter("nativesyntax","=",nativesyntax));\r
   }\r
   \r
+  /** \r
+   * Returns the <code>nativesyntax</code> parameter value.\r
+   */\r
   public String getNativesyntax () {\r
     return getParameterValue("nativesyntax");\r
   }\r
   \r
+  /**\r
+   * Sets the <code>syntax</code> parameter. See Pazpar2 documentation for details.\r
+   */  \r
   public void setSyntax (String syntax) {\r
     setParameterInState(new CommandParameter("syntax","=",syntax));    \r
   }\r
   \r
+  /** \r
+   * Returns the <code>syntax</code> parameter value.\r
+   */\r
   public String getSyntax () {\r
     return getParameterValue("syntax");\r
   }\r
   \r
+  /**\r
+   * Sets the <code>esn</code> parameter. See Pazpar2 documentation for details.\r
+   */  \r
   public void setEsn (String esn) {\r
     setParameter(new CommandParameter("esn","=",esn));\r
   }\r
   \r
+  /** \r
+   * Returns the <code>esn</code> parameter value.\r
+   */\r
   public String getEsn () {\r
     return getParameterValue("esn");\r
   }\r
   \r
+  /**\r
+   * Sets the <code>binary</code> parameter. See Pazpar2 documentation for details.\r
+   */  \r
   public void setBinary (String binary) {\r
     setParameter(new CommandParameter("binary","=",binary));\r
   }\r
   \r
+  /** \r
+   * Returns the <code>binary</code> parameter value.\r
+   */\r
   public String getBinary () {\r
     return getParameterValue("binary");\r
   }\r
index e36b239..671e723 100644 (file)
@@ -12,6 +12,12 @@ import com.indexdata.mkjsf.pazpar2.Pz2Service;
 import com.indexdata.mkjsf.pazpar2.commands.sp.ServiceProxyCommand;\r
 import com.indexdata.mkjsf.pazpar2.data.ResponseDataObject;\r
 \r
+/**\r
+ * Represents a Pazpar2 <code>search</code> command. \r
+ * \r
+ * @author Niels Erik\r
+ *\r
+ */\r
 @SessionScoped @Named\r
 public class SearchCommand extends Pazpar2Command implements ServiceProxyCommand {\r
   \r
@@ -31,7 +37,10 @@ public class SearchCommand extends Pazpar2Command implements ServiceProxyCommand
     Pz2Service.get().getSearchClient().setSearchCommand(this);\r
     return super.run();\r
   }\r
-    \r
+\r
+  /**\r
+   * Sets the <code>query</code> parameter. See Pazpar2 documentation for details.\r
+   */  \r
   public void setQuery(String query) {    \r
     setParameter(new QueryParameter("query","=",query));\r
   }\r
@@ -42,14 +51,24 @@ public class SearchCommand extends Pazpar2Command implements ServiceProxyCommand
     checkInState(copy);\r
   }\r
   \r
+  /** \r
+   * Returns the simple part of the <code>query</code> parameter value, excluding parts that \r
+   * were added as expressions (that is, not set with <code>setQuery()</code>).\r
+   */\r
   public String getQuery () {    \r
     return getParameter("query") == null ? null  : getParameter("query").getSimpleValue();\r
   }\r
-  \r
+\r
+  /** \r
+   * Returns the complete <code>query</code> parameter value, including expressions.\r
+   */\r
   public String getExtendedQuery () {    \r
     return getParameter("query") == null ? null  : getParameter("query").getValueWithExpressions();\r
   }\r
-  \r
+    \r
+  /**\r
+   * Sets the <code>filter</code> parameter. See Pazpar2 documentation for details.\r
+   */  \r
   public void setFilter(String filterExpression) {\r
     if (filterExpression != null && filterExpression.length()>0) {\r
       if (filterExpression.split("[=~]").length==1) {\r
@@ -62,10 +81,18 @@ public class SearchCommand extends Pazpar2Command implements ServiceProxyCommand
     }\r
   }\r
   \r
+  /**\r
+   * Sets the <code>filter</code> parameter. See Pazpar2 documentation for details.\r
+   */  \r
   public void setFilter(String field, String operator, String value, String label) {\r
     setParameter(new FilterParameter(new Expression(field,operator,value,label)));\r
   }\r
-  \r
+\r
+  /**\r
+   * Checks if there are any filter expressions matching any of the given expressionFields\r
+   * @param expressionFields expression fields (left-of-operator entities) to look for\r
+   * @return true if expression(s) found with any of <code>expressionFields</code> \r
+   */\r
   public boolean hasFilterExpression(String... expressionFields) {\r
     logger.trace("Checking for filter expression for " + Arrays.deepToString(expressionFields));\r
     for (String field : expressionFields) {\r
@@ -79,10 +106,18 @@ public class SearchCommand extends Pazpar2Command implements ServiceProxyCommand
   }\r
 \r
   \r
+  /** \r
+   * Returns the <code>filter</code> parameter value.\r
+   */\r
   public String getFilter() {\r
     return getParameter("filter") == null ? null : ((FilterParameter)getParameter("filter")).getValueWithExpressions();\r
   }\r
   \r
+  /**\r
+   * Returns the first filter expression of the given type\r
+   * @param expressionField expression field (left-of-operator entity) to look for\r
+   * @return the first filter expression found with the field <code>expressionField</code> or null if none found \r
+   */\r
   public Expression getOneFilterExpression(String expressionField) {\r
     List<Expression> exprs = getFilterExpressions(expressionField);\r
     if (exprs != null && exprs.size()>0) {\r
@@ -96,10 +131,14 @@ public class SearchCommand extends Pazpar2Command implements ServiceProxyCommand
   }\r
 \r
   \r
+  /**\r
+   * Returns list of all filter expressions \r
+   */\r
   public List<Expression> getFilterExpressions() {\r
     return getParameter("filter").getExpressions();\r
   }\r
     \r
+  \r
   public List<Expression> getFilterExpressions(String... expressionFields) {\r
     logger.trace("Checking for filter parameter");\r
     if (parameters.get("filter")!=null) {\r
@@ -114,7 +153,16 @@ public class SearchCommand extends Pazpar2Command implements ServiceProxyCommand
   public boolean hasFilter () {\r
     return getFilter().length()>0;\r
   }\r
-  \r
+\r
+  /**\r
+   * Adds a filter expression with a label for display. The filter is added to the end\r
+   * of an ordered list.  \r
+   * \r
+   * @param field\r
+   * @param operator\r
+   * @param value\r
+   * @param label\r
+   */\r
   public void addFilter(String field, String operator, String value, String label) {\r
     if (getParameter("filter") == null) {\r
       setFilter(field + operator + value);\r
@@ -122,37 +170,75 @@ public class SearchCommand extends Pazpar2Command implements ServiceProxyCommand
       addExpression("filter",new Expression(field,operator,value,(label != null ? label : value)));\r
     }\r
   }\r
-  \r
+\r
+  /**\r
+   * Clears the filter parameter\r
+   */\r
   public void removeFilters () {\r
     removeParameter("filter");\r
   }\r
-  \r
+\r
+  /**\r
+   * Removes a filter expression by exact attributes\r
+   * \r
+   * @param field\r
+   * @param operator\r
+   * @param value\r
+   */\r
   public void removeFilter(String field, String operator, String value) {\r
     removeExpression("filter",new Expression(field, operator, value, null));\r
   }\r
   \r
+  /**\r
+   * Removes all filter expressions matching a field listed in <code>fieldsToRemove</code>\r
+   * @param fieldsToRemove\r
+   */\r
   public void removeFilters(String... fieldsToRemove) {    \r
     removeExpressions("filter",fieldsToRemove);    \r
   }  \r
-    \r
+\r
+  /**\r
+   * Removes filter expressions coming after the expression matching the provided filter expression, \r
+   * if they have a field listed in <code>fieldsToRemove</code>. To be used for bread crumb like UI \r
+   * controls.\r
+   * \r
+   * @param field\r
+   * @param operator\r
+   * @param value\r
+   * @param fieldsToRemove\r
+   */\r
   public void removeFiltersAfter(String field, String operator, String value, String... fieldsToRemove) {     \r
     removeExpressionsAfter("filter",new Expression(field,operator,value,null),fieldsToRemove);    \r
   }\r
 \r
+  /**\r
+   * Sets the <code>limit</code> parameter. See Pazpar2 documentation for details.\r
+   */  \r
   public void setLimit (String limitExpression) {   \r
     if (limitExpression != null && limitExpression.length()>0) {\r
       setParameter(new LimitParameter(new Expression(limitExpression)));\r
     }\r
   }\r
   \r
+  /**\r
+   * Sets the <code>limit</code> parameter including a label. See Pazpar2 documentation for details.\r
+   */  \r
   public void setLimit(String field, String operator, String value, String label) {\r
     setParameter(new LimitParameter(new Expression(field,operator,value,label)));\r
   }\r
       \r
+  /** \r
+   * Returns the <code>limit</code> parameter value.\r
+   */\r
   public String getLimit () {\r
     return getParameter("limit") == null ? null : ((FilterParameter)getParameter("limit")).getValueWithExpressions();    \r
   }\r
     \r
+  /**\r
+   * Checks if there are any limit expressions matching any of the given expressionFields\r
+   * @param expressionFields expression fields (left-of-operator entities) to look for\r
+   * @return true if expression(s) found with any of <code>expressionFields</code> \r
+   */\r
   public boolean hasLimitExpression(String... expressionFields) {\r
     logger.trace("Checking for limit expression for " + Arrays.deepToString(expressionFields));\r
     for (String field : expressionFields) {\r
@@ -165,6 +251,11 @@ public class SearchCommand extends Pazpar2Command implements ServiceProxyCommand
     return false;\r
   }\r
   \r
+  /**\r
+   * Returns the first limit expression of the given type\r
+   * @param expressionField expression field (left-of-operator entity) to look for\r
+   * @return the first limit expression found with the field <code>expressionField</code> or null if none found \r
+   */\r
   public Expression getOneLimitExpression(String expressionField) {\r
     List<Expression> exprs = getLimitExpressions(expressionField);\r
     if (exprs != null && exprs.size()>0) {\r
@@ -177,10 +268,18 @@ public class SearchCommand extends Pazpar2Command implements ServiceProxyCommand
     }    \r
   }\r
   \r
+  /**\r
+   * Return a list of all current limit expressions\r
+   */\r
   public List<Expression> getLimitExpressions() {\r
     return getParameter("limit").getExpressions();\r
   }\r
   \r
+  /**\r
+   * Returns a list of limit expressions with fields that matches on of <code>expressionFields</code>\r
+   * \r
+   * @param expressionFields limit expressions to look for\r
+   */\r
   public List<Expression> getLimitExpressions(String... expressionFields) {\r
     logger.trace("Checking for limit parameter");\r
     if (parameters.get("limit")!=null) {\r
@@ -192,6 +291,15 @@ public class SearchCommand extends Pazpar2Command implements ServiceProxyCommand
     }\r
   }\r
   \r
+  /**\r
+   * Adds a limit expression with a label for display. The limit is added to the end\r
+   * of an ordered list.  \r
+   * \r
+   * @param field\r
+   * @param operator\r
+   * @param value\r
+   * @param label\r
+   */\r
   public void addLimit(String field, String operator, String value, String label) {\r
     if (getParameter("limit") == null) {\r
       setLimit(field, operator, value, label);\r
@@ -200,59 +308,112 @@ public class SearchCommand extends Pazpar2Command implements ServiceProxyCommand
     }\r
   }\r
   \r
+  /**\r
+   * Clears the limit parameter\r
+   */\r
   public void removeLimits() {\r
     removeParameter("limit");\r
   }\r
   \r
+  /**\r
+   * Removes all limit expressions that have fields as listed in <code>fieldsToRemove</code>\r
+   * @param fieldsToRemove\r
+   */\r
   public void removeLimits(String... fieldsToRemove) {    \r
     removeExpressions("limit",fieldsToRemove);    \r
   }\r
   \r
+  /**\r
+   * Removes a limit expression by exact attributes\r
+   * \r
+   * @param field\r
+   * @param operator\r
+   * @param value\r
+   */\r
   public void removeLimit(String field, String operator, String value) {\r
     removeExpression("limit",new Expression(field, operator, value, null));    \r
   }\r
   \r
+  /**\r
+   * Removes limit expressions coming after the provided limit expression, if they have a field listed in\r
+   * <code>fieldsToRemove</code>. To be used for bread crumb like UI controls.\r
+   * \r
+   * @param field\r
+   * @param operator\r
+   * @param value\r
+   * @param fieldsToRemove\r
+   */\r
   public void removeLimitsAfter(String field, String operator, String value, String... fieldsToRemove) {     \r
     removeExpressionsAfter("limit",new Expression(field,operator,value,null),fieldsToRemove);    \r
   }\r
 \r
         \r
+  /**\r
+   * Sets the <code>startrecs</code> parameter. See Pazpar2 documentation for details.\r
+   */  \r
   public void setStartrecs (String startrecs) {\r
     setParameter(new CommandParameter("startrecs","=",startrecs));\r
   }\r
   \r
+  /** \r
+   * Returns the <code>startrecs</code> parameter value.\r
+   */\r
   public String getStartrecs () {\r
     return getParameterValue("startrecs");\r
   }\r
   \r
+  /**\r
+   * Sets the <code>maxrecs</code> parameter. See Pazpar2 documentation for details.\r
+   */  \r
   public void setMaxrecs (String maxrecs) {\r
     setParameter(new CommandParameter("maxrecs","=",maxrecs));\r
   }\r
   \r
+  /** \r
+   * Returns the <code>maxrecs</code> parameter value.\r
+   */\r
   public String getMaxrecs () {\r
     return getParameterValue("maxrecs");\r
   }\r
   \r
+  /**\r
+   * Sets the <code>sort</code> parameter. See Pazpar2 documentation for details.\r
+   */  \r
   public void setSort (String sort) {\r
     setParameter(new CommandParameter("sort","=",sort));\r
   }\r
   \r
+  /** \r
+   * Returns the <code>sort</code> parameter value.\r
+   */\r
   public String getSort () {\r
     return getParameterValue("sort");\r
   }\r
   \r
+  /**\r
+   * Sets the <code>rank</code> parameter. See Pazpar2 documentation for details.\r
+   */  \r
   public void setRank (String rank) {\r
     setParameter(new CommandParameter("rank","=",rank));\r
   }\r
   \r
+  /** \r
+   * Returns the <code>rank</code> parameter value.\r
+   */\r
   public String getRank () {\r
     return getParameterValue("rank");\r
   }\r
   \r
+  /**\r
+   * Sets the <code>mergekey</code> parameter. See Pazpar2 documentation for details.\r
+   */  \r
   public void setMergekey (String mergekey) {\r
     setParameter(new CommandParameter("mergekey","=",mergekey));\r
   }\r
   \r
+  /** \r
+   * Returns the <code>mergekey</code> parameter value.\r
+   */\r
   public String getMergekey () {\r
     return getParameterValue("mergekey");\r
   }\r
index 347e81e..dd66c3f 100644 (file)
@@ -5,29 +5,29 @@
  * the selected Pazpar2 service. \r
  * <p>\r
  * The UI can access the command objects through the bean Pazpar2Commands, \r
- * which is exposed to the UI under the name 'pzreq'.\r
+ * which is exposed to the UI under the name <code>pzreq</code>.\r
  * </p>\r
  * <p>\r
  * For commands that has Service Proxy extension parameters, the UI \r
  * can access the extension parameters through the getSp() method\r
- * on the command.\r
+ * on the command - using for instance <code>pzreq.record.sp</code>\r
  * </p>\r
  * <p>\r
  * The UI can access Service Proxy-only commands through the getSp()\r
- * method on the pzreq bean.\r
+ * method on the pzreq bean - for instance <code>pzreq.sp.categories</code>\r
  * </p>\r
- * Examples\r
+ * <p>Examples:</p>\r
  * <ul>\r
- *  <li>pzreq.search.query references getter and setter for the \r
+ *  <li><code>pzreq.search.query</code> references getter and setter for the \r
  *          query parameter of the search command.</li>\r
  * \r
- *  <li>pzreq.search.run() executes the search command with current\r
+ *  <li><code>pzreq.search.run()</code> executes the search command with current\r
  *          parameters</li>\r
  *                      \r
- *  <li>pzreq.record.sp.recordquery references a Service Proxy-only \r
- *          parameter to the record command</li> \r
+ *  <li><code>pzreq.record.sp.recordquery</code> references getter and setter on a Service Proxy-only \r
+ *          <i>parameter</i> to the record command</li> \r
  *         \r
- *  <li>pzreq.sp.auth.run() executes a Service Proxy-only command</li> \r
+ *  <li><code>pzreq.sp.auth.run()</code> executes a Service Proxy-only <i>command</i></li> \r
  * </ul>          \r
  *          \r
  */\r