| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.portal.struts.command.StrutsViewCommand
public abstract class StrutsViewCommand
Command pattern class used to provide a mechanism to encapsulate the information needed to redisplay a view. The StrutsViewCommand 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 | CONTENT_TYPE
Request attribute name for the content type. |
protected static MessageResources | messages
The message resources for the Struts Portlet Framework. |
protected static java.lang.String | PREFIX
Request attribute name for the prefix. |
Constructor Summary | |
---|---|
StrutsViewCommand()
Default constructor. | |
PortletRequest)">StrutsViewCommand(PortletRequest request)
Constructs the StrutsViewCommand 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 object request that needs to be saved if present for the execution of the IViewCommand in Portal's render phase. |
void | RenderResponse, com.ibm.portal.struts.command.ViewCommandExecutionContext)">execute(RenderRequest request,
RenderResponse response,
ViewCommandExecutionContext executionContext)
Executes the given command given the request and response objects. |
java.lang.String | PortletRequest)">getContentType(PortletRequest request)
Returns the content type associated with this command. |
java.lang.String | PortletRequest)">getPrefix(PortletRequest request)
Returns the prefix associated with this command. |
boolean | getRemoveOnModeChange()
Returns the state of removeOnModeChange. |
java.util.Map | getSavedAttributes()
Returns the saved attributes map. |
static IViewCommand | PortletResponse, com.ibm.portal.struts.command.ViewCommandExecutionContext)">getSavedCommand(PortletRequest request,
PortletResponse response,
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. |
protected void | RenderRequest)">repopulateRequest(RenderRequest 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 restoral as an attribute for when the command is executed. |
protected void | saveAttribute(PortletRequest request,
java.lang.String name)
Saves the given request attribute for later restoral when the command is executed. |
void | saveAttributes(PortletRequest request,
ViewCommandExecutionContext context)
Saves attributes from the request by name for later restoral when the command is executed. |
protected void | saveAttributes(PortletRequest request,
ViewCommandExecutionContext context,
java.util.List namesToSave,
java.util.List typesToSave)
Saves attributes from the request by name for later restoral when the command is executed. |
void | saveCommand(PortletRequest request,
PortletResponse response)
Saves the current command using the Command Manager Factory. |
void | PortletResponse, java.lang.String)">saveCommand(PortletRequest request,
PortletResponse response,
java.lang.String commandPrefix)
Saves the current command using the Command Manager Factory. |
void | PortletRequest)">setContentType(PortletRequest request)
Sets the content type. |
void | setContentType(PortletRequest request,
java.lang.String contentType)
Sets the content type associated with this command. |
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 Portal mode changes. |
void | setSavedAttributes(java.util.Map attributeMap)
Sets the saved attributes 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 CONTENT_TYPE
protected static final java.lang.String PREFIX
protected static MessageResources messages
Constructor Detail |
---|
public StrutsViewCommand()
public StrutsViewCommand(PortletRequest request)
StrutsViewCommand
is typically created in the action phase of Portal, so the interface
expects a PortletRequest.
Method Detail |
---|
public static void addAttributeNameToSave(java.lang.String attributeName)
public static void removeAttributeNameToSave(java.lang.String attributeName)
public static void addAttributeTypeToSave(java.lang.Class attributeType)
public static void removeAttributeTypeToSave(java.lang.Class attributeType)
public static IViewCommand getSavedCommand(PortletRequest request, PortletResponse response, ViewCommandExecutionContext context) throws PortletException
public void saveCommand(PortletRequest request, PortletResponse response) throws PortletException
public void saveCommand(PortletRequest request, PortletResponse response, java.lang.String commandPrefix) throws PortletException
public void setContentType(PortletRequest request)
protected void repopulateRequest(RenderRequest request)
protected void saveAttributes(PortletRequest request, ViewCommandExecutionContext context, java.util.List namesToSave, java.util.List typesToSave)
protected void saveAttribute(PortletRequest request, java.lang.String name)
protected void saveAsAttribute(java.lang.String name, java.lang.Object value)
public void saveAttributes(PortletRequest request, ViewCommandExecutionContext context)
public java.util.Map getSavedAttributes()
public void setSavedAttributes(java.util.Map attributeMap)
public void setRemoveOnModeChange(boolean value)
public boolean getRemoveOnModeChange()
public java.lang.String getPrefix(PortletRequest request)
public void setPrefix(PortletRequest request, java.lang.String prefix)
public java.lang.String getContentType(PortletRequest request)
public void setContentType(PortletRequest request, java.lang.String contentType)
public void execute(RenderRequest request, RenderResponse response, ViewCommandExecutionContext executionContext) throws PortletException
protected static void addAttribute(java.lang.Object attribute, java.util.List list)
protected static void removeAttribute(java.lang.Object attribute, java.util.List list)
| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |