com.ibm.portal.state.accessors.url
Interface URLAccessorFactory

All Superinterfaces:
AccessorFactory

public interface URLAccessorFactory
extends AccessorFactory

Factory for obtaining EngineURL objects for a given state or resource URLs pointing to a portal resource. NOTE: This API may only be used in the scope of an HTTP request in WebSphere Portal, i.e. within a theme. The API can not be invoked directly by a custom servlet.

Since:
5.1

Method Summary
 ResourceURLAccessor newResourceURL(javax.servlet.http.HttpServletRequest req)
          Deprecated. Creates an accessor object that can generate links to resources in the portal application.
 ResourceURLAccessor newResourceURL(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Creates an accessor object that can generate links to resources in the portal application.
 ResourceURLAccessor newResourceURL(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, StateHolder state)
          Deprecated. Creates an accessor object that can generate links to resources in the portal application.
 ResourceURLAccessor newResourceURL(javax.servlet.http.HttpServletRequest req, StateHolder state)
          Deprecated. Creates an accessor object that can generate links to resources in the portal application.
 ResourceURLAccessor newResourceURL(ServerContext serverContext, java.util.Locale locale, javax.ccpp.Profile profile, boolean isSecure)
          Creates a resource URL accessor that can generate links to generic resources such as files, icons, voice grammars etc.
 ServerContext newServerContext(javax.servlet.http.HttpServletRequest req)
          Constructs a new server context
 EngineURL newURL(javax.servlet.http.HttpServletRequest req, Constants.Clone type)
          Deprecated. Returns a URL object based on the information in the servlet request. The object operates on a copy of the state holder, so setting parameters to the engine URL will not modify the original state.
 EngineURL newURL(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, Constants.Clone type)
          Returns a EngineURL object based on the information in the given servlet request.
 EngineURL newURL(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, ServerContext serverContext, URLContext allowedContext, boolean isSecure, boolean isProtected, StateHolder state, Constants.Clone type)
          Returns a EngineURL object based on explicit host, port and context information.
 EngineURL newURL(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, StateHolder state, Constants.Clone type)
          Returns an EngineURL object based on the information in the given servlet request.
 EngineURL newURL(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, StateHolder state, URLContext allowedContext, Constants.Clone type)
          Returns an EngineURL object based on the information in the given servlet request.
 EngineURL newURL(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, URLContext allowedContext, Constants.Clone type)
          Returns a EngineURL object based on the information in the given servlet request.
 EngineURL newURL(javax.servlet.http.HttpServletRequest req, StateHolder state, Constants.Clone type)
          Deprecated. Returns a URL object based on the information in the servlet request. The object operates on a copy of the state holder, so setting parameters to the engine URL will not modify the original state.
 EngineURL newURL(javax.servlet.http.HttpServletRequest req, StateHolder state, URLContext allowedContext, Constants.Clone type)
          Deprecated. Returns a URL object based on the information in the servlet request. The object operates on a copy of the state holder, so setting parameters to the engine URL will not modify the original state.
 EngineURL newURL(javax.servlet.http.HttpServletRequest req, URLContext allowedContext, Constants.Clone type)
          Deprecated. Returns a URL object based on the information in the servlet request. The object operates on a copy of the state holder, so setting parameters to the engine URL will not modify the original state.
 EngineURL newURL(ServerContext context, boolean isSecure, boolean isProtected, StateHolder state, Constants.Clone type)
          Returns a EngineURL object based on explicit host, port and context information.
 EngineURL newURL(ServerContext serverContext, URLContext allowedContext, boolean isSecure, boolean isProtected, StateHolder state, Constants.Clone type)
          Returns a EngineURL object based on explicit host, port and context information.
 
Methods inherited from interface com.ibm.portal.state.accessors.AccessorFactory
compact
 

Method Detail

newResourceURL

@Deprecated
ResourceURLAccessor newResourceURL(javax.servlet.http.HttpServletRequest req)
                                   throws StateNotInRequestException,
                                          ResourceUrlException
Deprecated. Creates an accessor object that can generate links to resources in the portal application.

Parameters:
req - the current servlet request
Returns:
a resource URL accessor
Throws:
StateNotInRequestException - - if no state could be associated with the request
ResourceUrlException - - if the URL accessor could not be initialized

newResourceURL

ResourceURLAccessor newResourceURL(javax.servlet.http.HttpServletRequest req,
                                   javax.servlet.http.HttpServletResponse resp)
                                   throws ResourceUrlException
Creates an accessor object that can generate links to resources in the portal application.

Parameters:
req - the current servlet request
resp - servlet response, required to perform encodeURL
Returns:
a resource URL accessor
Throws:
ResourceUrlException - - if the URL accessor could not be initialized

newResourceURL

@Deprecated
ResourceURLAccessor newResourceURL(javax.servlet.http.HttpServletRequest req,
                                              javax.servlet.http.HttpServletResponse resp,
                                              StateHolder state)
                                   throws ResourceUrlException
Deprecated. Creates an accessor object that can generate links to resources in the portal application.

Parameters:
req - the current servlet request
resp - servlet response, required to perform encodeURL
state - the state that specifies the current theme, must not be null
Returns:
a resource URL accessor
Throws:
ResourceUrlException - - if the URL accessor could not be initialized

newResourceURL

@Deprecated
ResourceURLAccessor newResourceURL(javax.servlet.http.HttpServletRequest req,
                                              StateHolder state)
                                   throws ResourceUrlException
Deprecated. Creates an accessor object that can generate links to resources in the portal application.

Parameters:
req - the current servlet request
state - the state that specifies the current theme, must not be null
Returns:
a resource URL accessor
Throws:
ResourceUrlException - - if the URL accessor could not be initialized

newResourceURL

ResourceURLAccessor newResourceURL(ServerContext serverContext,
                                   java.util.Locale locale,
                                   javax.ccpp.Profile profile,
                                   boolean isSecure)
                                   throws ResourceUrlException
Creates a resource URL accessor that can generate links to generic resources such as files, icons, voice grammars etc.
Note that when using this method, the returned accessor will generate the URL using the given ServerContext.

Parameters:
serverContext - The ServerContext providing server-related information (e.g. hostname, port etc.). Must not be null.
locale - Locale which is needed to create resource URLs that address locale-specific resources (e.g. icons). May be null.
profile - CCPP profile that characterizes the capabilities of a certain user agent. May be null.
isSecure - Boolean flag specifying whether the resource URL should be served using a secure connection (https).
Returns:
A new ResouceURLAccessor serving as a factory for resource URLs. Not null.
Throws:
ResourceUrlException - If the ResourceURLAccessor cannot be created and initialized properly.

newURL

@Deprecated
EngineURL newURL(javax.servlet.http.HttpServletRequest req,
                            Constants.Clone type)
                 throws CannotCloneDocumentModelException,
                        CannotCreateDocumentException,
                        StateNotInRequestException,
                        InvalidConstantException
Deprecated. Returns a URL object based on the information in the servlet request. The object operates on a copy of the state holder, so setting parameters to the engine URL will not modify the original state.

Parameters:
req - servlet request to retrieve server, portal and context information from
type - type of the clone operation to get a copy of the state holder for the URL, may be null in which case a SMART_COPY will be generated.
Returns:
engine URL object
Throws:
CannotCloneDocumentModelException - - if the state could not be cloned
CannotCreateDocumentException - - if a wrapper around the state could not be created
InvalidConstantException - - if the clone type is not supported
StateNotInRequestException - - if no state could be associated with the request

newURL

EngineURL newURL(javax.servlet.http.HttpServletRequest req,
                 javax.servlet.http.HttpServletResponse resp,
                 Constants.Clone type)
                 throws CannotCloneDocumentModelException,
                        CannotCreateDocumentException,
                        StateNotInRequestException,
                        InvalidConstantException
Returns a EngineURL object based on the information in the given servlet request. The object operates on a copy of the request-specific state holder, so setting parameters to the engine URL will not modify the original request-specific state.

Parameters:
req - The servlet request to retrieve server, portal and context information from. Must not be null.
resp - The servlet response, required to perform encodeURL. Must not be null.
type - Type of the clone operation to get a copy of the state holder for the URL. May be null in which case a SMART_COPY will be generated.
Returns:
An EngineURL object. Not null.
Throws:
CannotCloneDocumentModelException - If the state could not be cloned.
CannotCreateDocumentException - If a wrapper around the state could not be created.
InvalidConstantException - If the clone type is not supported.
StateNotInRequestException - If no state could be associated with the request.

newURL

EngineURL newURL(javax.servlet.http.HttpServletRequest req,
                 javax.servlet.http.HttpServletResponse resp,
                 ServerContext serverContext,
                 URLContext allowedContext,
                 boolean isSecure,
                 boolean isProtected,
                 StateHolder state,
                 Constants.Clone type)
                 throws CannotCloneDocumentModelException,
                        CannotCreateDocumentException,
                        InvalidConstantException
Returns a EngineURL object based on explicit host, port and context information. The object operates on a copy of the state holder, so setting parameters to the engine URL will not modify the original state.
The allowedContext argument refers to the type of the URL to be generated i.e. it specifies whether the created URL may be absolute, server-relative or relative. Note that this argument cannot enforce that the URL is server-relative or relative. For example in case of a protocol switch (e.g. http to https), the URL must be absolute in any case.

Parameters:
serverContext - Specifies the needed server information. Must not be null.
allowedContext - Specifies the type (absolute, server-relative, or relative) of the URL that should be generated. Must not be null.
isSecure - Boolean flag indicating whether the generated URL should by default result in a secure connection using the https protocol. true implies the https protocol, false http.
isProtected - Boolean flag indicating whether the generated URL should by default point to the protected portal domain or not. true means that the URL points to the protected domain, false that it addresses the public domain.
state - Original state holder the URL should be based on. May be null.
type - Type of the clone operation to get a copy of the state holder for the URL. May be null in which case a Constants.Clone.SMART_COPY will be generated.
Returns:
The created EngineURL object. Not null.
Throws:
CannotCloneDocumentModelException - If the state could not be cloned.
CannotCreateDocumentException - If the wrapper around the state could not be created.
InvalidConstantException - If the given clone type is not supported.
Since:
6.1.0

newURL

EngineURL newURL(javax.servlet.http.HttpServletRequest req,
                 javax.servlet.http.HttpServletResponse resp,
                 StateHolder state,
                 Constants.Clone type)
                 throws CannotCloneDocumentModelException,
                        CannotCreateDocumentException,
                        InvalidConstantException
Returns an EngineURL object based on the information in the given servlet request. The object operates on a copy of the given state holder, so setting parameters to the engine URL will not modify the original state.

Parameters:
req - The servlet request to retrieve server, portal and context information from. Must not be null.
resp - The servlet response, required to perform encodeURL. Must not be null.
state - The original state holder that should be cloned for this URL. Must not be null.
type - Type of the clone operation to get a copy of the state holder for the URL. May be null in which case a SMART_COPY will be generated.
Returns:
An EngineURL object. Not null.
Throws:
CannotCloneDocumentModelException - If the state could not be cloned.
CannotCreateDocumentException - If a wrapper around the state could not be created.
InvalidConstantException - If the clone type is not supported.

newURL

EngineURL newURL(javax.servlet.http.HttpServletRequest req,
                 javax.servlet.http.HttpServletResponse resp,
                 StateHolder state,
                 URLContext allowedContext,
                 Constants.Clone type)
                 throws CannotCloneDocumentModelException,
                        CannotCreateDocumentException,
                        InvalidConstantException
Returns an EngineURL object based on the information in the given servlet request. The object operates on a copy of the given state holder, so setting parameters to the engine URL will not modify the original state.

Parameters:
req - The servlet request to retrieve server, portal and context information from. Must not be null.
resp - The servlet response, required to perform encodeURL. Must not be null.
state - The original state holder that should be cloned for this URL. Must not be null.
allowedContext - Context object specifying the type of the requested URL (absolute, server-relative, or relative). May be null to indicate that the server's default URL context should be used.
type - Type of the clone operation to get a copy of the state holder for the URL. May be null in which case a SMART_COPY will be generated.
Returns:
An EngineURL object. Not null.
Throws:
CannotCloneDocumentModelException - If the state could not be cloned.
CannotCreateDocumentException - If a wrapper around the state could not be created.
InvalidConstantException - If the clone type is not supported.

newURL

EngineURL newURL(javax.servlet.http.HttpServletRequest req,
                 javax.servlet.http.HttpServletResponse resp,
                 URLContext allowedContext,
                 Constants.Clone type)
                 throws CannotCloneDocumentModelException,
                        CannotCreateDocumentException,
                        StateNotInRequestException,
                        InvalidConstantException
Returns a EngineURL object based on the information in the given servlet request. The object operates on a copy of the request-specific state holder, so setting parameters to the engine URL will not modify the original request-specific state.

Parameters:
req - The servlet request to retrieve server, portal and context information from. Must not be null.
resp - The servlet response, required to perform encodeURL. Must not be null.
allowedContext - Context object specifying the type of the requested URL (absolute, server-relative, or relative). May be null to indicate that the server's default URL context should be used.
type - Type of the clone operation to get a copy of the state holder for the URL. May be null in which case a SMART_COPY will be generated.
Returns:
An EngineURL object. Not null.
Throws:
CannotCloneDocumentModelException - If the state could not be cloned.
CannotCreateDocumentException - If a wrapper around the state could not be created.
InvalidConstantException - If the clone type is not supported.
StateNotInRequestException - If no state could be associated with the request.

newURL

@Deprecated
EngineURL newURL(javax.servlet.http.HttpServletRequest req,
                            StateHolder state,
                            Constants.Clone type)
                 throws CannotCloneDocumentModelException,
                        CannotCreateDocumentException,
                        InvalidConstantException
Deprecated. Returns a URL object based on the information in the servlet request. The object operates on a copy of the state holder, so setting parameters to the engine URL will not modify the original state.

Parameters:
req - servlet request to retrieve server, portal and context information from (must not be null)
state - original state holder (must not be null)
type - type of the clone operation to get a copy of the state holder for the URL, may be null in which case a SMART_COPY will be generated.
Returns:
engine URL object
Throws:
CannotCloneDocumentModelException - - if the state could not be cloned
CannotCreateDocumentException - - if a wrapper around the state could not be created
InvalidConstantException - - if the clone type is not supported

newURL

@Deprecated
EngineURL newURL(javax.servlet.http.HttpServletRequest req,
                            StateHolder state,
                            URLContext allowedContext,
                            Constants.Clone type)
                 throws CannotCloneDocumentModelException,
                        CannotCreateDocumentException,
                        InvalidConstantException
Deprecated. Returns a URL object based on the information in the servlet request. The object operates on a copy of the state holder, so setting parameters to the engine URL will not modify the original state.

Parameters:
req - servlet request to retrieve server, portal and context information from (must not be null)
state - original state holder (must not be null)
type - type of the clone operation to get a copy of the state holder for the URL, may be null in which case a SMART_COPY will be generated.
allowedContext - specifies what type of URLs may be generated. May be null to not limit the URL generation
Returns:
engine URL object
Throws:
CannotCloneDocumentModelException - - if the state could not be cloned
CannotCreateDocumentException - - if a wrapper around the state could not be created
InvalidConstantException - - if the clone type is not supported

newURL

@Deprecated
EngineURL newURL(javax.servlet.http.HttpServletRequest req,
                            URLContext allowedContext,
                            Constants.Clone type)
                 throws CannotCloneDocumentModelException,
                        CannotCreateDocumentException,
                        StateNotInRequestException,
                        InvalidConstantException
Deprecated. Returns a URL object based on the information in the servlet request. The object operates on a copy of the state holder, so setting parameters to the engine URL will not modify the original state.

Parameters:
req - servlet request to retrieve server, portal and context information from
type - type of the clone operation to get a copy of the state holder for the URL, may be null in which case a SMART_COPY will be generated.
allowedContext - specifies what type of URLs may be generated. May be null to not limit the URL generation
Returns:
engine URL object
Throws:
CannotCloneDocumentModelException - - if the state could not be cloned
CannotCreateDocumentException - - if a wrapper around the state could not be created
InvalidConstantException - - if the clone type is not supported
StateNotInRequestException - - if no state could be associated with the request

newURL

EngineURL newURL(ServerContext context,
                 boolean isSecure,
                 boolean isProtected,
                 StateHolder state,
                 Constants.Clone type)
                 throws CannotCloneDocumentModelException,
                        CannotCreateDocumentException,
                        InvalidConstantException
Returns a EngineURL object based on explicit host, port and context information. The object operates on a copy of the state holder, so setting parameters to the engine URL will not modify the original state. Note that the created URL will be absolute.

Parameters:
context - Specifies the needed server information. Must not be null.
isSecure - Boolean flag indicating whether the generated URL should by default result in a secure connection using the https protocol. true implies the https protocol, false http.
isProtected - Boolean flag indicating whether the generated URL should by default point to the protected portal domain or not. true means that the URL points to the protected domain, false that it addresses the public domain.
state - Original state holder the URL should be based on. May be null.
type - Type of the clone operation to get a copy of the state holder for the URL. May be null in which case a Constants.Clone.SMART_COPY will be generated.
Returns:
The created EngineURL object. Not null.
Throws:
CannotCloneDocumentModelException - If the state could not be cloned.
CannotCreateDocumentException - If the wrapper around the state could not be created.
InvalidConstantException - If the given clone type is not supported.

newURL

EngineURL newURL(ServerContext serverContext,
                 URLContext allowedContext,
                 boolean isSecure,
                 boolean isProtected,
                 StateHolder state,
                 Constants.Clone type)
                 throws CannotCloneDocumentModelException,
                        CannotCreateDocumentException,
                        InvalidConstantException
Returns a EngineURL object based on explicit host, port and context information. The object operates on a copy of the state holder, so setting parameters to the engine URL will not modify the original state.
The allowedContext argument refers to the type of the URL to be generated i.e. it specifies whether the created URL may be absolute, server-relative or relative. Note that this argument cannot enforce that the URL is server-relative or relative. For example in case of a protocol switch (e.g. http to https), the URL must be absolute in any case.

Parameters:
serverContext - Specifies the needed server information. Must not be null.
allowedContext - Specifies the type (absolute, server-relative, or relative) of the URL that should be generated. Must not be null.
isSecure - Boolean flag indicating whether the generated URL should by default result in a secure connection using the https protocol. true implies the https protocol, false http.
isProtected - Boolean flag indicating whether the generated URL should by default point to the protected portal domain or not. true means that the URL points to the protected domain, false that it addresses the public domain.
state - Original state holder the URL should be based on. May be null.
type - Type of the clone operation to get a copy of the state holder for the URL. May be null in which case a Constants.Clone.SMART_COPY will be generated.
Returns:
The created EngineURL object. Not null.
Throws:
CannotCloneDocumentModelException - If the state could not be cloned.
CannotCreateDocumentException - If the wrapper around the state could not be created.
InvalidConstantException - If the given clone type is not supported.

newServerContext

ServerContext newServerContext(javax.servlet.http.HttpServletRequest req)
                               throws StateException
Constructs a new server context

Parameters:
req -
Returns:
Throws:
StateException
Since:
8.0