Returns "" rather than "null" on missing value
[mkjsf-moved-to-github.git] / src / main / java / com / indexdata / mkjsf / pazpar2 / ServiceProxyClient.java
index ace35b1..e5d7307 100644 (file)
@@ -44,6 +44,20 @@ import com.indexdata.mkjsf.utils.Utils;
 /**\r
  * Search client handling Service Proxy requests. \r
  *   \r
+ * <h3>Configuration</h3>\r
+ *\r
+ * Configuration name: proxyclient\r
+ *  \r
+ * <p>When configuring the client using the Mk2Config scheme, this is the prefix to\r
+ * use in the .properties file. When using web.xml context parameters for configuration\r
+ * the configuration name has no effect.</p> \r
+ * \r
+ * <p>ServiceProxyClient will acknowledge following configuration parameters:\r
+ * \r
+ * <ul>\r
+ *  <li>(proxyclient.)SERVICE_PROXY_URL</li>\r
+ * </ul>   \r
+ *   \r
  * @author Niels Erik\r
  *\r
  */\r
@@ -241,8 +255,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