Fixes missing subscription to state changes by SP bean
authorNiels Erik G. Nielsen <nielserik@indexdata.com>
Mon, 15 Apr 2013 01:29:46 +0000 (21:29 -0400)
committerNiels Erik G. Nielsen <nielserik@indexdata.com>
Mon, 15 Apr 2013 01:29:46 +0000 (21:29 -0400)
src/main/java/com/indexdata/pz2utils4jsf/pazpar2/Pz2ProxyBean.java

index f37f98e..3eb0bba 100644 (file)
@@ -12,7 +12,6 @@ import javax.inject.Named;
 import org.apache.log4j.Logger;\r
 \r
 import com.indexdata.pz2utils4jsf.config.ConfigurationReader;\r
-import com.indexdata.pz2utils4jsf.pazpar2.commands.CommandParameter;\r
 import com.indexdata.pz2utils4jsf.pazpar2.sp.ServiceProxyClient;\r
 import com.indexdata.pz2utils4jsf.pazpar2.sp.ServiceProxyInterface;\r
 import com.indexdata.pz2utils4jsf.pazpar2.sp.auth.ServiceProxyUser;\r
@@ -41,6 +40,7 @@ public class Pz2ProxyBean extends Pz2Bean implements ServiceProxyInterface {
       logger.info("Using [" + Utils.objectId(searchClient) + "] configured by [" \r
                             + Utils.objectId(configurator) + "]" );    \r
       configureClient(searchClient,configurator);\r
+      stateMgr.addStateListener(this);\r
     } else {\r
       logger.debug("Pz2ProxyBean:postConstruct: searchClient already instantiated " +\r
                        "during construction of parent object Pz2Bean.");\r
@@ -61,6 +61,7 @@ public class Pz2ProxyBean extends Pz2Bean implements ServiceProxyInterface {
   public void setServiceProxyUrl(String url) {\r
     logger.info("Setting Service Proxy url: " + url);\r
     serviceProxyUrl = url;\r
+    pzreq.getRecordInState().removeParametersSilently();\r
     pzreq.getSearchInState().removeParametersSilently();\r
     pzresp.reset();\r
   }\r