The producer can be viewed as a container environment in which remote portlets reside and execute. The Web service interfaces exposed by the producer allow a WSRP-compliant consumer to discover the capabilities and offerings of the producer and establish a contract with the producer.
Note: The remote components must conform to the JSR 168 standard.
The WSRP specification defines four interfaces:
Service Description (required)
Markup (required)
Registration (optional)
Portlet Management (optional)
Note: The ATG WSRP implementation does not implement the Portlet Management interface; third-party consumers that expect it (specifically Cloning operations) may not function properly.
A simple example of how these interfaces are used is:
A consumer is made aware of a producer. The consumer requests the producer’s Service Description.
The producer response indicates that registration is required, and what information is requested.
The consumer registers and again requests the Service Description.
Now that the consumer has registered, the Service Description includes a list of offered portlets.
The consumer uses the methods of the Markup interface to request content from the producer and provide end-user interactivity.
The WSRP specification also defines the data model. The subset of this model that does not change frequently per request or per session is persisted in the GSA repository. The persistent WSRP information in ATG producer includes:
Consumer registration details
Producer service description
Descriptions of producer offered portlets
A single producer repository exists for persisting producer-specific information, structured so that it has almost a one-to-one mapping with the structure of the WSRP data-types. Other items are handled by WSRP services located at /atg/wsrp
in Nucleus.
Service Description
The service description provides information about the producer to a consumer that requests it. The information can include:
Descriptions of
customModes
andcustomWindowStates
Whether registration is required
Properties to be provided during registration
Portlets offered
Each portlet offered by the producer is associated with a detailed PortletDescription
containing the portlet’s meta-data and capability information.
The ATG producer is shipped with a service description that includes information for the out-of-the-box capabilities and meta-data supported in the ATG producer environment; however it does not include any portlet descriptions. Customers add portlets by importing them using the WSRP administration UI (see Importing Portlet Descriptions later in this chapter).
Note: The provided service description can be customized through the repository either directly or using the ACC; however this is not recommended. Customized information may be inconsistent with the underlying functionality and features. In particular, do not modify the following parts of the service description:
RegistrationPropertyDescription
CustomModeDescription
CustomWindowStateDescription
RequiresInitCookie
. Do not change tonone
.
The following table shows the Contact properties required for registration, which are included in the defaults shipped with the service description:
Property Name | Type | Label | Label |
---|---|---|---|
|
| Name Prefix |
|
|
| Given Name |
|
|
| Family Name |
|
|
| Middle Name |
|
|
| Name Suffix |
|
|
| Company Name |
|
|
| Title |
|
|
| Address |
|
|
| Street |
|
|
| City |
|
|
| State/Province |
|
|
| Postal Code |
|
|
| Country |
|
|
| Organization Name (Postal) |
|
|
|
| |
|
| URL |
|
|
| Telephone (International Code) |
|
|
| Telephone (Local Code) |
|
|
| Telephone (Number) |
|
|
| Telephone (Extension) |
|
|
| Telephone (Comments) |
|
|
| Fax (International Code) |
|
|
| Fax (Local Code) |
|
|
| Fax (Number) |
|
|
| Fax (Extension) |
|
|
| Fax (Comments) |
|
|
| Mobile (International Code) |
|
|
| Mobile (Local Code) |
|
|
| Mobile (Number) |
|
|
| Mobile (Extension) |
|
|
| Mobile (Comments) |
|
|
| Pager (International Code) |
|
|
| Pager (Local Code) |
|
|
| Pager (Number) |
|
|
| Pager (Extension) |
|
|
| Pager (Comments) |
|
The service description also includes the OfferedPortlets
property, a set of portlet descriptions describing the metadata and capabilities for each Portlet offered by the producer.
Do not modify the PortletDescription
directly in the repository; use the WSRP administration tool for modifications.
Registration
The optional Registration interface is a way for consumers to provide information to the producer, which uses it to establish a unique identity for and relationship with the consumer. Users can:
Configure whether registration is required.
Generate unique and secure registration handles.
Validate consumer registration requests.
Specify the lifespan of a consumer registration (apart from the deregister operation); invalidates the consumer registration after a specified time-lapse, either from the point when registration was done or last modified, or from the last consumer activity.
Consumers must provide contact details as registration properties (see the Service Description section). Registration requests that fail to provide this information are rejected. Using the information, a Consumer-Contact
instance is created in the ATG environment. The contact information is associated with a registered consumer and has dynamic properties analogous to the User-Profile
properties of the Oracle Commerce Personalization module. The producer is packaged with a default set of Contact RegistrationProperties
customers can modify, similar to customizing the User-Profile
.
Markup
The required Markup interface includes two methods for obtaining markup fragments and performing actions on remote portlets: getMarkup
and performBlockingInteraction
. See the WSRP specification for details on these methods.
One producer task is to smoothly interact with the JSR168 container and perform render and action requests on the target JSR168 portlet. However, there are fundamental differences between the way a JSR168 container is invoked from a conventional portal application and the way it is invoked from the producer environment:
The conventional portlet invocation mechanism is the HTTPProtocol request/response paradigm. WSRP requests are instead received as method invocations, with inputs passed as method arguments and the response as a return-type of method-invocation.
Once added to the ATG-Portal, a conventional portlet behaves in conjunction with the portal, community, or page to which it was added, particularly for URL generation. In contrast, a WSRP request does not provide or require the Portal Context information for the producer.
To handle these potential issues, the ATG producer uses a simulated J2EE FilterChain,
which is based on the Nucleus service. The FilterChain
and Filter
components can be found in the Producer Module at /atg/wsrp/producer/filter
.
The Producer executes the following scenario:
Receive a Markup request.
Obtain the associated
HttpServletRequest/Response
from the underlying Web Service environment.Wrap the request/response in an
HttpServletRequestWrapper
orHttpServletResponseWrapper
instance.Invoke the
FilterChain
.Synthesize the Web service method response using the state present in the request/response wrapper.
The producer is shipped with preconfigured filters in the WSRP servlet filter chain. Customers can add new Filters for specific functionality such as UserContext
handling. Do not remove any filters. The FilterChain
must always include the first (head) and last (tail) filters. The head filter initializes the request/response with WSRP specific information, and the tail filter delegates the request to JSR168 Container as a Render request. An ActionFilter
must also be present, to identify Action requests and appropriately invoke the JSR168 Container.