Adds windowid parameter to SP init command
[mkjsf-moved-to-github.git] / src / main / java / com / indexdata / mkjsf / pazpar2 / ServiceProxyClient.java
index ace35b1..26e5c9a 100644 (file)
@@ -38,6 +38,7 @@ import com.indexdata.mkjsf.errors.MissingConfigurationContextException;
 import com.indexdata.mkjsf.pazpar2.commands.CommandParameter;\r
 import com.indexdata.mkjsf.pazpar2.commands.Pazpar2Command;\r
 import com.indexdata.mkjsf.pazpar2.commands.sp.AuthCommand;\r
+import com.indexdata.mkjsf.pazpar2.commands.sp.ServiceProxyCommand;\r
 import com.indexdata.mkjsf.pazpar2.data.CommandError;\r
 import com.indexdata.mkjsf.utils.Utils;\r
 \r
@@ -241,8 +242,10 @@ public class ServiceProxyClient implements SearchClient {
     return initDocPaths;\r
   }\r
   \r
-  public HttpResponseWrapper postInitDoc(byte[] initDoc, boolean includeDebug) {\r
-    HttpPost post = new HttpPost(serviceUrl+"?command=init" + (includeDebug? "&includeDebug=yes" : ""));\r
+  public HttpResponseWrapper postInitDoc(byte[] initDoc, Pazpar2Command command) {\r
+    String requestParameters = command.getEncodedQueryString();\r
+    logger.info("Initiating session with init doc and [" + requestParameters +"]");\r
+    HttpPost post = new HttpPost(serviceUrl+"?" + requestParameters);\r
     post.setEntity(new ByteArrayEntity(initDoc));\r
     ClientCommandResponse commandResponse = null;\r
     byte[] response;\r