1 package com.indexdata.pz2utils4jsf.pazpar2;
\r
3 import java.io.Serializable;
\r
4 import java.util.List;
\r
6 import com.indexdata.pz2utils4jsf.controls.ResultsPager;
\r
7 import com.indexdata.pz2utils4jsf.errors.ErrorInterface;
\r
9 public interface Pz2Interface extends Serializable {
\r
12 * Executes a Pazpar2 search using the given query string
\r
16 public void doSearch(String query);
\r
19 * Executes a Pazpar2 search using the current query
\r
21 public void doSearch();
\r
24 * Updates display data objects by issuing the following pazpar2 commands:
\r
25 * 'show', 'stat', 'termlist' and 'bytarget'.
\r
27 * Returns a count of the remaining active clients from the most recent search.
\r
29 * After refreshing the data from pazpar2 the UI components displaying those
\r
30 * data should be re-rendered.
\r
32 * @return count of activeclients
\r
34 public String update();
\r
37 * Updates the data objects given by a comma separated list of one or more commands -
\r
38 * i.e. "show,state,termlist,bytarget".
\r
40 * May not be useful for the UI directly.
\r
42 * @param commands Command separated list of pazpar2 commands.
\r
43 * @return count of activeclients
\r
46 public String update (String commands);
\r
49 * Will retrieve or remove the record with the given recid from memory.
\r
51 * A pazpar2 'record' command will then be issued. The part of the UI
\r
52 * showing record data should thus be re-rendered.
\r
57 public String toggleRecord(String recid);
\r
60 * Resolves whether the backend has a record with the given recid in memory
\r
62 * @return true if the bean currently holds the record with recid
\r
64 public boolean hasRecord (String recId);
\r
68 * Initiates a pager object, a component holding the data to draw a sequence
\r
69 * of page numbers to navigate by and mechanisms to navigate with
\r
71 * @param pageRange number of pages to display in the pager
\r
72 * @return ResultsPager the initiated pager component
\r
74 public ResultsPager setPager(int pageRange);
\r
77 * Gives a component for drawing a pager to navigate by.
\r
78 * @return ResultsPager pager component
\r
80 public ResultsPager getPager();
\r
83 * Returns the current hash key used, as used for internal session state tracking
\r
84 * and potentially for browser history entries as well
\r
86 * A UI author would not normally be concerned with retrieving this. It's used by the
\r
87 * framework internally
\r
89 * @return string that can be used for browsers window.location.hash
\r
91 public String getCurrentStateKey ();
\r
94 * Sets the current state key, i.e. when user clicks back or forward in browser history.
\r
95 * Would normally be automatically handled by the frameworks components.
\r
97 * @param key corresponding to browsers hash string
\r
99 public void setCurrentStateKey(String key);
\r
102 * @return true if any errors encountered so far
\r
104 public boolean hasErrors();
\r
108 * @return true if errors encountered during execution of commands
\r
110 public boolean hasCommandErrors();
\r
114 * @return true if errors encountered when configuring the service
\r
116 public boolean hasConfigurationErrors();
\r
120 * Returns all errors encountered during configuration of the application, in particular
\r
121 * the Pazpar2 client.
\r
125 public List<ErrorInterface> getConfigurationErrors();
\r