X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fcom%2Findexdata%2Fpz2utils4jsf%2Fpazpar2%2FPz2Interface.java;h=b403d8d5dadb1c46825b333061ec8989b96c9c87;hb=7b71381e71db35eed511606e80c0d3e18cab4d2b;hp=0e1772498ec449bd1c2e71bce4b71998fe3fef06;hpb=6ecfe8692fcb0f9840b28325f413fc698093fa88;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 0e17724..b403d8d 100644 --- a/src/main/java/com/indexdata/pz2utils4jsf/pazpar2/Pz2Interface.java +++ b/src/main/java/com/indexdata/pz2utils4jsf/pazpar2/Pz2Interface.java @@ -5,12 +5,6 @@ import java.util.List; import com.indexdata.pz2utils4jsf.controls.ResultsPager; 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; -import com.indexdata.pz2utils4jsf.pazpar2.data.StatResponse; -import com.indexdata.pz2utils4jsf.pazpar2.data.TermListsResponse; -import com.indexdata.pz2utils4jsf.pazpar2.data.TermResponse; public interface Pz2Interface extends Serializable { @@ -50,142 +44,7 @@ public interface Pz2Interface extends Serializable { * */ public String update (String commands); - - /** - * Sets a query to used by the next search command - * - * @param query a query on pazpar2 query syntax - * - */ - public void setQuery (String query); - - /** - * Gets the current query - * @return a pazpar2 query string - */ - public String getQuery (); - - /** - * Sets a facet to limit the current query by, - * then executes the search - * - * @param facetKey i.e. 'au' for author - * @param term i.e. 'Dickens, Charles' - */ - public void setFacet(String facetKey, String term); - - /** - * Removes a facet set by setFacet(...), then executes - * the search. - * - * Will not remove facets set by setFacetOnQuery(...) - * - * @param facetKey i.e. 'au' for author - * @param term i.e. 'Dickens, Charles' - */ - public void removeFacet (String facetKey, String term); - - /** - * Sets a facet to limit the current query by. The - * facet is appended to the query string itself (rather - * as a separately managed entity. It will thus appear - * in a query field as retrieved by getQuery(). It will - * not be removed by removeFacet(...) - * - * @param facetKey i.e. 'au' for author - * @param term i.e. 'Dickens, Charles' - */ - public void setFacetOnQuery(String facetKey, String term); - - /** - * Adds a target filter to limit the current query by, then - * executes the current search. - * - * @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); - - /** - * Removes the current target filter from the search - * - */ - public void removeTargetFilter (); - - /** - * - * @return The target filter set on the current search command - */ - public TargetFilter getTargetFilter(); - - /** - * Resolves if the current search command has a target filter - to - * be used by the UI for conditional rendering of target filter info. - * - * @return true if the current search command is limited by a target - * filter - */ - public boolean hasTargetFilter(); - - /** - * Sets the ordering of records (hits) in the 'show' display object - */ - - /** - * Sets the sort order for results, the updates the 'show' data object - * from pazpar2. Set valid sort options in the documentation for pazpar2. - * - * The parts of the UI that display 'show' data should be rendered following - * this request. - * - * @param sortOption - */ - public void setSort(String sortOption); - - /** - * Retrieves the current sort order for results - * @return sort order - i.e. 'relevance' - */ - public String getSort(); - - /** - * Sets the number of records that pazpar2 should show at a time. Is - * followed by an update of the show data object from pazpar2. - * - * To be used by the UI for paging. After setting page size the parts - * of the UI that displays 'show' data should be rendered. - * - * @param perPageOption i.e. 10, default is 20. - */ - public void setPageSize (int perPageOption); - - /** - * Retrieves the currently defined number of items to show at a time - * - * @return number of result records that will be shown from pazpar2 - */ - public int getPageSize(); - - /** - * Sets the first record to show - starting at record '0'. After setting - * first record number, the 'show' data object will be updated from pazpar2, - * and the parts of the UI displaying show data should be re-rendered. - * - * To be used by the UI for paging. - * - * @param start first record to show - */ - public void setStart (int start); - - /** - * Retrieves the sequence number of the record that pazpaz2 will return as - * the first record in 'show' - * - * @return sequence number of the first record to be shown (numbering starting at '0') - * - */ - public int getStart(); - + /** * Will retrieve or remove the record with the given recid from memory. * @@ -196,74 +55,14 @@ public interface Pz2Interface extends Serializable { * @return */ public String toggleRecord(String recid); - - /** - * Returns the 'show' data as retrieved from pazpar2 by the most - * recent update request - * - * @return pazpar2 'show' response object - */ - public ShowResponse getShow(); - - /** - * Returns the 'stat' data as retrieved from pazpar2 by the most - * recent update request - * - * @return pazpar2 'stat' response object - */ - public StatResponse getStat(); - + /** * Resolves whether the backend has a record with the given recid in memory * * @return true if the bean currently holds the record with recid */ public boolean hasRecord (String recId); - - /** - * Resolves whether the back-end has any records in memory (in 'show') for - * display in UI - * - * @return true if there are records to display - */ - public boolean hasRecords (); - - /** - * Returns a pazpar2 record as retrieved by the most recent 'record' - * request - * @return record data object - */ - public RecordResponse getRecord(); - - /** - * Returns a set of term lists (targets and facets) as retrieved by the - * most recent 'termlist' command - * @return set of termlists - */ - public TermListsResponse getTermLists (); - - /** - * Returns up to 'count' terms from the facet given by the 'facet' parameter - * @param facet name of the facet - * @param count maximum number of facet terms to return - * @return facet term list limited to 'count' terms - */ - public List getFacetTerms (String facet, int count); - - /** - * Returns all the terms of a given facet - or as many as pazpar2 returns - * @param facet name of the facet - * @return facet term list - */ - public List getFacetTerms (String facet); - - /** - * Returns a ByTarget data object as retrieved by the most recent 'bytarget' - * request to pazpar2 - * - * @return ByTarget response data object - */ - public ByTarget getByTarget(); + /** * Initiates a pager object, a component holding the data to draw a sequence @@ -316,14 +115,6 @@ public interface Pz2Interface extends Serializable { */ 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(); /** * Returns all errors encountered during configuration of the application, in particular @@ -332,5 +123,6 @@ public interface Pz2Interface extends Serializable { * @return */ public List getConfigurationErrors(); + }