|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.portal.struts.common.PortletApiUtils
public abstract class PortletApiUtils
This class provides the APIs for allowing an application to interact with a portal container. The APIs are generic and not specific to the portal container. The utility methods can be used to support classes like tags without creating tight dependencies on the portal container.
Field Summary | |
---|---|
static int |
RETURN_URL
Deprecated. |
protected static boolean |
s_namescopeForm
Indicator of whether or not to namescope the form name. |
protected static boolean |
s_namescopeInputName
Indicator of whether or not to namescope the name attribute of the input element. |
static int |
STANDARD_URL
Deprecated. |
Constructor Summary | |
---|---|
PortletApiUtils()
Constructor for PortletApiUtils. |
Method Summary | |
---|---|
abstract void |
addDefaultPortletAction(java.lang.Object portletURI)
Adds a portlet action to the given PortletURI. |
abstract void |
addDefaultPortletAction(java.lang.Object portletURI,
java.lang.String key)
Adds a portlet action to the given PortletURI using the given key. |
abstract java.lang.String |
addModulePrefix(java.lang.String path,
HttpServletRequest request)
Adds the module prefix to the path. |
abstract void |
addParameter(java.lang.Object portletURI,
java.lang.String key,
java.lang.String value)
Adds the parameter to the given PortletURI. |
abstract void |
addStrutsActionUrlAsParameter(java.lang.Object portletURI,
java.lang.String actionUrl)
Adds the Struts action URL as a parameter to the given PortletURI using the value returned by getStrutsActionParameterName as the parameter name. |
abstract void |
createCommand(java.lang.String path,
HttpServletRequest request)
Creates the IViewCommand object for the path for the specified mode prefix. |
abstract void |
createCommand(java.lang.String path,
HttpServletRequest request,
HttpServletResponse response)
Creates the IViewCommand object for the path for the specified mode prefix. |
abstract void |
createCommand(java.lang.String path,
HttpServletRequest request,
HttpServletResponse response,
java.lang.String commandPrefix)
Creates the IViewCommand object for the path for the specified mode prefix. |
abstract void |
createCommand(java.lang.String path,
HttpServletRequest request,
java.lang.String commandPrefix)
Creates the IViewCommand object for the path for the specified mode prefix. |
java.lang.Object |
createPortletURI(java.lang.Object response)
Creates a Portlet URI from the given response. |
abstract java.lang.Object |
createPortletURI(java.lang.Object response,
int urlType)
Deprecated. |
abstract java.lang.Object |
createPortletURI(java.lang.Object response,
PortletURIAttributes uriAttributes)
Creates a PortletURI for the given response. |
java.lang.Object |
createPortletURIWithStrutsURL(HttpServletRequest request,
java.lang.String actionUrl)
Creates a Struts PortletURI for the given response and URL. |
abstract java.lang.Object |
createPortletURIWithStrutsURL(HttpServletRequest request,
java.lang.String actionUrl,
int urlType)
Deprecated. |
abstract java.lang.Object |
createPortletURIWithStrutsURL(HttpServletRequest request,
java.lang.String actionUrl,
PortletURIAttributes uriAttributes)
Creates the requested type of PortletURI for the given response and URL. |
java.lang.Object |
createPortletURIWithStrutsURL(java.lang.Object response,
java.lang.String actionUrl)
Deprecated. |
abstract java.lang.Object |
createPortletURIWithStrutsURL(java.lang.Object response,
java.lang.String actionUrl,
int urlType)
Deprecated. |
abstract java.lang.Object |
createStrutsPortletURL(HttpServletRequest request,
HttpServletResponse response,
java.lang.String actionUrl,
PortletURIAttributes uriAttributes)
Creates the requested type of PortletURI for the given response and URL. |
abstract java.lang.String |
encodeAction(java.lang.String actionURL,
HttpServletRequest request)
Encodes the Struts action URL so that it can be added as a paramter to the portlet URL. |
abstract java.lang.String |
encodeNamespace(java.lang.String name,
HttpServletRequest request)
Returns the namescoped name. |
abstract java.lang.String |
encodeURL(java.lang.String path,
HttpServletRequest request)
Returns the fully qualified URL from the path. |
abstract java.lang.String |
encodeURL(java.lang.String path,
HttpServletResponse response)
Returns the fully qualified URL from the path. |
abstract void |
forward(java.lang.String uri)
Processes a forward. |
abstract void |
forward(java.lang.String uri,
HttpServletRequest request)
Processes a forward. |
abstract java.lang.String |
getActionMappingURL(java.lang.String action,
PageContext pageContext)
Return the form action converted into a server-relative URL. |
java.lang.String |
getDefaultPortletActionName()
Returns the name of the portlet action for a Struts PortletURI. |
abstract java.lang.String |
getEncodedBeanName(java.lang.String beanName,
HttpServletRequest request)
Returns the encoded bean name with the first character upper-cased if isFormNamescoped returns true. |
abstract java.lang.Object |
getHttpServletRequest(java.lang.Object request)
Gets the HttpServletRequest as an object from the given request object. |
abstract java.lang.Object |
getHttpServletResponse(java.lang.Object response)
Gets the HttpServletResponse as an object from the given response object. |
java.lang.String |
getParameterName(java.lang.String key)
Returns the parameter name stored under the specified key. |
abstract java.lang.Object |
getPortletRequest(HttpServletRequest request)
Gets the PortletRequest as an object from the given request object. |
abstract java.lang.Object |
getPortletResponse(HttpServletRequest request)
Gets the PortletResponse as an object from the given request. |
abstract java.lang.Object |
getPortletResponse(HttpServletResponse response,
HttpServletRequest request)
Gets the PortletResponse as an object from the given request. |
java.lang.String |
getStrutsActionParameterName()
Returns the name of the parameter used to pass the Struts action. |
static PortletApiUtils |
getUtilsInstance()
Gets the singleton instance of the PortletApiUtils implementation. |
abstract void |
includeTile(java.lang.String path,
PageContext pageContext)
Includes the path as a tile. |
static boolean |
isFormNamescoped()
Returns whether or not namescoping of forms is enabled. |
void |
setDefaultPortletActionName(java.lang.String name)
Sets the name of the portlet action for a Struts PortletURI. |
static void |
setNamescopeForm(boolean value)
Turns namescoping of forms on or off, default is on. |
void |
setParameterName(java.lang.String key,
java.lang.String name)
Sets the parameter name for the specified key. |
void |
setStrutsActionParameterName(java.lang.String name)
Sets the name used to store the Struts action as a parameter in the Portlet URL. |
static void |
setUtilsInstance(PortletApiUtils implementation)
Sets the singleton instance of the PortletApiUtils implementation. |
int |
typeOfURL(java.lang.String urlType)
Deprecated. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static boolean s_namescopeForm
protected static boolean s_namescopeInputName
public static final int STANDARD_URL
PortletURIAttributes
,
Constant Field Valuespublic static final int RETURN_URL
PortletURIAttributes
,
Constant Field ValuesConstructor Detail |
---|
public PortletApiUtils()
Method Detail |
---|
public static PortletApiUtils getUtilsInstance()
null
if none has been setpublic static void setUtilsInstance(PortletApiUtils implementation)
implementation
- the implementation object of the PortletApiUtilspublic java.lang.String getDefaultPortletActionName()
public void setDefaultPortletActionName(java.lang.String name)
name
- the portlet action namepublic java.lang.String getStrutsActionParameterName()
public void setStrutsActionParameterName(java.lang.String name)
name
- the parameter name used to store the Struts actionpublic java.lang.String getParameterName(java.lang.String key)
key
- the parameter names key
null
if not setpublic void setParameterName(java.lang.String key, java.lang.String name)
key
- the paramter keyname
- the parameter namepublic abstract java.lang.Object getPortletResponse(HttpServletRequest request)
request
- the request object
null
public abstract java.lang.Object getPortletResponse(HttpServletResponse response, HttpServletRequest request)
response
- the response objectrequest
- the request object
null
public abstract java.lang.Object getPortletRequest(HttpServletRequest request)
request
- the request object
null
public abstract java.lang.Object getHttpServletRequest(java.lang.Object request)
request
- the request object
null
public abstract java.lang.Object getHttpServletResponse(java.lang.Object response)
request
- the request object
null
public java.lang.Object createPortletURI(java.lang.Object response)
response
- the portlet response
null
public abstract java.lang.Object createPortletURI(java.lang.Object response, int urlType)
response
- A PortletResponseurlType
- the type of URL, typically standard, or return
null
public abstract java.lang.Object createPortletURI(java.lang.Object response, PortletURIAttributes uriAttributes)
response
- the portlet response objecturiAttributes
- the URI attributes
null
public java.lang.Object createPortletURIWithStrutsURL(java.lang.Object response, java.lang.String actionUrl)
response
- the response objectactionUrl
- the Struts action Url
null
public java.lang.Object createPortletURIWithStrutsURL(HttpServletRequest request, java.lang.String actionUrl)
null
, if the response object cannot be found.
The PortletURI should be casted to the
appropriate PortletURI class of the current portal container.
request
- the request objectactionUrl
- the Struts action Url
null
public abstract java.lang.Object createPortletURIWithStrutsURL(java.lang.Object response, java.lang.String actionUrl, int urlType)
response
- A PortletResponseactionUrl
- the Struts action UrlurlType
- the type of URL to create
null
public abstract java.lang.Object createPortletURIWithStrutsURL(HttpServletRequest request, java.lang.String actionUrl, int urlType)
null
, if the response object cannot be found.
The PortletURI should be casted to the
appropriate PortletURI class of the current portal container.
request
- the HttpServletRequest objectactionUrl
- the Struts action UrlurlType
- the type of URL to create
null
public abstract java.lang.Object createPortletURIWithStrutsURL(HttpServletRequest request, java.lang.String actionUrl, PortletURIAttributes uriAttributes)
null
, if the response object cannot be found.
The PortletURI should be casted to the
appropriate PortletURI class of the current portal container.
request
- the HttpServletRequest objectactionUrl
- the Struts action UrluriAttributes
- the Portlet URI attributes
null
public abstract java.lang.Object createStrutsPortletURL(HttpServletRequest request, HttpServletResponse response, java.lang.String actionUrl, PortletURIAttributes uriAttributes)
null
, if the response object cannot be found.
The Portlet URI should be casted to the
appropriate PortletURI class of the current portal container.
request
- the HttpServletRequest objectresponse
- the HttpServletResponse objectactionUrl
- the Struts action UrluriAttributes
- the PortletURI attributes
null
public int typeOfURL(java.lang.String urlType)
urlType
- the url type
PortletURIAttributes
public abstract void addDefaultPortletAction(java.lang.Object portletURI)
portletURI
- previously created PorletURIpublic abstract void addDefaultPortletAction(java.lang.Object portletURI, java.lang.String key)
portletURI
- previously created PorletURIkey
- the key to addpublic abstract void addStrutsActionUrlAsParameter(java.lang.Object portletURI, java.lang.String actionUrl)
portletURI
- previously created porletURIactionUrl
- action URL String to usepublic abstract void addParameter(java.lang.Object portletURI, java.lang.String key, java.lang.String value)
portletURI
- previously created PorletURIkey
- the parameter namevalue
- the parameter valuepublic abstract void forward(java.lang.String uri) throws ServletException
uri
- forward to the specified URI path
ServletException
- if the forward is not successfulpublic abstract void forward(java.lang.String uri, HttpServletRequest request) throws ServletException
uri
- forward to the URI pathrequest
- the HttpServletRequest object
ServletException
- if the forward is not successfulpublic abstract java.lang.String encodeURL(java.lang.String path, HttpServletRequest request)
path
- the pathrequest
- the request object.
public abstract java.lang.String encodeURL(java.lang.String path, HttpServletResponse response)
path
- the pathresponse
- the response object.
public abstract java.lang.String encodeNamespace(java.lang.String name, HttpServletRequest request)
name
- the name to namescoperequest
- the request object.
public abstract java.lang.String addModulePrefix(java.lang.String path, HttpServletRequest request)
path
- the pathrequest
- the request object.
public abstract java.lang.String getEncodedBeanName(java.lang.String beanName, HttpServletRequest request)
beanName
- the bean namerequest
- the request object.
public static void setNamescopeForm(boolean value)
value
- false to turn off namescopingpublic static boolean isFormNamescoped()
public abstract void createCommand(java.lang.String path, HttpServletRequest request, HttpServletResponse response, java.lang.String commandPrefix) throws ServletException
path
- the URI for the commandrequest
- the request object.response
- the response object.commandPrefix
- the prefix that the command is stored under
ServletException
- if create failspublic abstract void createCommand(java.lang.String path, HttpServletRequest request, HttpServletResponse response) throws ServletException
path
- the URI for the commandrequest
- the request object.response
- the response object.
ServletException
- if create failspublic abstract void createCommand(java.lang.String path, HttpServletRequest request) throws ServletException
path
- the URI for the commandrequest
- the request object.
ServletException
- if create failspublic abstract void createCommand(java.lang.String path, HttpServletRequest request, java.lang.String commandPrefix) throws ServletException
path
- the URI for the commandrequest
- the request object.commandPrefix
- the prefix that the command is stored under
ServletException
- if create failspublic abstract void includeTile(java.lang.String path, PageContext pageContext) throws ServletException
path
- the URI for the commandpageContext
- the page context
ServletException
- if include failspublic abstract java.lang.String encodeAction(java.lang.String actionURL, HttpServletRequest request)
actionURL
- the Struts action URLrequest
- the servlet request object
public abstract java.lang.String getActionMappingURL(java.lang.String action, PageContext pageContext)
action
- the Struts actionpageContext
- the page context
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |