FOAFRealm/Installation
From Corrib Clan Wiki
c4tzelelch acelboctrbog This page provides some instructions for installing developement version of FOAFRealm with HyperCuP. It is intended for JeromeDL developers who need to make JeromeDL working with new FOAFRealm.
Contents |
Step by step
Sources
Go to your JeromeDL sources directory.
Remove ALL foafmanage.jar and foafrealm.jar. To be sure perform something like: find . -name'*foaf*.jar' | xargs rm -i
Libraries
- Get jars listed below
(attachment:foafjars.tar.gz or build them from cvs) and place them like following:
- tomcat/common/lib/foafrealm.jar
- tomcat/common/lib/foafmanage.jar
- tomcat/common/lib/foafsscf.jar
- tomcat/server/lib/foafrealm-server.jar
- Get
- axis.jar (and all axis jars which come in its distribution pack)
- hypercup.jar
- activation.jar
- mail.jar
- jaxrpc.jar
- jdom.jar
and place them in tomcat/common/lib and nowhere else.
Sesame
- Download Sesame, put sesame webapp to tomcat/webapps, move all jars from tomcat/webapps/sesame/WEB-INF/lib to tomcat/common/lib
- Edit tomcat/webapps/sesame/WEB-INF/system.conf and instert this repository definition:
<repository id='foafrealm-repository'> <title>FOAFRealm repository</title> <sailstack> <sail class='org.openrdf.sesame.sailimpl.sync.SyncRdfRepository'/> <sail class='org.openrdf.sesame.sailimpl.nativerdf.NativeRdfRepository'> <param name='dir' value='/tmp/nativerdf-foafrealm/'/> </sail> </sailstack> <acl worldReadable='true' worldWriteable='true'/> </repository>
- After successful sesame instalation - remove sesame.war from /webapps directory
- Move all jars from webapps/sesame/WEB-INF/lib/ into common/lib
HyperCuP
- Edit hypercup4dfoaf.properties file placed in foafrealm.jar and provide there real ip address of your application (it could not be localhost) and follow it by /services/HyperCuP4DFOAF (e.g http://ip:port/jeromedl/services/HyperCuP4DFOAF or http://library.deri.org/services/HyperCuP4DFOAF) (this part will be done automaticly in the near future)
- Create HyperCuP for DFOAF.
- Check if there is temporary directory for HyperCuP connections created. Name of this directory is related to the entry in hypercup4dfoaf.properties. The following directory should exist (with rights to read and write):
/tmp/ + 'ip address of application' + /services/HyperCuP4DFOAF
for example the directory for library.deri.org will be as follows:
/tmp/library.deri.org/services/HyperCuP4DFOAF/
- Ensure that all temporary files (which holds hypercup state) are removed.
- Join HyperCuP network. to do so invoke following:
joining schema: path_to_the_service?method=join & p1=path_to_the_service & p2=path_to_the_service_that_are_in_hypercup (in case there are some error try to do: path_to_the_service?method=join & p1=path_to_the_service_that_are_in_hypercup & p2=path_to_the_service
There are avaliable some other service in HyperCuP, the most important:
check for path (on which [[HyperCuP]] has registered): path_to_the_sercvice?method=showPath & p1=path_to_the_service list connections (to check if join was successful) path_to_the_sercvice?method=listConnections & p1=path_to_the_service
Some example:
http://localhost:port/jeromedl/services/HyperCuP4DFOAF?method=join&p1=http://inetAddrOfHyperCuPpeer]]:port/jeromedl/services/HyperCuP4DFOAF&p2=http://yourInetAddr:port/jeromedl/service/HyperCuP4DFOAF
How to create HyperCuP for library.deri.*:
joining org to ie: http://library.deri.org/services/HyperCuP4DFOAF?method=join&p1=http://library.deri.org/services/HyperCuP4DFOAF&p2=http://library.deri.ie/services/HyperCuP4DFOAF (or http://library.deri.org/services/HyperCuP4DFOAF?method=join&p1=http://library.deri.ie/services/HyperCuP4DFOAF&p2=http://library.deri.org/services/HyperCuP4DFOAF) joining at to ie: http://library.deri.at/services/HyperCuP4DFOAF?method=join&p1=http://library.deri.at/services/HyperCuP4DFOAF&p2=http://library.deri.ie/services/HyperCuP4DFOAF (or http://library.deri.at/services/HyperCuP4DFOAF?method=join&p1=http://library.deri.ie/services/HyperCuP4DFOAF&p2=http://library.deri.at/services/HyperCuP4DFOAF)
DFOAFService
Check if DFOAFService is deployed. There should be following lines in server-config.wsdd in application /WEB-INF directory (in services section)
<service name="DFOAFService" provider="java:RPC"> <parameter name="allowed Methods" value="*"/> <parameter name="class Name" value="org.foafrealm.webservices.DFOAFWebServices"/> </service>
To check if service is succesfully deployed invoke in browser:
http://library.deri.org/services/DFOAFService?wsdl
FOAFRealm webapp installation notes
Copy or symlink webapp code into tomcats webapp directory OR use docBase entry to point the tomcat to your webapp. To use FOAFRealm realm you need to add following into conf/server.xml file (between <host (...)></host>)
<Context className="org.apache.catalina.core.StandardContext" cachingAllowed="true"
path="/webapp"
privileged="true" reloadable="true"
[[doc Base]]="/home/adam/workspace/FOAFRealm_webapp"
>
<Realm [[class Name]]="org.foafrealm.realm.FOAFRealm" debug="99"/>
<Valve [[class Name]]="org.foafrealm.realm.FOAFValve" debug="99"/>
</Context>
Now you could access your service by invoking:
http://host:port/webapp
- In webapp there is protected.jsp page which simulate employing FOAFRealm realm. To make it work you should have suitable entry in web.xml with your application name. So if your application is called webapp (as shown below, then the web.xml entry should be like following (Version of web.xml containing such entry is avaliable on CVS):
<web-resource-collection>
<web-resource-name>Administration</web-resource-name>
<description>Protected test</description>
<url-pattern>/webapp/protected.jsp</url-pattern>
</web-resource-collection>
Proper UTF-8 characters
There are two options to solve it. We can change default(ISO-8895-1) coyote configuration, or convert every string from an user. I recommend first option, because it is far more versatile, so please modify yours server.xml file:
<Connector port="8081"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirect Port="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true"
URIEncoding="UTF-8"
/>
Field URIEncoding set up new value for character encoding
WordNet
Check WordNet Installation Notes
Good luck



