Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/pazpar2
[pazpar2-moved-to-github.git] / doc / ajaxdev.xml
index 8a48d01..035f250 100644 (file)
@@ -9,11 +9,11 @@
   <para><bridgehead>Pz2.js</bridgehead></para>
   
   <para>
-  Pazapar2 comes with a small JavaScript library called pz2.js. This library is designed to simplify development of Ajax-based pazpar2 clients and alleviate programmer from low-level details like polling the web service, fetching and parsing returned XML output or managing timers, sessions and basic state variables.
+  Pazpar2 comes with a small JavaScript library called pz2.js. This library is designed to simplify development of an Ajax-based pazpar2 client and alleviate programmer from the low-level details like polling the web service, fetching and parsing returned XML output or managing timers, sessions and basic state variables.
   </para>
   
   <para>
-  The library supports most major browser's including Firefox 1.5+, IE 6+, Safari 2+, Opera 9+ and Konqueror.
+  The library supports most major browsers including Firefox 1.5+, IE 6+, Safari 2+, Opera 9+ and Konqueror.
   </para>
   
   <para>
     
   <para>In the session-less mode the library assumes that the client is identified on the server and the session Ids are not managed directly. This way of operation requires more sophisticated pazpar2 proxy (preferably a wrapper written in a server-side scripting language like PHP that can identify clients and relate them to open pazpar2 sessions).</para>
   
-  
   <para><bridgehead>Using pz2.js</bridgehead></para>
   
   <para>
-  Client development with the pz2.js is strongly event based and should be familiar to most JavaScript developers. A simple client (jsdemo) is distributed with pazpar2's source code and shows how to set-up and use pz2.js.
+  Client development with the pz2.js is strongly event based and the style should be familiar to most JavaScript developers. A simple client (jsdemo) is distributed with pazpar2's source code and shows how to set-up and use pz2.js.
   </para>
   
   <para>
@@ -63,7 +62,7 @@
   </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 the viewed document.
+  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 on_record(data) {
-        // if detailsstylesheet parameter was set data array will contain raw xml // // and xsl 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 runtime</bridgehead></para>
+  <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.
   </screen>
   
   <para>
-  To retrieve detailed record 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.
+  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});
+    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 pazar2 is installed as a package this does not have to be set </para></listitem>
+    <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>
+    <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>
+    <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>
+    <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>
 
     <listitem><para>specifies reset method callback function</para></listitem></varlistentry>
 
     <varlistentry><term>termlist</term>
-    <listitem><para>coma separated list of facets</para></listitem></varlistentry>
+    <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>bytargettime</term></varlistentry>
 
   </variablelist>
-  
+
   <variablelist>
    
-    <para><bridgehead>PZ2 METHODS</bridgehead></para>
+    <para><bridgehead>METHODS</bridgehead></para>
    
     <varlistentry><term>stop ()</term>
     <listitem><para>stop activity by clearing timeouts</para></listitem></varlistentry>
     <listitem><para>reset state</para></listitem></varlistentry>
 
     <varlistentry><term>init (sesionId)</term>
-    <listitem><para>session-mode, intitialize new session or pick up a session already initialized</para></listitem></varlistentry>
+    <listitem><para>session-mode, initialize new session or pick up a session already initialized</para></listitem></varlistentry>
 
     <varlistentry><term>ping ()</term>
     <listitem><para>session-mode, intitialize pinging </para></listitem></varlistentry>
 
     <varlistentry><term>search (query, num, sort, filter, showfrom)</term>
-    <listitem><para>execute piggy-back search and activate polling on every command specfied by assigning command callback (in the pz2 constructor)</para></listitem></varlistentry>
+    <listitem><para>execute piggy-back search and activate polling on every command specified by assigning command callback (in the pz2 constructor)</para></listitem></varlistentry>
 
     <varlistentry><term>show (start, num, sort)</term>
     <listitem><para>start or change parameters of polling for a given window of records</para></listitem></varlistentry>
 
     <varlistentry><term>record (id, offset, syntax, handler)</term>
-    <listitem><para>retrieve detailed or raw record. handler temporary overrirdes default callback function.</para></listitem></varlistentry>
+    <listitem><para>retrieve detailed or raw record. handler temporarily overrides default callback function.</para></listitem></varlistentry>
 
     <varlistentry><term>termlist ()</term>
     <listitem><para>start polling for termlists</para></listitem></varlistentry>
 
   </variablelist>
   
+  <para/>
+  <para>Pz2.js comes with a set of cross-browser helper classes and functions.</para>
+
   <variablelist>
 
-    <para><bridgehead>AJAX HELPER CLASS</bridgehead></para>
+    <para><bridgehead>AJAX helper class</bridgehead></para>
 
     <varlistentry><term>pzHttpRequest</term> 
-    <listitem><para>this is a cross-browses Ajax wrapper class</para></listitem></varlistentry>
+    <listitem><para>a cross-browser Ajax wrapper class</para></listitem></varlistentry>
 
     <varlistentry><term>constructor (url, errorHandler)</term>
     <listitem><para>create new request for a given url</para></listitem></varlistentry>
 
   <variablelist>
 
-    <para><bridgehead>HELPER FUNCTIONS</bridgehead></para>
+    <para><bridgehead>XML helper functions</bridgehead></para>
    
     <varlistentry><term>document.newXmlDoc (root)</term>
     <listitem><para>create new XML document with root node as specified in parameter</para></listitem></varlistentry>
   </variablelist>
    
 </section>
+
+<!-- Keep this comment at the end of the file
+ Local variables:
+ mode: sgml
+ sgml-omittag:t
+ sgml-shorttag:t
+ sgml-minimize-attributes:nil
+ sgml-always-quote-attributes:t
+ sgml-indent-step:1
+ sgml-indent-data:t
+ sgml-parent-document: nil
+ sgml-local-catalogs: nil
+ sgml-namecase-general:t
+ End:
+ -->