|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.http.HttpServletRequestWrapper
com.ibm.wps.pe.pc.legacy.cmpf.PortletRequestWrapper
public class PortletRequestWrapper
Provides a convenient implementation of the PortletRequest interface that can be subclassed by developers who wish to wrap the request to a Portlet. This class implements the Wrapper or Decorator pattern. Methods default to calling through to the wrapped request object.
PortletRequest
Constructor Summary | |
---|---|
PortletRequestWrapper(PortletRequest portletRequest)
Creates a PortletRequest adaptor wrapping the specified request object. |
Method Summary | |
---|---|
Client |
getClient()
Returns an object representing the client device that the user connects to the portal with. |
protected ClientWrapper |
getClientWrapper()
Use this method to return a wrapped client instead of the getClient method |
PortletData |
getData()
Returns the data of the concrete portlet instance |
Portlet.Mode |
getMode()
Returns the mode that the portlet is running in. |
protected PortletRequest |
getPortletRequest()
Returns the wrapped ServletRequest object. |
PortletSession |
getPortletSession()
Returns the current session for the portlet or, if there is no current portlet session, creates one and returns it. |
PortletSession |
getPortletSession(boolean create)
Returns the current session for the portlet or, if there is no current portlet session and the given flag is true , creates one and returns
it. |
PortletSettings |
getPortletSettings()
Returns the PortletSettings object of the concrete portlet. |
Portlet.Mode |
getPreviousMode()
Returns the last mode that is kept for this portlet on the mode stack, or null if no previous mode exists. |
User |
getUser()
Returns the user object. |
PortletWindow |
getWindow()
Returns the window that the portlet is running in. |
void |
invalidateCache()
Invalidates the cache for all window states, markups and locals |
void |
setModeModifier(Portlet.ModeModifier modeModifier)
Defines which portlet mode is shown next. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.jetspeed.portlet.PortletRequest |
---|
getAttribute, getAttributeNames, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getInputStream, getIntHeader, getLocale, getLocales, getMethod, getParameter, getParameterMap, getParameterNames, getParameterValues, isSecure, removeAttribute, setAttribute |
Constructor Detail |
---|
public PortletRequestWrapper(PortletRequest portletRequest)
portletRequest
- the portlet request
java.lang.IllegalArgumentException
- if the request is nullMethod Detail |
---|
protected PortletRequest getPortletRequest()
public Portlet.Mode getMode()
PortletRequest
getMode
in interface PortletRequest
public Portlet.Mode getPreviousMode()
PortletRequest
null
if no previous mode exists.
Note that the result is not necessarily the last mode that this
portlet was running in. For example, if the portlet starts in view
mode, changes to edit mode and then goes back to view mode through
a return URL or by using PortletMode.ModeModifier.PREVIOUS
,
then getPreviousMode
will return null
because the edit mode has already been removed from the stack.
getPreviousMode
in interface PortletRequest
public void setModeModifier(Portlet.ModeModifier modeModifier) throws AccessDeniedException
PortletRequest
Portlet.ModeModifier.REQUESTED
.
This function may only be used during event processing, in any other case the call has no effect.
setModeModifier
in interface PortletRequest
modeModifier
- the mode modifier
AccessDeniedException
- if the portlet tries to access this function
outside of the action event processingpublic final Client getClient()
PortletRequest
getClient
in interface PortletRequest
protected ClientWrapper getClientWrapper()
Client
public PortletWindow getWindow()
PortletRequest
getWindow
in interface PortletRequest
public PortletData getData()
PortletRequest
If the portlet is run in CONFIGURE mode, the
portlet data is not accessible and this method will
return null
.
getData
in interface PortletRequest
public User getUser()
PortletRequest
If the user has not logged in or does not grant access to
the portlet, this method returns null
.
getUser
in interface PortletRequest
public PortletSession getPortletSession()
PortletRequest
This method should not be called when no portal session exists, i.e. when no user is logged in and the portlet is viewed on an anonymous page. In this case, the result may be a temporary session and session contents will be lost after the request completes.
getPortletSession
in interface PortletRequest
public PortletSession getPortletSession(boolean create)
PortletRequest
true
, creates one and returns
it.
If the given flag is false
and there is no current session for the
portal, this method returns null
. If a session exists for the portal,
but the portlet has not yet requested a session, a new portlet session will be
created.
This method should not be called with an argument value of true
when no
portal session exists, i.e. when no user is
logged in and the portlet is viewed on an anonymous page. In this case, the result may
be a temporary session and session contents will be lost after the request completes.
getPortletSession
in interface PortletRequest
create
- true
always return a portlet session, even if none exists and
only a temporary session can be created.
false
return null
if there is no current session
for the portal. Never return a temporary session.
public PortletSettings getPortletSettings()
PortletRequest
PortletSettings
object of the concrete portlet.
getPortletSettings
in interface PortletRequest
public void invalidateCache()
PortletRequest
invalidateCache
in interface PortletRequest
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |