Sun GlassFish Web Space Server 10.0 Developer's Guide

ProcedureTo Create a Web Application Using the Drag and Drop Features in 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 GlassFish v2 and click Next.

  5. From the Frameworks list box, select the SAW plug-in.

    You can see that the Java Composite Application Platform Suite is selected by default, for the SAW implementation

  6. Click Finish.


    Tip –

    Check the SAW project web site https://saw.dev.java.net/ regularly, for updates on these implementations.


  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, OS Workflow or other workflow Engines.

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

    The web application is listed in the Projects tab and the index.jsp appears in the code window. You can see the appropriate Workflow tags listed in the Palette.


    Note –

    If the Workflow tags palette is not loaded in the NetBeans IDE, you can manually load it by clicking Tools and selecting Workflow from the Palette option. Moreover, if you right click on the web application and select Properties, the Libraries Category in the Project Properties window displays the SAW libraries that are added by the SAW plug-in in the NetBeans IDE. The current version of SAW libraries is 0.8. Check the SAW project web site https://saw.dev.java.net/ regularly for updates on the plug-in for new versions of SAW.


  9. Open the Java file in your web application.

    You can notice that the relevant Workflow APIs are listed in the palette. You can drag and drop these Workflow APIs in the Java file, depending upon the usage for your logic. In the default package, you can see various properties required by SAW to execute. These properties are the location of Sun Java Composite Application Platform Suite, SAW implementation and so on.


    Note –

    You cannot drag and drop duplicate methods. There are two ways to use the SAW APIs. One way is to use through JSP tag libraries and the other way is through the Java APIs.


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

    The web application is ready to deploy. 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

    Caution – Caution –

    Do not edit the ImplementationType.Properties file.


  11. Right click on the created web 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.

    A web browser is launched and it displays the user interface defined in your web application.