- </screen>
-
- <para>
- Each command callback is a user defined function that takes a hash object as a parameter. The hash object contains parsed pazpar2 responses (hash members that correspond to the elements in the response XML document). Within the handler programmer further processes the data and updates the viewed document.
- </para>
-
- <screen>
- function my_onstat(data) {
- var stat = document.getElementById("stat");
- stat.innerHTML = '<span>Active clients: '+ data.activeclients
- + '/' + data.clients + ' | </span>'
- + '<span>Retrieved records: ' + data.records
- + '/' + data.hits + '</span>';
- }
-
- function my_onshow(data) {
- // data contains parsed show response
- for (var i = 0; i < data.hits[0].length; i++)
- // update page with the hits
- }
-
- function on_record(data) {
- // if detailsstylesheet parameter was set data array
- // will contain raw xml and xsl data
- Element_appendTransformResult(someDiv, data.xmlDoc, data.xslDoc);
- }
- </screen>
-
- <para><bridgehead>pz2.js on runtime</bridgehead></para>
-
- <para>
- The search process is initiated by calling the search method on the instantiated pz2 object. To initiate short status reports and per-target status information methods stat and bytarget have to be called accordingly.
- </para>
-
- <screen>
- my_paz.search (query, recPergPage, 'relevance');
- </screen>
-
- <para>
- Managing the results (keeping track of the browsed results page and sorting) is up to the client's programmer. At any point the show method may be called to bring up the latest result set with a different sorting criteria or range and without re-executing the search on the back-end.
- </para>
-
- <screen>
- my_paz.show (1, 10, 'relevance');
- </screen>
-
- <para>
- To retrieve a detailed record the record command is called. When calling record command one may temporarily override its default callback by specifying the handler parameter. This might be useful when retrieving raw records that need to be processed differently.
- </para>
-
- <screen>
- my_paz.record (recId, 2, 'opac', { “callback”: temp_callback, “args”, caller_args});
- </screen>
-
- <variablelist>
-
- <para><bridgehead>PARAMATERS ARRAY</bridgehead></para>
-
- <varlistentry><term>pazpar2path</term>
- <listitem><para>server path to pazpar2 (relative to the portal), when pazpar2 is installed as a package this does not have to be set </para></listitem>
- </varlistentry>
-
- <varlistentry><term>usesessions</term>
- <listitem><para>boolean, when set to true pz2.js will manage sessions internally otherwise it's left to the server-side script, default true</para></listitem>
- </varlistentry>
-
- <varlistentry><term>autoInit</term>
- <listitem><para>bolean, sets auto initialization of pazpar2 session on the object instantiation, default true, valid only if usesession is set to true</para></listitem>
- </varlistentry>
-
- <varlistentry><term>detailstylesheet</term>
- <listitem><para>path to the xsl presentation stylesheet (relative to the portal) used for the detailed record display</para></listitem></varlistentry>
-
- <varlistentry><term>errorhandler</term>
- <listitem><para>callback function called on any, pazpar2 or pz2.js' internal, error</para></listitem></varlistentry>
-
- <varlistentry><term>oninit</term>
- <listitem><para>specifies init response callback function</para></listitem></varlistentry>
-
- <varlistentry><term>onstat</term>
- <listitem><para>specifies stat response callback function</para></listitem></varlistentry>
-
- <varlistentry><term>onshow</term>
- <listitem><para>specifies show response callback function</para></listitem></varlistentry>
-
- <varlistentry><term>onterm</term>
- <listitem><para>specifies termlist response callback function</para></listitem></varlistentry>
-
- <varlistentry><term>onrecord</term>
- <listitem><para>specifies record response callback function</para></listitem></varlistentry>
-
- <varlistentry><term>onbytarget</term>
- <listitem><para>specifies bytarget response callback function</para></listitem></varlistentry>
-
- <varlistentry><term>onreset</term>
- <listitem><para>specifies reset method callback function</para></listitem></varlistentry>
-
- <varlistentry><term>termlist</term>
- <listitem><para>comma separated list of facets</para></listitem></varlistentry>
-
- <varlistentry><term>keepAlive</term>
- <listitem><para>ping period, should not be lower than 5000 usec</para></listitem></varlistentry>
+ </screen>
+ <para>
+ Each command callback is a user defined function that takes a hash
+ object as a parameter. The hash object contains parsed pazpar2
+ responses (hash members that correspond to the elements in the
+ response XML document). Within the handler programmer further
+ processes the data and updates the viewed document.
+ </para>
+ <screen>
+ function my_onstat(data) {
+ var stat = document.getElementById("stat");
+ stat.innerHTML = '<span>Active clients: '+ data.activeclients
+ + '/' + data.clients + ' | </span>'
+ + '<span>Retrieved records: ' + data.records
+ + '/' + data.hits + '</span>';
+ }
+
+ function my_onshow(data) {
+ // data contains parsed show response
+ for (var i = 0; i < data.hits[0].length; i++)
+ // update page with the hits
+ }
+
+ function on_record(data) {
+ // if detailsstylesheet parameter was set data array
+ // will contain raw xml and xsl data
+ Element_appendTransformResult(someDiv, data.xmlDoc, data.xslDoc);
+ }
+ </screen>
+ <para><bridgehead><filename>pz2.js</filename> on runtime</bridgehead></para>
+ <para>
+ The search process is initiated by calling the search method on the
+ instantiated pz2 object. To initiate short status reports and
+ per-target status information methods stat and bytarget have to be
+ called accordingly.
+ </para>
+ <screen>
+ my_paz.search (query, recPergPage, 'relevance');
+ </screen>
+ <para>
+ Managing the results (keeping track of the browsed results page and
+ sorting) is up to the client's programmer. At any point the show
+ method may be called to bring up the latest result set with a
+ different sorting criteria or range and without re-executing the
+ search on the back-end.
+ </para>
+ <screen>
+ my_paz.show (1, 10, 'relevance');
+ </screen>
+ <para>
+ To retrieve a detailed record the record command is called. When
+ calling record command one may temporarily override its default
+ callback by specifying the handler parameter. This might be useful
+ when retrieving raw records that need to be processed differently.
+ </para>
+ <screen>
+ my_paz.record (recId, 2, 'opac', { “callback”: temp_callback, “args”, caller_args});
+ </screen>
+ <variablelist>
+ <para><bridgehead>PARAMETERS ARRAY</bridgehead></para>
+ <varlistentry><term>pazpar2path</term>
+ <listitem><para>server path to pazpar2 (relative to the portal), when pazpar2 is installed as a package this does not have to be set </para></listitem>
+ </varlistentry>
+ <varlistentry><term>usesessions</term>
+ <listitem><para>boolean, when set to true <filename>pz2.js</filename> will manage sessions internally otherwise it's left to the server-side script, default true</para></listitem>
+ </varlistentry>
+ <varlistentry><term>autoInit</term>
+ <listitem><para>bolean, sets auto initialization of pazpar2 session on the object instantiation, default true, valid only if usesession is set to true</para></listitem>
+ </varlistentry>
+ <varlistentry><term>detailstylesheet</term>
+ <listitem><para>path to the xsl presentation stylesheet (relative to the portal) used for the detailed record display</para></listitem></varlistentry>
+
+ <varlistentry><term>errorhandler</term>
+ <listitem><para>callback function called on any, pazpar2 or <filename>pz2.js</filename>' internal, error</para></listitem></varlistentry>
+
+ <varlistentry><term>oninit</term>
+ <listitem><para>specifies init response callback function</para></listitem></varlistentry>
+
+ <varlistentry><term>onstat</term>
+ <listitem><para>specifies stat response callback function</para></listitem></varlistentry>
+
+ <varlistentry><term>onshow</term>
+ <listitem><para>specifies show response callback function</para></listitem></varlistentry>
+
+ <varlistentry><term>onterm</term>
+ <listitem><para>specifies termlist response callback function</para></listitem></varlistentry>
+
+ <varlistentry><term>onrecord</term>
+ <listitem><para>specifies record response callback function</para></listitem></varlistentry>
+
+ <varlistentry><term>onbytarget</term>
+ <listitem><para>specifies bytarget response callback function</para></listitem></varlistentry>
+
+ <varlistentry><term>onreset</term>
+ <listitem><para>specifies reset method callback function</para></listitem></varlistentry>
+
+ <varlistentry><term>termlist</term>
+ <listitem><para>comma separated list of facets</para></listitem></varlistentry>
+
+ <varlistentry><term>keepAlive</term>
+ <listitem><para>ping period, should not be lower than 5000 usec</para></listitem></varlistentry>
+
+ <varlistentry><term>stattime</term>
+ <listitem><para>default 1000 usec</para></listitem></varlistentry>
+
+ <varlistentry><term>termtime</term></varlistentry>
+
+ <varlistentry><term>showtime</term></varlistentry>
+
+ <varlistentry><term>bytargettime</term></varlistentry>
+
+ </variablelist>