Packaging, deploying and compiling cooperative portlets

When packaging, deploying, and compiling cooperative portlets, refer to these considerations on aspects of the process such as creating deployment descriptors and packaging the WAR file.

Creating the deployment descriptors

A WAR must have a web.xml and a portlet.xml file in order to comply with J2EE specifications. For standard portlets, web.xml needs to contain only servlet information, not portlet information. If the standard portlet does not contain servlets, web.xml must still be present, though the content of the file will be empty.

The portlet.xml file must specify the location of the WSDL file associated with each portlet. To achieve this, you must modify portlet.xml to add a configuration parameter to each concrete portlet that exposes actions to the property broker through the WSDL file.

  • Standard portlet examples

    Sample web.xml file for standard portlet with empty content:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" 
        <display-name>Shipping Portlets - Standard Version</display-name>

    Sample standard portlet.xml file

    <?xml version="1.0"?>
            <description xml:lang="en">
               Displays details for a particular order
            <display-name xml:lang="en">Standard Order Detail</display-name>
    Note: For standard portlets, you must use a special <preference> entry to specify the application portlet class.

WAR file considerations

Once the code and deployment changes have been made for using the property broker, additional libraries and files must be packaged along with the application. After you package the WAR file, it is ready to be installed. Use the following table to package the files in the correct location.

Table 1. Files to package and their correct location
Portlet type Standard portlets
File name WSDL file
Path relative to the root of the WAR file or an absolute URL

Additional considerations for compiling

If you are using your own development environment, make sure to add the wp.propertybroker.standard.api.jar file to your class path for standard portlets. These JAR files can be found in the PortalServer_root/base/wp.propertybroker.standard.api/shared/app directory.