Adds windowid parameter to applicable commands
authorNiels Erik G. Nielsen <nielserik@indexdata.com>
Wed, 19 Jun 2013 00:51:55 +0000 (20:51 -0400)
committerNiels Erik G. Nielsen <nielserik@indexdata.com>
Wed, 19 Jun 2013 00:51:55 +0000 (20:51 -0400)
12 files changed:
src/main/java/com/indexdata/mkjsf/pazpar2/commands/BytargetCommand.java
src/main/java/com/indexdata/mkjsf/pazpar2/commands/InitCommand.java
src/main/java/com/indexdata/mkjsf/pazpar2/commands/SearchCommand.java
src/main/java/com/indexdata/mkjsf/pazpar2/commands/ShowCommand.java
src/main/java/com/indexdata/mkjsf/pazpar2/commands/StatCommand.java
src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/BytargetCommandSp.java [new file with mode: 0644]
src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/InitCommandSp.java
src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/RecordCommandSp.java
src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/SearchCommandSp.java [new file with mode: 0644]
src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/ShowCommandSp.java [new file with mode: 0644]
src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/StatCommandSp.java [new file with mode: 0644]
src/main/java/com/indexdata/mkjsf/pazpar2/commands/sp/TermlistCommandSp.java [new file with mode: 0644]

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