/[hyperestraier]/upstream/0.5.3/java/example/NodeExample001.java
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /upstream/0.5.3/java/example/NodeExample001.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 10 - (hide annotations)
Wed Aug 3 15:25:48 2005 UTC (18 years, 11 months ago) by dpavlin
File size: 898 byte(s)
import of upstream 0.5.3

1 dpavlin 9 import estraier.*;
2    
3     public class NodeExample001 {
4     public static void main(String[] args){
5 dpavlin 10 // create the creator object
6     Creator creator = new CreatorImpl();
7 dpavlin 9 // create and configure the node connecton object
8 dpavlin 10 Node node = creator.create_node();
9 dpavlin 9 node.set_url("http://localhost:1978/node/test1");
10     node.set_auth("admin", "admin");
11     // create a document object
12 dpavlin 10 Document doc = creator.create_document();
13 dpavlin 9 // add attributes to the document object
14     doc.add_attr("@uri", "http://estraier.gov/example.txt");
15     doc.add_attr("@title", "Over the Rainbow");
16     // add the body text to the document object
17     doc.add_text("Somewhere over the rainbow. Way up high.");
18     doc.add_text("There's a land that I heard of once in a lullaby.");
19     // register the document object to the node
20     if(!node.put_doc(doc))
21     System.err.println("error: " + node.status());
22     }
23     }

  ViewVC Help
Powered by ViewVC 1.1.26