AquaLogic .NET Portlet Toolkit WSRP Development Guide

     Previous Next  Open TOC in new window   View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

WSRP Producer Configuration Elements (wsrp-producer.xml)

The wsrp-producer.xml file provides configuration information about all portlets deployed in the WSRP Producer. This file is also used to map portlet modes to specific URLs and define portlet info and portlet properties for use within portlets.

The table below summarizes the configuration elements required in wsrp-producer.xml. For a complete listing of elements and their restrictions, see the wsrp-producer.xsd schema file in the WSRP Producer installation directory (\wsrpproducer\1.1\webapp\wsrpproducer\).
Note: Some metadata elements can be localized using a “key” attribute. For details, see Localizing WSRP Portlet Metadata.
Element Description Accepted Values
<requires-registration> A flag indicating wether or not the WSRP Producer requires Consumers to register before providing a description of the portlets offered by the Producer. true or false
<registration-properties><property> The list of registration properties required by the Producer. For details on using registration properties, see Accessing WSRP Consumer Registration Information Using the .NET Portlet Toolkit.
<custom-items> The list of custom window states and custom portlet modes that are used by the Producer. Custom items defined at this level may be referenced by any portlet offered by the Producer. Custom items that are shared by multiple portlets should always be defined here. <custom-window-state> and <custom-portlet-mode>

For details on window states and portlet modes, see Implementing WSRP Portlet Window States Using the .NET Portlet Toolkit and Implementing WSRP Portlet Modes Using the .NET Portlet Toolkit.

<portlets> A list of the portlets offered by the Producer. <portlet> elements
<portlet> Element within <portlets> that contains metadata for an individual portlet. portlet configuration elements (see below)
Portlet Configuration Elements (used within each <portlet> element)
<handle> WSRP portlet handle, a unique token used to refer to the portlet shared between the Consumer and Producer. string
<url id=" "> Defines a URL for later use within portlet mode mappings; requires “id” parameter URL
<expiration-cache> Cache expiration setting in minutes int
<supported-locale> A locale in which the portlet is able to generate markup. If not provided, indicates that the portlet will attempt to generate markup in any requested locale. standard locale (as in Accept-Language header)
<description lang=" "> A localizable description of the portlet intended for display in Consumer-generated dialogs. string
<display-name lang=" "> A localizable value intended for display in a Consumer's tooling for building aggregated pages. This value is usually shorter than either title element. string
<supports> Defines mime-type, window state, and portlet mode combinations supported by the portlet. If omitted, a default <supports> element for the mime-type”'text/html” and all standard WSRP window-states and portlet modes is applied. <mime-type>, <portlet-mode> and <window-state>
<mime-type> Element within the <supports> element that defines the MIME type(s) supported by the portlet.
Note: If the <supports> element contains multiple <mime-type> elements, the specified portlet mode or window state settings apply to all. To specify different portlet modes or window states on a per MIME type basis, add multiple <supports> elements to the portlet definition, each with a different <mime-type> element. If the same <mime-type> is listed more than once, an exception is thrown.
In addition to fully-specified mime-types, '*' and type specific wildcards (e.g., 'text/*') may be used.
<portlet-mode>

<name></name>

<url></url>

Defines support for a portlet mode for the mime-type(s) of the parent <supports> element. If omitted, defaults to supporting all standard wsrp portlet modes. The <name> element must contain a standard WSRP portlet mode (wsrp:view, wsrp:edit, wsrp:help or wsrp:preview) or a URI to a custom portlet mode. Custom portlet modes should include a <description>.

Each supported mode must have an associated URL. Either include the URL for the mode within the <url> node, or use the idref attribute to refer to a URL defined as a child of the <portlet> element (see above). If neither an URL nor the idref is specified, the URL is assumed to be the first one found for the portlet.

For details on using portlet modes, see Implementing WSRP Portlet Modes Using the .NET Portlet Toolkit.

<window-state>

<name></name>

Defines support for a window state for the mime-type(s) of the parent <supports> element. If omitted, defaults to supporting all standard wsrp window states. The <name> element must contain a standard WSRP window state (wsrp:normal, wsrp:solo, wsrp:minimized or wsrp:maximized) or a URI to a custom window state. Custom window states should include a description.

For details on using window states, see Implementing WSRP Portlet Window States Using the .NET Portlet Toolkit.

<portlet-info> Localized portlet metadata intended for use in Consumer-generated dialogs. <title>: Localized title for the portlet. This value is intended for display in a titlebar decoration for the portlet markup.

<short-title>: Localized short title for the portlet.

For details on localization, see Localizing WSRP Portlet Metadata.

<portlet-properties><property> A list of portlet properties supported by instances of the portlet. Each property element contains the following attributes: name: A unique name for the property used for indexing the property in a collection. (Required.)label: A short, human-readable name for the property intended for display in any Consumer-generated user interface for administering the portlet.hint: A short description of the property intended for display.type: The datatype of the property. Defaults to xs:string if omitted.defaultValue: The value sent to the portlet for this property if the property has not been explicitly set for the portlet instance.

For details on using portlet properties, see Manipulating WSRP Properties Using the .NET Portlet Toolkit.

<user-profile> A list of user profile properties requested by the portlet. <item>: The full name of the user profile property.
<forms-authentication> Defines support and configuration for SSO forms authentication. For details on using this element, see Using UNT Authentication with WebLogic Portal.
The example below defines two portlets. The first uses one URL for all portlet modes, while the second uses separate URLs for the view mode and edit mode. This code is from the WSRP sample code provided with the .NET Application Accelerator.
<?xml version="1.0"?>
<wsrp-producer xmlns="http://www.bea.com/al/dotnet/wsrpproducer/1.1"
		  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		  xmlns:xs="http://www.w3.org/2001/XMLSchema">
		  
	<requires-registration>false</requires-registration>
		
	<portlets>

		<portlet>
			<handle>quote</handle>
			<url id="default">http://localhost:4614/WSRPSamples/StockQuotePortlet.aspx</url>
			<expiration-cache>10</expiration-cache>
			<supported-locale>en</supported-locale>
			<description lang="en">Portlet that displays stock quotes.</description>
			<display-name lang="en">Stock Quote Portlet</display-name>
			<supports>
				<mime-type>text/html</mime-type>
				<portlet-mode>
					<name>wsrp:view</name>
					<url idref="default"/>
				</portlet-mode>
				<portlet-mode>
					<name>wsrp:edit</name>
					<url idref="default"/>
				</portlet-mode>
				<portlet-mode>
					<name>wsrp:help</name>
					<url idref="default"/>
				</portlet-mode>
			</supports>
			<portlet-info>
				<title lang="en">Stock Quote Portlet</title>
				<short-title lang="en">quote</short-title>
			</portlet-info>
			<portlet-properties>
				<property name="stockSymbols" type="xs:string" defaultValue="BEAS"/>
			</portlet-properties>
		</portlet>

		<portlet>
			<handle>quote2</handle>
			<url id="view">http://localhost:4614/WSRPSamples/StockQuotePortlet2/View.aspx</url>
			<url id="edit">http://localhost:4614/WSRPSamples/StockQuotePortlet2/Edit.aspx</url>
			<expiration-cache>10</expiration-cache>
			<supported-locale>en</supported-locale>
			<description lang="en">Portlet that displays stock quotes using a seperate edit page.</description>
			<display-name lang="en">Stock Quote Portlet 2</display-name>
			<supports>
				<mime-type>text/html</mime-type>
				<portlet-mode>
					<name>wsrp:view</name>
					<url idref="view"/>
				</portlet-mode>
				<portlet-mode>
					<name>wsrp:edit</name>
					<url idref="edit"/>
				</portlet-mode>
			</supports>
			<portlet-info>
				<title lang="en">Stock Quote Portlet 2</title>
				<short-title lang="en">quote#2</short-title>
			</portlet-info>
			<portlet-properties>
				<property name="stockSymbols" type="xs:string" defaultValue="BEAS"/>
			</portlet-properties>
		</portlet>

	</portlets>

</wsrp-producer>

  Back to Top      Previous Next