Monday Apr 27, 2009

Glassfish Web Space Portal in JES6 Release

JES6 (Java Enterprise System 6) has been released today!!. Please download it from the following location

JES6 contains the GlassFish Web Space Portal 10.0 which is the next generation portal from Sun Microsystems which is based on Open source Liferay community. Following are some of the features provided by Web Space Portal 10.0

Features
Benefits
Web Aggregation Enhances user experience with efficient views of Web content/application, Using mashups and Ajax based desktop for easy drag and drop
Identity-based content delivery (IDBC) Achieved through opensso addon feature
User generated/managed communities Improves efficiency for ad hoc/informal project teams by providing a Web space that can be tailored to the needs of the project
User/role-based content management An out-of-the-box support for CMS based on JSR 170. Supports Document Management, Image Management, Web Content Management. More info...
Comprehensive collection of integrated collaboration tools Simplifies users' access to collaboration tools like wikis, blogs
Human workflow application development tools and rules engine integration Acheived through Simple api for workflow(SAW). Supports JCAPS workflow Engine and JBPM Engine. More info...
Enterprise 2.0 platform – social graph, wiki, blogs, forums, etc. Improves communication, intellectual property sharing/capturing, and collaboration
Content staging and workflow Controls content publishing by staging page content and assigning content managers
Web site branding

Enables the rapid development and publishing of company-branded Web sites

Leverages the large number of customized themes that have already been produced in the community

Allows Web developers to quickly customize theme/skin by utilizing Web Space Server plugin for Dreamweaver

Presence Feature
more info...
Portlet Container Support
Portlet Container 2.1 is bundled with the Web Space portal. This supports JSR 168 and JSR 286 portlet specifications.
Portlet Development Tools
Developer Tools are also provided for fast and seamless portlet development/deployment over web space server. more info...
Installer
ant based installer and very simple to install and deploy


Thursday Feb 19, 2009

SSL install of GlassFish Webspace server 10.0

GlassFish Webspace server 10.0 based on Liferay Portal is Sun's next generation portal. The latest Commercial Release can be downloaded from the following site

SSL install of Webspace server involves two steps :

1. Enabling the SSL on the Glassfish server instance

2. Installing the Webspace server

Enabling the SSL on the Glassfish server instance

  1. Download the RR release of Glassfish from the following location . Install and start the domain
  2. change to directory domains/domain1/config under the Glassfish install directory (cd to <gf_install_dir>/domains/domain1/config
  3. Delete the existing alias s1as from the keystore. Execute : keytool -delete -alias s1as -keystore keystore.jks (keytool will be present under jdk1.6.0_10/bin/ directory. Keystore password by default will be "changeit")
  4. Generate the key request. Execute : keytool -genkey -alias s1as -keyalg RSA -keysize 512 -dname "CN=<hostname-fqdn>,Ou=People,O=Sun,L=Bangalore,S=Karnataka,C=IN" -keystore keystore.jks
    Enter keystore password:  changeit
    Enter key password for <s1as>
            (RETURN if same as keystore password):
  5. Generate certificate signing request. Execute : keytool -certreq -alias s1as -sigalg "MD5withRSA" -file certreq.pem -keypass changeit -keystore keystore.jks -storepass changeit 
  6. cat certreq.pem
    -----BEGIN NEW CERTIFICATE REQUEST-----
    MIIBLTCB2AIBADBzMQswCQYDVQQGEwJJTjESMBAGA1UECBMJS2FybmF0YWthMRIwEAYDVQQHEwlC
    YW5nYWxvcmUxDDAKBgNVBAoTA1N1bjEPMA0GA1UECxMGUGVvcGxlMR0wGwYDVQQDExRuaWNwNzQu
    aW5kaWEuc3VuLmNvbTBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQCWvzZ+Ub04IcYZe7ybutZn8faf
    HcECwxFiV/vlYdqz/rr+ggQcDYz5+odLpmszIgIe41M1ZnDPwzd9W4H9RHF9AgMBAAGgADANBgkq
    hkiG9w0BAQQFAANBAIps0ba1sliacZkljptvSushvYV3fSkeVaGwt/erk92pILZIQ6jehfIZmw2G
    qYX3I7x9wntTDxaBq8GD3i5V0Kk=
    -----END NEW CERTIFICATE REQUEST-----
  7. Get this certificate signed from the CA. We internally use http://raasi.red.iplanet.com  openssl install
  8. Now import the rootca of this CA. This can be obtained on http://raasi.red.iplanet.com. Execute : keytool -import -alias rootca -trustcacerts -file rootca.pem -keystore keystore.jks -storepass changeit  (rootca.pem file contains the rootca obtained from raasi.red.iplanet.com)
  9. Import the signed certificate from the CA. Execute : keytool -import  -alias s1as -file servercert.pem -keypass changeit -keystore keystore.jks -storepass changeit
  10. Restart the glassfish domain.
  11. Access https://<hostname:8181> and view the certificate. It should show issued by : Veera Natarajan if you have used raasi as the signing CA
  12. Install the Glassfish Webspace 10.0. See the instructions under the section "To Install Webspace Server Software Into an Existing Sun GlassFish Configuration" from the "getting started guide" at the following location

Courtesy : Ajit Kamble, Gang chen and Veera Natarajan

Friday Oct 31, 2008

SSO between SGD 4.4 and PortalServer 7.2

To obtain SSO between SGD server 4.4 version and Portalserver 7.2 version :

1. Install SGD server version 4.4

2. cd /opt/tarantella/webserver/tomcat/5.0.28_axis1.2/shared

3. cat /opt/tarantella/webserver/tomcat/5.0.28_axis1.2/shared//classes/com/tarantella/tta/webservices/client/views/Resources.properties

(imagine the content is abcdefghijkl)

3. run the following command :

root[bash]@megha# java -cp lib/sgd-webservices.jar com.tarantella.tta.webservices.client.views.SgdPasswd --decode abcdefghijkl

output of the above command will be : sgd_trusted_user:Ez---=itxyz


add this to the sgd portlet username/password field ie username will be sgd_trusted_user and password will be Ez---=itxyz


Installing SGD version 4.4

If you already had SGD version 4.3 on your machine and you may want to remove that and install SGD 4.4 version, then follow the following steps :

mkdir /space/ttasys
mkdir /space/ttaserv
chown ttasys:ttaserv /space/ttasys
chown ttaserv:ttaserv /space/ttaserv

add the existing tta users to /etc/passwd file

ttaserv:x:841:841:test:/space/ttaserv:/sbin/sh
ttasys:x:844:841:test:/space/ttasys:/sbin/sh

After this run #pkgadd -d /space/tta-4.40-917.sol-x86.pkg

Websynergy on Oracle

1. Downloaded Oracle 10g XE for windows from www.oracle.com. Install it. I gave SYS/password
2. Access http://localhost:8080/apex -> login as SYS/password
3. Click on Administration -> Database Users -> Create users
Enter username : lportal
password : lportal
Granted all user privileges (except for the DBA checkbox)
4. Go to Oracle sql prompt and run "connect lportal/lportal;" command
5. run the following command "create schema authorization lportal;"

6. Now install websynergy (change the port of websynergy to 6060 in the setup.xml of glassfish so that it doesn't clash with oracle port. ). Start GF V2
7. copy ojdbc14.jar (Download from http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc_10201.html) to glassfish/domains/domain1/lib directory and restart GF V2 again
8. Go to the admin of GF V2 (http://localhost:4848) -> resources -> Connection Pools -> LiferayPool

9. Change to the following properties :
Under "General" Tab :
Datasource Classname : oracle.jdbc.pool.OracleDataSource
Under "Additional Properties" Tab : set the following properties :
username : lportal
password : lportal
URL : jdbc:oracle:thin:@localhost:1521:XE

10. Go to general tab and click on ping. If everything is fine, This should succeed :-)

11. Restart GF V2. This should create the tables and populate all the data into the oracle db.

Monday May 19, 2008

Setting up the development environment on liferay latest trunk

Goals :

1. To setup the dev environment of the liferay code on Netbeans 6.1 and Tomcat in debug mode

This is to understand the liferay code for the project websynergy and the flow of the code. 


 

 Pre-requisites :

1. Install Netbeans 6.1 , ant 1.7, Tomcat 6.x, and svn

 


 

Steps : 

1. checkout the latest Liferay trunk with the help of the following command "svn co https://lportal.svn.sourceforge.net/svnroot/lportal/portal/trunk liferaytrunk"

2. cd to liferaytrunk

3. run "ant"

4. After this, cd to liferaytrunk copy "app.server.properties" to "app.server.siddesh.properties". Note : siddesh is the login name for my windows xp machine. So it will vary for you depending on your login name

5. Remove everything from "app.server.siddesh.properties" and add the following. (Note : These properties might change for you depending on where you have installed the apache-tomcat-6.0.16

    app.server.parent.dir=${project.dir}/../

    app.server.tomcat.version=6.0
    app.server.tomcat.dir=${app.server.parent.dir}/apache-tomcat-6.0.16
    app.server.tomcat.classes.global.dir=${app.server.tomcat.dir}/lib
    app.server.tomcat.lib.endorsed.dir=${app.server.tomcat.dir}/lib/ext
    app.server.tomcat.lib.global.dir=${app.server.tomcat.dir}/lib/ext
    app.server.tomcat.lib.support.dir=${app.server.tomcat.dir}/lib/ext
    app.server.tomcat.support.dir=${app.server.tomcat.dir}/lib/ext
    app.server.tomcat.zip.name=liferay-portal-tomcat-6.0-${downloads.version}.zip
    app.server.tomcat.classes.portal.dir=${app.server.tomcat.classes.global.dir}
    app.server.tomcat.lib.portal.dir=${app.server.tomcat.lib.global.dir

6. If one starts the tomcat using startup.bat(in windows) or startup.sh in Solaris, it gives the following exception

Exception in thread "http-8080-Processor25" java.lang.OutOfMemoryError: PermGen space
Exception in thread "DefaultQuartzScheduler_QuartzSchedulerThread" java.lang.OutOfMemoryError: PermGen space
Exception in thread "http-8080-Processor24" java.lang.OutOfMemoryError: PermGen space
Exception in thread "QuartzScheduler_QuartzSchedulerThread" java.lang.OutOfMemoryError: PermGen space
Exception in thread "QuartzScheduler_QuartzScheduler-NON_CLUSTERED_MisfireHandler" java.lang.OutOfMemoryError: PermGen space

7. To solve this, add the following line in catalina.bat(on windows) or catalina.sh(on solaris) :

JAVA_OPTS="$JAVA_OPTS "-Xmx1024m" "-Xms1024m" "-XX:MaxPermSize=512m""


8. Setting Tomcat to listen in debug mode : (Example of startup.bat is shown)

    cd to apache-tomcat-6.0.16\\bin directory

    Add the following lines in startup.bat script (set JPDA_ADDRESS=8000
set JPDA_TRANSPORT=dt_socket)

Add the following line just before :end (call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%)

9. Start the netbeans 6.1 and import the liferaytrunk project into the netbeans

10. click on run -> attach debugger

Debugger : JPDA Debugger

Connector : Socket Attach

Host : give localhost or the hostname

Port : 8000

11. Access the liferay http://localhost:8080 This will invoke the debugger in the netbeans 6.1 . One can add break points and checkout the flow of the code.

 

Sunday May 18, 2008

Configure MYSQL for project websynergy on GlassFish V3 in 60 seconds

Courtesy : Raju uppalapati from the portal team.

Goal : Making websynergy to work with mysql instead of the default hsql database

Pre-requisite :

1. Install WebSynergy

2. Install mysql running on port 3306. Username : root and password :<password>. Create a database "lportal" in it. From the sql command line client, use the command "create database lportal; "

 


 

  Accessing websynergy portal :

1. cd to glassfish-synergy/glassfish/bin and run asadmin start-domain

2. Access http://localhost:8585 and login with username: paul@example.com  and password: paul to check whether websynergy is up and running.

 


 

 Installing the admin console for the GlassFish V3 :

1. Access http://localhost:8585/admin , Download and install the adminconsole. Login as anonymous. Please go through this blog for more information on installing admin console for Glassfish V3

 


 

 Changing the existing jdbc connection pool so that it points to mysql :

1. Follow the following screencast to change the existing jdbc hsql connection pool to point to mysql

2. Restart the domain using "asadmin stop-domain" and "asadmin start-domain" commands

2. Login to websynergy http://localhost:8585. Now it uses mysql to store the user data.

 


 

 Also Check Out :

GlassFish Version 3 Community Efforts

 


 

 

HSQL in project websynergy

Goal : To understand the usage of HSQL by project Websynergy

1. Download Websynergy and install it.

2. cd to the glassfish-synergy/glassfish/bin directory and run asadmin start-domain

3. Once the server is started, you will find a lportal.log in glassfish-synergy/glassfish/bin directory

4. This log file contains all the sql statements that are run on the hsql db

5. Now access the websynergy page http://localhost:8585 and login as paul@example.com and password : paul

6. Note the change in the lportal.log. So once paul/paul authenticates, the hsql is updated with paul's information and so is the file lportal.log

Friday May 16, 2008

Creating a custom widget in project websynergy

Courtesy : Thanks to Neel from the Portal team to give me a heads up on this.

Goal : To create a custom widget in the Project websynergy codebase and deploy it in the websynergy portal. Project Websynergy is Sun's next generation portal using Liferay Portal Server, GlassFish v3, and MySQL . I am re-using a JSR 286 portlet which my colleague Sriram has written and can be found here : http://portalpack.netbeans.org/tutorials/eventing/EventingStoryBoardTutorial.html

Creating a EmployeeInfo Portlet and a Health Portlet which displays the BMI of the person entered in EmployeeInfo Portlet.

Steps to create the widget in websynergy :

 Steps to checkout the websynergy code base : http://blogs.sun.com/siddeshkamath/entry/writing_a_custom_portlet_under

1. Once the code base is checked out, cd to synergy/widgets directory

2. run ant create . Enter the widget name as "EmployeeInfo" , Enter the widget directory as "EmployeeInfo"

3. The widget directory will have the "EmployeeInfo" directory created which will have src, web and build.xml

4. copy the Employee.java and EmployeeInfo.java under synergy\\widgets\\EmployeeInfo\\src\\java\\com\\sun\\portlet

5. change the package name in Employee.java and EmployeeInfo.java for ex : to "package com.sun.portlet"

6. The EmployeeInfo directory will have "web" directory -> EmployeeInfo-docroot, META-INF and WEB-INF

7. copy the jsp files to WEB-INF/jsp directory

8. add the following lines in the individual jsp files

<%@ taglib uri="http://liferay.com/tld/portlet" prefix="liferay-portlet" %>
<%@ taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme" %>
<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %>

9. The purpose of liferay-display.xml and liferay-portlet.xml

a. liferay-portlet.xml is like a wrapper on the portlet.xml. Liferay has added certain extra functionalities and they have used their own dtd (liferay-portlet-app_5_0_0.dtd)

b. The liferay-display.xml has the following items :

<category name="category.sample">
 <portlet id="EmployeeInfo"/>

The category.sample means that when we deploy this portlet and then log in as paul/paul or any other user, then click on "Add application" link, the EmployeeInfo portlet will be displayed under "sample"

10. Add the portlet name in the build.xml in the widgets directory

11. The war file will be created under the directory synergy\\widgets\\EmployeeInfo\\build\\war

12. copy this war file and just paste it under the directory C:\\Documents and Settings\\<username>\\liferay\\deploy

13. Now login to websynergy http://localhost:8585 (paul@example.com/paul) and click on "add applications" . You should find the custom portlets under sample.

Here is how the portlets look on the websynergy :

http://blogs.sun.com/siddeshkamath/resource/synergy%20customportlet/customportlet_synergy.JPG

 

 

To checkout the websynergy code base

Project Websynergy is Sun's next generation portal using Liferay Portal Server, GlassFish v3, and MySQL

Steps to checkout the websynergy code base :

1. Download the svn utility from http://subversion.tigris.org/files/documents/15/41686/svn-1.4.6-setup.exe

2. Edit the servers file to add your respective proxy server which is  under the location C:\\Documents and Settings\\<windows user>\\Application Data\\Subversion . A Sample "servers" file is available at the following location. Just replace the tag "<Add your proxy name here>" with your proxy.

http://blogs.sun.com/siddeshkamath/resource/synergy checkout/servers

3. Note, sometimes the Subversion directory wont be present under C:\\Documents and Settings\\<windows user>\\Application Data until you restart the machine

4. Download and install ant from the location : http://apache.cs.utah.edu/ant/binaries/apache-ant-1.7.0-bin.zip

5. Download and install JDK 1.6

6. Add a system variable JAVA_HOME = C:\\Program Files\\Java\\jdk1.6.0

7. Add a system variable SVN = C:\\Program Files\\Subversion\\bin\\svn

8. Add the jdk path (C:\\Program Files\\Java\\jdk1.6.0\\bin) to the path variable

9. svn co http://mercurial.sfbay.sun.com/svn/repos/e2demo/synergy synergy

10. cd to the synergy directory and run ant

11. Once the ant is successful, cd to the directory synergy\\install\\image\\glassfish\\bin and run asadmin.bat start-domain

12. Wait for 1 or 2 mintues for the jsps to compile and run the websynergy portal by accessing http://localhost:8585  (user : paul@example.com password : paul)

 

Wednesday Oct 31, 2007

Configuring hadb for Sun Application server 9.1 on Solaris 10 machine

Thanks to Ajit Kamble, I just made small additions into his document :-). Feel free to visit his blog
to find out about other complex topologies we try out for the open source portal from Sun Microsystem

 What is hadb ?

HADB is a horizontally-scalable database. It is designed to support data availability with load balancing, failover, and state recovery capabilities.

How is it used with  Sun Open Portal version ?

HADB is used for session failovers for portal  server instances which are clustered. This is also used for portlet session Failover.

Topology that we follow when we cluster Portal server :

 Gateway(This comes with the SRA components of the portal) : https://gateway.com
  LoadBalancer : http://loadbalancer.com/portal 
 Access Manager : http://accessmanager.com:8080/amconsole
 Portalserver instance1 + Admin server : http://machine1.com:38080/portal
 Portalserver instance2:  http://machine2.com:38080/portal

Portalserver instance1 and Portalserver instance2 are clustered with Admin server on 4848 port of machine1 .

In this install hadb is installed on machine1 and machine2 machine.

 

Steps to Configure hadb for Sun Application server 9.1 on Solaris 10 machine :

Pre-requisites for configuring hadb : 

1. All the machines should be in the same subnet

2. Ensure that name resolution of all servers is correct on each server, either via the hosts file or DNS as required.

3. Ensure that the fully qualified hostname is the first entry after the IP address in the /etc/hosts file. Enter the other machine details also in hosts file. For ex : machine1.india.sun.com should be present in hosts file of machine2 and viceversa

cat /etc/hosts file on machine1 : 

127.0.0.1       localhost
172.12.144.23   machine1 machine1.com loghost
172.12.144.24   machine2 machine2.com

Repeat the same thing for hosts file on machine2

4. Shared Memory Configuration

Depending on how much physical memory is on the system, configure the shared memory in the system configuration file: /etc/system

root@as1#prtconf | grep Mem

Memory size: 1024 Megabytes

Use the following formula to calculate the value of the shminfo_shmmax parameter

shminfo_shmmax =( Server's Physical Memory in MB / 256MB ) \* 10000000

examples:

2GB == 80000000

1GB == 40000000

512MB == 20000000

Add the following parameters to the /etc/system configuration file:

set shmsys:shminfo_shmmax=0x40000000

set shmsys:shminfo_shmseg=20

set semsys:seminfo_semmni=16

set semsys:seminfo_semmns=128

set semsys:seminfo_semmnu=1000

                                set ip:dohwcksum=0

5.Check that hostname lookup and reverse lookup is functioning correctly, check the contents of the /etc/nsswitch.conf file hosts entry:

root@as1#cat /etc/nsswitch.conf | grep hosts

hosts: files dns 

6. Allow non-console root login by commenting out the CONSOLE=/dev/console entry in the /etc/default/login file:

root@as1#cat /etc/default/login | grep “CONSOLE=”

#CONSOLE=/dev/console

7. Enable remote root ftp, comment out the root entry in the /etc/ftpd/ftpusers file:

root@as1#cat /etc/ftpd/ftpusers | grep root

#root

8. Permit ssh root login. Set PermitRootLogin to yes in /etc/ssh/sshd_config file, and restart the ssh daemon process:

root@as1#cat /etc/ssh/sshd_config | grep PermitRootLogin

PermitRootLogin yes 

9. root@as1#/etc/init.d/sshd stop

10. root@as1#/etc/init.d/sshd start

11. Generate the ssh plulic and private key pair on each machine, machine1 and machine2 in this case :

root@as1#ssh-keygen -t dsa

 Enter file in which to save the key(//.ssh/id_dsa): <CR>

Enter passphrase(empty for no passphrase): <CR>

Enter same passphrase again: <CR>

12. Copy all the public key values to each server's authorized_keys file. Create the authorized_keys file on each server

 

root@as1# cd ~/.ssh

root@as1# cp id_dsa.pub authorized_keys

Run the same on machine2 machine also and copy the public key of machine1(present in the authorized_keys file on machine1) to the authorized_keys file on machine2 and do the same thing viceversa.

13.disableIPv6 interface that is not supported by HADB.

To do this on solaris, please remove the file /etc/hostname6.__0(where __ is eir or hme)

14. Make Date and Time same on all the machines involved in the topology

15. Restart both the machines using init 6

16. Install AS9.1 along with hadb from the installer panel on both the machines machine1 and machine2

17. On both machine1 and machine2 run ma,

cd /opt/SUNWhadb/4/bin

./ma

18. We have noticed that this wont install all the hadb packages. Hence on both the machines, go to the directory where you have unzipped the AS9.1 installer ex : <AS9.1 unzip location>/installer-ifr/package/

19. run  pkgadd -d . SUNWhadbe SUNWhadbi SUNWhadbv

20.machine1 will have DAS and first portal instance and machine2 machine has second portal instance.

21. On machine1 : create cluster

./asadmin create-cluster --user admin pscluster

22. Create node agent on machine1

./asadmin create-node-agent --host machine1.com --port 4848 --user admin machine1node

23. Create node agent on machine2(Note, the --host should point to machine1 since machine1 is the Admin server)

./asadmin create-node-agent --host machine1 --port 4848 --user admin machine2node

24.  Create an AS9.1 instance on machine1 :

./asadmin create-instance --user admin --cluster pscluster --nodeagent machine1node --systemproperties HTTP_LISTENER_PORT=38080 machine1instance

25. Create an AS9.1 instance on machine2 :

./asadmin create-instance --user admin --cluster pscluster --host machine1.com  --nodeagent machine2node --systemproperties HTTP_LISTENER_PORT=38080 machine2instance

26. Start both the node agents :

/opt/SUNWappserver/appserver/bin/asadmin start-node-agent machine1node 

27. run configure-ha-cluster

 ./asadmin configure-ha-cluster --user admin --port 4848 --devicesize 256 --hosts machine1.com,machine2.com pscluster

IMP Note : 

If configure-ha-cluster fails for some reason, then while re-installing the next time, do a ps -ef | grep ma and kill all the ma process and the process which runs on port 15200

restart the machines again and try configure-ha-cluster again. 

If configure-ha-cluster is successful, one can start installing the Portal server 7.2 to leverage its enhanced cluster capability as given in the following blog by Prakash Radhakrishnan


Monday Oct 15, 2007

Creating a Test Client to Test SAW(Simple Api for Workflow)

    

    Pre-requisites to create a Test Client(Using Netbeans 6.0 M10 on windows) :

        SAW Project Site can be Accessed at the following URL
 

  1. JCAPS 5.1.3 should be installed. Please see this blog entry
  2. Download the saw api 0.2 version from the SAW Project Site
  3. Download Netbeans 6.0 M10 for windows
  4. TestClient Netbeans Project :

     The TestClient Netbeans project is uploaded here. If you dont want to read the steps below, just add the nbproject to your Netbeans, change the property files accordingly and add your generated stub(WorkflowServiceClient.jar) and start using it. However you have to add your own stub and change the property files accordingly. 

         Creating a TestClient to Test SAW api version 0.2 :

  1. In the Netbeans 6.0 m10 ide click on New Project
  2. Choose Java -> Java Application. See the image
  3. Give the name TestClient to the Java App. Image
  4. Copy ImplementationType.properties, JCAPSWorkflowConfig.properties and WorkflowConfig.properties directly under Source Packages (Image)
  5. Change the following ImplementationType.properties
    • ImplementationType=JCAPS

     6.  Change the following in JCAPSWorkflowConfig.properties

  •  appserverhost=<integration server where jcaps is running>
  • appserverport=18002
  • appserverusername=Administrator
  • appserverpassword=<password>
  • contextfactory=com.sun.jndi.cosnaming.CNCtxFactory
  • serviceJndi=WorkflowService                

    7.   Change the following in WorkflowConfig.properties

                   businessProcess=com.sun.saw.impls.jcaps.JCAPSWorkflow

                    logFileLocation=D:\\\\b7log.txt

    8.   Now right click on the Java App name, in this case TestClient and select properties

    9.   Then click on Libraries on the Left Hand menu(Image)

    10. Add saw-api-0.2.jar under the compile tab (Image)

    11. Then add saw-api-0.2.jar, saw-imp-jcaps-0.2.jar, WorkflowServiceClient.jar, javaee.jar under the run tab (Image)

    12. To checkOut Tasks following code should be written in the main :

 

                public class TestClient {
                public TestClient() {
                }
                      public static void main(String[] args) {
                        TestClient client = new TestClient();
                        List taskIdList = new ArrayList();
                        taskIdList.add(0,"-24fb26e7:1157fe0cdcb:-7ec6") ;
                        taskIdList.add(1,"-24fb26e7:1157fe0cdcb:-7eca") ;
                try {
                        com.sun.saw.vo.OutputVO output = null;
                        output = client.checkOutTasks("CPina", taskIdList) ;
               
                        if(output.isOperationStatus())
                        {
                            System.out.println("checkout : success") ;
                        }
                        else
                       {
                            System.out.println("checkout : Failed") ;
                        }
              
                        } catch (com.sun.saw.WorkflowException e) {
                            e.printStackTrace();
                        }
              }
    
        public com.sun.saw.vo.OutputVO checkOutTasks(String userId, java.util.List taskIdList) throws         com.sun.saw.WorkflowException {
        com.sun.saw.WorkFlowManager workFlowManager = com.sun.saw.WorkFlowManager.getInstance();
        com.sun.saw.vo.CheckoutTaskVO checkoutTaskVO = new com.sun.saw.vo.CheckoutTaskVO();
        checkoutTaskVO.setTaskIdList(taskIdList);
        checkoutTaskVO.setUserId(userId);
        com.sun.saw.vo.OutputVO outputVO = null;
        outputVO = workFlowManager.checkoutTasks(checkoutTaskVO);
        return outputVO;
    }

}


 

 

 

Sunday Oct 07, 2007

Creating a portlet war file from porltet source present on Sun Portlet Repository

Thanks to Deepak Gothe for explaining me about maven.

 The SUN Portlet Repository can be accessed from the following location :

Following are the steps required to build a portlet war file from the portlet source present in the sun portlet repository :

  1. Here I will take the example of rssportlet. Download the rss portlet src from the following location https://portlet-repository.dev.java.net/files/documents/5129/57742/rssportlet-src-20070514.zip
  2. Download maven-2.0.5 from the following location:
  3. gzip -d maven-2.0.5-bin.tar.gz
  4. tar -xvf maven-2.0.5-bin.tar
  5. Add the below proxy settings in the following file<maven_install_dir>/conf/settings.xml           

   <proxy>
      <id>http</id>
      <active>true</active>
      <protocol>http</protocol>
      <username></username>
      <password></password>
      <host>ENTER YOUR PROXY</host>
      <port>8080</port>
      <nonProxyHosts>local.net,some.host.com</nonProxyHosts>
    </proxy>
    <proxy>
      <id>https</id>
      <active>true</active>
      <protocol>https</protocol>
      <username></username>
      <password></password>
      <host>ENTER YOUR PROXY</host>
      <port>8080</port>
      <nonProxyHosts>local.net,some.host.com</nonProxyHosts>
    </proxy>

    6. run export JAVA_HOME=/usr/jdk/latest

    7. unzip rssportlet-src-20070514.zip

    8. cd to the directory rssportlet

    9. run  <maven_install_dir>/bin/mvn package. If this gives the following error :

 

[INFO] [war:war]
[INFO] Exploding webapp...
[INFO] Assembling webapp rssportlet in /space/rssportlet/dist/rssportlet
[INFO] Copy webapp webResources to /space/rssportlet/dist/rssportlet
[INFO] Copy webapp webResources to /space/rssportlet/dist/rssportlet
[INFO] Generating war /space/rssportlet/dist/rssportlet.war
[INFO] Building war: /space/rssportlet/dist/rssportlet.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 30 seconds
[INFO] Finished at: Sun Oct 07 19:30:07 IST 2007
[INFO] Final Memory: 7M/121M
A Brief Description on the working of maven :

1. maven reads the <rssportlet_dir>/pom.xml

2. It reads the repository entry in pom.xml  and downloads the depedencies for the rssportlet from the repository(http://repo1.maven.org/maven2) to $HOME/.m2/repository directory . Following is the repository tag :

 

    <repositories>
        <repository>
            <id>central</id>
            <name>Maven Repository Switchboard</name>
            <url>http://repo1.maven.org/maven2</url>
        </repository>
        <repository>
            <id>maven-repository.dev.java.net</id>
            <name>Java.net Repository for Maven</name>
            <url>https://maven-repository.dev.java.net/nonav/repository</url>
            <layout>legacy</layout>
        </repository>
    </repositories>

3. Then maven reads plugin tag and downloads the plugins required

           <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.4</source>
                    <target>1.4</target>
                </configuration>
            </plugin>
4. You can see maven-compiler-plugin downloaded to the maven repository, see below :

bash-3.00# ls $HOME/.m2/repository/org/apache/maven/plugins/maven-
maven-clean-plugin/     maven-plugins/          maven-surefire-plugin/
maven-compiler-plugin/  maven-resources-plugin/ maven-war-plugin/

5. Next maven reads the dependencies tag. For ex :

       <dependency>
            <groupId>rome</groupId>
            <artifactId>rome</artifactId>
            <version>0.9</version>
            <scope>compile</scope>
        </dependency>

6. You can see rome downloaded to the maven repository, see below :

bash-3.00# ls /.m2/repository/rome/rome/0.9
rome-0.9.jar       rome-0.9.jar.sha1  rome-0.9.pom       rome-0.9.pom.sha1

Monday Oct 01, 2007

Installation of JCAPS 5.1.3 for SAW(Simple API for workflow) Testing

The Homepage Simple API for workflow open source project is at the following location : https://saw.dev.java.net/

To Test these SAW API's, installation of JCAPS 5.1.2/5.1.3 is a pre-requisite. This entry deals with step-by-step process to install JCAPS on Windows XP.

1.Unzip Repository CD1 and CD2

2.Run install.bat from the unzipped Repository CD1

3.Select defaults. Make sure ports are not conflicting

4.It will create “repository” folder

5.From repository folder run startserver.bat

6.Access the repository (http://localhost:12000/eManager) Login with necessary credentials

7.Go to Administration and Install Products eGate.sar (once you upload this sar file, one can see the product list. Now you can start installing the required sar files mentioned below in the same way as eGate.sar)

  • Logicalhost-win32
  • ldapeWay.sar
  • FileeWay.sar
  • eInsight.sar
  • eVision.sar
  • Enterprise-Manager-win32.sar
 14.Go to downloads Tab of the repository (ie http://localhost:12000/eManager)
  • Download logicalhost-win32.zip
  • Unzip logicalhost-win32.zip
  • createdomain.bat
  • start_domain1.bat

15. Download Enterprise Designer(eDesigner.zip)

  • runed.bat, this will open the edesigner page. Then click on Tools -> update manager ->select all install -> restart the ide

16. Download Workflow Service API (workflowserver.zip)

  • Unzip workflowserver.zip
  • Go to WLM-API-JDK14 directory.
  • Unjar WorkflowService.jar (jar -xvf WorkflowService.jar)
  • Change the dbType=oracle, userId=wlm51, password=wlm51 in connection.properties in the directory \\WLM-API-JDK14\\com\\stc\\bpms\\wlm\\connection.properties
  • jar it again using jar -cvf WorkflowService.jar \*
  • Deploy it on the integration server http://localhost:18000/asadmin -> Applications -> EJB Modules -> Deploy

 17.Install the open ldap in C: and start the slapd.exe (ldap_install_dir/bin/slapd.exe)

18.Install Oracle 10G. Login using Oracle utility sql plus . Enter Login/password (ex: system/<password>) .

19. Login to e-designer(by running runed.bat) -> project Explorer -> Sun seebeyond -> eInsight -> WorkListViewer -> Database scripts -> oracle install script. Copy the contents of this file and paste it onto the sqlplus terminal so that wlm51/wlm51 user is created in the database and all the corresponding tables are created.

 

Human Workflow Creation using JCAPS 5.1.3 :

  1. JCAPS Workflow Engine is installed and a workflow is defined. Please go through the following link to define a workflow

 

Creation of Stubs :

<Logical host installdir>\\is\\bin>isadmin get-client-stubs --user Administrator --password <password> --appname WorkflowService "D:\\JavaCAPS51\\stubs"

The stubs(WorkflowServiceClient.jar) will be created under “D:\\JavaCAPS51\\stubs” directory.

 

 


 

 

About

siddeshk123

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today