X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fcom%2Findexdata%2Fmkjsf%2Fpazpar2%2Fcommands%2FShowCommand.java;h=bdb2c44b336871494b33aaa017fc213a7ede78c3;hb=48ef3e8a3cd32eda3979082a7736cafd1862ae73;hp=89e6c73a0bb38d8d53a4b6d090c425233fd8f855;hpb=11ff48b9d37193a89a4b74da75db8c58415c46a6;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 89e6c73..bdb2c44 100644
--- a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/ShowCommand.java
+++ b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/ShowCommand.java
@@ -1,7 +1,15 @@
package com.indexdata.mkjsf.pazpar2.commands;
import com.indexdata.mkjsf.pazpar2.commands.sp.ServiceProxyCommand;
+import com.indexdata.mkjsf.pazpar2.commands.sp.ShowCommandSp;
+
+/**
+ * Represents a Pazpar2 show
command, can be accessed by pzreq.show
+ *
+ * @author Niels Erik
+ *
+ */
public class ShowCommand extends Pazpar2Command implements ServiceProxyCommand {
private static final long serialVersionUID = -8242768313266051307L;
@@ -12,21 +20,14 @@ public class ShowCommand extends Pazpar2Command implements ServiceProxyCommand {
}
/**
- * 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";
@@ -56,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));
@@ -79,30 +74,63 @@ 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();
for (String parameterName : parameters.keySet()) {
@@ -113,7 +141,7 @@ public class ShowCommand extends Pazpar2Command implements ServiceProxyCommand {
@Override
public ServiceProxyCommand getSp() {
- return this;
+ return new ShowCommandSp(this);
}
@Override