org.apache.jetspeed.layout.impl
Class MultipleAction

java.lang.Object
  extended by org.apache.jetspeed.layout.impl.BasePortletAction
      extended by org.apache.jetspeed.layout.impl.MultipleAction
All Implemented Interfaces:
AjaxAction, AjaxBuilder, Constants, org.springframework.beans.factory.BeanFactoryAware

public class MultipleAction
extends BasePortletAction
implements AjaxAction, AjaxBuilder, org.springframework.beans.factory.BeanFactoryAware

Author:
David Gurney The purpose of this object is to run several AJAX actions and aggregate the results into a single response. This is useful when the client needs to make more than one call as the result of a single user action. The sample request URL is shown below: http://host:port/ajaxapi?action=multiple&commands=(action;name,value;name,value)(action;name,value) The constructor accepts a map of the actions that are available to be run. The name,value pairs are parameter values needed by the action. The actions are run in the order that they are found on the URL string

Field Summary
protected  java.util.Map actionMap
           
protected static java.lang.String ALL_RESULTS
           
protected static java.lang.String BUILD_RESULTS
           
protected static java.lang.String COMMAND_TOKEN
           
protected static java.lang.String COMMANDS
           
protected  org.apache.velocity.app.VelocityEngine m_oVelocityEngine
           
protected static java.lang.String MULTIPLE_ACTION_PROCESSOR
           
protected static java.lang.String PARAM_TOKEN
           
protected static java.lang.String VALUE_TOKEN
           
 
Fields inherited from class org.apache.jetspeed.layout.impl.BasePortletAction
errorTemplate, log, pageManager, securityBehavior, template
 
Fields inherited from interface org.apache.jetspeed.layout.impl.Constants
ABS, ACTION, CARTESIAN, COL, CUSTOM_MENUS, DEFAULT_LAYOUT, DESKTOP_EXTENDED, DESKTOP_PAGE_DECORATIONS, DESKTOP_PORTLET_DECORATIONS, DESTINATION, DOWN, FILTER, FOLDER, FOLDERS, FORMAT, FRAGMENTID, FRAGMENTS, GUESTUSERS, HEIGHT, INCLUDE_MENU_DEFS, IPADDRESS, LAYOUT, LAYOUTID, LAYOUTS, LEFT, LINK, LINKS, MENU, MENU_CONTEXT, MENU_DEFINITIONS, MENU_LOCALE, MENU_NAME, METADATA, NEWCOL, NEWROW, OFFLINE, OLD_DESKTOP_EXTENDED, OLD_HEIGHT, OLD_PORTLET_MODE, OLD_WIDTH, OLD_WINDOW_STATE, OLD_X, OLD_Y, OLD_Z, OLDCOL, OLDROW, ONLINE, PAGE, PAGE_DECORATIONS, PAGE_QUALIFIED_CREATE_ON_EDIT, PAGES, PORTLET_DECORATIONS, PORTLET_MODE, PORTLETENTITY, PORTLETID, PORTLETS, PROFILED_PATH, REASON, RESOURCE_NAME, RIGHT, ROLES, ROW, SECURITY_DEFS, SECURITY_OWNER, SECURITY_REFS, SESSIONS, SHORT_TITLE, SIZES, SOURCE, STANDARD_MENUS, STATUS, TITLE, TYPE, UP, USER_IS_ANONYMOUS, USERINFO, USERNAME, USERS, WIDTH, WINDOW_STATE, X, Y, Z
 
Constructor Summary
MultipleAction(AjaxRequestService requestService, java.lang.String p_sTemplate, java.lang.String p_sErrorTemplate, PageManager p_oPageManager, PortletActionSecurityBehavior p_oSecurityBehavior, org.apache.velocity.app.VelocityEngine p_oVelocityEngine)
           
 
Method Summary
 boolean buildContext(RequestContext p_oRequestContext, java.util.Map p_oInputMap)
          Build the normal context template
protected  void processBuilder(AjaxBuilder p_oBuilder, java.util.Map p_oInputMap, RequestContext p_oRequestContext, boolean p_oActionSuccessFlag)
           
 boolean run(RequestContext p_oRequestContext, java.util.Map p_oResultMap)
          The action should put any parameters or results it wants passed on to the builders in the resultMap This method runs an Ajax action.
 void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
           
 
Methods inherited from class org.apache.jetspeed.layout.impl.BasePortletAction
buildErrorContext, checkAccess, createNewPageOnEdit, getActionParameter, getErrorTemplate, getFragmentIdFromLocation, getFragmentIdFromLocation, getNonNullActionParameter, getParentFragmentById, getTemplate, isCreateNewPageOnEditEnabled, isPageQualifiedForCreateNewPageOnEdit, runBatch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.jetspeed.ajax.AjaxAction
checkAccess, runBatch
 
Methods inherited from interface org.apache.jetspeed.ajax.AjaxBuilder
buildErrorContext, getErrorTemplate, getTemplate
 

Field Detail

ALL_RESULTS

protected static final java.lang.String ALL_RESULTS
See Also:
Constant Field Values

BUILD_RESULTS

protected static final java.lang.String BUILD_RESULTS
See Also:
Constant Field Values

MULTIPLE_ACTION_PROCESSOR

protected static final java.lang.String MULTIPLE_ACTION_PROCESSOR
See Also:
Constant Field Values

COMMANDS

protected static final java.lang.String COMMANDS
See Also:
Constant Field Values

COMMAND_TOKEN

protected static final java.lang.String COMMAND_TOKEN
See Also:
Constant Field Values

PARAM_TOKEN

protected static final java.lang.String PARAM_TOKEN
See Also:
Constant Field Values

VALUE_TOKEN

protected static final java.lang.String VALUE_TOKEN
See Also:
Constant Field Values

actionMap

protected java.util.Map actionMap

m_oVelocityEngine

protected org.apache.velocity.app.VelocityEngine m_oVelocityEngine
Constructor Detail

MultipleAction

public MultipleAction(AjaxRequestService requestService,
                      java.lang.String p_sTemplate,
                      java.lang.String p_sErrorTemplate,
                      PageManager p_oPageManager,
                      PortletActionSecurityBehavior p_oSecurityBehavior,
                      org.apache.velocity.app.VelocityEngine p_oVelocityEngine)
Method Detail

setBeanFactory

public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
                    throws org.springframework.beans.BeansException
Specified by:
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAware
Throws:
org.springframework.beans.BeansException

run

public boolean run(RequestContext p_oRequestContext,
                   java.util.Map p_oResultMap)
            throws AJAXException
Description copied from interface: AjaxAction
The action should put any parameters or results it wants passed on to the builders in the resultMap This method runs an Ajax action.

Specified by:
run in interface AjaxAction
Parameters:
p_oRequestContext - The Jetspeed Request Context
p_oResultMap - map of action parameters passed to the builder context
Returns:
success is true, failure is false
Throws:
AJAXException

processBuilder

protected void processBuilder(AjaxBuilder p_oBuilder,
                              java.util.Map p_oInputMap,
                              RequestContext p_oRequestContext,
                              boolean p_oActionSuccessFlag)

buildContext

public boolean buildContext(RequestContext p_oRequestContext,
                            java.util.Map p_oInputMap)
Description copied from interface: AjaxBuilder
Build the normal context template

Specified by:
buildContext in interface AjaxBuilder
Overrides:
buildContext in class BasePortletAction
Parameters:
p_oRequestContext - The Jetspeed Request Context
p_oInputMap - Context variables to be substituted into template
Returns:
true on success false onerror


Copyright © 1999-2009 Apache Software Foundation. All Rights Reserved.