|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PortletTargetAccessorController
Controller interface which allows for declaring an object as a target of a request. Typically the controller is used to declare a portlet window as a render-, action-, or resource-target in order to create render- action-, or resource-URLs. Action URLs are supposed to be executed using HTTP POST whereas render URLs are to be executed via HTTP GET. Resource URLs can be used in conjunction with HTTP GET or POST depending on the concrete use case they are used for.
Note that each URL can target one object only. If the
setTarget()
method is invoked multiple times for different
objects, the controller will clear any target information which is already
part of the state holder prior to writing the new target information.
Keep in mind that action URLs (URLs which encode an action target) are protected via the "Dangerous URL Protection (DUP)" feature of WebSphere Portal. DUP makes sure that each action URL is bound to the user session (if any) the URL was created in. As a consequence, DUP does not allow for executing such a URL in the scope of a different user session. If done anyway, DUP will refuse to execute the encoded action. DUP is not applied to action URLs which are created on public portal pages.
Action URLs that are mistakenly executed via HTTP GET can only be executed once to make sure that a click on the browser's Back, Forward, or Refresh button does not re-execute the action. This is important because actions are tyically used for unsafe operations a user can be held accountable for. This behavior can be customized via the portlet init parameter "wps.multiple.action.execution" in portlet.xml.
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.
Method Summary | |
---|---|
java.util.Map<java.lang.String,java.lang.String[]> |
getParameters()
Returns a modifiable map of target parameters (String -> String[]). |
void |
setActionTarget(javax.servlet.http.HttpServletRequest request,
ObjectID id)
Deprecated. Use setTarget(TargetType, ObjectID) instead. |
void |
setActionTarget(javax.servlet.http.HttpServletRequest request,
java.lang.String uniqueName)
Deprecated. Use setTarget(TargetType, String) instead. |
void |
setActionTarget(ObjectID id)
Deprecated. Use setTarget(TargetType, ObjectID) instead. |
void |
setActionTarget(ObjectID id,
java.lang.String actionID)
|
void |
setActionTarget(java.lang.String uniqueName)
Deprecated. Use setTarget(TargetType, String) instead. |
void |
setActionTarget(java.lang.String uniqueName,
java.lang.String actionID)
|
void |
setRenderTarget(ObjectID id)
Deprecated. Use setTarget(TargetType, ObjectID) instead. |
void |
setRenderTarget(java.lang.String uniqueName)
Deprecated. Use setTarget(TargetType, String) instead. |
void |
setResourceCacheability(java.lang.String resourceCacheability)
Sets the resource cacheability. |
void |
setResourceID(java.lang.String resourceID)
Sets a resource ID. |
void |
setTarget(TargetType targetType,
ObjectID id)
Declares the object with the given ObjectID as a request
target. |
void |
setTarget(TargetType targetType,
java.lang.String uniqueName)
Declares the object with the given unique name as a request target. |
Methods inherited from interface com.ibm.portal.Disposable |
---|
dispose |
Method Detail |
---|
void setTarget(TargetType targetType, ObjectID id)
ObjectID
as a request
target. Use this method for example to create portlet render-, action-,
or resource URLs by passing in the appropriate TargetType
.
targetType
- The type of the target. Must not be null
.id
- The ObjectID
of the target object (typically a
portlet window). Must not be null
.void setActionTarget(ObjectID id, java.lang.String actionID)
void setActionTarget(java.lang.String uniqueName, java.lang.String actionID) throws MissingUniqueNameException, UnknownUniqueNameException
MissingUniqueNameException
UnknownUniqueNameException
void setTarget(TargetType targetType, java.lang.String uniqueName) throws MissingUniqueNameException, UnknownUniqueNameException
TargetType
.
targetType
- The type of the target. Must not be null
.uniqueName
- String
representing the unique name of the
target object (typically a portlet window). Must not be
null
.
MissingUniqueNameException
UnknownUniqueNameException
java.util.Map<java.lang.String,java.lang.String[]> getParameters()
null
.void setResourceID(java.lang.String resourceID)
setTarget(TargetType, ObjectID)
is called
after this method.
resourceID
- The resource ID to set. Must not be null
.void setResourceCacheability(java.lang.String resourceCacheability)
setTarget(TargetType, ObjectID)
is called after this method.
resourceCacheability
- The resource cacheability to set. Must not be
null
.void setActionTarget(javax.servlet.http.HttpServletRequest request, ObjectID id) throws CannotSetTargetException
setTarget(TargetType, ObjectID)
instead.
ObjectID
as an
action target. Use this method to create a portlet action URL. Note that
action URLs are subject to the security constraints outlined above.
id
- The ObjectID
of the portlet window that should
be addressed. Must not be null
.request
- The current HttpServletRequest
or
null
.
CannotSetTargetException
- If the target information cannot be written to the underlying
state.void setActionTarget(javax.servlet.http.HttpServletRequest request, java.lang.String uniqueName) throws MissingUniqueNameException, UnknownUniqueNameException, CannotSetTargetException
setTarget(TargetType, String)
instead.
uniqueName
- String
representing the unique name of the
portlet window that should be addressed. Must not be
null
.request
- The current HttpServletRequest
or
null
.
CannotSetTargetException
- If the target information cannot be written to the underlying
state.
MissingUniqueNameException
- If the unique name is missing
UnknownUniqueNameException
- If the unique name cannot be converted into a
ObjectID
.void setActionTarget(ObjectID id)
setTarget(TargetType, ObjectID)
instead.
ObjectID
as an
action target. Use this method to create a portlet action URL. Note that
action URLs are subject to the security constraints outlined above.
id
- The ObjectID
of the portlet window that should
be addressed. Must not be null
.void setActionTarget(java.lang.String uniqueName) throws MissingUniqueNameException, UnknownUniqueNameException
setTarget(TargetType, String)
instead.
uniqueName
- String
representing the unique name of the
portlet window that should be addressed. Must not be
null
.
MissingUniqueNameException
- If the unique name is missing.
UnknownUniqueNameException
- If the unique name cannot be converted into a
ObjectID
.void setRenderTarget(ObjectID id)
setTarget(TargetType, ObjectID)
instead.
ObjectID
as a
render target. Use this method to create a portlet render URL.
id
- The ObjectID
of the portlet window that should
be addressed. Must not be null
.void setRenderTarget(java.lang.String uniqueName) throws MissingUniqueNameException, UnknownUniqueNameException
setTarget(TargetType, String)
instead.
uniqueName
- String
representing the unique name of the
portlet window that should be addressed. Must not be
null
.
MissingUniqueNameException
- If the unique name is missing.
UnknownUniqueNameException
- If the unique name cannot be converted into a
ObjectID
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |