|
Step 1: Download the WebWork MVC Portlet Demo files
First you should download the UserManagement
demo files, there will be two zip files in the downloaded file
UserManagement-1.0.zip packages.
- The UserMangement-Database.zip is the hsqldb DB server
file, unzip it. You can use the start-database.bat/sh command to run
the userdb which UserManagement portlet will use.
- The UserManagement.war is the Portlet application based
on wwportlet MVC framework.
Step 2: Install the WebWork MVC Portlet Demo in JetSpeed
- You should download the new jetspeed Portal server jetspeed-2.0-M3-Tomcat-5.0.30.zip
from apache.
- Suppose you unzip the download jetspeed server in C:/JetSpeed2.0,
now there should be two directories in JetSpeed Server:
C:/JetSpeed2.0/jakarta-tomcat-5.0.30 &
C:/JetSpeed2.0/jetspeed-database. The second directory is the
JetSpeed database server, before you start jetspeed server, you
should start database server first.
- Copy the WebWork MVC Portlet Demo UserManagement.war to the
directory
C:/JetSpeed2.0/jakarta-tomcat-5.0.30/webapps/jetspeed/WEB-INF/deploy,
when start the jetspeed server, this portlet will be installed
automatically.
- Unzip the UserManagement-Database.zip file to
C:/jetSpeed2.0/UserMangement-Database directory.
Step 3: Start & Config the WebWork MVC Portlet Demo in JetSpeed
- Start JetSpeed Portal Database Server, run cmd:
C:/JetSpeed2.0/jetspeed-database/start-database.bat
- Start User Management Portlet Database Server, run cmd:
C:/jetSpeed2.0/UserMangement-Database/start-database.bat
- Start JetSpeed Server, run cmd:
C:/JetSpeed2.0/jakarta-tomcat-5.0.30/bin/startup.bat
- Login in JetSpeed Portal Server as admin user, and add the new
installed UserManagement Portlet in one of your page.
- Now you can test the new installed WebWork MVC Portlet Demo:
UserManagement.
- How to login in the User Management Demo Portlet?
You can use 'admin' to login as super user, password is 'admin'.
Or other normal user 'test1, test2, test3....', the password is same
as user name.
Why I can not enter the administration page in User
Management porlet, even I used the correct user name & password to
login ?
Answer: the main reason is that we put the loginUser object info in
the PortletSession, but we can not retrieve the correct
PortletSession object & loginUser from view (velocity) servletRequest
in JetSpeed/Tomcat. (But in IBM WPSv5.1 do not have such problem).
The detail you can refer to the velocity code in 'include/misc.vm'
We can modify the 'include/misc.vm' as below, and refresh the User
Management Portlet in your browser.
include/misc.vm
|
#set($loginUser1 =
$req.getPortletSession().getAttribute("loginUser"))
#set($loginUser2 =
$req.getSession().getAttribute("loginUser"))
#if (${loginUser1.id.toString()} != "")
#set ($loginUser = $loginUser1)
#else
#set ($loginUser = $loginUser2)
#end <br>
#set ($names =
$req.getSession().getAttributeNames())
#foreach ($name in $names)
$name<br>
#end <br>
###set($loginUser =
$req.getSession().getAttribute("javax.portlet.p.P-104c88b40f1-10001?loginUser"))
#set($jbbUrlBeforeLogin =
$req.getSession().getAttribute("jbbUrlBeforeLogin"))
|
The Browser refresh result display as below:
|
javax.portlet.p.P-104cc6dcd18-10001?loginUser
javax.portlet.p.P-104cc6dcd18-10001?com.opensymphony.webwork.portlet.RenderTemplate
|
And we last modify the 'include/misc.vm' to support
loginUser object retrieve.
last modified 'include/misc.vm'
|
#set($loginUser1 =
$req.getPortletSession().getAttribute("loginUser"))
#set($loginUser2 =
$req.getSession().getAttribute("loginUser"))
#if (${loginUser1.id.toString()} != "")
#set ($loginUser = $loginUser1)
#else
#set ($loginUser = $loginUser2) #end
##<br>
##set ($names = $req.getSession().getAttributeNames())
##foreach ($name in $names)
## $name<br>
##end
##<br>
#set($loginUser = $req.getSession().getAttribute("javax.portlet.p.P-104cc6dcd18-10001?loginUser"))
#set($jbbUrlBeforeLogin =
$req.getSession().getAttribute("jbbUrlBeforeLogin"))
|
Done, now we can login to the User management
Administration Page!
Step 2: Install the WebWork MVC Portlet Demo in IBM WPS v5.1
- Unzip the UserManagement-Database.zip file to the directory you
like, suppose it is C:/UserMangement-Database
- Because JetSpeed portlet.xml description is not strictly keep to
JSR168 standard, here is the different part show as below:
JetSpeed portlet.xml
|
<?xml version="1.0"
encoding="UTF-8"?>
<portlet-app id="WebWorkPortlet"
version="1.0.0">
<portlet id="WebWorkPortlet">
|
IBM WPS portlet.xml
|
<?xml version="1.0"
encoding="UTF-8"?>
<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
version="1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
id="webworkportlet.WebWorkPortletPortlet.d0faa56020">
<portlet>
|
For user testing convenience, we put the JetSpeed portlet.xml as
default in the downloaded UserManagement.war.
In order to install UserManagement.war into IBM WPSv5.1
Server, we must replace WEB-INF/portlet.xml content with portlet.xml.standard
content in UserManagement.war
- Start your IBM WPS v5.1, run cmd:
C:/WebSphere/PortalServer/bin/startServer5.bat
- Login WPS portal server as wpsadmin (the super user)
- Enter into the Portal Management page: Administration -->
Portlet Management --> Web Modules
- In 'Web Modules' management page, use install button to
install UserManagement.war WebWork MVC Portlet Demo.
- Return to 'My Portal'
Step 3: Start & Config the WebWork MVC Portlet Demo in IBM WPS
v5.1
- Start User Management Database, run cmd:
C:/UserMangement-Database/start-database.bat
- In the WPS portal choose one page you like to install
UserManagement Portlet, and press 'Edit Page' page link to
enter this page's editor
- Press the 'Add Portlets' button to choose the new
installed Portlet: UserManagementPorlet to add.
- After press 'Done' button, and return the original
edited page, you will find UserManagementPortlet display its'
content.
|
|