Changeset 2321 for trunk/java-client


Ignore:
Timestamp:
2001-04-18T00:53:16+12:00 (23 years ago)
Author:
bas6
Message:

modified simple example in org/nzdl/gsdl/service/package.html to connect to remote servers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/java-client/org/nzdl/gsdl/service/package.html

    r2163 r2321  
    5050<li>
    5151&nbsp; a <b>NzdlService</b> object to service CORBA interface requests
    52 to
    53 a Greenstone collection</li>
     52to a Greenstone collection</li>
    5453</ul>
    5554
     
    7675<p>In order to function, this app needs Corbaserver running on the same
    7776machine.
     77<br>&nbsp;
    7878<p><tt>/**</tt>
    7979<br><tt>* TrivialDemo.java.</tt>
     
    9191<br><tt>import java.lang.*;</tt>
    9292<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>
     93<br><tt>import org.nzdl.gsdl.util.NzdlServiceFactory</tt>
    9494<p><tt>public class TrivialDemo {</tt>
    9595<br><tt>&nbsp; public static void main( String [] args )</tt>
    9696<br><tt>&nbsp; {</tt>
    97 <br><tt>&nbsp;&nbsp;&nbsp; String myIorFile = "/tmp/localcorba.objid";</tt>
    9897<br><tt>&nbsp;&nbsp;&nbsp; String myQueryString = "snail farming";</tt>
    9998<br><tt>&nbsp;&nbsp;&nbsp; String myCollection = "demo";</tt>
    10099<p><tt>&nbsp;&nbsp;&nbsp; // Create a Service Object</tt>
    101 <br><tt>&nbsp;&nbsp;&nbsp; NzdlService myService = NzdlIORs.findIOR(null,
    102 null,</tt>
    103 <br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    104 myIorFile, null);</tt>
     100<br><tt>&nbsp;&nbsp;&nbsp; NzdlService myService = NzdlServiceFactory.CreateNzdlService(args,</tt>
     101<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     102System.getProperties(), null, null, null);</tt>
    105103<p><tt>&nbsp;&nbsp;&nbsp; // Use getCollectionSet to obtain List of Collections</tt>
    106104<br><tt>&nbsp;&nbsp;&nbsp; Set myCollections = myService.getCollectionSet();</tt>
     
    115113"+ collName);</tt>
    116114<br><tt>&nbsp;&nbsp;&nbsp; }</tt>
    117 <p><tt>&nbsp;&nbsp;&nbsp; // Find The Number of documents in my collection</tt>
    118 <br><tt>&nbsp;&nbsp;&nbsp; NzdlCollectionInfo myInfo = myService.getCollectionInfo(myCollection);</tt>
    119 <br><tt>&nbsp;&nbsp;&nbsp; System.out.println("\nNum Of Collection docs
    120 = "+myInfo.getNumOfDocs());</tt>
    121115<p><tt>&nbsp;&nbsp;&nbsp; // Create query object</tt>
    122116<br><tt>&nbsp;&nbsp;&nbsp; NzdlQuery query = new NzdlQuery( myQueryString
     
    158152<br><tt>} // end of demo class</tt>
    159153<br>&nbsp;
     154<br>&nbsp;
    160155</body>
    161156</html>
Note: See TracChangeset for help on using the changeset viewer.