|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jasig.portal.channels.portlet.CPortletAdapter
public class CPortletAdapter
A JSR 168 Portlet adapter that presents a portlet through the uPortal channel interface.
There is a related channel type called "Portlet Adapter" that is included with uPortal, so to use this channel, just select the "Portlet" type when publishing.
Note: A portlet can specify the String "password" in the
user attributes section of the portlet.xml. In this is done,
this adapter will look for the user's cached password. If
the user's password is being stored in memory by a caching
security context, the adapter will consult the cache to fill the
request for the attribute. If the user's password is not cached,
null will be set for the attributes value.
| Field Summary | |
|---|---|
protected static java.util.Map |
channelStateMap
|
private static ChannelCacheKey |
instanceCacheKey
|
protected org.apache.commons.logging.Log |
log
|
private static org.apache.pluto.PortletContainer |
portletContainer
|
private static boolean |
portletContainerInitialized
|
private static java.lang.String |
portletDefinitionIdParamName
|
static java.lang.String |
portletPreferenceNamePrefix
|
private static java.lang.String |
REQUEST_PARAMS_KEY
|
private static javax.servlet.ServletConfig |
servletConfig
|
private static ChannelCacheKey |
systemCacheKey
|
private static java.lang.String |
uniqueContainerName
|
| Constructor Summary | |
|---|---|
CPortletAdapter()
|
|
| Method Summary | |
|---|---|
ChannelCacheKey |
generateKey(java.lang.String uid)
Generates a channel cache key. |
protected java.lang.String |
getMarkup(java.lang.String uid)
This is where we do the real work of getting the markup. |
private java.lang.String |
getPassword(ISecurityContext baseContext)
Retrieves the users password by iterating over the user's security contexts and returning the first available cached password. |
ChannelRuntimeProperties |
getRuntimeProperties(java.lang.String uid)
Sets channel runtime properties. |
protected java.util.Map |
getUserInfo(java.lang.String uid,
ChannelStaticData staticData,
UserAttributeListImpl userAttributes)
Get the Map of portlet user attribute names to portlet user attribute values. |
protected void |
initPortletContainer(java.lang.String uid)
|
protected void |
initPortletWindow(java.lang.String uid)
|
boolean |
isCacheValid(java.lang.Object validity,
java.lang.String uid)
Determines whether the cached content for this channel is still valid. |
void |
receiveEvent(PortalEvent ev,
java.lang.String uid)
React to portal events. |
void |
renderCharacters(java.io.PrintWriter pw,
java.lang.String uid)
Output channel content to the portal as raw characters |
void |
renderXML(org.xml.sax.ContentHandler out,
java.lang.String uid)
Output channel content to the portal. |
void |
setPortalControlStructures(PortalControlStructures pcs,
java.lang.String uid)
Sets the portal control structures. |
void |
setResponse(java.lang.String uid,
javax.servlet.http.HttpServletResponse response)
Sets the HttpServletResponse for the channel to use. |
void |
setRuntimeData(ChannelRuntimeData rd,
java.lang.String uid)
Sets the channel runtime data. |
static void |
setServletConfig(javax.servlet.ServletConfig config)
Receive the servlet config from uPortal's PortalSessionManager servlet. |
void |
setStaticData(ChannelStaticData sd,
java.lang.String uid)
Sets the channel static data. |
protected void |
setupRequestAttributes(javax.servlet.http.HttpServletRequest request,
java.lang.String uid)
Adds the appropriate information to the request attributes of the portlet. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final org.apache.commons.logging.Log log
protected static java.util.Map channelStateMap
private static boolean portletContainerInitialized
private static org.apache.pluto.PortletContainer portletContainer
private static javax.servlet.ServletConfig servletConfig
private static ChannelCacheKey systemCacheKey
private static ChannelCacheKey instanceCacheKey
private static final java.lang.String uniqueContainerName
private static final java.lang.String REQUEST_PARAMS_KEY
private static final java.lang.String portletDefinitionIdParamName
public static final java.lang.String portletPreferenceNamePrefix
| Constructor Detail |
|---|
public CPortletAdapter()
| Method Detail |
|---|
public static void setServletConfig(javax.servlet.ServletConfig config)
config - the servlet config
protected void initPortletContainer(java.lang.String uid)
throws PortalException
uid - A String uniquely identifying the IChannel 'instance' we are virtually representing
as an IMultithreadedChannel.
PortalException
protected void initPortletWindow(java.lang.String uid)
throws PortalException
PortalExceptionpublic ChannelRuntimeProperties getRuntimeProperties(java.lang.String uid)
getRuntimeProperties in interface IMultithreadedChanneluid - a unique ID used to identify the state of the channel
public void receiveEvent(PortalEvent ev,
java.lang.String uid)
receiveEvent in interface IMultithreadedChannelev - a portal eventuid - a unique ID used to identify the state of the channel
public void setStaticData(ChannelStaticData sd,
java.lang.String uid)
throws PortalException
setStaticData in interface IMultithreadedChannelsd - the channel static datauid - a unique ID used to identify the state of the channel
PortalException
public void setRuntimeData(ChannelRuntimeData rd,
java.lang.String uid)
throws PortalException
setRuntimeData in interface IMultithreadedChannelrd - the channel runtime datauid - a unique ID used to identify the state of the channel
PortalException
public void setPortalControlStructures(PortalControlStructures pcs,
java.lang.String uid)
throws PortalException
setPortalControlStructures in interface IMultithreadedPrivilegedpcs - the portal control structuresuid - a unique ID used to identify the state of the channel
PortalExceptionPortalControlStructures
public void renderCharacters(java.io.PrintWriter pw,
java.lang.String uid)
throws PortalException
renderCharacters in interface IMultithreadedCharacterChannelpw - a print writeruid - a unique ID used to identify the state of the channel
PortalException - if an error occurs
public void renderXML(org.xml.sax.ContentHandler out,
java.lang.String uid)
throws PortalException
renderXML in interface IMultithreadedChannelout - a sax document handleruid - a unique ID used to identify the state of the channel
PortalException
protected java.lang.String getMarkup(java.lang.String uid)
throws PortalException
uid - a unique ID used to identify the state of the channel
PortalExceptionpublic ChannelCacheKey generateKey(java.lang.String uid)
generateKey in interface IMultithreadedCacheableuid - the unique identifier
public boolean isCacheValid(java.lang.Object validity,
java.lang.String uid)
Return true when:
false.
In other words, cache the content in all cases except for when a user clicks a channel button, a link or form button within the channel, or the focus or unfocus button.
isCacheValid in interface IMultithreadedCacheablevalidity - the validity objectuid - the unique identifier
true if the cache is still valid, otherwise false
public void setResponse(java.lang.String uid,
javax.servlet.http.HttpServletResponse response)
IMultithreadedDirectResponse
setResponse in interface IMultithreadedDirectResponseuid - The unique ID of the channelresponse - The HttpServletResponse for the channel to use.private java.lang.String getPassword(ISecurityContext baseContext)
baseContext - The security context to start looking for a password from.
protected void setupRequestAttributes(javax.servlet.http.HttpServletRequest request,
java.lang.String uid)
request - The request to add the attributes touid - The uid of the request so the appropriate ChannelState can be accessed
protected java.util.Map getUserInfo(java.lang.String uid,
ChannelStaticData staticData,
UserAttributeListImpl userAttributes)
uid - a String uniquely identifying the IChannel 'instance' we are emulating
as an IMultithreaded channel.staticData - data associated with the particular instance of the portlet window for the particular
user sessionuserAttributes - the user attributes requested by the Portlet
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||