Tuesday, March 13, 2007

Sakai JSR 168 Tests

* svn co https://source.sakaiproject.org/svn/sakai/trunk sakai

* Must create a build file in your $HOME:

[gateway@gridfarm008 WebFeatureService_Deploy]$ more ~/build.properties
maven.repo.remote = http://source.sakaiproject.org/mirrors/ibiblio/maven/,http://source.sakaiproject.org/maven/,http://www.ibi
blio.org/maven,http://horde.planetmirror.com/pub/maven/,http://www.collab-ogce.org/maven/cog-common/

maven.tomcat.home = /home/gateway/SakaiJsr168/apache-tomcat-5.5.20/

maven.tomcat.version.major=5

maven.compile.source= 1.5
maven.compile.target= 1.5

maven.test.skip=true

* For a fast build, use "~/maven-1.0.2/bin/maven bld dpl" the first time to avoid downloading unnecessary jars.

* To run sakai's maven targets in any subdirectory, use

~/maven-1.0.2/bin/maven plugin:download -DgroupId=sakaiproject -DartifactId=sakai -Dversion=2.2



* To completely clean everything out,

~/maven-1.0.2/bin/maven cln

Note the usual "maven clean" will not use the the reactor. Noticed this because we had some problems with
incompatible java versions (1.6 versusu 1.5, trying to use 1.6 classes with 1.5 compiler).

* Or just use "find . -name target|xargs rm -r" (this is faster, since you won't have to check remote repositories
for jars that don't exist).

* Don't use Java 1.4. Use Java 1.5. Java 1.6 may work or not, but be sure to be consistent--Java 1.5 compilers
will not understand java 1.6 classes.

* After installing,
[gateway@gridfarm008 SakaiJsr168]$ mkdir apache-tomcat-5.5.20/sakai/
[gateway@gridfarm008 SakaiJsr168]$ cp sakai/reference/demo/sakai.properties apache-tomcat-5.5.20/sakai/

* Be sure to use extra memory:
export CATALINA_OPTS="-server -Xms512m -Xmx512m -XX:NewSize=128m -XX:PermSize=16m -XX:MaxPermSize=128m -XX:+UseConcMarkSweepGC -XX

* Point browser to http://.../portal after it starts (tail -f your catalina.out file to track--could take a few
seconds).

* Make your web.xml for your portlet:
<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
<display-name>IFrame Portlet</display-name>
<description>
This application is a portlet. It can not be used outside a portal.
</description>


<servlet>
<servlet-name>PortletServlet</servlet-name>
<servlet-class>org.apache.pluto.core.PortletServlet</servlet-class>
<!-- This param value should match the value of the <portlet-name> in
portlet.xml
-->
<init-param>
<param-name>portlet-name</param-name>
<param-value>IFramePortlet</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<!-- Note the servlet-name must match the servlet-name param above -->
<servlet-name>PortletServlet</servlet-name>
<url-pattern>/PlutoInvoker/IFramePortlet</url-pattern>
</servlet-mapping>

<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>

</web-app>

* To add portlet,
1. Click "Worksite setup" and create a new workspace
2. In the workspace you just created, add the portlet using "Site Info"

* Tested: Velocity-based Iframe portlet (worked) and JSF-bridges based Google Map portlet (also worked). Tested
OGCE myproxy portlet and found a bug in the Sakai bridge (accidentally called portlet twice, which caused
problems since the portlet's state had been flushed.) Turned out to be an easy fix.

No comments: