com.atlassian.jira.plugin.workflow
Class AbstractWorkflowPermissionPluginFactory

java.lang.Object
  extended by com.atlassian.jira.plugin.workflow.AbstractWorkflowPluginFactory
      extended by com.atlassian.jira.plugin.workflow.AbstractWorkflowPermissionPluginFactory
All Implemented Interfaces:
WorkflowPluginFactory
Direct Known Subclasses:
WorkflowPermissionConditionFactoryImpl, WorkflowPermissionValidatorPluginFactory

public abstract class AbstractWorkflowPermissionPluginFactory
extends AbstractWorkflowPluginFactory

A common base class for Workflow Plugin Factories that are concerned with Permissions.

Since:
v3.13

Constructor Summary
protected AbstractWorkflowPermissionPluginFactory(JiraAuthenticationContext authenticationContext, PermissionManager permissionManager)
           
 
Method Summary
protected  void clearLegacyPermissionArgument(Map<?,?> descriptorArgs)
           
protected abstract  Map<?,?> extractArgs(com.opensymphony.workflow.loader.AbstractDescriptor descriptor)
           
 Map<String,?> getDescriptorParams(Map<String,Object> params)
          Given a set of name:value parameters from the plugin configuration page (ie.
protected  void getVelocityParamsForEdit(Map<String,Object> velocityParams, com.opensymphony.workflow.loader.AbstractDescriptor descriptor)
          Populates the given map with velocity parameters for 'edit-parameters' velocity template.
protected  void getVelocityParamsForInput(Map<String,Object> velocityParams)
          Get velocity parameters for 'input-parameters' velocity template.
protected  void getVelocityParamsForView(Map<String,Object> velocityParams, com.opensymphony.workflow.loader.AbstractDescriptor descriptor)
          Populates the given map with velocity parameters for 'view' velocity template.
protected  void populateTemplateParamsForInputAndEdit(Map<String,Object> velocityParams, Map<?,?> descriptorArgs)
           
protected  void populateTemplateParamsForView(Map<String,Object> velocityParams, Map<?,?> descriptorArgs)
           
 
Methods inherited from class com.atlassian.jira.plugin.workflow.AbstractWorkflowPluginFactory
createMap, extractMultipleParams, extractSingleParam, getVelocityParams
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractWorkflowPermissionPluginFactory

protected AbstractWorkflowPermissionPluginFactory(JiraAuthenticationContext authenticationContext,
                                                  PermissionManager permissionManager)
Method Detail

getDescriptorParams

public Map<String,?> getDescriptorParams(Map<String,Object> params)
Description copied from interface: WorkflowPluginFactory
Given a set of name:value parameters from the plugin configuration page (ie. the 'input-parameters' velocity template) return a map of sanitized parameters which will be passed into workflow plugin instances. For example, the results are passed in the 'arg' parameter of post-functions' execute() or conditions' passesCondition methods. The velocity page often submits values in array form, and this method extracts just the relevant value.

Parameters:
params - Parameters from the velocity template, eg. {"fieldId" : ["assignee"], "fieldValue":["-1"]}
Returns:
Parameters to be passed into workflow functions via the 'args' map. Eg. {"assignee": "-1"}

getVelocityParamsForInput

protected void getVelocityParamsForInput(Map<String,Object> velocityParams)
Description copied from class: AbstractWorkflowPluginFactory
Get velocity parameters for 'input-parameters' velocity template.

Specified by:
getVelocityParamsForInput in class AbstractWorkflowPluginFactory
Parameters:
velocityParams - Map to populate.
See Also:
AbstractWorkflowPluginFactory.getVelocityParams(String, com.opensymphony.workflow.loader.AbstractDescriptor)

getVelocityParamsForEdit

protected void getVelocityParamsForEdit(Map<String,Object> velocityParams,
                                        com.opensymphony.workflow.loader.AbstractDescriptor descriptor)
Description copied from class: AbstractWorkflowPluginFactory
Populates the given map with velocity parameters for 'edit-parameters' velocity template. Typically an implementation would call descriptor.getArgs() to retrieve the current configuration, and populate velocityParams from that.

Specified by:
getVelocityParamsForEdit in class AbstractWorkflowPluginFactory
Parameters:
velocityParams - Map to populate.
descriptor - Eg. FunctionDescriptor or ConditionDescriptor describing the function/condition and its current configuration.
See Also:
AbstractWorkflowPluginFactory.getVelocityParams(String, com.opensymphony.workflow.loader.AbstractDescriptor)

populateTemplateParamsForInputAndEdit

protected void populateTemplateParamsForInputAndEdit(Map<String,Object> velocityParams,
                                                     Map<?,?> descriptorArgs)

getVelocityParamsForView

protected void getVelocityParamsForView(Map<String,Object> velocityParams,
                                        com.opensymphony.workflow.loader.AbstractDescriptor descriptor)
Description copied from class: AbstractWorkflowPluginFactory
Populates the given map with velocity parameters for 'view' velocity template. Eg. call descriptor.getArgs() to retrieve the current configuration, look up a displayable string for the value and and populate velocityParams with that.

Specified by:
getVelocityParamsForView in class AbstractWorkflowPluginFactory
Parameters:
velocityParams - Map to populate.
descriptor - Eg. a FunctionDescriptor or ConditionDescriptor describing the function/condition and its current configuration.
See Also:
AbstractWorkflowPluginFactory.getVelocityParams(String, com.opensymphony.workflow.loader.AbstractDescriptor)

populateTemplateParamsForView

protected void populateTemplateParamsForView(Map<String,Object> velocityParams,
                                             Map<?,?> descriptorArgs)

extractArgs

protected abstract Map<?,?> extractArgs(com.opensymphony.workflow.loader.AbstractDescriptor descriptor)

clearLegacyPermissionArgument

protected void clearLegacyPermissionArgument(Map<?,?> descriptorArgs)


Copyright © 2002-2014 Atlassian. All Rights Reserved.