org.apache.jetspeed.portlet
Interface PortletRequest

All Known Implementing Classes:
PortletRequestWrapper

Deprecated. since 6.0. Support of the IBM portlet API may be removed in a future release of WebSphere Portal. Use of the Java Portlet API (javax.portlet) is recommended instead.

public interface PortletRequest

The PortletRequest encapsulates the request sent by the client to the portlet.

Since:
4.1
See Also:
PortletResponse

Method Summary
 java.lang.Object getAttribute(java.lang.String name)
          Deprecated. Returns the value of the attribute with the given name, or null if no attribute with the given name exists.
 java.util.Enumeration getAttributeNames()
          Deprecated. Returns an enumeration of names of all attributes available to this request.
 Client getClient()
          Deprecated. Returns an object representing the client device that the user connects to the portal with.
 javax.servlet.http.Cookie[] getCookies()
          Deprecated. Returns an array containing all of the Cookie objects the client sent with this request.
 PortletData getData()
          Deprecated. Returns the data of the concrete portlet instance
 long getDateHeader(java.lang.String name)
          Deprecated. Returns the value of the specified request header as a long value that represents a Date object.
 java.lang.String getHeader(java.lang.String name)
          Deprecated. Returns the value of the specified request header as a String.
 java.util.Enumeration getHeaderNames()
          Deprecated. Returns an enumeration of all the header names this request contains.
 java.util.Enumeration getHeaders(java.lang.String name)
          Deprecated. Returns all the values of the specified request header as an Enumeration of String objects.
 javax.servlet.ServletInputStream getInputStream()
          Deprecated. Retrieves the body of the request as binary data using an InputStream.
 int getIntHeader(java.lang.String name)
          Deprecated. Returns the value of the specified request header as an int.
 java.util.Locale getLocale()
          Deprecated. Returns the locale of the preferred language.
 java.util.Enumeration getLocales()
          Deprecated. Returns an Enumeration of Locale objects indicating, in decreasing order starting with the preferred locale, the locales that are acceptable to the client based on the Accept-Language header.
 java.lang.String getMethod()
          Deprecated. Returns the HTTP method of this request.
 Portlet.Mode getMode()
          Deprecated. Returns the mode that the portlet is running in.
 java.lang.String getParameter(java.lang.String name)
          Deprecated. Returns the value of the parameter with the given name, or null if no such parameter exists.
 java.util.Map getParameterMap()
          Deprecated. Returns a map of the parameters of this request.
 java.util.Enumeration getParameterNames()
          Deprecated. Returns an enumeration of all parameter names.
 java.lang.String[] getParameterValues(java.lang.String name)
          Deprecated. Returns the values of all parameters with the given name.
 PortletSession getPortletSession()
          Deprecated. Returns the current session for the portlet or, if there is no current portlet session, creates one and returns it.
 PortletSession getPortletSession(boolean create)
          Deprecated. 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()
          Deprecated. Returns the PortletSettings object of the concrete portlet.
 Portlet.Mode getPreviousMode()
          Deprecated. Returns the last mode that is kept for this portlet on the mode stack, or null if no previous mode exists.
 User getUser()
          Deprecated. Returns the user object.
 PortletWindow getWindow()
          Deprecated. Returns the window that the portlet is running in.
 void invalidateCache()
          Deprecated. Invalidates the cache for all window states, markups and locals
 boolean isSecure()
          Deprecated. Returns whether this request was made using a secure channel, such as HTTPS.
 void removeAttribute(java.lang.String name)
          Deprecated. Removes the attribute with the given name.
 void setAttribute(java.lang.String name, java.lang.Object value)
          Deprecated. Associates an attribute with the given name and value with this request.
 void setModeModifier(Portlet.ModeModifier modeModifier)
          Deprecated. Defines which portlet mode is shown next.
 

Method Detail

getMode

Portlet.Mode getMode()
Deprecated. 
Returns the mode that the portlet is running in.

Returns:
the portlet mode

getPreviousMode

Portlet.Mode getPreviousMode()
Deprecated. 
Returns the last mode that is kept for this portlet on the mode stack, or 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.

Returns:
the previous portlet mode

setModeModifier

void setModeModifier(Portlet.ModeModifier modeModifier)
                     throws AccessDeniedException
Deprecated. 
Defines which portlet mode is shown next. Once the mode is changed it cannot be changed back to Portlet.ModeModifier.REQUESTED.

This function may only be used during event processing, in any other case the call has no effect.

Parameters:
modeModifier - the mode modifier
Throws:
AccessDeniedException - if the portlet tries to access this function outside of the action event processing

getMethod

java.lang.String getMethod()
Deprecated. 
Returns the HTTP method of this request. The most commonly used request methods are GET and POST.

Returns:
the method

getInputStream

javax.servlet.ServletInputStream getInputStream()
                                                throws java.io.IOException
Deprecated. 
Retrieves the body of the request as binary data using an InputStream.

Returns:
an input stream containing the body of the request
Throws:
java.lang.IllegalStateException - if the portlet tries to access this function outside of the action event processing
java.io.IOException - if an input or output exception occurred

getLocale

java.util.Locale getLocale()
Deprecated. 
Returns the locale of the preferred language. The preference is based on the user's choice of language(s) and/or the client's Accept-Language header.

If more than one language is preferred, the locale returned by this method is the one with the highest preference.

Returns:
the locale of the preferred language

getLocales

java.util.Enumeration getLocales()
Deprecated. 
Returns an Enumeration of Locale objects indicating, in decreasing order starting with the preferred locale, the locales that are acceptable to the client based on the Accept-Language header. If the client request doesn't provide an Accept-Language header, this method returns an Enumeration containing one Locale, the default locale for the server.

Returns:
an Enumeration of preferred Locale objects for the client

getClient

Client getClient()
Deprecated. 
Returns an object representing the client device that the user connects to the portal with.

Returns:
the client

getParameter

java.lang.String getParameter(java.lang.String name)
Deprecated. 
Returns the value of the parameter with the given name, or null if no such parameter exists.

You should only use this method when you are sure the parameter has only one value. If not, use getParameterValues(String)

All parameter retrieval methods check for parameters that are namespaced by the portlet and for paramters that are not namespaced. If both exist, the namespaced parameter values are returned

Parameters:
name - the parameter name
Returns:
the parameter value
See Also:
getParameterMap(), getParameterValues(String)

getParameterMap

java.util.Map getParameterMap()
Deprecated. 
Returns a map of the parameters of this request.

All parameter retrieval methods check for parameters that are namespaced by the portlet and for paramters that are not namespaced. If both exist, the namespaced parameter values are returned

Note that, for historical reasons, the values of the returned map are Strings and not String arrays, altough this is is inconsistent with the behavior defined by javax.servlet.ServletRequest

Returns:
a map of parameters; maps from String to String
See Also:
getParameter(String), getParameterValues(String)

getParameterNames

java.util.Enumeration getParameterNames()
Deprecated. 
Returns an enumeration of all parameter names. If this request

All parameter retrieval methods check for parameters that are namespaced by the portlet and for paramters that are not namespaced.

Returns:
the enumeration

getParameterValues

java.lang.String[] getParameterValues(java.lang.String name)
Deprecated. 
Returns the values of all parameters with the given name.

A request can carry more than one parameter with a certain name. This method returns these parameters in the order of appearance.

All parameter retrieval methods check for parameters that are namespaced by the portlet and for paramters that are not namespaced. If both exist, the namespaced parameter values are returned

Note that, for historical reasons, this method returns an empty String array and not null if the specified parameter is not set, altough this is is inconsistent with the behavior defined by javax.servlet.ServletRequest

Parameters:
name - the parameter name
Returns:
the array of parameter values
See Also:
getParameterMap(), getParameter(String)

setAttribute

void setAttribute(java.lang.String name,
                  java.lang.Object value)
Deprecated. 
Associates an attribute with the given name and value with this request. If a portlet needs to communicate information to embedded servlets or JSP, this methods can used carry the information along.

The portlet provider should take care that the the namespace of attribute names is not unnecessarily polluted. It is recommended to prefix all attributes the package and class name of the portlet that makes use of this method.

Parameters:
name - the attribute name
value - the attribute value

removeAttribute

void removeAttribute(java.lang.String name)
Deprecated. 
Removes the attribute with the given name.

Parameters:
name - the name of attribute to be removed

getAttribute

java.lang.Object getAttribute(java.lang.String name)
Deprecated. 
Returns the value of the attribute with the given name, or null if no attribute with the given name exists.

Parameters:
name - the attribute name
Returns:
the attribute value

getAttributeNames

java.util.Enumeration getAttributeNames()
Deprecated. 
Returns an enumeration of names of all attributes available to this request. This method returns an empty enumeration if the request has no attributes available to it.

Returns:
an enumeration of attribute names

isSecure

boolean isSecure()
Deprecated. 
Returns whether this request was made using a secure channel, such as HTTPS.

Returns:
true if channel is secure,
false otherwise

getWindow

PortletWindow getWindow()
Deprecated. 
Returns the window that the portlet is running in.

Returns:
the portlet window

getData

PortletData getData()
Deprecated. 
Returns the data of the concrete portlet instance

If the portlet is run in CONFIGURE mode, the portlet data is not accessible and this method will return null.

Returns:
the portlet data

getPortletSession

PortletSession getPortletSession()
Deprecated. 
Returns the current session for the portlet or, if there is no current portlet session, creates one and returns it.

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.

Returns:
the portlet session

getPortletSession

PortletSession getPortletSession(boolean create)
Deprecated. 
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.

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.

Parameters:
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.
Returns:
the portlet session

getCookies

javax.servlet.http.Cookie[] getCookies()
Deprecated. 
Returns an array containing all of the Cookie objects the client sent with this request. This method returns null if no cookies were sent.

Returns:
an array of all the Cookies included with this request, or null if the request has no cookies

getUser

User getUser()
Deprecated. 
Returns the user object. The user object contains useful information about the user and his or her preferences.

If the user has not logged in or does not grant access to the portlet, this method returns null.

Returns:
the user object

getPortletSettings

PortletSettings getPortletSettings()
Deprecated. 
Returns the PortletSettings object of the concrete portlet.

Returns:
the PortletSettings object, or NULL if no PortletSettings object is available.

getDateHeader

long getDateHeader(java.lang.String name)
Deprecated. 
Returns the value of the specified request header as a long value that represents a Date object. Use this method with headers that contain dates, such as If-Modified-Since.

The date is returned as the number of milliseconds since January 1, 1970 GMT. The header name is case insensitive.

If the request did not have a header of the specified name, this method returns -1. If the header can't be converted to a date, the method throws an IllegalArgumentException.

Parameters:
name - a String specifying the name of the header
Returns:
a long value representing the date specified in the header expressed as the number of milliseconds since January 1, 1970 GMT, or -1 if the named header was not included with the reqest
Throws:
java.lang.IllegalArgumentException - If the header value can't be converted to a date

getHeader

java.lang.String getHeader(java.lang.String name)
Deprecated. 
Returns the value of the specified request header as a String. If the request did not include a header of the specified name, this method returns null. The header name is case insensitive. You can use this method with any request header.

Parameters:
name - a String specifying the header name
Returns:
a String containing the value of the requested header, or null if the request does not have a header of that name

getHeaders

java.util.Enumeration getHeaders(java.lang.String name)
Deprecated. 
Returns all the values of the specified request header as an Enumeration of String objects.

Some headers, such as Accept-Language can be sent by clients as several headers each with a different value rather than sending the header as a comma separated list.

If the request did not include any headers of the specified name, this method returns an empty Enumeration. The header name is case insensitive. You can use this method with any request header.

Parameters:
name - a String specifying the header name
Returns:
a Enumeration containing the values of the requested header, or null if the request does not have any headers of that name

getHeaderNames

java.util.Enumeration getHeaderNames()
Deprecated. 
Returns an enumeration of all the header names this request contains. If the request has no headers, this method returns an empty enumeration.

Some portlet containers do not allow do not allow portlets to access headers using this method, in which case this method returns null

Returns:
an enumeration of all the header names sent with this request; if the request has no headers, an empty enumeration; if the portlet container does not allow portlets to use this method, null

getIntHeader

int getIntHeader(java.lang.String name)
Deprecated. 
Returns the value of the specified request header as an int. If the request does not have a header of the specified name, this method returns -1. If the header cannot be converted to an integer, this method throws a NumberFormatException.

The header name is case insensitive.

Parameters:
name - a String specifying the name of a request header
Returns:
an integer expressing the value of the request header or -1 if the request doesn't have a header of this name
Throws:
java.lang.NumberFormatException - If the header value can't be converted to an int

invalidateCache

void invalidateCache()
Deprecated. 
Invalidates the cache for all window states, markups and locals