X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fcom%2Findexdata%2Fpz2utils4jsf%2Fpazpar2%2FPz2Bean.java;h=845f3d959968f8fe715a7e67d71f17f3f357f5fa;hb=46a090cd2f2e2069c684084eeded75c9d5ed71f5;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..845f3d9 100644 --- a/src/main/java/com/indexdata/pz2utils4jsf/pazpar2/Pz2Bean.java +++ b/src/main/java/com/indexdata/pz2utils4jsf/pazpar2/Pz2Bean.java @@ -29,7 +29,9 @@ 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 () { @@ -37,16 +39,15 @@ public class Pz2Bean implements Pz2Interface, Serializable { } @PostConstruct - public void instantiatePz2SessionObject() { - logger.debug(Utils.objectId(this) + " will instantiate a Pz2Session next."); - pz2 = new Pz2Session(); + public void instantiatePz2SessionObject() { + logger.debug("in start of Pz2Bean post-construct configurator is " + configurator); + logger.debug(Utils.objectId(this) + " will instantiate a Pz2Client next."); 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); + } /* (non-Javadoc) * @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#doSearch(java.lang.String) @@ -59,7 +60,7 @@ public class Pz2Bean implements Pz2Interface, Serializable { * @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#doSearch() */ public void doSearch() { - logger.info(Utils.objectId(this) + " doing search for "+this.getQuery()); + logger.info(Utils.objectId(this) + " doing search for "+pz2.getCommandReadOnly("search").getParameterValue("query")); pz2.doSearch(); } @@ -76,121 +77,6 @@ public class Pz2Bean implements Pz2Interface, Serializable { public String update(String commands) { return pz2.update(commands); } - - /* (non-Javadoc) - * @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#setQuery(java.lang.String) - */ - public void setQuery(String query) { - pz2.setQuery(query); - } - - /* (non-Javadoc) - * @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#getQuery() - */ - public String getQuery() { - return pz2.getQuery(); - } - - /* (non-Javadoc) - * @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#setFacet(java.lang.String, java.lang.String) - */ - public void setFacet(String facetKey, String term) { - pz2.setFacet(facetKey, term); - } - - /* (non-Javadoc) - * @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#removeFacet(java.lang.String, java.lang.String) - */ - public void removeFacet(String facetKey, String term) { - pz2.removeFacet(facetKey, term); - } - - /* (non-Javadoc) - * @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#setFacetOnQuery(java.lang.String, java.lang.String) - */ - public void setFacetOnQuery(String facetKey, String term) { - pz2.setFacetOnQuery(facetKey, term); - } - - /* (non-Javadoc) - * @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#setTargetFilter(java.lang.String, java.lang.String) - */ - public void setSingleTargetFilter(String targetId, String targetName) { - pz2.setSingleTargetFilter(targetId, targetName); - } - - /* (non-Javadoc) - * @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#getTargetFilter() - */ - public SingleTargetFilter getSingleTargetFilter() { - return pz2.getSingleTargetFilter(); - } - - /* (non-Javadoc) - * @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#removeTargetFilter() - */ - public void removeSingleTargetFilter () { - pz2.removeSingleTargetFilter(); - } - - /* (non-Javadoc) - * @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#hasTargetFilter() - */ - public boolean hasSingleTargetFilter() { - return pz2.hasSingleTargetFilter(); - } - - - public String getFilter () { - return pz2.getFilter(); - } - - public void setFilter (String filterExpression) { - pz2.setFilter(filterExpression); - } - - - /* (non-Javadoc) - * @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#setSort(java.lang.String) - */ - public void setSort(String sortOption) { - pz2.setSort(sortOption); - } - - /* (non-Javadoc) - * @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#getSort() - */ - public String getSort() { - return pz2.getSort(); - } - - /* (non-Javadoc) - * @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#setPageSize(int) - */ - public void setPageSize(int perPageOption) { - pz2.setPageSize(perPageOption); - } - - /* (non-Javadoc) - * @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#getPageSize() - */ - public int getPageSize() { - return pz2.getPageSize(); - } - - /* (non-Javadoc) - * @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#setStart(int) - */ - public void setStart(int start) { - pz2.setStart(start); - } - - /* (non-Javadoc) - * @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#getStart() - */ - public int getStart() { - return pz2.getStart(); - } /* (non-Javadoc) * @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#toggleRecord(java.lang.String) @@ -311,15 +197,5 @@ public class Pz2Bean implements Pz2Interface, Serializable { public boolean hasConfigurationErrors() { return pz2.hasConfigurationErrors(); } - - @Override - public void setRecordId(String recId) { - pz2.setRecordId(recId); - } - - @Override - public String getRecordId() { - return pz2.getRecordId(); - } - + }