|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.wps.portlets.struts.WpsStrutsViewCommand
public abstract class WpsStrutsViewCommand
The WpsStrutsViewCommand
class is a command pattern class used to
provide a mechanism to encapsulate the information needed to redisplay a view.
The WpsStrutsViewCommand is the base class for all commands in the Struts
Portlet Framework. The base class provides the methods to save all the attributes
that need to be saved with the command, and provides the methods to repopulate
the request attributes.
Field Summary | |
---|---|
protected static java.lang.String |
LAST_MODIFIED
Request attribute name for the last modified timestamp. |
protected static java.lang.String |
PREFIX
Request attribute name for the module prefix. |
Constructor Summary | |
---|---|
WpsStrutsViewCommand()
Default constructor for the WpsStrutsView command. |
|
WpsStrutsViewCommand(HttpServletRequest request)
Constructs the WpsStrutsViewCommand object. |
|
WpsStrutsViewCommand(PortletRequest request)
Constructs the WpsStrutsViewCommand object. |
Method Summary | |
---|---|
protected static void |
addAttribute(java.lang.Object attribute,
java.util.List list)
Adds the attribute to the list. |
static void |
addAttributeNameToSave(java.lang.String attributeName)
Adds the name of an attribute from the object request that needs to be saved if present for the execution of the IViewCommand in Portal's render phase |
static void |
addAttributeTypeToSave(java.lang.Class attributeType)
Adds the class type of an attribute from the request that needs to be saved if present for the execution of the IViewCommand in ortal's render phase. |
static void |
addParameterNameToSave(java.lang.String parameterName)
Adds the name of an parameter from the object request that needs to be saved if present for the execution of the IViewCommand in Portal's render phase |
void |
execute(PortletRequest request,
PortletResponse response,
ViewCommandExecutionContext executionContext)
Executes the given command given the request and response objects. |
void |
execute(PortletRequest request,
ViewCommandExecutionContext executionContext)
Executes the given command given the request and response objects. |
long |
getLastModified(PortletRequest request)
Returns the last modified time. |
java.lang.String |
getPrefix(PortletRequest request)
Returns the prefix associated with this command. |
boolean |
getRemoveOnModeChange()
Returns the state of removeOnModeChange. |
java.util.Map |
getSavedAttributes()
Returns the saved attribute map. |
static IViewCommand |
getSavedCommand(PortletRequest pRequest,
ViewCommandExecutionContext context)
Gets the saved command from the Command Manager Factory. |
protected static void |
removeAttribute(java.lang.Object attribute,
java.util.List list)
Removes the attribute from the list. |
static void |
removeAttributeNameToSave(java.lang.String attributeName)
Removes the name of an attribute from the list of attribute names to save. |
static void |
removeAttributeTypeToSave(java.lang.Class attributeType)
Removes the class type of the request attribute from the list of attributes to save. |
static void |
removeParameterNameToSave(java.lang.String parameterName)
Removes the name of an parameter from the list of parameter names to save. |
protected void |
repopulateRequest(PortletRequest request)
Repopulates the given request from saved values. |
protected void |
saveAsAttribute(java.lang.String name,
java.lang.Object value)
Saves the given named object for later retrieval as an attribute for when the command is executed. |
protected void |
saveAsParameter(java.lang.String name,
java.lang.String value)
Saves the given named object for later retrieval as an parameter for when the command is executed. |
protected void |
saveAttribute(HttpServletRequest request,
java.lang.String name)
Saves the given request attribute for later retrieval when the command is executed. |
void |
saveAttributes(HttpServletRequest request,
ViewCommandExecutionContext context)
Saves attributes from the request by name for later retrieval when the command is executed. |
protected void |
saveAttributes(HttpServletRequest request,
ViewCommandExecutionContext context,
java.util.List namesToSave,
java.util.List typesToSave)
Saves attributes from the request by name for later retrieval when the command is executed. |
void |
saveCommand(HttpServletRequest request)
Saves the current command using the Command Manager Factory. |
void |
saveCommand(HttpServletRequest request,
java.lang.String commandPrefix)
Saves the current command using the Command Manager Factory. |
protected void |
saveParameter(HttpServletRequest request,
java.lang.String name)
Saves the given request parameter for later retrieval when the command is executed. |
protected void |
saveParameters(HttpServletRequest request,
ViewCommandExecutionContext context,
java.util.List namesToSave)
Saves parameters from the request by name for later retrieval when the command is executed. |
void |
setLastModified(PortletRequest request,
long lastModified)
Sets the last modified time. |
void |
setPrefix(PortletRequest request,
java.lang.String prefix)
Sets the prefix associated with this command. |
void |
setRemoveOnModeChange(boolean value)
Allows setting a flag so that this command is removed when the user switches modes. |
void |
setSavedAttributes(java.util.Map attributeMap)
Sets the saved attribute map. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String PREFIX
protected static final java.lang.String LAST_MODIFIED
Constructor Detail |
---|
public WpsStrutsViewCommand()
request
- The request object to save context information frompublic WpsStrutsViewCommand(PortletRequest request)
request
- The request object to save context information frompublic WpsStrutsViewCommand(HttpServletRequest request)
request
- The request object to save context information fromMethod Detail |
---|
public static void addAttributeNameToSave(java.lang.String attributeName)
attributeName
- the name of the attributepublic static void removeAttributeNameToSave(java.lang.String attributeName)
attributeName
- the name of the attributepublic static void addAttributeTypeToSave(java.lang.Class attributeType)
attributeType
- the attribute typepublic static void removeAttributeTypeToSave(java.lang.Class attributeType)
attributeType
- the attribute typepublic static void addParameterNameToSave(java.lang.String parameterName)
parameterName
- the name of the parameterpublic static void removeParameterNameToSave(java.lang.String parameterName)
parameterName
- the name of the parameterpublic static IViewCommand getSavedCommand(PortletRequest pRequest, ViewCommandExecutionContext context) throws PortletException
request
- the portlet request objectcontext
- the view command execution context
PortletException
- if the request cannot fulfilledpublic void saveCommand(HttpServletRequest request) throws PortletException
request
- The request object
PortletException
public void saveCommand(HttpServletRequest request, java.lang.String commandPrefix) throws PortletException
request
- The request objectcommandPrefix
- the prefix to store the command
PortletException
- if the request cannot fulfilledprotected void repopulateRequest(PortletRequest request)
request
- The request object to repopulatepublic void execute(PortletRequest request, PortletResponse response, ViewCommandExecutionContext executionContext) throws PortletException
execute
in interface IViewCommand
request
- The request objectrequest
- The response objectexecutionContext
- the execution context objectresponse
- The response object
PortletException
- if the request cannot fulfilledprotected void saveAttributes(HttpServletRequest request, ViewCommandExecutionContext context, java.util.List namesToSave, java.util.List typesToSave)
request
- The request object to save attributes fromcontext
- the view command execution contextnamesToSave
- a list of the attribute names to savetypesToSave
- a list of the types to saveprotected void saveAttribute(HttpServletRequest request, java.lang.String name)
request
- The request object to get attribute fromname
- of attribute to saveprotected void saveAsAttribute(java.lang.String name, java.lang.Object value)
name
- of attribute to savevalue
- the value to storeprotected void saveParameters(HttpServletRequest request, ViewCommandExecutionContext context, java.util.List namesToSave)
request
- The request object to save parameters fromcontext
- the view command execution contextnamesToSave
- a list of the attribute names to saveprotected void saveParameter(HttpServletRequest request, java.lang.String name)
request
- The request object to get parameter fromname
- of parameter to saveprotected void saveAsParameter(java.lang.String name, java.lang.String value)
name
- of parameter to savevalue
- the value to storepublic void saveAttributes(HttpServletRequest request, ViewCommandExecutionContext context)
request
- The request object to save attributes fromcontext
- the view command execution contextpublic java.util.Map getSavedAttributes()
public void setSavedAttributes(java.util.Map attributeMap)
attributeMap
- the map of attributes.public void setRemoveOnModeChange(boolean value)
value
- true will cause this command to get removedpublic boolean getRemoveOnModeChange()
public java.lang.String getPrefix(PortletRequest request)
public void setPrefix(PortletRequest request, java.lang.String prefix)
public void execute(PortletRequest request, ViewCommandExecutionContext executionContext) throws PortletException
request
- The request objectrequest
- The response objectexecutionContext
- the execution context object
PortletException
- if the request cannot fulfilledprotected static void addAttribute(java.lang.Object attribute, java.util.List list)
attribute
- the attribute to add to the listlist
- the array list to updateprotected static void removeAttribute(java.lang.Object attribute, java.util.List list)
attribute
- the attributelist
- the array list to updatepublic long getLastModified(PortletRequest request)
request
- the request object
public void setLastModified(PortletRequest request, long lastModified)
request
- the request objectlastModified
- the last modified time
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |