SAS 9.1.3 Integration Technologies » SAS Web Infrastructure Kit: Developer's Guide


Developing Custom Portlets
Development Steps
Creating a Deployment Descriptor
Creating Display Resources Files
Developing the Presentation JSP Page
Creating Action Classes
Implementing Portlet Help
Creating a PAR File
Use Cases
Simple Display Portlet
Localized Portlet
Portlet Template (Editable Portlet)
Remote Portlet
Tips and Best Practices
Using the Portlet API
Sample Portlets
Localized Display Portlet (Welcome)
Interactive Form Portlet (FormExample)
Portlet Template, or Editable Portlet (DisplayURL)
Web Application (HelloUserWikExample)
Remote Portlet (HelloUserRemote
Portlet
Sample: Web Application (HelloUserWikExample)

Step 4: Create the Web Application Deployment Descriptor

The Web application deployment descriptor is an XML file that describes the Web application's initialization parameters, servlets, and other components. Here is the Web application deployment descriptor for the HelloUserWikExample application. The boxes contain explanatory comments.

Note: The line breaks in the loggingURL and SystemPropsFile values are for display purposes only. If you copy this example into your XML file, then you must put these statements on one line.

For more information about creating Web application deployment descriptors, see the documentation for your servlet container.


<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
  Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>

The metadata-privilegeduserid parameter within the context-param element specifies a privileged user account, in the format domain\userid. This account provides credentials that enable the application to access the remote session context that was created by the portal Web application.

You should set up a unique privileged user for this purpose. See Step 3 for details.

<context-param>
<param-name>metadata-privilegeduserid</param-name>
<param-value>mycompany\portalservice</param-value>
</context-param>

The servlet entry specifies the SAS Foundation Services Bootstrap servlet. This servlet provides a convenient way to deploy local services for the Web application to use. For more information, see com.sas.services.webapp in the Portlet API class documentation.

The localPropsfile parameter specifies the name of the properties file that is to be used for local services deployment, and the remotePropsFile parameter specifies the name of the properties file that is to be used to access remote services. The referenced files must be present in the path /WEB-INF/conf in the Web application's directory structure. For more information, see Step 2: Create Deployment Definitions and Properties Files for Local and Remote Services.

<!-- BEGIN BootstrapServlet -->
  <servlet>
    <servlet-name>BootstrapServlet</servlet-name>
    <servlet-class>
      com.sas.services.webapp.BootstrapServlet
    </servlet-class>
    <init-param>
    <!-- metadata source for local deployable services -->
      <param-name>localPropsFile</param-name>
      <param-value>
        sas_metadata_source_client.properties
      </param-value>
    </init-param>
    <init-param>
    <!-- metadata source to retrieve remotely deployable services -->
      <param-name>remotePropsFile</param-name>
      <param-value>
        sas_metadata_source_server.properties
      </param-value>
    </init-param>
    <init-param>
      <param-name>loggingURL</param-name>
      <param-value>
        file:///C:\SAS\EntBIServer\Lev1\web\Deployments\Portal\
          logging_config_idp.xml</param-value>
    </init-param>
    <init-param>
      <param-name>SystemPropsFile</param-name>
      <param-value>
        C:\SAS\EntBIServer\Lev1\web\Deployments\
          Portal\system_properties.config
      </param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <!-- END BootstrapServlet -->
  <servlet-mapping>
    <servlet-name>BootstrapServlet</servlet-name>
    <url-pattern>/Bootstrap</url-pattern>
  </servlet-mapping>
</web-app>