X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fcom%2Findexdata%2Fpz2utils4jsf%2Fpazpar2%2FPz2Interface.java;h=8a59cfe2eda13b76449d622c7c9367b3089e0b73;hb=33338bd223ec711264392b7768d89d0f3fbce677;hp=b69b4e2d866cd12739f0007ab23f7cc78cb683e2;hpb=ab7a23c769e77affa25a47112d2e5e93ae23d7bc;p=mkjsf-moved-to-github.git diff --git a/src/main/java/com/indexdata/pz2utils4jsf/pazpar2/Pz2Interface.java b/src/main/java/com/indexdata/pz2utils4jsf/pazpar2/Pz2Interface.java index b69b4e2..8a59cfe 100644 --- a/src/main/java/com/indexdata/pz2utils4jsf/pazpar2/Pz2Interface.java +++ b/src/main/java/com/indexdata/pz2utils4jsf/pazpar2/Pz2Interface.java @@ -4,7 +4,7 @@ import java.io.Serializable; import java.util.List; import com.indexdata.pz2utils4jsf.controls.ResultsPager; -import com.indexdata.pz2utils4jsf.pazpar2.TargetFilter; +import com.indexdata.pz2utils4jsf.errors.ErrorInterface; import com.indexdata.pz2utils4jsf.pazpar2.data.ByTarget; import com.indexdata.pz2utils4jsf.pazpar2.data.RecordResponse; import com.indexdata.pz2utils4jsf.pazpar2.data.ShowResponse; @@ -97,26 +97,36 @@ public interface Pz2Interface extends Serializable { */ public void setFacetOnQuery(String facetKey, String term); + + public void setFilter(String filterExpression); + + public String getFilter(); + + /** - * Adds a target filter to limit the current query by, then - * executes the current search. + * Adds a single target filter to restrict the current query by, + * then executes the current search. + * + * This is a special case of the general setFilter function, + * allowing to associate a descriptive target name with the + * filter expression for display in UI. * * @param targetId pazpar2's ID for the target to limit by * @param targetName a descriptive name for the target */ - public void setTargetFilter (String targetId, String targetName); + public void setSingleTargetFilter (String targetId, String targetName); /** * Removes the current target filter from the search * */ - public void removeTargetFilter (); + public void removeSingleTargetFilter (); /** * * @return The target filter set on the current search command */ - public TargetFilter getTargetFilter(); + public SingleTargetFilter getSingleTargetFilter(); /** * Resolves if the current search command has a target filter - to @@ -125,8 +135,8 @@ public interface Pz2Interface extends Serializable { * @return true if the current search command is limited by a target * filter */ - public boolean hasTargetFilter(); - + public boolean hasSingleTargetFilter(); + /** * Sets the ordering of records (hits) in the 'show' display object */ @@ -204,7 +214,7 @@ public interface Pz2Interface extends Serializable { * @return pazpar2 'show' response object */ public ShowResponse getShow(); - + /** * Returns the 'stat' data as retrieved from pazpar2 by the most * recent update request @@ -299,10 +309,42 @@ public interface Pz2Interface extends Serializable { */ public void setCurrentStateKey(String key); + /** + * @return true if any errors encountered so far + */ public boolean hasErrors(); - public String getErrorMessages(); + /** + * + * @return true if errors encountered during execution of commands + */ + public boolean hasCommandErrors(); + + /** + * + * @return true if errors encountered when configuring the service + */ + public boolean hasConfigurationErrors(); + + /** + * Returns one (of possibly multiple) errors encountered during execution of commands + * Will prefer to show the search errors - if any - as the search command is usually + * executed first. + * + * @return + */ + public ErrorInterface getCommandError(); - public String getFirstErrorMessage(); - + /** + * Returns all errors encountered during configuration of the application, in particular + * the Pazpar2 client. + * + * @return + */ + public List getConfigurationErrors(); + + void setRecordId(String recId); + + String getRecordId(); + }