Sun GlassFish Web Space Server 10.0 Developer's Guide

Creating a SAW Portlet Using the SAW plug-in

This section explains you how to create a simple workflow portlet in NetBeans IDE using the SAW plug-in.

ProcedureTo Create a SAW Portlet Using the SAW plug-in

  1. Click New Project in NetBeans IDE.

  2. Select Web from Categories and Web application from Projects and click Next.

  3. Enter a project name.

  4. From the Server drop down list, select Open Portal Portlet Container 2.0 Beta and click Next.

  5. From the Frameworks list box, select Portlet Support and select the Create Portlet checkbox.

  6. Select the SAW plug-in and click Finish.

  7. Expand the Source Packages folder to see the ImplementationType.properties and WorkflowConfig.properties property files, under the default package folder.

    The ImplementationType.properties file sets the ImplementationType as Java Composite Application Platform Suite. This can be changed in future saw releases to point to JBPM, OpenESB or other workflow Engines

  8. Set the WorkflowConfig.properties file appropriately, to point the Java Composite Application Platform Suite Integration server.

  9. Edit the WorkflowConfig.Properties file to define your runtime execution environment.

    The sample WorkflowConfig.Properties file is shown below:


    # the business process to use.
    sawworkflowimplclass = The SAW Workflow Implementation class to use.
    For example, com.sun.saw.impls.jcaps.JCAPSWorkflow
    # Properties that are needed by the JCAPS Implementation of SAW.
    com.sun.saw.impls.jcaps.JCAPSWorkflow.appserverhost = machine name or IP
    where Sun Java Composite Application Platform Suite business process is running.
    For example, abc.india.sun.com
    com.sun.saw.impls.jcaps.JCAPSWorkflow.iiopserverport =
    Port on which the IIOP lookup for EJB happens. For example, 18002
    com.sun.saw.impls.jcaps.JCAPSWorkflow.appserverusername =
    Administrator user name. For example, Administrator
    com.sun.saw.impls.jcaps.JCAPSWorkflow.appserverpassword =
    Administrator password of JCAPS Integration server. For example, <password>
    com.sun.saw.impls.jcaps.JCAPSWorkflow.contextfactory = The context factory.
    For example, com.sun.jndi.cosnaming.CNCtxFactory
    com.sun.saw.impls.jcaps.JCAPSWorkflow.serviceJndi = The JNDI look up name.
    For example, WorkflowService
  10. Change the portlet Java and the JSP files in your web application accordingly, to write the portlet.

    You can notice that the relevant Workflow APIs are listed in the palette that you can drag and drop in the Java file, depending upon the usage for your logic.

  11. Right click on the created portlet application and select Libraries.

  12. Click Add Jar and select the WorkflowServiceClient.jar from Java Composite Application Platform Suite and click OK.

  13. Right click on the web application and select Clean and Build.

  14. Right click on the web application and select Run.

    The portlet gets rendered on the portlet container.