[3222] | 1 | initial prototype of gsdl3
|
---|
| 2 |
|
---|
[3282] | 3 | 2002/07/30 *********************************
|
---|
[3252] | 4 |
|
---|
[3282] | 5 | think we will use java servlets rather than cgi. can use tomcat to serve our
|
---|
| 6 | servlets as well as for the soap stuff (in fact, rpcrouter is a servlet that
|
---|
| 7 | does soap stuff)
|
---|
| 8 |
|
---|
| 9 | I have added a test html page, and a test servlet.
|
---|
| 10 |
|
---|
| 11 | tomcat should already be installed (if not, see below).
|
---|
| 12 |
|
---|
| 13 | you need to edit the tomcat conf/server.xml to add a context for gsdl servlets
|
---|
| 14 | add this line near the soap one:
|
---|
| 15 |
|
---|
| 16 | <!-- GSDL3 Service -->
|
---|
| 17 | <Context path="/gsdl3" docBase="<GSDLHOME>/web" debug="1" reloadable="true"/>
|
---|
| 18 |
|
---|
| 19 | when you edit server.xml, (or change web.xml in gsdl3/web/WEB-INF/web.xml) or
|
---|
| 20 | change the classes, you need to shutdown and restart the server. also you may
|
---|
| 21 | need to clear the cache of your browser
|
---|
| 22 |
|
---|
| 23 | once you have made the test servlet class,
|
---|
| 24 | (in web/WEB-INF/classes, javac TestServlet.java)
|
---|
| 25 | you can run it.
|
---|
| 26 |
|
---|
| 27 | localhost:8080/gsdl3 should get you the index page - can click on the link to
|
---|
| 28 | run the test. or can specify it directly:
|
---|
| 29 | localhost:8080/gsdl3/testing
|
---|
| 30 |
|
---|
| 31 | the path 'testing' is determined by servlet-mapping entry in
|
---|
| 32 | web/WEB-INF/web.xml
|
---|
| 33 |
|
---|
[3283] | 34 | Note: also changed setup.bash to only have CLASSPATH, not CP - need to change
|
---|
| 35 | the CP entry in catalina.sh to use CLASSPATH instead - see below in Tomcat
|
---|
| 36 | installation
|
---|
[3282] | 37 | 2002/07/16 *********************************
|
---|
| 38 |
|
---|
| 39 | MGPP java wrapper
|
---|
| 40 |
|
---|
| 41 | a java interface has been added for mgpp.
|
---|
| 42 |
|
---|
| 43 | the java code is in src/java/org/greenstone/mgpp
|
---|
| 44 | the cpp code in src/cpp/jni/mgpp
|
---|
| 45 |
|
---|
| 46 | you need to run make in the java part before the cpp part, as the java stuff
|
---|
| 47 | creates the jni header file for the cpp side
|
---|
| 48 |
|
---|
| 49 | in src/java/org/greenstone/mgpp do:
|
---|
| 50 | make
|
---|
| 51 | make install
|
---|
| 52 |
|
---|
| 53 | in src/cpp/jni/mgpp do:
|
---|
| 54 | make
|
---|
| 55 | make install
|
---|
| 56 |
|
---|
| 57 | run the Queryer:
|
---|
| 58 | java org.greenstone.mgpp.Queryer <basedir> <indexdir> <textdir>
|
---|
| 59 |
|
---|
| 60 | eg if have a mgpp collection in gsdl/collect/mgppdemo
|
---|
| 61 | java org...Queryer gsdl/collect/mgppdemo/index tt/mgppdemo text/mgppdemo
|
---|
| 62 |
|
---|
| 63 | for this to work (termporarily) you need to get the mgpp source from gsdl as
|
---|
| 64 | it hasn't been added to gsdl3 cvs yet
|
---|
| 65 |
|
---|
| 66 | if you already have gsdl installed, then build a collection using mgpp (see
|
---|
| 67 | greenstone doc and source collection at nzdl2.cs.waikato.ac.nz for more info - search for mgpp)
|
---|
| 68 |
|
---|
| 69 | you need to edit the src/cpp/jni/mgpp Makefile to set the correct include
|
---|
| 70 | directories.
|
---|
| 71 | also copy gsdl/src/mgpp/lib/libmg.a and gsdl/src/mgpp/text/libtextin.a to
|
---|
| 72 | gsdl3/lib/cpp
|
---|
| 73 |
|
---|
| 74 | (and if you want 'make test' to work in src/java/org/greenstone/mgpp you need to change the command to run)
|
---|
| 75 |
|
---|
| 76 | the make steps above should now work.
|
---|
| 77 |
|
---|
| 78 | if you dont have gsdl yet, do:
|
---|
| 79 | cvs co gsdl
|
---|
| 80 | cd gsdl
|
---|
| 81 | ./configure
|
---|
| 82 | make
|
---|
| 83 | make install
|
---|
| 84 |
|
---|
| 85 | then build collections etc (good luck)
|
---|
| 86 |
|
---|
| 87 | 2002/07/05 *******************************
|
---|
| 88 |
|
---|
[3222] | 89 | only for linux
|
---|
| 90 |
|
---|
| 91 | need to run setup.bash to set CLASSPATH etc
|
---|
| 92 |
|
---|
| 93 | java src code in src/java/org/greenstone/gsdl3 - you need to do a make, and
|
---|
| 94 | then a make install in this top directory. - makes all the classes in the
|
---|
| 95 | subdirectories too.
|
---|
| 96 |
|
---|
| 97 | classes get compiled to src/java/org/greenstone/gsdl/classes, then a jar file
|
---|
| 98 | is made of them all. make install copies this to lib/java
|
---|
| 99 |
|
---|
| 100 | There are two executable classes: Library1 and Library2
|
---|
| 101 |
|
---|
| 102 | both are run by "java org.greenstone.gsdl3.Libraryx <gsdlhome> <sitehome>"
|
---|
| 103 |
|
---|
| 104 | gsdlhome is the base dir for your installation: .../gsdl3
|
---|
| 105 | sitehome is the base dir for the site you are running:
|
---|
| 106 | for the local library example site, its .../gsdl3/sites/localsite
|
---|
| 107 | for the distributed soap example site, its .../gsdl3/sites/site1
|
---|
| 108 |
|
---|
| 109 | (imaginative names eh)
|
---|
| 110 |
|
---|
| 111 | There are 3 sites in this prototype example.
|
---|
| 112 |
|
---|
| 113 | sites/localsite is a standalone site, like used by a local library. It has
|
---|
| 114 | no connections to any other sites.
|
---|
| 115 |
|
---|
| 116 | sites/site1 is a site that specifies a SOAP connection to another site: site2
|
---|
| 117 |
|
---|
| 118 | sites/site2 can be run as a local site also.
|
---|
| 119 |
|
---|
| 120 | to run site1, and talk to site2 via SOAP, you need to have apache tomcat installed,running, and serving site2. (see below)
|
---|
| 121 |
|
---|
| 122 | 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
|
---|
| 123 | basically its like:
|
---|
| 124 |
|
---|
| 125 | <message><request type="describe|query" to="demo/TextQuery" info=""/></message>
|
---|
| 126 | with type="describe", to="", can use serviceList, collectionList and siteList for the info field.
|
---|
| 127 |
|
---|
| 128 | Library2 - still command line based, but has a slightly nicer interface.
|
---|
| 129 | it will prompt you for commands eg
|
---|
| 130 | type of request - describe/query
|
---|
| 131 | collection name
|
---|
| 132 | service name
|
---|
| 133 | info name (at the moment collectionList, serviceList, siteList)
|
---|
| 134 | these can all be left blank except for the first one
|
---|
| 135 | A sample usage thingy:
|
---|
| 136 |
|
---|
| 137 | describe,_,_,_ - returns info from MessageRouter - list of colls, sites, services etc
|
---|
| 138 |
|
---|
| 139 | describe,_,_,collectionList - returns info from MessageRouter - only a list of colls
|
---|
| 140 |
|
---|
| 141 | describe,demo,_,_ - returns info from demo coll - list of services
|
---|
| 142 |
|
---|
| 143 | describe,demo,TextQuery,_ - returns info about the service
|
---|
| 144 |
|
---|
| 145 | Library2 also attempts to use some XSLT transforms to format the resulting xml
|
---|
| 146 |
|
---|
| 147 | ********************************************************************
|
---|
| 148 |
|
---|
| 149 | SOAP stuff.
|
---|
| 150 |
|
---|
| 151 | am using jakarta tomcat at this stage to serve the SOAP classes
|
---|
| 152 | -----------------------------------------------------
|
---|
| 153 | set up SOAP Server:
|
---|
| 154 |
|
---|
| 155 | the class SOAPServer is a wrapper around a messagerouter - so can serve
|
---|
| 156 | the collections
|
---|
| 157 |
|
---|
| 158 | it has a path hard coded in - need to set this to your appropriate site -
|
---|
| 159 | for the example sites that I've set up, it should be <GSDL3HOME>/sites/site2
|
---|
| 160 | --------------------------------------------------------------------
|
---|
| 161 | TOMCAT installation:
|
---|
| 162 |
|
---|
| 163 | need to install tomcat and soap:
|
---|
| 164 |
|
---|
| 165 |
|
---|
| 166 | a tar file is in comms/tomcat directory - not sure where to put this, so made a new directory for it
|
---|
| 167 |
|
---|
| 168 | you need to unzip the tar file.
|
---|
| 169 |
|
---|
| 170 | edit jakarta-tomcat-4.0.1/bin/catalina.sh:
|
---|
| 171 |
|
---|
[3283] | 172 | on line 89 add $CLASSPATH to the CP="...." line ie. CP="$CLASSPATH:..." - this
|
---|
| 173 | sets up the class path properly (note this has changed since last time
|
---|
| 174 | 2002/07/30)
|
---|
[3222] | 175 |
|
---|
| 176 | edit jakarta-tomcat-4.0.1/conf/server.xml
|
---|
| 177 |
|
---|
| 178 | add the following (put proper path for <GSDL3HOME>)
|
---|
| 179 |
|
---|
| 180 | <!-- SOAP Service -->
|
---|
| 181 | <Context path="/soap" docBase="<GSDL3HOME>/comms/soap/soap-2_2/webapps/soap" debug="1" reloadable="true"/>
|
---|
| 182 |
|
---|
| 183 | (there are other Context elements to look at)
|
---|
| 184 |
|
---|
| 185 | ---------------------------------------------------------------------
|
---|
| 186 | install soap:
|
---|
| 187 |
|
---|
| 188 | just untar soap-bin-2.2.tar.gz in the comms/soap directory
|
---|
| 189 | --------------------------------------------------------------
|
---|
| 190 | to run tomcat, need to source setup.bash in GSDL3HOME to set up $CP
|
---|
| 191 |
|
---|
| 192 | then cd to comms/tomcat/jakarta-tomcat-4.0.1/bin
|
---|
| 193 |
|
---|
| 194 | run startup.sh
|
---|
| 195 |
|
---|
| 196 | to shut down tomcat, run shutdown.sh
|
---|
| 197 |
|
---|
| 198 | you can access the soap service though the web, at http://localhost:8080/soap
|
---|
| 199 |
|
---|
| 200 | (conf/server.xml is the place to change the port number if needed)
|
---|
| 201 |
|
---|
| 202 |
|
---|
| 203 | Run the admin client
|
---|
| 204 |
|
---|
| 205 | can list, deploy, undeploy soap services
|
---|
| 206 |
|
---|
| 207 | -----------------------------------------------------------------
|
---|
| 208 | to deploy the SOAPServer for site2:
|
---|
| 209 |
|
---|
| 210 | edit the following fields in the deploy form:
|
---|
| 211 |
|
---|
| 212 | ID: org.greenstone.site2
|
---|
| 213 | Scope: any will do: Request - new instantiation for each request
|
---|
| 214 | Session - same instantiation across a session
|
---|
| 215 | Application - only uses one instantiation
|
---|
| 216 |
|
---|
| 217 | Methods: process
|
---|
| 218 |
|
---|
| 219 | Java Provider / Provider Class: org.greenstone.gsdl3.SOAPServer
|
---|
| 220 |
|
---|
| 221 | then click deploy.
|
---|
| 222 | hopefully all will be well.
|
---|
| 223 |
|
---|
| 224 | ---------------------------------------------------------
|
---|
| 225 |
|
---|
| 226 | shoudl be able to run (from GSDL3HOME directory)
|
---|
| 227 | java org.greenstone.gsdl3.Library2 . ./sites/site1
|
---|
| 228 |
|
---|
| 229 | and have it talk via soap. (assuming you have tomcat running and have deployed
|
---|
| 230 | org.greenstone.site2)
|
---|
| 231 |
|
---|
| 232 | --------------------------------------------------------
|
---|
| 233 |
|
---|
| 234 | debugging soap:
|
---|
| 235 |
|
---|
| 236 | tomcat output goes to jakarta-tomcat-4.0.1/logs/catalina.out
|
---|
| 237 |
|
---|
| 238 | if you recompile the classes, you need to shutdown and restart tomcat to get the new classes.
|
---|
| 239 |
|
---|
| 240 | deployment info is retained between shutdown and start up - dont need to redeploy it each time.
|
---|
| 241 |
|
---|
| 242 | TcpTUnnelGui:
|
---|
| 243 |
|
---|
| 244 | this program allows you to view the actual soap messages
|
---|
| 245 |
|
---|
| 246 | run like:
|
---|
| 247 |
|
---|
| 248 | java org.apache.soap.util.net.TcpTunnelGui 8070 localhost 8080
|
---|
| 249 |
|
---|
| 250 | tomcat uses 8080, and you need to modify the greenstone stuff to talk to port 8070 instead of 8080:
|
---|
| 251 |
|
---|
| 252 | sites/site1 is the site that talks to the SOAPServer for site2
|
---|
| 253 |
|
---|
| 254 | in site1/sitecfg.xml, in the address field, replace 8080 with 8070 when you want to use TcpTunnelGui.
|
---|
| 255 |
|
---|
| 256 | note that
|
---|
| 257 | http://localhost:8080/soap/servlet/rpcrouter
|
---|
| 258 |
|
---|
| 259 | is the address for talking to the tomcat soap thingy.
|
---|
[3252] | 260 |
|
---|
| 261 |
|
---|
| 262 | -------------------------------------------------------------------
|
---|
| 263 |
|
---|
| 264 |
|
---|
| 265 |
|
---|
| 266 |
|
---|