1 | initial prototype of gsdl3
|
---|
2 |
|
---|
3 | only for linux
|
---|
4 |
|
---|
5 | need to run setup.bash to set CLASSPATH etc
|
---|
6 |
|
---|
7 | java src code in src/java/org/greenstone/gsdl3 - you need to do a make, and
|
---|
8 | then a make install in this top directory. - makes all the classes in the
|
---|
9 | subdirectories too.
|
---|
10 |
|
---|
11 | classes get compiled to src/java/org/greenstone/gsdl/classes, then a jar file
|
---|
12 | is made of them all. make install copies this to lib/java
|
---|
13 |
|
---|
14 | There are two executable classes: Library1 and Library2
|
---|
15 |
|
---|
16 | both are run by "java org.greenstone.gsdl3.Libraryx <gsdlhome> <sitehome>"
|
---|
17 |
|
---|
18 | gsdlhome is the base dir for your installation: .../gsdl3
|
---|
19 | sitehome is the base dir for the site you are running:
|
---|
20 | for the local library example site, its .../gsdl3/sites/localsite
|
---|
21 | for the distributed soap example site, its .../gsdl3/sites/site1
|
---|
22 |
|
---|
23 | (imaginative names eh)
|
---|
24 |
|
---|
25 | There are 3 sites in this prototype example.
|
---|
26 |
|
---|
27 | sites/localsite is a standalone site, like used by a local library. It has
|
---|
28 | no connections to any other sites.
|
---|
29 |
|
---|
30 | sites/site1 is a site that specifies a SOAP connection to another site: site2
|
---|
31 |
|
---|
32 | sites/site2 can be run as a local site also.
|
---|
33 |
|
---|
34 | to run site1, and talk to site2 via SOAP, you need to have apache tomcat installed,running, and serving site2. (see below)
|
---|
35 |
|
---|
36 | Library1 - just takes straight XML queries and returns the results. see docs/xml/* for examples - not there yet. can use the other library to see how requests are formatted
|
---|
37 | basically its like:
|
---|
38 |
|
---|
39 | <message><request type="describe|query" to="demo/TextQuery" info=""/></message>
|
---|
40 | with type="describe", to="", can use serviceList, collectionList and siteList for the info field.
|
---|
41 |
|
---|
42 | Library2 - still command line based, but has a slightly nicer interface.
|
---|
43 | it will prompt you for commands eg
|
---|
44 | type of request - describe/query
|
---|
45 | collection name
|
---|
46 | service name
|
---|
47 | info name (at the moment collectionList, serviceList, siteList)
|
---|
48 | these can all be left blank except for the first one
|
---|
49 | A sample usage thingy:
|
---|
50 |
|
---|
51 | describe,_,_,_ - returns info from MessageRouter - list of colls, sites, services etc
|
---|
52 |
|
---|
53 | describe,_,_,collectionList - returns info from MessageRouter - only a list of colls
|
---|
54 |
|
---|
55 | describe,demo,_,_ - returns info from demo coll - list of services
|
---|
56 |
|
---|
57 | describe,demo,TextQuery,_ - returns info about the service
|
---|
58 |
|
---|
59 | Library2 also attempts to use some XSLT transforms to format the resulting xml
|
---|
60 |
|
---|
61 | ********************************************************************
|
---|
62 |
|
---|
63 | SOAP stuff.
|
---|
64 |
|
---|
65 | am using jakarta tomcat at this stage to serve the SOAP classes
|
---|
66 | -----------------------------------------------------
|
---|
67 | set up SOAP Server:
|
---|
68 |
|
---|
69 | the class SOAPServer is a wrapper around a messagerouter - so can serve
|
---|
70 | the collections
|
---|
71 |
|
---|
72 | it has a path hard coded in - need to set this to your appropriate site -
|
---|
73 | for the example sites that I've set up, it should be <GSDL3HOME>/sites/site2
|
---|
74 | --------------------------------------------------------------------
|
---|
75 | TOMCAT installation:
|
---|
76 |
|
---|
77 | need to install tomcat and soap:
|
---|
78 |
|
---|
79 |
|
---|
80 | a tar file is in comms/tomcat directory - not sure where to put this, so made a new directory for it
|
---|
81 |
|
---|
82 | you need to unzip the tar file.
|
---|
83 |
|
---|
84 | edit jakarta-tomcat-4.0.1/bin/catalina.sh:
|
---|
85 |
|
---|
86 | on line 89 add $CP to the CP="...." line ie. CP="$CP:..." - this sets up the
|
---|
87 | class path properly
|
---|
88 |
|
---|
89 | edit jakarta-tomcat-4.0.1/conf/server.xml
|
---|
90 |
|
---|
91 | add the following (put proper path for <GSDL3HOME>)
|
---|
92 |
|
---|
93 | <!-- SOAP Service -->
|
---|
94 | <Context path="/soap" docBase="<GSDL3HOME>/comms/soap/soap-2_2/webapps/soap" debug="1" reloadable="true"/>
|
---|
95 |
|
---|
96 | (there are other Context elements to look at)
|
---|
97 |
|
---|
98 | ---------------------------------------------------------------------
|
---|
99 | install soap:
|
---|
100 |
|
---|
101 | just untar soap-bin-2.2.tar.gz in the comms/soap directory
|
---|
102 | --------------------------------------------------------------
|
---|
103 | to run tomcat, need to source setup.bash in GSDL3HOME to set up $CP
|
---|
104 |
|
---|
105 | then cd to comms/tomcat/jakarta-tomcat-4.0.1/bin
|
---|
106 |
|
---|
107 | run startup.sh
|
---|
108 |
|
---|
109 | to shut down tomcat, run shutdown.sh
|
---|
110 |
|
---|
111 | you can access the soap service though the web, at http://localhost:8080/soap
|
---|
112 |
|
---|
113 | (conf/server.xml is the place to change the port number if needed)
|
---|
114 |
|
---|
115 |
|
---|
116 | Run the admin client
|
---|
117 |
|
---|
118 | can list, deploy, undeploy soap services
|
---|
119 |
|
---|
120 | -----------------------------------------------------------------
|
---|
121 | to deploy the SOAPServer for site2:
|
---|
122 |
|
---|
123 | edit the following fields in the deploy form:
|
---|
124 |
|
---|
125 | ID: org.greenstone.site2
|
---|
126 | Scope: any will do: Request - new instantiation for each request
|
---|
127 | Session - same instantiation across a session
|
---|
128 | Application - only uses one instantiation
|
---|
129 |
|
---|
130 | Methods: process
|
---|
131 |
|
---|
132 | Java Provider / Provider Class: org.greenstone.gsdl3.SOAPServer
|
---|
133 |
|
---|
134 | then click deploy.
|
---|
135 | hopefully all will be well.
|
---|
136 |
|
---|
137 | ---------------------------------------------------------
|
---|
138 |
|
---|
139 | shoudl be able to run (from GSDL3HOME directory)
|
---|
140 | java org.greenstone.gsdl3.Library2 . ./sites/site1
|
---|
141 |
|
---|
142 | and have it talk via soap. (assuming you have tomcat running and have deployed
|
---|
143 | org.greenstone.site2)
|
---|
144 |
|
---|
145 | --------------------------------------------------------
|
---|
146 |
|
---|
147 | debugging soap:
|
---|
148 |
|
---|
149 | tomcat output goes to jakarta-tomcat-4.0.1/logs/catalina.out
|
---|
150 |
|
---|
151 | if you recompile the classes, you need to shutdown and restart tomcat to get the new classes.
|
---|
152 |
|
---|
153 | deployment info is retained between shutdown and start up - dont need to redeploy it each time.
|
---|
154 |
|
---|
155 | TcpTUnnelGui:
|
---|
156 |
|
---|
157 | this program allows you to view the actual soap messages
|
---|
158 |
|
---|
159 | run like:
|
---|
160 |
|
---|
161 | java org.apache.soap.util.net.TcpTunnelGui 8070 localhost 8080
|
---|
162 |
|
---|
163 | tomcat uses 8080, and you need to modify the greenstone stuff to talk to port 8070 instead of 8080:
|
---|
164 |
|
---|
165 | sites/site1 is the site that talks to the SOAPServer for site2
|
---|
166 |
|
---|
167 | in site1/sitecfg.xml, in the address field, replace 8080 with 8070 when you want to use TcpTunnelGui.
|
---|
168 |
|
---|
169 | note that
|
---|
170 | http://localhost:8080/soap/servlet/rpcrouter
|
---|
171 |
|
---|
172 | is the address for talking to the tomcat soap thingy.
|
---|