X-Git-Url: http://git.indexdata.com/?p=mkjsf-moved-to-github.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fcom%2Findexdata%2Fmkjsf%2Fpazpar2%2Fcommands%2FRecordCommand.java;h=8991dde1e6dae6f3b7b50119d08906e50de19ad2;hp=c9df6105eaa695ee6b8dc34c142f2cce493a645f;hb=b31cb1a9589fc04252c5bbfa11a0f6093f2f8ec6;hpb=d8b3b01004d7fa71658275822f569783f1c62047 diff --git a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/RecordCommand.java b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/RecordCommand.java index c9df610..8991dde 100644 --- a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/RecordCommand.java +++ b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/RecordCommand.java @@ -11,6 +11,12 @@ import com.indexdata.mkjsf.pazpar2.data.RecordResponse; import com.indexdata.mkjsf.pazpar2.data.ResponseDataObject; import com.indexdata.mkjsf.pazpar2.data.ResponseParser; +/** + * Represents a Pazpar2 record command, can be accessed by pzreq.record + * + * @author Niels Erik + * + */ public class RecordCommand extends Pazpar2Command implements ServiceProxyCommand { private static final long serialVersionUID = 2817539422114569506L; @@ -21,6 +27,14 @@ public class RecordCommand extends Pazpar2Command implements ServiceProxyCommand super("record"); } + /** + * Special handling of record responses since they come in three distinctly different ways + *
    + *
  1. As a regular <record> document
  2. + *
  3. In arbitrary XML format, in case of an offset request to get the native format
  4. + *
  5. In binary (non XML) format
  6. + *
+ */ @Override public ResponseDataObject run() { ResponseDataObject responseObject = null; @@ -57,58 +71,102 @@ public class RecordCommand extends Pazpar2Command implements ServiceProxyCommand return responseObject; } + /** + * Sets the id parameter. See Pazpar2 documentation for details. + * + * @param recId record ID + */ public void setId(String recId) { setParameter(new CommandParameter("id","=",recId)); } - + + /** + * Returns the id parameter value. + */ public String getId () { return getParameterValue("id"); } - + + /** + * Sets the offset parameter. See Pazpar2 documentation for details. + */ public void setOffset (String offset) { setParameter(new CommandParameter("offset","=",offset)); } - + + /** + * Returns the offset parameter value. + */ public String getOffset () { return getParameterValue("offset"); } + /** + * Sets the checksum parameter. See Pazpar2 documentation for details. + */ public void setChecksum (String checksum) { setParameter(new CommandParameter("checksum","=",checksum)); } + /** + * Returns the checksum parameter value. + */ public String getChecksum () { return getParameterValue("checksum"); } + /** + * Sets the nativesyntax parameter. See Pazpar2 documentation for details. + */ public void setNativesyntax (String nativesyntax) { setParameterInState(new CommandParameter("nativesyntax","=",nativesyntax)); } + /** + * Returns the nativesyntax parameter value. + */ public String getNativesyntax () { return getParameterValue("nativesyntax"); } + /** + * Sets the syntax parameter. See Pazpar2 documentation for details. + */ public void setSyntax (String syntax) { setParameterInState(new CommandParameter("syntax","=",syntax)); } + /** + * Returns the syntax parameter value. + */ public String getSyntax () { return getParameterValue("syntax"); } + /** + * Sets the esn parameter. See Pazpar2 documentation for details. + */ public void setEsn (String esn) { setParameter(new CommandParameter("esn","=",esn)); } + /** + * Returns the esn parameter value. + */ public String getEsn () { return getParameterValue("esn"); } + /** + * Sets the binary parameter. See Pazpar2 documentation for details. + */ public void setBinary (String binary) { setParameter(new CommandParameter("binary","=",binary)); } + /** + * Returns the binary parameter value. + */ public String getBinary () { return getParameterValue("binary"); } @@ -119,7 +177,7 @@ public class RecordCommand extends Pazpar2Command implements ServiceProxyCommand for (String parameterName : parameters.keySet()) { newCommand.setParameterInState(parameters.get(parameterName).copy()); } - newCommand.spCommand = this.spCommand; + newCommand.spCommand = new RecordCommandSp(newCommand); return newCommand; }