2 |
<!--NewPage--> |
<!--NewPage--> |
3 |
<HTML> |
<HTML> |
4 |
<HEAD> |
<HEAD> |
5 |
<!-- Generated by javadoc (build 1.4.2_06) on Mon Jul 25 11:24:18 JST 2005 --> |
<!-- Generated by javadoc (build 1.4.2_06) on Mon Aug 01 00:51:52 JST 2005 --> |
6 |
<TITLE> |
<TITLE> |
7 |
Overview (estraier) |
Overview (estraier) |
8 |
</TITLE> |
</TITLE> |
97 |
|
|
98 |
<h2>Introduction</h2> |
<h2>Introduction</h2> |
99 |
|
|
100 |
<p>This is a package implementing the node API of <a href="http://hyperestraier.sourceforge.net/">Hyper Estraier</a>. This is a pure java package though it is not uncertified. So, it works on Linux, Mac OS X, Windows, and so on. It does not depend on the core library of Hyper Estraier. Applications are implemented as clients of node servers running on local or remote machines.</p> |
<p>This is a package implementing the node API of <a href="http://hyperestraier.sourceforge.net/">Hyper Estraier</a>. This is a pure java package though it has never uncertified yet. So, it works on Linux, Mac OS X, Windows, and so on. It does not depend on the core library of Hyper Estraier. Applications are implemented as clients of node servers running on local or remote machines.</p> |
101 |
|
|
102 |
<p>Though Hyper Estraier itself is released under the terms of the GNU LGPL, this package is released under the terms of a BSD-style license.</p> |
<p>Though Hyper Estraier itself is released under the terms of the GNU LGPL, this package is released under the terms of a BSD-style license.</p> |
103 |
|
|
104 |
<h2>Setting</h2> |
<h2>Setting</h2> |
105 |
|
|
106 |
<p>Get the JAR file `<a href="http://hyperestraier.sourceforge.net/jar/estraier.jar">estraier.jar</a>' and make the classpath include the JAR file.</p> |
<p>Get the JAR file `<a href="http://hyperestraier.sourceforge.net/jar/">estraier.jar</a>' and make the classpath include the JAR file.</p> |
107 |
|
|
108 |
<p>`estraier.*' should be imported in each source file of application programs.</p> |
<p>`estraier.*' should be imported in each source file of application programs.</p> |
109 |
|
|
115 |
|
|
116 |
public class NodeExample001 { |
public class NodeExample001 { |
117 |
public static void main(String[] args){ |
public static void main(String[] args){ |
118 |
|
// create the creator object |
119 |
|
Creator creator = new CreatorImpl(); |
120 |
// create and configure the node connecton object |
// create and configure the node connecton object |
121 |
Node node = new NodeImpl(); |
Node node = creator.create_node(); |
122 |
node.set_url("http://localhost:1978/node/test1"); |
node.set_url("http://localhost:1978/node/test1"); |
123 |
node.set_auth("admin", "admin"); |
node.set_auth("admin", "admin"); |
124 |
// create a document object |
// create a document object |
125 |
Document doc = new DocumentImpl(); |
Document doc = creator.create_document(); |
126 |
// add attributes to the document object |
// add attributes to the document object |
127 |
doc.add_attr("@uri", "http://estraier.gov/example.txt"); |
doc.add_attr("@uri", "http://estraier.gov/example.txt"); |
128 |
doc.add_attr("@title", "Over the Rainbow"); |
doc.add_attr("@title", "Over the Rainbow"); |
144 |
|
|
145 |
public class NodeExample002 { |
public class NodeExample002 { |
146 |
public static void main(String[] args){ |
public static void main(String[] args){ |
147 |
|
// create the creator object |
148 |
|
Creator creator = new CreatorImpl(); |
149 |
// create the node connecton object |
// create the node connecton object |
150 |
Node node = new NodeImpl(); |
Node node = creator.create_node(); |
151 |
node.set_url("http://localhost:1978/node/test1"); |
node.set_url("http://localhost:1978/node/test1"); |
152 |
// create a search condition object |
// create a search condition object |
153 |
Condition cond = new ConditionImpl(); |
Condition cond = creator.create_condition(); |
154 |
// set the search phrase to the search condition object |
// set the search phrase to the search condition object |
155 |
cond.set_phrase("rainbow AND lullaby"); |
cond.set_phrase("rainbow AND lullaby"); |
156 |
// get the result of search |
// get the result of search |