Do record despite no previous search IF it has recordquery.
authorNiels Erik G. Nielsen <nielserik@indexdata.com>
Wed, 24 Apr 2013 21:13:04 +0000 (17:13 -0400)
committerNiels Erik G. Nielsen <nielserik@indexdata.com>
Wed, 24 Apr 2013 21:13:04 +0000 (17:13 -0400)
And defaults UI accessible serviceProxyUrl from config

src/main/java/com/indexdata/mkjsf/pazpar2/Pz2Bean.java
src/main/java/com/indexdata/mkjsf/pazpar2/Pz2ProxyBean.java

index d617f14..98f4c71 100644 (file)
@@ -112,7 +112,7 @@ public class Pz2Bean implements Pz2Interface, StateListener, Serializable {
   public String update (String commands) {\r
     if (! errors.hasConfigurationErrors()) {\r
       if (commandsAreValid(commands)) {\r
-        if (hasQuery()) {\r
+        if (hasQuery() || (commands.equals("record") && pzreq.getCommand("record").hasParameterSet("recordquery"))) {\r
           handleQueryStateChanges(commands);\r
           logger.debug("Processing request for " + commands); \r
           List<CommandThread> threadList = new ArrayList<CommandThread>();\r
@@ -137,7 +137,7 @@ public class Pz2Bean implements Pz2Interface, StateListener, Serializable {
              Pazpar2ResponseData responseObject = Pazpar2ResponseParser.getParser().getDataObject(response);\r
              pzresp.put(commandName, responseObject);        \r
           }\r
-          if (commands.equals("record")) {\r
+          if (commands.equals("record")) {            \r
             logger.debug("Record: Active clients: "+pzresp.getRecord().getActiveClients());\r
             return pzresp.getRecord().getActiveClients();\r
           } else {\r
index 4209aa2..6e74ed0 100644 (file)
@@ -41,6 +41,7 @@ public class Pz2ProxyBean extends Pz2Bean implements ServiceProxyInterface {
                             + Utils.objectId(configurator) + "]" );    \r
       configureClient(searchClient,configurator);\r
       stateMgr.addStateListener(this);\r
+      serviceProxyUrl = searchClient.getConfiguration().get(ServiceProxyClient.SERVICE_PROXY_URL);\r
     } else {\r
       logger.debug("Pz2ProxyBean:postConstruct: searchClient already instantiated " +\r
                        "during construction of parent object Pz2Bean.");\r