GridSphere Installation
1. Prerequisites
Please be sure that the Java and Java Developer patterns are installed for your openSUSE platforms using YAST. See JavaConfig for details.
Make sure Tomcat is installed and configured according to TomcatConfig documentation.
Make sure your home directory has the recommended directory structure for developers?.
2. Get GridSphere
Download GridSphere 3.0.8 from http://www.gridsphere.org/gridsphere/gridsphere?cid=download#GridSphere and save it it $HOME/dist.
Unpack the tarball prepare for the build
cd ~/src tar -xzf ~/dist/gridsphere-3.0.8.tar.gz
3. Environment
Your environment should be automatically configured for new shells. You'll need to set your personal tomcat install config. The can be easily done with
export JAVA_HOME=/usr/lib/jvm/java export ANT_HOME=/usr/share/ant export CATALINA_BASE=$HOME/tomcat export CATALINA_HOME=/usr/share/tomcat55
4. Installation
GridSphere's build script needs to be fixed to support the developer instances of Tomcat described in TomcatConfig. Apply the following patch so it recognizes $CATALINA_BASE as the deploy target.
patch --backup --ignore-whitespace build.xml << EOF
87c87
< <property name="appserver.home" value="\${env.CATALINA_HOME}"/>
---
> <property name="appserver.home" value="\${env.CATALINA_BASE}"/>
EOF
It appears that GridSphere doesn't fully comprehend the separation of $CATALINA_BASE and $CATALINA_HOME. The above patch to build.xml causes the build process to look in $CATALINA_BASE for supporting libraries rather than $CATALINA_HOME. The following commands resolve this issue during the build.
pushd $CATALINA_BASE ln -s $CATALINA_HOME/bin ln -s $CATALINA_HOME/common popd
Now you can build gridsphere and the install target will deploy it to your personal tomcat instance.
cd ~/src/gridsphere-3.0.8 ant install
You'll be prompted to accept the license. It's an Apache-style license, so it's fine to choose yes. Answer yes to the subsequent javadoc prompt, and wait for BUILD SUCCESSFUL message
5. Running Gridsphere
Restart your Tomcat so the newly deployed GridSphere is recognized.
$HOME/bin/tc5 stop $HOME/bin/tc5 start
Go to http://localhost:8080/gridsphere/gridsphere
6. Set up GridSphere
The first time you run GridSphere you'll be prompted to create a database. Use the embedded database option for ordinary development. This is a simple option and doesn't require configuration of standalone database servers. NOTE: the embedded database option does not preserve database information across re-installs of GridSphere by default. You need to manually preserve the portal configuration data if it is valuable to you.
You also be prompted to create an administrator account. You need to fill out all the form values to create this account. We recommend the following settings for your personal development instance:
User: admin Firstname: Portal Lastname: Admin Email: admin@localhost Passwd: admin
7. Run the example Hello World Portlet
Make sure that tomcat is stopped before you proceed $HOME/bin/tc5 stop
Go to http://docs.gridsphere.org/display/gs30/Hello+World+Portlet Follow the instructions:
~/src/gridsphere-3.0.8> ant new-project
The output of the build looks like this
Buildfile: build.xml
setenv:
[mkdir] Created dir: /home/$user/src/gridsphere-3.0.8/projects
[echo] Installing for Tomcat 5.x
[echo] GridSphere Webserver is tomcat
[echo] GridSphere will be deployed to /home/$user/tomcat as the gridsphere web application
new-project:
new-project:
[echo] Creating a New Portlet Project
[input] Please enter a Project Title e.g. Cool Portlets
The user shall mention a Project Title("GS Examples", according to the Hello World example)
[input] Please enter a Project Title e.g. Cool Portlets GS Examples
Now the user shall enter a Project name("gsexamples")
[input] Please enter a Project Name this will be used for your portlet web application and should be lowercase e.g. coolportlets gsexamples
After a successful build, a new directory "gsexamples" will be created (~src/gridsphere-3.0.8/projects/gsexamples). "gsexamples" build file needs to be fixed to support the developer instances of Tomcat described in TomcatConfig.. Apply the following patch so it recognizes $CATALINA_BASE as the deploy target.
patch --backup --ignore-whitespace build.xml << EOF
68c68
< <property name="appserver.home" value="\${env.CATALINA_HOME}"/>
---
> <property name="appserver.home" value="\${env.CATALINA_BASE}"/>
EOF
The next instruction on the Hello World Portlet is to create a subdirectory "portlets" in ~src/gridsphere-3.0.8/projects/gsexamples. The subdirectory has to be created with the following structure:
~/src/gridsphere-3.0.8/projects/gsexamples/src/org/gridsphere/gsexamples/portlets>
Now within the "portlets" directory create the HelloWorld?.java and edit the "portlet.xml" according to the instructions specified. Do an "ant install"
~/src/gridsphere-3.0.8/projects/gsexamples> ant install
After a successful build, start the tomcat $HOME/bin/tc5 start
Open a browser and connect to http://localhost:8080/gridsphere/gridsphere
Login with your username and password
Go to the "Administration" tab and then to the "Portlets" tab. You should be able to see "gsexamples" under the column - "View Portlet Details" and the Deployment status should be "successful".
Now go to the "Layout" tab on the upper-right corner. The Layout Manager will show up.
For "Select a layout to customize: " choose "loggedin" and hit Display
In the "Edit layout properties by selecting components below for page: loggedin" section
Browse for "gsexamples - Hello World" in the "Add Portlets: " field and then hit Add
Now go to Home tab, you should be able to see the Hello World Portlet
Here are some of the links/files regarding Portlet development:
