com.ibm.portal.struts.plugins
Class CommandManagerFactory

java.lang.Object
  extended by com.ibm.portal.struts.plugins.CommandManagerFactory

public abstract class CommandManagerFactory
extends java.lang.Object

The CommandManager class is a factory class for creating classes that control the storage and retrieval of IViewCommands. The subclass must implement the methods to get, set and remove commands.

Since:
5.1

Constructor Summary
CommandManagerFactory()
          Construct the factory object.
 
Method Summary
abstract  IViewCommand getCommand(PortletRequest request, PortletResponse response)
          Get the IViewCommand.
abstract  IViewCommand getCommand(PortletRequest request, PortletResponse response, java.lang.String prefix)
          Get the IViewCommand.
 java.lang.String getCommandPrefix(PortletRequest request)
          Returns the command prefix determined from the request object.
static CommandManagerFactory getFactory(ServletContext servletContext)
          Get the CommandManagerFactory object for this context.
abstract  void removeCommand(PortletRequest request, PortletResponse response, java.lang.String prefix)
          Remove the IViewCommand.
abstract  void setCommand(PortletRequest request, PortletResponse response, IViewCommand command)
          Set the IViewCommand.
abstract  void setCommand(PortletRequest request, PortletResponse response, IViewCommand command, java.lang.String prefix)
          Set the IViewCommand.
static void setFactory(ServletContext servletContext, CommandManagerFactory factory)
          Set a new CommandManagerFactory object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandManagerFactory

public CommandManagerFactory()
Construct the factory object.

Method Detail

getCommandPrefix

public java.lang.String getCommandPrefix(PortletRequest request)
Returns the command prefix determined from the request object.

Parameters:
request - the portlet request object
Returns:
the command prefix

setFactory

public static void setFactory(ServletContext servletContext,
                              CommandManagerFactory factory)
Set a new CommandManagerFactory object.

Parameters:
servletContext - the servlet context
factory - the factory object

getFactory

public static CommandManagerFactory getFactory(ServletContext servletContext)
Get the CommandManagerFactory object for this context.

Parameters:
servletContext - the servlet context
Returns:
the command manager factory

getCommand

public abstract IViewCommand getCommand(PortletRequest request,
                                        PortletResponse response)
                                 throws PortletException
Get the IViewCommand. The mode should be obtained from the PortletRequest.

Parameters:
request - the request object
response - the response object
Returns:
returns the IViewCommand object, can be null
Throws:
PortletException - if the request cannot be fulfilled

getCommand

public abstract IViewCommand getCommand(PortletRequest request,
                                        PortletResponse response,
                                        java.lang.String prefix)
                                 throws PortletException
Get the IViewCommand. The prefix, which is the portlet mode, can be specified and may be different then the mode obtained from the request object.

Parameters:
request - the portlet request object
request - the portlet response object
prefix - the prefix
Returns:
returns the IViewCommand object, can be null
Throws:
PortletException - if the request cannot be fulfilled

setCommand

public abstract void setCommand(PortletRequest request,
                                PortletResponse response,
                                IViewCommand command)
                         throws PortletException
Set the IViewCommand. The prefix will be obtained from the PortletRequest.

Parameters:
request - the portlet request object
response - the portlet response object
command - the IViewCommand command.
Throws:
PortletException - if the request cannot be fulfilled

setCommand

public abstract void setCommand(PortletRequest request,
                                PortletResponse response,
                                IViewCommand command,
                                java.lang.String prefix)
                         throws PortletException
Set the IViewCommand. The prefix, the portlet mode, can be specified and may be different then the current portlet mode obtained from the request object.

Parameters:
request - the portlet request object
response - the portlet response object
command - the IViewCommand
prefix - the prefix to store the command under
Throws:
PortletException - if the request cannot be fulfilled

removeCommand

public abstract void removeCommand(PortletRequest request,
                                   PortletResponse response,
                                   java.lang.String prefix)
                            throws PortletException
Remove the IViewCommand. The prefix, the portlet mode, can be specified and may be different then the mode obtained from the request object.

Parameters:
request - the portlet request object
prefix - the prefix for the command
Throws:
PortletException - if the request cannot be fulfilled