Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

CPortletAdapter is the IChannel that bridges from the uPortal IChannel API to the JSR-168 Portlet API.

Extending CPortletAdapter

Actually doing it

You can extend the CPortletAdapter class to override implementation of some of its protected methods for getting user attributes for for setting up PortletRequest attributes. The way you do this is you write a Java class that extends CPortletAdapter and overrides the appropriate methods. Then, when publishing a Portlet using CChannelManager, instead of using CPortletAdapter use your subclass.

UserAttributes

The JSR-168 Portlet specification provides a language for Portlets to declare user attributes that they would like to read. By default CPortletAdapter includes in the UserAttributes made available to the Portlet those attributes that it requested that also were uPortal IPerson attributes of the user as well as the user's cached password if requested and present.

You can override this implementation to handle such cases as the Portlet requesting attributes using different names than are used in your IPersons, the Portlet needing the attribute values differently formatted, or your desire to sneak in other, non-IPerson-attribute values in the UserAttribute map.

Request Attributes

By default CPortletAdapter sets the Map of UserAttributes into the portlet request attribute designated for this information. You can override this to add other request attributes.

Alternative to extending CPortletAdapter

CPortletAdapter not meeting your needs? You can instead implement the IPortletAdaptor marker interface directly in the alternative IChannel of your choice.

  • No labels