X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fcom%2Findexdata%2Fmkjsf%2Fpazpar2%2Fcommands%2FShowCommand.java;h=d290f7445775ca3fbb1b060060445fa55870f9ed;hb=6c92dd9a72ae1fa27dd061c1897531879b8c0ba6;hp=90e3cd0cfd1a07f1fde71da6673692dcb26c2d81;hpb=2d0e3e85c08c0e25b077e6a140019ad3f6e57505;p=mkjsf-moved-to-github.git
diff --git a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/ShowCommand.java b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/ShowCommand.java
index 90e3cd0..d290f74 100644
--- a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/ShowCommand.java
+++ b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/ShowCommand.java
@@ -1,33 +1,33 @@
package com.indexdata.mkjsf.pazpar2.commands;
import com.indexdata.mkjsf.pazpar2.commands.sp.ServiceProxyCommand;
-import com.indexdata.mkjsf.pazpar2.state.StateManager;
+import com.indexdata.mkjsf.pazpar2.commands.sp.ShowCommandSp;
+
+/**
+ * show
Pazpar2 command, referenced as: pzreq.show
+ *
+ * @author Niels Erik
+ *
+ */
public class ShowCommand extends Pazpar2Command implements ServiceProxyCommand {
private static final long serialVersionUID = -8242768313266051307L;
- public ShowCommand(StateManager stateMgr) {
- super("show",stateMgr);
+ public ShowCommand() {
+ super("show");
setParameterInState(new CommandParameter("start","=","0"));
}
/**
- * Sets the sort order for results, the updates the 'show' data object
- * from pazpar2. Set valid sort options in the documentation for pazpar2.
- *
- * The parts of the UI that display 'show' data should be rendered following
- * this request.
- *
- * @param sortOption
+ * Sets Pazpar2 parameter sort
. See Pazpar2 documentation for details.
*/
public void setSort (String sort) {
setParameter(new CommandParameter("sort","=",sort));
}
/**
- * Retrieves the current sort order for results
- * @return sort order - i.e. 'relevance'
+ * Gets parameter value for sort
*/
public String getSort () {
return getParameter("sort") != null ? getParameter("sort").value : "relevance";
@@ -57,13 +57,7 @@ public class ShowCommand extends Pazpar2Command implements ServiceProxyCommand {
}
/**
- * Sets the first record to show - starting at record '0'. After setting
- * first record number, the 'show' data object will be updated from pazpar2,
- * and the parts of the UI displaying show data should be re-rendered.
- *
- * To be used by the UI for paging.
- *
- * @param start first record to show
+ * Sets Pazpar2 parameter start
. See Pazpar2 documentation for details.
*/
public void setStart (int start) {
setParameter(new CommandParameter("start","=",start));
@@ -80,25 +74,65 @@ public class ShowCommand extends Pazpar2Command implements ServiceProxyCommand {
return getParameter("start") != null ? Integer.parseInt(getParameter("start").value) : 0;
}
+ /**
+ * Sets Pazpar2 parameter num
. See Pazpar2 documentation for details.
+ */
public void setNum (int num) {
setParameter(new CommandParameter("num","=",num));
}
-
+
+ /**
+ * Get the parameter value for num
+ */
public int getNum () {
return getParameter("num") != null ? Integer.parseInt(getParameter("num").value) : 0;
}
+ /**
+ * Sets Pazpar2 parameter block
. See Pazpar2 documentation for details.
+ */
public void setBlock(String block) {
setParameterInState(new CommandParameter("block","=",block));
}
-
+
+ /**
+ * Get the parameter value for block
+ */
public String getBlock() {
return getParameterValue("block");
}
+ /**
+ * Sets Pazpar2 parameter mergekey
. See Pazpar2 documentation for details.
+ */
+ public void setMergekey (String mergekey) {
+ setParameter(new CommandParameter("mergekey","=",mergekey));
+ }
+
+ /**
+ * Get the parameter value for mergekey
+ */
+ public String getMergekey () {
+ return getParameterValue("mergekey");
+ }
+
+ /**
+ * Sets Pazpar2 parameter rank
. See Pazpar2 documentation for details.
+ */
+ public void setRank (String rank) {
+ setParameter(new CommandParameter("rank","=",rank));
+ }
+
+ /**
+ * Get the parameter value for rank
+ */
+ public String getRank () {
+ return getParameterValue("rank");
+ }
+
public ShowCommand copy () {
- ShowCommand newCommand = new ShowCommand(stateMgr);
+ ShowCommand newCommand = new ShowCommand();
for (String parameterName : parameters.keySet()) {
newCommand.setParameterInState(parameters.get(parameterName).copy());
}
@@ -107,7 +141,12 @@ public class ShowCommand extends Pazpar2Command implements ServiceProxyCommand {
@Override
public ServiceProxyCommand getSp() {
- return this;
+ return new ShowCommandSp(this);
+ }
+
+ @Override
+ public boolean spOnly() {
+ return false;
}
}