X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fcom%2Findexdata%2Fpz2utils4jsf%2Fpazpar2%2FPz2Bean.java;h=345f049285a4d0c2410a10d56e800a38339cebe8;hb=977e4983e28683dd8a7d9fd19b0daee3ac349a3a;hp=70dde9274a143c495b501ddf363bb45785f1258e;hpb=33338bd223ec711264392b7768d89d0f3fbce677;p=mkjsf-moved-to-github.git diff --git a/src/main/java/com/indexdata/pz2utils4jsf/pazpar2/Pz2Bean.java b/src/main/java/com/indexdata/pz2utils4jsf/pazpar2/Pz2Bean.java index 70dde92..345f049 100644 --- a/src/main/java/com/indexdata/pz2utils4jsf/pazpar2/Pz2Bean.java +++ b/src/main/java/com/indexdata/pz2utils4jsf/pazpar2/Pz2Bean.java @@ -14,6 +14,7 @@ import org.apache.log4j.Logger; import com.indexdata.pz2utils4jsf.config.ConfigurationReader; import com.indexdata.pz2utils4jsf.controls.ResultsPager; import com.indexdata.pz2utils4jsf.errors.ErrorInterface; +import com.indexdata.pz2utils4jsf.pazpar2.commands.Pazpar2Command; import com.indexdata.pz2utils4jsf.pazpar2.data.ByTarget; import com.indexdata.pz2utils4jsf.pazpar2.data.RecordResponse; import com.indexdata.pz2utils4jsf.pazpar2.data.ShowResponse; @@ -29,24 +30,28 @@ public class Pz2Bean implements Pz2Interface, Serializable { private static Logger logger = Logger.getLogger(Pz2Bean.class); @Inject ConfigurationReader configurator; - protected Pz2Session pz2; + + @Inject @ForStraightPz2 Pz2Session pz2; + protected SearchClient searchClient; public Pz2Bean () { logger.info("Instantiating pz2 bean [" + Utils.objectId(this) + "]"); + logger.debug("in Pz2Bean configurator is " + configurator); } @PostConstruct - public void instantiatePz2SessionObject() { + public void instantiatePz2SessionObject() { + logger.debug("in start of Pz2Bean post-construct configurator is " + configurator); logger.debug(Utils.objectId(this) + " will instantiate a Pz2Session next."); - pz2 = new Pz2Session(); searchClient = new Pz2Client(); logger.info("Using [" + Utils.objectId(searchClient) + "] configured by [" + Utils.objectId(configurator) + "] on session [" + Utils.objectId(pz2) + "]" ); - pz2.configureClient(searchClient,configurator); - } - + pz2.configureClient(searchClient,configurator); + logger.debug("in end of Pz2Bean post-construct configurator is " + configurator); + + } /* (non-Javadoc) * @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#doSearch(java.lang.String) @@ -81,9 +86,9 @@ public class Pz2Bean implements Pz2Interface, Serializable { * @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#setQuery(java.lang.String) */ public void setQuery(String query) { - pz2.setQuery(query); + pz2.req.getSearch().setQuery(query); } - + /* (non-Javadoc) * @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#getQuery() */ @@ -321,5 +326,9 @@ public class Pz2Bean implements Pz2Interface, Serializable { public String getRecordId() { return pz2.getRecordId(); } + + public Pazpar2Command getSearchCommand () { + return pz2.getCommand("search"); + } }