org.alfresco.web.app.servlet.command
Class UIActionCommandProcessor

java.lang.Object
  extended by org.alfresco.web.app.servlet.command.UIActionCommandProcessor
All Implemented Interfaces:
CommandProcessor, ExtCommandProcessor

public class UIActionCommandProcessor
extends java.lang.Object
implements ExtCommandProcessor

UI action command processor implementation.

Responsible for executing specific UI actions via a REST style URL interface.

The URL postfix for each specific command depends on the context that is required for that command. For example, a command to launch the Create Web Content dialog may require the current sandbox and the current web project as its context e.g.
http://server/alfresco/command/ui/createwebcontent?sandbox=website1&webproject=1234567890


Field Summary
static java.lang.String PARAM_CONTAINER
           
 
Constructor Summary
UIActionCommandProcessor()
           
 
Method Summary
 void outputStatus(java.io.PrintWriter out)
          Output a simple status message to the supplied PrintWriter.
 void process(org.alfresco.service.ServiceRegistry serviceRegistry, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String command)
          Process the supplied command name.
 void process(org.alfresco.service.ServiceRegistry serviceRegistry, javax.servlet.http.HttpServletRequest request, java.lang.String command)
          Process the supplied command name.
 boolean validateArguments(javax.servlet.ServletContext sc, java.lang.String command, java.util.Map args, java.lang.String[] urlElements)
          Pass and validate URL arguments for the command processor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAM_CONTAINER

public static final java.lang.String PARAM_CONTAINER
See Also:
Constant Field Values
Constructor Detail

UIActionCommandProcessor

public UIActionCommandProcessor()
Method Detail

validateArguments

public boolean validateArguments(javax.servlet.ServletContext sc,
                                 java.lang.String command,
                                 java.util.Map args,
                                 java.lang.String[] urlElements)
Description copied from interface: CommandProcessor
Pass and validate URL arguments for the command processor. Validate if the command can be executed given the arguments supplied. Generally at this post a Command Processor will convert the supplied arguments to the objects it expects, and also check any permissions that are required by the current user to execute the command.

Specified by:
validateArguments in interface CommandProcessor
Parameters:
sc - ServletContext, can be used to retrieve ServiceRegistry instance from the Repository bean.
command - Name of the command the arguments are for
args - Map of URL args passed to the command servlet
urlElements - String[] of the remaining URL arguments to the command servlet
Returns:
true if the command can be executed by the current user given the supplied args.
See Also:
CommandProcessor.validateArguments(javax.servlet.ServletContext, java.lang.String, java.util.Map, java.lang.String[])

process

public void process(org.alfresco.service.ServiceRegistry serviceRegistry,
                    javax.servlet.http.HttpServletRequest request,
                    java.lang.String command)
Description copied from interface: CommandProcessor
Process the supplied command name. It is the responsibility of the Command Processor to lookup the specified command name using the CommandFactory registry. For that reason it also has the responsiblity to initially register commands it is responsible for so they can be constructed later. If the supplied command is unknown to it then an exception should be thrown to indicate this.

Specified by:
process in interface CommandProcessor
Parameters:
serviceRegistry - ServiceRegistry
request - HttpServletRequest
command - Name of the command to construct and execute

process

public void process(org.alfresco.service.ServiceRegistry serviceRegistry,
                    javax.servlet.http.HttpServletRequest request,
                    javax.servlet.http.HttpServletResponse response,
                    java.lang.String command)
Description copied from interface: ExtCommandProcessor
Process the supplied command name. It is the responsibility of the Command Processor to lookup the specified command name using the CommandFactory registry. For that reason it also has the responsiblity to initially register commands it is responsible for so they can be constructed later. If the supplied command is unknown to it then an exception should be thrown to indicate this.

Specified by:
process in interface ExtCommandProcessor
Parameters:
serviceRegistry - ServiceRegistry
request - HttpServletRequest
response - HttpServletResponse
command - Name of the command to construct and execute
See Also:
ExtCommandProcessor.process(org.alfresco.service.ServiceRegistry, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String)

outputStatus

public void outputStatus(java.io.PrintWriter out)
Description copied from interface: CommandProcessor
Output a simple status message to the supplied PrintWriter. It can be assumed that the process() method was successful if this method is called.

Specified by:
outputStatus in interface CommandProcessor
Parameters:
out - PrintWriter
See Also:
CommandProcessor.outputStatus(java.io.PrintWriter)


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.