Changeset 2163


Ignore:
Timestamp:
2001-03-13T07:38:57+13:00 (23 years ago)
Author:
bas6
Message:

Tidied up some comments & added package.html to SimpleGraphical Client

Location:
trunk/java-client/org/nzdl/gsdl
Files:
1 added
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/java-client/org/nzdl/gsdl/SimpleServer.java

    r2135 r2163  
    4343
    4444/**
    45  * SimpleServer A very basic Greenstoen server (not yet complete).
     45 * SimpleServer A very basic Greenstone server (not yet complete).
    4646 *
    4747 * @author stuart yeates ([email protected])
  • trunk/java-client/org/nzdl/gsdl/package.html

    r2156 r2163  
    88<body bgcolor="#FFFFFF">
    99Contains following classes: SearchAllCollections, SimpleClient
    10 (can be used to test the workings of the client-side interface) and
    11 SimpleServer (a basic Greenstone Server).
     10(can be used to test the workings of the client-side interface) and SimpleServer
     11(a basic Greenstone Server).
     12<p>To run from the command prompt, type something like:
     13<p><tt>cd java-client java org.nzdl.gsdl.SimpleClient -v 2 -Q</tt>
    1214</body>
    1315</html>
  • trunk/java-client/org/nzdl/gsdl/ptp/HTTP.java

    r2124 r2163  
    3535
    3636/**
    37  * Class ...
     37 * Represents HTTP.
    3838 *
    3939 * Based on algorithms in ...
  • trunk/java-client/org/nzdl/gsdl/ptp/package.html

    r2156 r2163  
    77</head>
    88<body bgcolor="#FFFFFF">
    9 Contains classes for representing: Connection, HTTP, IOR,
    10 Node Poller and PTP.
     9Contains classes for creating Peer-To-Peer connections.
    1110</body>
    1211</html>
  • trunk/java-client/org/nzdl/gsdl/service/NzdlCollectionInfo.java

    r2160 r2163  
    3434 * @author Gordon Paynter ([email protected])
    3535 * @author Dave Nichols   ([email protected])
     36 * @author Brett Sheeran ([email protected]) (comments)
    3637 * @version $Revision$
    3738 */
  • trunk/java-client/org/nzdl/gsdl/service/NzdlQuery.java

    r2159 r2163  
    3535 * @author Aziz Mahoui    ([email protected])
    3636 * @author Gordon Paynter ([email protected])
     37 * @author Brett Sheeran ([email protected]) (comments)
    3738 * @version $Revision$
    3839 */
  • trunk/java-client/org/nzdl/gsdl/service/NzdlQueryHit.java

    r2159 r2163  
    11/*
    2  *    NzdlCollectionInfo.java
     2 *    NzdlQueryHit.java
    33 *    Copyright (C) 2001 New Zealand Digital Library Project
    44 *
     
    2929 * {@link NzdlResponse NzdlResponse} and
    3030 * {@link NzdlResultSet NzdlResultSet}
     31 *
     32 * @author Stuart Yeates  ([email protected])
     33 * @author Aziz Mahoui    ([email protected])
     34 * @author Gordon Paynter ([email protected])
     35 * @author Brett Sheeran ([email protected]) (comments)
    3136 */
    3237public class NzdlQueryHit extends java.lang.Object {
  • trunk/java-client/org/nzdl/gsdl/service/NzdlRequest.java

    r2159 r2163  
    3636 * @author Aziz Mahoui    ([email protected])
    3737 * @author Gordon Paynter ([email protected])
     38 * @author Brett Sheeran ([email protected]) (comments)
    3839 * @version $Revision$
    3940 */
  • trunk/java-client/org/nzdl/gsdl/service/NzdlResponse.java

    r2159 r2163  
    4040 * @author Aziz Mahoui    ([email protected])
    4141 * @author Gordon Paynter ([email protected])
     42 * @author Brett Sheeran ([email protected]) (comments)
    4243 * @version $Revision$
    4344 */
  • trunk/java-client/org/nzdl/gsdl/service/NzdlResultSet.java

    r2159 r2163  
    3333 * {@link NzdlResponse#getResultSet() NzdlResponse.getResultSet()}.
    3434 * Easily interrogated by a user.
     35 * @author Stuart Yeates  ([email protected])
     36 * @author Aziz Mahoui    ([email protected])
     37 * @author Gordon Paynter ([email protected])
     38 * @author Brett Sheeran ([email protected]) (comments)
    3539 */
    3640public class NzdlResultSet extends java.lang.Object {
  • trunk/java-client/org/nzdl/gsdl/service/NzdlService.java

    r2159 r2163  
    3131 * @author Aziz Mahoui    ([email protected])
    3232 * @author Gordon Paynter ([email protected])
     33 * @author Brett Sheeran ([email protected]) (comments)
    3334 * @version $Revision$
    3435 */
  • trunk/java-client/org/nzdl/gsdl/service/NzdlServiceClient.java

    r2157 r2163  
    4343 * @author Aziz Mahoui    ([email protected])
    4444 * @author Gordon Paynter ([email protected])
     45 * @author Brett Sheeran ([email protected]) (comments)
    4546 * @version $Revision$
    4647 */
  • trunk/java-client/org/nzdl/gsdl/service/package.html

    r2156 r2163  
    1111Provides services for java client-side communication
    1212to a Greenstone Digital Library via CORBA.
    13 <p><b>See:</b>
    14 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><a href="#package_description">Description</a></b>
    15 <table BORDER CELLSPACING=0 CELLPADDING=3 WIDTH="100%" >
    16 <tr BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
    17 <td COLSPAN="2"><b><font size=+2>Interface Summary</font></b></td>
    18 </tr>
    19 
    20 <tr BGCOLOR="#FFFFFF" CLASS="TableRowColor">
    21 <td WIDTH="15%"><b><i><a href="NzdlService.html">NzdlService</a></i></b></td>
    22 
    23 <td>An object that services CORBA client requests to a Greenstone Digital
    24 Library.</td>
    25 </tr>
    26 </table>
    27 
    28 <table BORDER CELLSPACING=0 CELLPADDING=3 WIDTH="100%" >
    29 <tr BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
    30 <td COLSPAN="2"><b><font size=+2>Class Summary</font></b></td>
    31 </tr>
    32 
    33 <tr BGCOLOR="#FFFFFF" CLASS="TableRowColor">
    34 <td WIDTH="15%"><b><a href="NzdlCollectionInfo.html">NzdlCollectionInfo</a></b></td>
    35 
    36 <td>An object that stores information on a collection.</td>
    37 </tr>
    38 
    39 <tr BGCOLOR="#FFFFFF" CLASS="TableRowColor">
    40 <td WIDTH="15%"><b><a href="NzdlQuery.html">NzdlQuery</a></b></td>
    41 
    42 <td>NzdlQuery is an object that holds the options for a query and is easily
    43 configured by the user.</td>
    44 </tr>
    45 
    46 <tr BGCOLOR="#FFFFFF" CLASS="TableRowColor">
    47 <td WIDTH="15%"><b><a href="NzdlQueryHit.html">NzdlQueryHit</a></b></td>
    48 
    49 <td>Holds a single result from a query.</td>
    50 </tr>
    51 
    52 <tr BGCOLOR="#FFFFFF" CLASS="TableRowColor">
    53 <td WIDTH="15%"><b><a href="NzdlRequest.html">NzdlRequest</a></b></td>
    54 
    55 <td>An object that holds CORBA request data ready for by servicing by <tt><a href="NzdlService.html">NzdlService</a></tt>.</td>
    56 </tr>
    57 
    58 <tr BGCOLOR="#FFFFFF" CLASS="TableRowColor">
    59 <td WIDTH="15%"><b><a href="NzdlResponse.html">NzdlResponse</a></b></td>
    60 
    61 <td>An object that holds data from a response after a <tt><a href="NzdlRequest.html">NzdlRequest</a></tt>
    62 has been serviced by <tt><a href="NzdlService.html">NzdlService</a></tt>.</td>
    63 </tr>
    64 
    65 <tr BGCOLOR="#FFFFFF" CLASS="TableRowColor">
    66 <td WIDTH="15%"><b><a href="NzdlResultSet.html">NzdlResultSet</a></b></td>
    67 
    68 <td>An object that holds results extracted from a response by <tt><a href="NzdlResponse.html#getResultSet()">NzdlResponse.getResultSet()</a></tt>.</td>
    69 </tr>
    70 
    71 <tr BGCOLOR="#FFFFFF" CLASS="TableRowColor">
    72 <td WIDTH="15%"><b><a href="NzdlServiceClient.html">NzdlServiceClient</a></b></td>
    73 
    74 <td>Used to implement the <tt><a href="NzdlService.html">NzdlService</a></tt>
    75 object.</td>
    76 </tr>
    77 
    78 <tr BGCOLOR="#FFFFFF" CLASS="TableRowColor">
    79 <td WIDTH="15%"><b><a href="NzdlServiceServer.html">NzdlServiceServer</a></b></td>
    80 
    81 <td>SimpleServer Based on algorithms in ...</td>
    82 </tr>
    83 </table>
    84 
    85 <p><a NAME="package_description"></a><!-- -->
    86 <h2>
    87 Package org.nzdl.gsdl.service Description</h2>
    88 Provides services for java client-side communication to a Greenstone Digital
    89 Library via CORBA.
    9013<br>&nbsp;
    9114<h2>
     
    12750<li>
    12851&nbsp; a <b>NzdlService</b> object to service CORBA interface requests
    129 to a Greenstone collection</li>
     52to
     53a Greenstone collection</li>
    13054</ul>
    13155
     
    14569
    14670<br>Get documents using <b>NzdlService.getDocument()</b></ul>
    147 <b></b>
     71
    14872<h1>
    14973Sample Code</h1>
    150 <tt>/**</tt>
     74Below is a trivial example of a client application. For a more elaborate
     75example, see <a href="../SimpleClient.html">SimpleClient</a>.
     76<p>In order to function, this app needs Corbaserver running on the same
     77machine.
     78<p><tt>/**</tt>
    15179<br><tt>* TrivialDemo.java.</tt>
    152 <br><tt>* A very simple application that:</tt>
    153 <br><tt>* - reads an Interoperable Object Reference (IOR) from a file;</tt>
     80<br><tt>* A very simple client application that:</tt>
     81<br><tt>* - Creates a service object using an Interoperable</tt>
     82<br><tt>*&nbsp;&nbsp; Object Reference (IOR) from a file;</tt>
    15483<br><tt>* - lists all available collections;</tt>
    15584<br><tt>* - searches "demo" collection for "snail farming";</tt>
     
    16291<br><tt>import java.lang.*;</tt>
    16392<br><tt>import org.nzdl.gsdl.service.*; //the java-client stuff</tt>
     93<br><tt>import org.nzdl.gsdl.util.NzdlIORs; //for obtaining the IOR</tt>
    16494<p><tt>public class TrivialDemo {</tt>
    16595<br><tt>&nbsp; public static void main( String [] args )</tt>
     
    16898<br><tt>&nbsp;&nbsp;&nbsp; String myQueryString = "snail farming";</tt>
    16999<br><tt>&nbsp;&nbsp;&nbsp; String myCollection = "demo";</tt>
    170 <p><tt>&nbsp;&nbsp;&nbsp; // Use NzdlService to create corba connection</tt>
    171 <br><tt>&nbsp;&nbsp;&nbsp; NzdlService myService = new NzdlServiceClient</tt>
     100<p><tt>&nbsp;&nbsp;&nbsp; // Create a Service Object</tt>
     101<br><tt>&nbsp;&nbsp;&nbsp; NzdlService myService = NzdlIORs.findIOR(null,
     102null,</tt>
    172103<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    173 ( null, null, getIor(myIorFile) );</tt>
     104myIorFile, null);</tt>
    174105<p><tt>&nbsp;&nbsp;&nbsp; // Use getCollectionSet to obtain List of Collections</tt>
    175106<br><tt>&nbsp;&nbsp;&nbsp; Set myCollections = myService.getCollectionSet();</tt>
     
    188119<br><tt>&nbsp;&nbsp;&nbsp; System.out.println("\nNum Of Collection docs
    189120= "+myInfo.getNumOfDocs());</tt>
    190 <br><tt>&nbsp;</tt>
    191 <br><tt>&nbsp;&nbsp;&nbsp; // Create query object</tt>
     121<p><tt>&nbsp;&nbsp;&nbsp; // Create query object</tt>
    192122<br><tt>&nbsp;&nbsp;&nbsp; NzdlQuery query = new NzdlQuery( myQueryString
    193 );</tt><tt></tt>
     123);</tt>
    194124<p><tt>&nbsp;&nbsp;&nbsp; // Create request object</tt>
    195125<br><tt>&nbsp;&nbsp;&nbsp; NzdlRequest request = new NzdlRequest( query
    196 );</tt><tt></tt>
     126);</tt>
    197127<p><tt>&nbsp;&nbsp;&nbsp; // create response object</tt>
    198128<br><tt>&nbsp;&nbsp;&nbsp; NzdlResponse response = new NzdlResponse( );</tt>
    199 <br>&nbsp;
    200 <br><tt>&nbsp;&nbsp;&nbsp; // use service to get response from request
    201 to myCollection</tt>
     129<p><tt>&nbsp;&nbsp;&nbsp; // use service to get response from request to
     130myCollection</tt>
    202131<br><tt>&nbsp;&nbsp;&nbsp; myService.service( myCollection, request, response
    203132);</tt>
    204133<p><tt>&nbsp;&nbsp;&nbsp; // use getResultSet to get results from response</tt>
    205 <br><tt>&nbsp;&nbsp;&nbsp; NzdlResultSet results = response.getResultSet();</tt><tt></tt>
     134<br><tt>&nbsp;&nbsp;&nbsp; NzdlResultSet results = response.getResultSet();</tt>
    206135<p><tt>&nbsp;&nbsp;&nbsp; // getNumOfDocs</tt>
    207 <br><tt>&nbsp;&nbsp;&nbsp; System.out.println("\nNumber of hits = "+results.getNumOfDocs());</tt><tt></tt>
     136<br><tt>&nbsp;&nbsp;&nbsp; System.out.println("\nNumber of hits = "+results.getNumOfDocs());</tt>
    208137<p><tt>&nbsp;&nbsp;&nbsp; // Use getDocumentIDs to build list of titles
    209138(defaults: 1 - 10)</tt>
     
    227156<br><tt>&nbsp;&nbsp;&nbsp; System.out.println(myDoc);</tt>
    228157<p><tt>&nbsp;&nbsp;&nbsp; } // end of main</tt>
    229 <br>&nbsp;
    230 <p><tt>&nbsp;&nbsp;&nbsp; // Read the IOR from a file</tt>
    231 <br><tt>&nbsp;&nbsp;&nbsp; static private String getIor(String sourceOfID)
    232 {</tt>
    233 <br><tt>&nbsp;&nbsp;&nbsp; String ior = null;</tt>
    234 <br><tt>&nbsp;&nbsp;&nbsp; try</tt>
    235 <br><tt>&nbsp;&nbsp;&nbsp; {</tt>
    236 <br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BufferedReader input</tt>
    237 <br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    238 = new BufferedReader(new FileReader(sourceOfID));</tt>
    239 <br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ior = input.readLine();</tt>
    240 <br><tt>&nbsp;&nbsp;&nbsp; }</tt>
    241 <br><tt>&nbsp;&nbsp;&nbsp; catch (java.io.IOException e)</tt>
    242 <br><tt>&nbsp;&nbsp;&nbsp; {</tt>
    243 <br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.err.println("Error
    244 reading IOR key:\n" + e);</tt>
    245 <br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.exit(1);</tt>
    246 <br><tt>&nbsp;&nbsp;&nbsp; }</tt>
    247 <br><tt>&nbsp;&nbsp;&nbsp; return ior;</tt>
    248 <br><tt>&nbsp; }&nbsp; //end of getIors</tt><tt></tt>
    249 <p><tt>} // end of demo class</tt>
     158<br><tt>} // end of demo class</tt>
    250159<br>&nbsp;
    251160</body>
  • trunk/java-client/org/nzdl/gsdl/util/NzdlConstants.java

    r2155 r2163  
    2121package org.nzdl.gsdl.util;
    2222
     23/**
     24 * Contains default values for: query and other stuff.
     25 *
     26 * @author Stuart Yeates  ([email protected])
     27 * @author Aziz Mahoui    ([email protected])
     28 * @author Gordon Paynter ([email protected])
     29 * @version $Revision$
     30 */
    2331public interface NzdlConstants {
    2432
  • trunk/java-client/org/nzdl/gsdl/util/NzdlCorbaFactory.java

    r2159 r2163  
    3030import org.nzdl.gsdl.util.NzdlConstants;
    3131
     32/**
     33 * Returns CORBA objects via it's operations.
     34 */
    3235public final class NzdlCorbaFactory {
    3336
  • trunk/java-client/org/nzdl/gsdl/util/NzdlHosts.java

    r2159 r2163  
    4040
    4141/**
    42  * Class ...
    43  *
    44  * Based on algorithms in ...
     42 * Used to get host information including: name, IOR and URL.
    4543 *
    4644 * @author stuart yeates ([email protected])
  • trunk/java-client/org/nzdl/gsdl/util/NzdlIORs.java

    r2159 r2163  
    6161 *
    6262 * A repositry for IORs of various NZDL servers we've seen.
     63 * Finds IORs from sources such as: URL, file, string, or server based
     64 * list of known IORs.
    6365 *
    6466 * @author stuart yeates ([email protected])
     
    8183 */
    8284
     85
    8386public class NzdlIORs implements Cloneable, Serializable {
    8487
     
    212215   
    213216    // try an IOR from a file (the filename may have been
    214     // given from teh commandline
     217    // given from the commandline
    215218    if (client == null) {
    216219      IOR = NzdlIORs.getIORfromFile(_filename);
  • trunk/java-client/org/nzdl/gsdl/util/package.html

    r2156 r2163  
     1<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
    12<html>
    2 <title>Utils Package</title>
     3<head>
     4   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
     5   <meta name="GENERATOR" content="Mozilla/4.76 [en] (X11; U; Linux 2.2.16-22 i686) [Netscape]">
     6   <title>Utils Package</title>
     7</head>
    38<body bgcolor="#FFFFFF">
    4 Contains:
    5 NzdlConstants a classthat holds constants and
    6 NzdlHosts a class for finding NZDL hosts and determining their Interoperable Object References.
    7 NzdlCorbaFactory
    8 
     9Contains utilities for working with hosts, IORs and the NzdlCorba
     10factory.
    911</body>
    1012</html>
Note: See TracChangeset for help on using the changeset viewer.