Package lumis.portal.url
Class PageWebResourceRequest
- java.lang.Object
-
- javax.servlet.ServletRequestWrapper
-
- javax.servlet.http.HttpServletRequestWrapper
-
- lumis.portal.url.PageWebResourceRequest
-
- All Implemented Interfaces:
HttpServletRequest
,ServletRequest
,IPageWebResourceRequest
- Direct Known Subclasses:
PageWebResourceRenderRequest
,ServiceContainerRequest
public class PageWebResourceRequest extends HttpServletRequestWrapper implements IPageWebResourceRequest
AIServiceInterfaceRequest
implementation that is used by the service container.- Since:
- 8.2.0
- Version:
- $Revision: 18135 $ $Date: 2015-12-15 17:31:03 -0200 (Tue, 15 Dec 2015) $
-
-
Field Summary
Fields Modifier and Type Field Description protected IPortalMode
mode
-
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
-
-
Constructor Summary
Constructors Constructor Description PageWebResourceRequest(SessionConfig sessionConfig, PageWebResource webResource, HttpServletRequest request, Map<String,FileParameter> fileParameters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getApplicationRequestedPath()
Returns the path requested by the browser relative to the currentwebsite base URL
.Object
getAttribute(String key)
Returns the value of the named attribute as anObject
, ornull
if no attribute of the given name exists.Enumeration<String>
getAttributeNames()
Returns anEnumeration
containing the names of the attributes available to this request.IBusinessContext
getBusinessContext()
Returns the business context for this request.Cookie
getCookie(String cookieName)
Returns the requested cookie ornull
if the cookie does not exist in request.FileParameter
getFileParameter(String parameterName)
Returns the uploaded file by the given parameter name.PageWebResource
getPageWebResource()
Returns thePageWebResource
of this request.String
getParameter(String name)
Returns the value of a request parameter as aString
, ornull
if the parameter does not exist.Map<String,String[]>
getParameterMap()
Returns aMap
of the parameters of this request.Enumeration<String>
getParameterNames()
Returns anEnumeration
ofString
objects containing the names of the parameters contained in this request.String[]
getParameterValues(String name)
Returns an array ofString
objects containing all of the values the given request parameter has, ornull
if the parameter does not exist.IPortalMode
getPortalMode()
Returns the requested portal mode.SessionConfig
getSessionConfig()
Returns the session of the user that has performed the request.IWebsiteBaseURL
getWebsiteBaseURL()
Returns the website's base URL accessed to generate this request.boolean
isPageCachedInFile()
Returns whether the requested page is cached in file.boolean
isPreview()
Returns whether the request is in preview mode.void
removeAttribute(String key)
Removes an attribute from this request.void
setAttribute(String key, Object value)
Stores an attribute in this request.protected void
setPageWebResource(PageWebResource pageWebResource)
Sets the page web resource.-
Methods inherited from class javax.servlet.http.HttpServletRequestWrapper
authenticate, getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPart, getParts, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole, login, logout
-
Methods inherited from class javax.servlet.ServletRequestWrapper
getAsyncContext, getCharacterEncoding, getContentLength, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, isWrapperFor, isWrapperFor, setCharacterEncoding, setRequest, startAsync, startAsync
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface lumis.portal.url.IPageWebResourceRequest
getContextPath, getCookies, getHeader, getScheme, getServerName, getServerPort, isSecure
-
Methods inherited from interface javax.servlet.ServletRequest
getAsyncContext, getCharacterEncoding, getContentLength, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, setCharacterEncoding, startAsync, startAsync
-
-
-
-
Field Detail
-
mode
protected IPortalMode mode
-
-
Constructor Detail
-
PageWebResourceRequest
public PageWebResourceRequest(SessionConfig sessionConfig, PageWebResource webResource, HttpServletRequest request, Map<String,FileParameter> fileParameters)
-
-
Method Detail
-
getParameter
public String getParameter(String name)
Description copied from interface:IPageWebResourceRequest
Returns the value of a request parameter as aString
, ornull
if the parameter does not exist. Request parameters are extra information sent with the request. The returned parameter are "x-www-form-urlencoded" decoded.This method should only be used if the parameter has only one value. If the parameter might have more than one value, use
IPageWebResourceRequest.getParameterValues(java.lang.String)
.If this method is used with a multivalued parameter, the value returned is equal to the first value in the array returned by
getParameterValues
.- Specified by:
getParameter
in interfaceIPageWebResourceRequest
- Specified by:
getParameter
in interfaceServletRequest
- Overrides:
getParameter
in classServletRequestWrapper
- Parameters:
name
- aString
specifying the name of the parameter- Returns:
- a
String
representing the single value of the parameter - See Also:
IPageWebResourceRequest.getParameterValues(java.lang.String)
-
getParameterNames
public Enumeration<String> getParameterNames()
Description copied from interface:IPageWebResourceRequest
Returns anEnumeration
ofString
objects containing the names of the parameters contained in this request. If the request has no parameters, the method returns an emptyEnumeration
.- Specified by:
getParameterNames
in interfaceIPageWebResourceRequest
- Specified by:
getParameterNames
in interfaceServletRequest
- Overrides:
getParameterNames
in classServletRequestWrapper
- Returns:
- an
Enumeration
ofString
objects, eachString
containing the name of a request parameter; or an emptyEnumeration
if the request has no parameters.
-
getParameterValues
public String[] getParameterValues(String name)
Description copied from interface:IPageWebResourceRequest
Returns an array ofString
objects containing all of the values the given request parameter has, ornull
if the parameter does not exist. The returned parameters are "x-www-form-urlencoded" decoded.If the parameter has a single value, the array has a length of 1.
- Specified by:
getParameterValues
in interfaceIPageWebResourceRequest
- Specified by:
getParameterValues
in interfaceServletRequest
- Overrides:
getParameterValues
in classServletRequestWrapper
- Parameters:
name
- aString
containing the name of the parameter the value of which is requested- Returns:
- an array of
String
objects containing the parameter values. - See Also:
IPageWebResourceRequest.getParameter(java.lang.String)
-
getParameterMap
public Map<String,String[]> getParameterMap()
Description copied from interface:IPageWebResourceRequest
Returns aMap
of the parameters of this request. Request parameters are extra information sent with the request. The returned parameters are "x-www-form-urlencoded" decoded.The values in the returned
Map
are from type String array (String[]
).If no parameters exist this method returns an empty
Map
.- Specified by:
getParameterMap
in interfaceIPageWebResourceRequest
- Specified by:
getParameterMap
in interfaceServletRequest
- Overrides:
getParameterMap
in classServletRequestWrapper
- Returns:
- an immutable
Map
containing parameter names as keys and parameter values as map values, or an emptyMap
if no parameters exist. The keys in the parameter map are of type String. The values in the parameter map are of type String array (String[]
).
-
getAttributeNames
public Enumeration<String> getAttributeNames()
Description copied from interface:IPageWebResourceRequest
Returns anEnumeration
containing the names of the attributes available to this request. This method returns an emptyEnumeration
if the request has no attributes available to it.- Specified by:
getAttributeNames
in interfaceIPageWebResourceRequest
- Specified by:
getAttributeNames
in interfaceServletRequest
- Overrides:
getAttributeNames
in classServletRequestWrapper
- Returns:
- an
Enumeration
of strings containing the names of the request attributes, or an emptyEnumeration
if the request has no attributes available to it.
-
getAttribute
public Object getAttribute(String key)
Description copied from interface:IPageWebResourceRequest
Returns the value of the named attribute as anObject
, ornull
if no attribute of the given name exists.- Specified by:
getAttribute
in interfaceIPageWebResourceRequest
- Specified by:
getAttribute
in interfaceServletRequest
- Overrides:
getAttribute
in classServletRequestWrapper
- Parameters:
key
- aString
specifying the name of the attribute- Returns:
- an
Object
containing the value of the attribute, ornull
if the attribute does not exist.
-
setAttribute
public void setAttribute(String key, Object value)
Description copied from interface:IPageWebResourceRequest
Stores an attribute in this request.- Specified by:
setAttribute
in interfaceIPageWebResourceRequest
- Specified by:
setAttribute
in interfaceServletRequest
- Overrides:
setAttribute
in classServletRequestWrapper
- Parameters:
key
- aString
specifying the name of the attributevalue
- theObject
to be stored
-
removeAttribute
public void removeAttribute(String key)
Description copied from interface:IPageWebResourceRequest
Removes an attribute from this request. This method is not generally needed, as attributes only persist as long as the request is being handled.- Specified by:
removeAttribute
in interfaceIPageWebResourceRequest
- Specified by:
removeAttribute
in interfaceServletRequest
- Overrides:
removeAttribute
in classServletRequestWrapper
- Parameters:
key
- aString
specifying the name of the attribute to be removed
-
getPageWebResource
public PageWebResource getPageWebResource()
Description copied from interface:IPageWebResourceRequest
Returns thePageWebResource
of this request.- Specified by:
getPageWebResource
in interfaceIPageWebResourceRequest
- Returns:
- the
PageWebResource
of this request.
-
getWebsiteBaseURL
public IWebsiteBaseURL getWebsiteBaseURL()
Description copied from interface:IPageWebResourceRequest
Returns the website's base URL accessed to generate this request.- Specified by:
getWebsiteBaseURL
in interfaceIPageWebResourceRequest
- Returns:
- the website base URL.
-
getSessionConfig
public SessionConfig getSessionConfig()
Description copied from interface:IPageWebResourceRequest
Returns the session of the user that has performed the request.- Specified by:
getSessionConfig
in interfaceIPageWebResourceRequest
- Returns:
- the session of the user that has performed the request.
-
getCookie
public Cookie getCookie(String cookieName)
Description copied from interface:IPageWebResourceRequest
Returns the requested cookie ornull
if the cookie does not exist in request.- Specified by:
getCookie
in interfaceIPageWebResourceRequest
- Parameters:
cookieName
- the requested cookie name.- Returns:
- the requested cookie or
null
if the cookie does not exist in request.
-
getFileParameter
public FileParameter getFileParameter(String parameterName)
Description copied from interface:IPageWebResourceRequest
Returns the uploaded file by the given parameter name.- Specified by:
getFileParameter
in interfaceIPageWebResourceRequest
- Parameters:
parameterName
- the parameter name.- Returns:
- the uploaded file by the given parameter name
-
isPreview
public boolean isPreview()
Description copied from interface:IPageWebResourceRequest
Returns whether the request is in preview mode.- Specified by:
isPreview
in interfaceIPageWebResourceRequest
- Returns:
- whether the request is in preview mode.
-
getBusinessContext
public IBusinessContext getBusinessContext()
Description copied from interface:IPageWebResourceRequest
Returns the business context for this request.- Specified by:
getBusinessContext
in interfaceIPageWebResourceRequest
- Returns:
- the business context.
-
getPortalMode
public IPortalMode getPortalMode()
Description copied from interface:IPageWebResourceRequest
Returns the requested portal mode.- Specified by:
getPortalMode
in interfaceIPageWebResourceRequest
- Returns:
- the requested portal mode.
-
isPageCachedInFile
public boolean isPageCachedInFile()
Description copied from interface:IPageWebResourceRequest
Returns whether the requested page is cached in file.- Specified by:
isPageCachedInFile
in interfaceIPageWebResourceRequest
- Returns:
- whether the requested page is cached in file.
-
getApplicationRequestedPath
public String getApplicationRequestedPath()
Description copied from interface:IPageWebResourceRequest
Returns the path requested by the browser relative to the currentwebsite base URL
.- Specified by:
getApplicationRequestedPath
in interfaceIPageWebResourceRequest
- Returns:
- the path requested by the browser relative to the current
website base URL
.
-
setPageWebResource
protected void setPageWebResource(PageWebResource pageWebResource)
Sets the page web resource.- Parameters:
pageWebResource
- the page web resource.- Since:
- 8.2.0
-
-