projects
/
mkjsf-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adds filter attribute, renames target id filter attribute
[mkjsf-moved-to-github.git]
/
src
/
main
/
java
/
com
/
indexdata
/
pz2utils4jsf
/
pazpar2
/
Pz2Bean.java
diff --git
a/src/main/java/com/indexdata/pz2utils4jsf/pazpar2/Pz2Bean.java
b/src/main/java/com/indexdata/pz2utils4jsf/pazpar2/Pz2Bean.java
index
dff3142
..
70dde92
100644
(file)
--- a/
src/main/java/com/indexdata/pz2utils4jsf/pazpar2/Pz2Bean.java
+++ b/
src/main/java/com/indexdata/pz2utils4jsf/pazpar2/Pz2Bean.java
@@
-5,12
+5,13
@@
import java.util.List;
\r
import javax.annotation.PostConstruct;
\r
import javax.enterprise.context.SessionScoped;
\r
\r
import javax.annotation.PostConstruct;
\r
import javax.enterprise.context.SessionScoped;
\r
+import javax.enterprise.inject.Alternative;
\r
import javax.inject.Inject;
\r
import javax.inject.Named;
\r
\r
import org.apache.log4j.Logger;
\r
\r
import javax.inject.Inject;
\r
import javax.inject.Named;
\r
\r
import org.apache.log4j.Logger;
\r
\r
-import com.indexdata.pz2utils4jsf.config.Pz2Configurator;
\r
+import com.indexdata.pz2utils4jsf.config.ConfigurationReader;
\r
import com.indexdata.pz2utils4jsf.controls.ResultsPager;
\r
import com.indexdata.pz2utils4jsf.errors.ErrorInterface;
\r
import com.indexdata.pz2utils4jsf.pazpar2.data.ByTarget;
\r
import com.indexdata.pz2utils4jsf.controls.ResultsPager;
\r
import com.indexdata.pz2utils4jsf.errors.ErrorInterface;
\r
import com.indexdata.pz2utils4jsf.pazpar2.data.ByTarget;
\r
@@
-21,30
+22,32
@@
import com.indexdata.pz2utils4jsf.pazpar2.data.TermListsResponse;
import com.indexdata.pz2utils4jsf.pazpar2.data.TermResponse;
\r
import com.indexdata.pz2utils4jsf.utils.Utils;
\r
\r
import com.indexdata.pz2utils4jsf.pazpar2.data.TermResponse;
\r
import com.indexdata.pz2utils4jsf.utils.Utils;
\r
\r
-@Named("pz2") @SessionScoped
\r
+@Named("pz2") @SessionScoped @Alternative
\r
public class Pz2Bean implements Pz2Interface, Serializable {
\r
\r
private static final long serialVersionUID = 3440277287081557861L;
\r
private static Logger logger = Logger.getLogger(Pz2Bean.class);
\r
\r
public class Pz2Bean implements Pz2Interface, Serializable {
\r
\r
private static final long serialVersionUID = 3440277287081557861L;
\r
private static Logger logger = Logger.getLogger(Pz2Bean.class);
\r
\r
- Pz2Session pz2;
\r
- @Inject Pz2Configurator configurator;
\r
- @Inject SearchClient searchClient;
\r
+ @Inject ConfigurationReader configurator;
\r
+ protected Pz2Session pz2;
\r
+ protected SearchClient searchClient;
\r
\r
public Pz2Bean () {
\r
logger.info("Instantiating pz2 bean [" + Utils.objectId(this) + "]");
\r
}
\r
\r
@PostConstruct
\r
\r
public Pz2Bean () {
\r
logger.info("Instantiating pz2 bean [" + Utils.objectId(this) + "]");
\r
}
\r
\r
@PostConstruct
\r
- public void initiatePz2Session() {
\r
+ public void instantiatePz2SessionObject() {
\r
logger.debug(Utils.objectId(this) + " will instantiate a Pz2Session next.");
\r
pz2 = new Pz2Session();
\r
logger.debug(Utils.objectId(this) + " will instantiate a Pz2Session next.");
\r
pz2 = new Pz2Session();
\r
+ searchClient = new Pz2Client();
\r
logger.info("Using [" + Utils.objectId(searchClient) + "] configured by ["
\r
+ Utils.objectId(configurator) + "] on session ["
\r
logger.info("Using [" + Utils.objectId(searchClient) + "] configured by ["
\r
+ Utils.objectId(configurator) + "] on session ["
\r
- + Utils.objectId(pz2) + "]" );
\r
- pz2.init(searchClient,configurator);
\r
+ + Utils.objectId(pz2) + "]" );
\r
+ pz2.configureClient(searchClient,configurator);
\r
}
\r
\r
}
\r
\r
+
\r
/* (non-Javadoc)
\r
* @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#doSearch(java.lang.String)
\r
*/
\r
/* (non-Javadoc)
\r
* @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#doSearch(java.lang.String)
\r
*/
\r
@@
-112,31
+115,41
@@
public class Pz2Bean implements Pz2Interface, Serializable {
/* (non-Javadoc)
\r
* @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#setTargetFilter(java.lang.String, java.lang.String)
\r
*/
\r
/* (non-Javadoc)
\r
* @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#setTargetFilter(java.lang.String, java.lang.String)
\r
*/
\r
- public void setTargetFilter(String targetId, String targetName) {
\r
- pz2.setTargetFilter(targetId, targetName);
\r
+ public void setSingleTargetFilter(String targetId, String targetName) {
\r
+ pz2.setSingleTargetFilter(targetId, targetName);
\r
}
\r
\r
/* (non-Javadoc)
\r
}
\r
\r
/* (non-Javadoc)
\r
- * @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#removeTargetFilter()
\r
+ * @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#getTargetFilter()
\r
*/
\r
*/
\r
- public void removeTargetFilter () {
\r
- pz2.removeTargetFilter();
\r
+ public SingleTargetFilter getSingleTargetFilter() {
\r
+ return pz2.getSingleTargetFilter();
\r
}
\r
}
\r
-
\r
+
\r
/* (non-Javadoc)
\r
/* (non-Javadoc)
\r
- * @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#getTargetFilter()
\r
+ * @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#removeTargetFilter()
\r
*/
\r
*/
\r
- public TargetFilter getTargetFilter() {
\r
- return pz2.getTargetFilter();
\r
+ public void removeSingleTargetFilter () {
\r
+ pz2.removeSingleTargetFilter();
\r
}
\r
}
\r
-
\r
+
\r
/* (non-Javadoc)
\r
* @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#hasTargetFilter()
\r
*/
\r
/* (non-Javadoc)
\r
* @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#hasTargetFilter()
\r
*/
\r
- public boolean hasTargetFilter() {
\r
- return pz2.hasTargetFilter();
\r
+ public boolean hasSingleTargetFilter() {
\r
+ return pz2.hasSingleTargetFilter();
\r
}
\r
\r
}
\r
\r
+
\r
+ public String getFilter () {
\r
+ return pz2.getFilter();
\r
+ }
\r
+
\r
+ public void setFilter (String filterExpression) {
\r
+ pz2.setFilter(filterExpression);
\r
+ }
\r
+
\r
+
\r
/* (non-Javadoc)
\r
* @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#setSort(java.lang.String)
\r
*/
\r
/* (non-Javadoc)
\r
* @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#setSort(java.lang.String)
\r
*/
\r
@@
-178,7
+191,7
@@
public class Pz2Bean implements Pz2Interface, Serializable {
public int getStart() {
\r
return pz2.getStart();
\r
}
\r
public int getStart() {
\r
return pz2.getStart();
\r
}
\r
-
\r
+
\r
/* (non-Javadoc)
\r
* @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#toggleRecord(java.lang.String)
\r
*/
\r
/* (non-Javadoc)
\r
* @see com.indexdata.pz2utils4jsf.pazpar2.Pz2Interface#toggleRecord(java.lang.String)
\r
*/
\r
@@
-299,4
+312,14
@@
public class Pz2Bean implements Pz2Interface, Serializable {
return pz2.hasConfigurationErrors();
\r
}
\r
\r
return pz2.hasConfigurationErrors();
\r
}
\r
\r
+ @Override
\r
+ public void setRecordId(String recId) {
\r
+ pz2.setRecordId(recId);
\r
+ }
\r
+
\r
+ @Override
\r
+ public String getRecordId() {
\r
+ return pz2.getRecordId();
\r
+ }
\r
+
\r
}
\r
}
\r