Changeset 2163
- Timestamp:
- 2001-03-13T07:38:57+13:00 (23 years ago)
- 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 43 43 44 44 /** 45 * SimpleServer A very basic Greensto en server (not yet complete).45 * SimpleServer A very basic Greenstone server (not yet complete). 46 46 * 47 47 * @author stuart yeates ([email protected]) -
trunk/java-client/org/nzdl/gsdl/package.html
r2156 r2163 8 8 <body bgcolor="#FFFFFF"> 9 9 Contains 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> 12 14 </body> 13 15 </html> -
trunk/java-client/org/nzdl/gsdl/ptp/HTTP.java
r2124 r2163 35 35 36 36 /** 37 * Class ...37 * Represents HTTP. 38 38 * 39 39 * Based on algorithms in ... -
trunk/java-client/org/nzdl/gsdl/ptp/package.html
r2156 r2163 7 7 </head> 8 8 <body bgcolor="#FFFFFF"> 9 Contains classes for representing: Connection, HTTP, IOR, 10 Node Poller and PTP. 9 Contains classes for creating Peer-To-Peer connections. 11 10 </body> 12 11 </html> -
trunk/java-client/org/nzdl/gsdl/service/NzdlCollectionInfo.java
r2160 r2163 34 34 * @author Gordon Paynter ([email protected]) 35 35 * @author Dave Nichols ([email protected]) 36 * @author Brett Sheeran ([email protected]) (comments) 36 37 * @version $Revision$ 37 38 */ -
trunk/java-client/org/nzdl/gsdl/service/NzdlQuery.java
r2159 r2163 35 35 * @author Aziz Mahoui ([email protected]) 36 36 * @author Gordon Paynter ([email protected]) 37 * @author Brett Sheeran ([email protected]) (comments) 37 38 * @version $Revision$ 38 39 */ -
trunk/java-client/org/nzdl/gsdl/service/NzdlQueryHit.java
r2159 r2163 1 1 /* 2 * Nzdl CollectionInfo.java2 * NzdlQueryHit.java 3 3 * Copyright (C) 2001 New Zealand Digital Library Project 4 4 * … … 29 29 * {@link NzdlResponse NzdlResponse} and 30 30 * {@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) 31 36 */ 32 37 public class NzdlQueryHit extends java.lang.Object { -
trunk/java-client/org/nzdl/gsdl/service/NzdlRequest.java
r2159 r2163 36 36 * @author Aziz Mahoui ([email protected]) 37 37 * @author Gordon Paynter ([email protected]) 38 * @author Brett Sheeran ([email protected]) (comments) 38 39 * @version $Revision$ 39 40 */ -
trunk/java-client/org/nzdl/gsdl/service/NzdlResponse.java
r2159 r2163 40 40 * @author Aziz Mahoui ([email protected]) 41 41 * @author Gordon Paynter ([email protected]) 42 * @author Brett Sheeran ([email protected]) (comments) 42 43 * @version $Revision$ 43 44 */ -
trunk/java-client/org/nzdl/gsdl/service/NzdlResultSet.java
r2159 r2163 33 33 * {@link NzdlResponse#getResultSet() NzdlResponse.getResultSet()}. 34 34 * 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) 35 39 */ 36 40 public class NzdlResultSet extends java.lang.Object { -
trunk/java-client/org/nzdl/gsdl/service/NzdlService.java
r2159 r2163 31 31 * @author Aziz Mahoui ([email protected]) 32 32 * @author Gordon Paynter ([email protected]) 33 * @author Brett Sheeran ([email protected]) (comments) 33 34 * @version $Revision$ 34 35 */ -
trunk/java-client/org/nzdl/gsdl/service/NzdlServiceClient.java
r2157 r2163 43 43 * @author Aziz Mahoui ([email protected]) 44 44 * @author Gordon Paynter ([email protected]) 45 * @author Brett Sheeran ([email protected]) (comments) 45 46 * @version $Revision$ 46 47 */ -
trunk/java-client/org/nzdl/gsdl/service/package.html
r2156 r2163 11 11 Provides services for java client-side communication 12 12 to a Greenstone Digital Library via CORBA. 13 <p><b>See:</b>14 <br> <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 Digital24 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 easily43 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 Digital89 Library via CORBA.90 13 <br> 91 14 <h2> … … 127 50 <li> 128 51 a <b>NzdlService</b> object to service CORBA interface requests 129 to a Greenstone collection</li> 52 to 53 a Greenstone collection</li> 130 54 </ul> 131 55 … … 145 69 146 70 <br>Get documents using <b>NzdlService.getDocument()</b></ul> 147 <b></b> 71 148 72 <h1> 149 73 Sample Code</h1> 150 <tt>/**</tt> 74 Below is a trivial example of a client application. For a more elaborate 75 example, see <a href="../SimpleClient.html">SimpleClient</a>. 76 <p>In order to function, this app needs Corbaserver running on the same 77 machine. 78 <p><tt>/**</tt> 151 79 <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>* Object Reference (IOR) from a file;</tt> 154 83 <br><tt>* - lists all available collections;</tt> 155 84 <br><tt>* - searches "demo" collection for "snail farming";</tt> … … 162 91 <br><tt>import java.lang.*;</tt> 163 92 <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> 164 94 <p><tt>public class TrivialDemo {</tt> 165 95 <br><tt> public static void main( String [] args )</tt> … … 168 98 <br><tt> String myQueryString = "snail farming";</tt> 169 99 <br><tt> String myCollection = "demo";</tt> 170 <p><tt> // Use NzdlService to create corba connection</tt> 171 <br><tt> NzdlService myService = new NzdlServiceClient</tt> 100 <p><tt> // Create a Service Object</tt> 101 <br><tt> NzdlService myService = NzdlIORs.findIOR(null, 102 null,</tt> 172 103 <br><tt> 173 ( null, null, getIor(myIorFile));</tt>104 myIorFile, null);</tt> 174 105 <p><tt> // Use getCollectionSet to obtain List of Collections</tt> 175 106 <br><tt> Set myCollections = myService.getCollectionSet();</tt> … … 188 119 <br><tt> System.out.println("\nNum Of Collection docs 189 120 = "+myInfo.getNumOfDocs());</tt> 190 <br><tt> </tt> 191 <br><tt> // Create query object</tt> 121 <p><tt> // Create query object</tt> 192 122 <br><tt> NzdlQuery query = new NzdlQuery( myQueryString 193 );</tt> <tt></tt>123 );</tt> 194 124 <p><tt> // Create request object</tt> 195 125 <br><tt> NzdlRequest request = new NzdlRequest( query 196 );</tt> <tt></tt>126 );</tt> 197 127 <p><tt> // create response object</tt> 198 128 <br><tt> NzdlResponse response = new NzdlResponse( );</tt> 199 <br> 200 <br><tt> // use service to get response from request 201 to myCollection</tt> 129 <p><tt> // use service to get response from request to 130 myCollection</tt> 202 131 <br><tt> myService.service( myCollection, request, response 203 132 );</tt> 204 133 <p><tt> // use getResultSet to get results from response</tt> 205 <br><tt> NzdlResultSet results = response.getResultSet();</tt> <tt></tt>134 <br><tt> NzdlResultSet results = response.getResultSet();</tt> 206 135 <p><tt> // getNumOfDocs</tt> 207 <br><tt> System.out.println("\nNumber of hits = "+results.getNumOfDocs());</tt> <tt></tt>136 <br><tt> System.out.println("\nNumber of hits = "+results.getNumOfDocs());</tt> 208 137 <p><tt> // Use getDocumentIDs to build list of titles 209 138 (defaults: 1 - 10)</tt> … … 227 156 <br><tt> System.out.println(myDoc);</tt> 228 157 <p><tt> } // end of main</tt> 229 <br> 230 <p><tt> // Read the IOR from a file</tt> 231 <br><tt> static private String getIor(String sourceOfID) 232 {</tt> 233 <br><tt> String ior = null;</tt> 234 <br><tt> try</tt> 235 <br><tt> {</tt> 236 <br><tt> BufferedReader input</tt> 237 <br><tt> 238 = new BufferedReader(new FileReader(sourceOfID));</tt> 239 <br><tt> ior = input.readLine();</tt> 240 <br><tt> }</tt> 241 <br><tt> catch (java.io.IOException e)</tt> 242 <br><tt> {</tt> 243 <br><tt> System.err.println("Error 244 reading IOR key:\n" + e);</tt> 245 <br><tt> System.exit(1);</tt> 246 <br><tt> }</tt> 247 <br><tt> return ior;</tt> 248 <br><tt> } //end of getIors</tt><tt></tt> 249 <p><tt>} // end of demo class</tt> 158 <br><tt>} // end of demo class</tt> 250 159 <br> 251 160 </body> -
trunk/java-client/org/nzdl/gsdl/util/NzdlConstants.java
r2155 r2163 21 21 package org.nzdl.gsdl.util; 22 22 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 */ 23 31 public interface NzdlConstants { 24 32 -
trunk/java-client/org/nzdl/gsdl/util/NzdlCorbaFactory.java
r2159 r2163 30 30 import org.nzdl.gsdl.util.NzdlConstants; 31 31 32 /** 33 * Returns CORBA objects via it's operations. 34 */ 32 35 public final class NzdlCorbaFactory { 33 36 -
trunk/java-client/org/nzdl/gsdl/util/NzdlHosts.java
r2159 r2163 40 40 41 41 /** 42 * Class ... 43 * 44 * Based on algorithms in ... 42 * Used to get host information including: name, IOR and URL. 45 43 * 46 44 * @author stuart yeates ([email protected]) -
trunk/java-client/org/nzdl/gsdl/util/NzdlIORs.java
r2159 r2163 61 61 * 62 62 * 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. 63 65 * 64 66 * @author stuart yeates ([email protected]) … … 81 83 */ 82 84 85 83 86 public class NzdlIORs implements Cloneable, Serializable { 84 87 … … 212 215 213 216 // try an IOR from a file (the filename may have been 214 // given from t ehcommandline217 // given from the commandline 215 218 if (client == null) { 216 219 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"> 1 2 <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> 3 8 <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 9 Contains utilities for working with hosts, IORs and the NzdlCorba 10 factory. 9 11 </body> 10 12 </html>
Note:
See TracChangeset
for help on using the changeset viewer.