A WSRP consumer is an intermediary system that communicates with producers and the portlets they offer on behalf of its client (typically a portal). It gathers markup delivered by the remote portlets to be used by the portal and manages the remote portlet providers. The portal then mediates the markup and interaction between end-users and the producer. The consumer provides comprehensive client-side support for the four WSRP interfaces (Service Description, Registration, Markup, and Manage Portlets).
Once a standard JSR168 portlet is deployed in ATG, it behaves like any other ATG portal gear. A gear manifest is generated which can be used for adding the portlet to the ATG Portal framework.
The ATG consumer is shipped as separate module responsible for communicating with a producer based on the standard WSRP interfaces. It also is responsible for managing the producer and its offered portlets using ATG repositories. All WSRP functionality is encapsulated within the WSRP-ProxyPortlet.
WSRP-ProxyPortlet
WSRP-ProxyPortlet acts as a proxy for the remotely running portlet. In the ATG portal framework, it behaves like any other ATG gear. It is provided in deployed form in the WSRP.consumer module, and can be added to the Portal Framework. Like any other portlet, the WSRP-ProxyPortlet can have multiple instances, and each instance can be configured to interact with a specific remote producer offered portlet.
WSRP-related configuration and management functionality is provided through the following two custom portlet modes of WSRP-ProxyPortlet:
- Config. Corresponds to ATG’s- installConfiggear mode and is primarily used to configure the proxy portlet in the framework, including:- Registering with producers 
- Adding and removing the list of available remote portlets from each producer 
- Getting the latest WSRP - PortletDescriptionfor individual remote portlets
- Modifying existing registrations 
- Deregistering with producers 
 
- Edit_defaults. Corresponds to ATG’s- instanceConfiggear mode. It is used to configure a particular- ProxyPortletinstance (or gear instance) to be associated with a particular portlet from any producers with which the consumer registered during- installConfigmode.
Consumer Portlet Modes
The WSRP-ProxyPortlet has a predefined set of portlet modes, which complements the set supported by the ATG consumer. The combined portlet modes supported by the ProxyPortlet fall into two categories:
- Modes that are primarily handled by the proxy portlet itself. These modes are required for proxy portlet administration, and their handling is confined to the scope of the ATG proxy portlet. The modes are: - Edit_defaults 
- CONFIG 
 
- Modes whose handling is delegated to a remote WSRP portlet by the proxy portlet, and which are handled by the ATG consumer. These modes may not be present in the supported modes definition of the proxy portlet; instead their support is determined by the proxy portlet itself. The following remote portlet modes are supported by ATG proxy portlet: - VIEW 
- EDIT 
- HELP 
 
When a JSR168 portlet is deployed to the ATG portal framework, the existing portlet modes for that portlet are mapped to the corresponding gear mode implementation in ATG, and further mapped to WSRP Portlet modes. The following table shows the mapping:
| JSR168 Portlet Modes | ATG Gear Modes | WSRP Portlet Modes | 
| 
 | 
 | 
 | 
| 
 | 
 | 
 | 
| 
 | 
 | 
 | 
| 
 | 
 | 
 | 
| 
 | 
 | 
 | 
| 
 | 
 | 
 | 
| 
 | 
 | 
 | 
The portlet modes supported by the consumer can be passed in the RegistrationData; the portal administrator can select the view, edit, help, or preview portlet modes during registration.
Consumer Window States
A window state is an indicator of the amount of portal page space assigned to a portlet’s content; supported states are Normal, Maximized and Minimized. In the ATG portal framework, portlet window states are implemented in as gear display modes. Like Portlet modes, the window states supported by the consumer can be passed in the RegistrationData; the portal administrator can select a WSRP window state from Normal, Minimized, Maximized and Solo during the registration.
- The Normal and Minimized window states correspond to Shared display mode. 
- The Maximized and Solo window states correspond to Full display mode. 
Consumer UserProfile Items
The UserContext structure is a way for the consumer to provide end-user data to the producer, allowing the producer to perform end-user-specific handling. The UserContext data structure consists of the following members:
- UserContextKey. A required token supplied by the consumer to uniquely identify the - UserContext, and which remains invariant for the duration of a consumer’s registration. The ATG consumer generates a unique- UserContextKeybased on the registration context passed by it to the producer in the- UserContextstructure. The producer can use this key as a reference to the user.
- UserCategories. An optional array of strings, each of which specifies a producer-defined user category in which the consumer places the end-user relative to the current operation, to be used for personalization. The ATG consumer does not support - UserCategories, and they are ignored if offered by a producer.
- UserProfile: An optional WSRP structure used to carry information about the end-user. Note that this structure does not carry any user credentials, such as ID or password. The portlet uses the - userProfileItemsin its metadata to describe the fields it uses to generate markup from this set and any others the consumer indicated were available when it registered. The ATG consumer provides a mapping between the WSRP- UserProfileand ATG personalization’s- UserProfileattributes. To modify the default mapping, change the- userProfileMapproperty in the- /atg/wsrp/consumer/ConfigurationNucleus component. The default mapping is described in the table below.- Profile Name - Field Name - ATG Profile Repository Property - name/prefix- prefix- ContactInformation.prefix- name/given- given- User.firstName- name/family- family- User.lastName- name/middle- middle- User.middleName- name/suffix- suffix- ContactInformation.suffix- name/nickname- nickname- "Empty"- bdate- bdate- User.dateOfBirth- Gender- gender- User.gender- employerInfo/employer- employer- "Empty"- employerInfo/department- department- "Empty"- employerInfo/jobtitle- jobtitle- ContactInformation.title- homeInfo/postal/name- name- ContactInformation.address1- homeInfo/postal/street- street- ContactInformation.address2- homeInfo/postal/city- City- ContactInformation.city- homeInfo/postal/stateprov- stateprov- ContactInformation.state- homeInfo/postal/postalcode- postalcode- ContactInformation.postalCode- homeInfo/postal/country- country- ContactInformation.country- homeInfo/postal/organization- organization- ContactInformation.companyName- homeInfo/telecom/telephone/intcode- intcode- ContactInformation.phoneNumber- homeInfo/telecom/telephone/loccode- loccode- homeInfo/telecom/telephone/number- number- homeInfo/telecom/telephone/ext- Ext- "Empty"- homeInfo/telecom/telephone/comment- comment- "Empty"- homeInfo/telecom/fax/intcode- intcode- ContactInformation.faxNumber- homeInfo/telecom/fax/loccode- loccode- homeInfo/telecom/fax/number- number- homeInfo/telecom/fax/ext- Ext- "Empty"- homeInfo/telecom/fax/comment- comment- "Empty"- homeInfo/telecom/mobile/intcode- intcode- "Empty"- homeInfo/telecom/mobile/loccode- loccode- "Empty"- homeInfo/telecom/mobile/number- number- "Empty"- homeInfo/telecom/mobile/ext- Ext- "Empty"- homeInfo/telecom/mobile/comment- comment- "Empty"- homeInfo/telecom/pager/intcode- intcode- "Empty"- homeInfo/telecom/pager/loccode- loccode- "Empty"- homeInfo/telecom/pager/number- number- "Empty"- homeInfo/telecom/pager/ext- Ext- "Empty"- homeInfo/telecom/pager/comment- comment- "Empty"- homeInfo/online/email- email- User.email- homeInfo/online/uri- Uri- "Empty"- businessInfo/postal/name- name- "Empty"- businessInfo/postal/street- street- "Empty"- businessInfo/postal/city- City- "Empty"- businessInfo/postal/stateprov- stateprov- "Empty"- businessInfo/postal/postalcode- postalcode- "Empty"- businessInfo/postal/country- country- "Empty"- businessInfo/postal/organization- organization- "Empty"- businessInfo/telecom/telephone/intcode- intcode- "Empty"- businessInfo/telecom/telephone/loccode- loccode- "Empty"- businessInfo/telecom/telephone/number- number- "Empty"- businessInfo/telecom/telephone/ext- Ext- "Empty"- businessInfo/telecom/telephone/comment- comment- "Empty"- businessInfo/telecom/fax/intcode- intcode- "Empty"- businessInfo/telecom/fax/loccode- loccode- "Empty"- businessInfo/telecom/fax/number- number- "Empty"- businessInfo/telecom/fax/ext- Ext- "Empty"- businessInfo/telecom/fax/comment- comment- "Empty"- businessInfo/telecom/mobile/intcode- intcode- "Empty"- businessInfo/telecom/mobile/loccode- loccode- "Empty"- businessInfo/telecom/mobile/number- number- "Empty"- businessInfo/telecom/mobile/ext- Ext- "Empty"- businessInfo/telecom/mobile/comment- comment- "Empty"- businessInfo/telecom/pager/intcode- intcode- "Empty"- businessInfo/telecom/pager/loccode- loccode- "Empty"- businessInfo/telecom/pager/number- number- "Empty"- businessInfo/telecom/pager/ext- Ext- "Empty"- businessInfo/telecom/pager/comment- comment- "Empty"- businessInfo/online/email- email- "Empty"- businessInfo/online/uri- Uri- "Empty"
Inner Title Bar
In the ATG Portal implementation, the gear title template is responsible for displaying the gear title bar and optional links for Edit, About and Help. For the proxy portlet implementation, the gear title template is not sufficient, therefore the WSRP-ProxyPortlet itself generates HTML for the links for the supported Portlet Modes. The HTML is embedded in the markup obtained from the remote portlet. The inner title bar is based on the PortletDescription of the remote portlet for which the WSRP-ProxyPortlet instance is configured.
WSRP Remote Portlet – ProxyPortlet Relationship
To establish an association between the WSRP-ProxyPortlet instance and the actual remote WSRP portlet, the consumer uses Gear Instance parameters of the WSRP-ProxyPortlet. Whenever the proxy portlet instance is configured for linking with a specific remote portlet available to the consumer, the Gear Instance parameter of the current ProxyPortlet instance stores a unique consumer generated portletDescriptionID, which identifies a specific remote portlet and its associated PortletDescription. This way a given ProxyPortlet instance is able to reach the target PortletDescription and the producer for which it has been configured.

