From: Niels Erik G. Nielsen Date: Wed, 19 Jun 2013 00:51:55 +0000 (-0400) Subject: Adds windowid parameter to applicable commands X-Git-Tag: v0.0.7~41 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=48ef3e8a3cd32eda3979082a7736cafd1862ae73;p=mkjsf-moved-to-github.git Adds windowid parameter to applicable commands --- diff --git a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/BytargetCommand.java b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/BytargetCommand.java index 786ae4c..6fb213e 100644 --- a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/BytargetCommand.java +++ b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/BytargetCommand.java @@ -1,5 +1,6 @@ package com.indexdata.mkjsf.pazpar2.commands; +import com.indexdata.mkjsf.pazpar2.commands.sp.BytargetCommandSp; import com.indexdata.mkjsf.pazpar2.commands.sp.ServiceProxyCommand; /** @@ -25,7 +26,7 @@ public class BytargetCommand extends Pazpar2Command implements ServiceProxyComma } public ServiceProxyCommand getSp() { - return this; + return new BytargetCommandSp(this); } @Override diff --git a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/InitCommand.java b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/InitCommand.java index 27958c4..890e4ab 100644 --- a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/InitCommand.java +++ b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/InitCommand.java @@ -75,7 +75,9 @@ public class InitCommand extends Pazpar2Command implements ServiceProxyCommand { newCommand.setParameterInState(parameters.get(parameterName).copy()); } newCommand.spCommand = new InitCommandSp(this); - newCommand.spCommand.setUploadedInitDoc(spCommand.getUploadedInitDoc()); + if (spCommand.getUploadedInitDoc()!=null) { + newCommand.spCommand.setUploadedInitDoc(spCommand.getUploadedInitDoc()); + } return newCommand; } diff --git a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/SearchCommand.java b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/SearchCommand.java index f2c53da..bbfbd62 100644 --- a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/SearchCommand.java +++ b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/SearchCommand.java @@ -9,6 +9,7 @@ import javax.inject.Named; import org.apache.log4j.Logger; import com.indexdata.mkjsf.pazpar2.Pz2Service; +import com.indexdata.mkjsf.pazpar2.commands.sp.SearchCommandSp; import com.indexdata.mkjsf.pazpar2.commands.sp.ServiceProxyCommand; import com.indexdata.mkjsf.pazpar2.data.ResponseDataObject; @@ -231,7 +232,7 @@ public class SearchCommand extends Pazpar2Command implements ServiceProxyCommand * Returns the limit parameter value. */ public String getLimit () { - return getParameter("limit") == null ? null : ((FilterParameter)getParameter("limit")).getValueWithExpressions(); + return getParameter("limit") == null ? null : ((LimitParameter)getParameter("limit")).getValueWithExpressions(); } /** @@ -487,7 +488,7 @@ public class SearchCommand extends Pazpar2Command implements ServiceProxyCommand @Override public ServiceProxyCommand getSp() { - return this; + return new SearchCommandSp(this); } @Override 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 04a87d8..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,6 +1,7 @@ package com.indexdata.mkjsf.pazpar2.commands; import com.indexdata.mkjsf.pazpar2.commands.sp.ServiceProxyCommand; +import com.indexdata.mkjsf.pazpar2.commands.sp.ShowCommandSp; /** @@ -140,7 +141,7 @@ public class ShowCommand extends Pazpar2Command implements ServiceProxyCommand { @Override public ServiceProxyCommand getSp() { - return this; + return new ShowCommandSp(this); } @Override diff --git a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/StatCommand.java b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/StatCommand.java index 5229060..5fcb11b 100644 --- a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/StatCommand.java +++ b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/StatCommand.java @@ -1,6 +1,7 @@ package com.indexdata.mkjsf.pazpar2.commands; import com.indexdata.mkjsf.pazpar2.commands.sp.ServiceProxyCommand; +import com.indexdata.mkjsf.pazpar2.commands.sp.StatCommandSp; /** * Represents a Pazpar2 stat command, can be accessed by pzreq.state @@ -26,7 +27,7 @@ public class StatCommand extends Pazpar2Command implements ServiceProxyCommand { @Override public ServiceProxyCommand getSp() { - return this; + return new StatCommandSp(this); } @Override diff --git a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/BytargetCommandSp.java b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/BytargetCommandSp.java new file mode 100644 index 0000000..ec9417a --- /dev/null +++ b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/BytargetCommandSp.java @@ -0,0 +1,37 @@ +package com.indexdata.mkjsf.pazpar2.commands.sp; + +import java.io.Serializable; + +import com.indexdata.mkjsf.pazpar2.commands.BytargetCommand; +import com.indexdata.mkjsf.pazpar2.commands.CommandParameter; + +public class BytargetCommandSp implements Serializable, ServiceProxyCommand { + + private BytargetCommand command = null; + private static final long serialVersionUID = -1742198227615699037L; + + public BytargetCommandSp(BytargetCommand command) { + this.command = command; + } + + /** + * Sets the windowid parameter. See Service Proxy documentation for details. + */ + public void setWindowid (String windowid) { + command.setParameterInState(new CommandParameter("windowid","=",windowid)); + } + + /** + * Returns the windowid parameter value. + */ + public String getWindowid () { + return command.getParameterValue("windowid"); + } + + @Override + public boolean spOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/InitCommandSp.java b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/InitCommandSp.java index 1b0ed84..16f7dec 100644 --- a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/InitCommandSp.java +++ b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/InitCommandSp.java @@ -11,7 +11,6 @@ import com.indexdata.mkjsf.pazpar2.HttpResponseWrapper; import com.indexdata.mkjsf.pazpar2.Pz2Service; import com.indexdata.mkjsf.pazpar2.commands.CommandParameter; import com.indexdata.mkjsf.pazpar2.commands.InitCommand; -import com.indexdata.mkjsf.pazpar2.commands.Pazpar2Command; import com.indexdata.mkjsf.pazpar2.data.ResponseDataObject; import com.indexdata.mkjsf.pazpar2.data.ResponseParser; import com.indexdata.mkjsf.pazpar2.data.sp.SpResponseDataObject; @@ -56,8 +55,12 @@ public class InitCommandSp implements Serializable, ServiceProxyCommand { public UploadedFile getUploadedInitDoc () { logger.info("initDocUpload is: " + initDocUpload ); - logger.info("initDocUpload.getUploadedFile() is: " +initDocUpload.getUploadedFile()); + if (initDocUpload != null) { + logger.info("initDocUpload.getUploadedFile() is: " +initDocUpload.getUploadedFile()); return initDocUpload.getUploadedFile(); + } else { + return null; + } } public void downloadInitDoc () throws IOException { diff --git a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/RecordCommandSp.java b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/RecordCommandSp.java index 0b40381..a134733 100644 --- a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/RecordCommandSp.java +++ b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/RecordCommandSp.java @@ -48,6 +48,21 @@ public class RecordCommandSp implements Serializable, ServiceProxyCommand { public String getAcefilter () { return command.getParameterValue("acefilter"); } + + /** + * Sets the windowid parameter. See Service Proxy documentation for details. + */ + public void setWindowid (String windowid) { + command.setParameterInState(new CommandParameter("windowid","=",windowid)); + } + + /** + * Returns the windowid parameter value. + */ + public String getWindowid () { + return command.getParameterValue("windowid"); + } + @Override public boolean spOnly() { diff --git a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/SearchCommandSp.java b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/SearchCommandSp.java new file mode 100644 index 0000000..810ce54 --- /dev/null +++ b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/SearchCommandSp.java @@ -0,0 +1,36 @@ +package com.indexdata.mkjsf.pazpar2.commands.sp; + +import java.io.Serializable; + +import com.indexdata.mkjsf.pazpar2.commands.CommandParameter; +import com.indexdata.mkjsf.pazpar2.commands.SearchCommand; + +public class SearchCommandSp implements Serializable, ServiceProxyCommand { + + private SearchCommand command = null; + private static final long serialVersionUID = -8945477254342198735L; + + public SearchCommandSp(SearchCommand command) { + this.command=command; + } + + /** + * Sets the windowid parameter. See Service Proxy documentation for details. + */ + public void setWindowid (String windowid) { + command.setParameterInState(new CommandParameter("windowid","=",windowid)); + } + + /** + * Returns the windowid parameter value. + */ + public String getWindowid () { + return command.getParameterValue("windowid"); + } + + @Override + public boolean spOnly() { + return false; + } + +} diff --git a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/ShowCommandSp.java b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/ShowCommandSp.java new file mode 100644 index 0000000..a3bdc92 --- /dev/null +++ b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/ShowCommandSp.java @@ -0,0 +1,40 @@ +package com.indexdata.mkjsf.pazpar2.commands.sp; + +import java.io.Serializable; + +import com.indexdata.mkjsf.pazpar2.commands.CommandParameter; +import com.indexdata.mkjsf.pazpar2.commands.ShowCommand; + +public class ShowCommandSp implements Serializable, ServiceProxyCommand{ + + ShowCommand command = null; + /** + * + */ + private static final long serialVersionUID = -4563427833820559878L; + + public ShowCommandSp(ShowCommand showCommand) { + this.command=showCommand; + } + + /** + * Sets the windowid parameter. See Service Proxy documentation for details. + */ + public void setWindowid (String windowid) { + command.setParameterInState(new CommandParameter("windowid","=",windowid)); + } + + /** + * Returns the windowid parameter value. + */ + public String getWindowid () { + return command.getParameterValue("windowid"); + } + + + @Override + public boolean spOnly() { + return false; + } + +} diff --git a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/StatCommandSp.java b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/StatCommandSp.java new file mode 100644 index 0000000..a8a5552 --- /dev/null +++ b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/StatCommandSp.java @@ -0,0 +1,35 @@ +package com.indexdata.mkjsf.pazpar2.commands.sp; + +import java.io.Serializable; + +import com.indexdata.mkjsf.pazpar2.commands.CommandParameter; +import com.indexdata.mkjsf.pazpar2.commands.StatCommand; + +public class StatCommandSp implements Serializable, ServiceProxyCommand { + + private StatCommand command = null; + private static final long serialVersionUID = -469324132819092701L; + + public StatCommandSp(StatCommand command) { + this.command = command; + } + + /** + * Sets the windowid parameter. See Service Proxy documentation for details. + */ + public void setWindowid (String windowid) { + command.setParameterInState(new CommandParameter("windowid","=",windowid)); + } + + /** + * Returns the windowid parameter value. + */ + public String getWindowid () { + return command.getParameterValue("windowid"); + } + + public boolean spOnly() { + return false; + } + +} diff --git a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/TermlistCommandSp.java b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/TermlistCommandSp.java new file mode 100644 index 0000000..a048ae0 --- /dev/null +++ b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/TermlistCommandSp.java @@ -0,0 +1,38 @@ +package com.indexdata.mkjsf.pazpar2.commands.sp; + +import java.io.Serializable; + +import com.indexdata.mkjsf.pazpar2.commands.CommandParameter; +import com.indexdata.mkjsf.pazpar2.commands.TermlistCommand; + +public class TermlistCommandSp implements Serializable, ServiceProxyCommand { + + private TermlistCommand command = null; + private static final long serialVersionUID = -7453670169089123800L; + + public TermlistCommandSp(TermlistCommand command) { + this.command = command; + } + + /** + * Sets the windowid parameter. See Service Proxy documentation for details. + */ + public void setWindowid (String windowid) { + command.setParameterInState(new CommandParameter("windowid","=",windowid)); + } + + /** + * Returns the windowid parameter value. + */ + public String getWindowid () { + return command.getParameterValue("windowid"); + } + + + @Override + public boolean spOnly() { + // TODO Auto-generated method stub + return false; + } + +}