com.atlassian.jira.web.bean
Class BulkEditBean

java.lang.Object
  extended by com.atlassian.jira.web.bean.BulkEditBean
All Implemented Interfaces:
OperationContext

public class BulkEditBean
extends java.lang.Object
implements OperationContext

Used in the BulkEdit Wizard Stores in session: currentStep action selected and values associated with that action issues selected


Field Summary
static java.lang.String BULK_DELETE
           
static java.lang.String BULK_DELETE_OP
           
static java.lang.String BULK_EDIT_OP
           
static java.lang.String BULK_MOVE_OP
           
static java.lang.String BULKEDIT_PREFIX
           
static java.lang.String SUBTASK_STATUS_INFO
           
 
Constructor Summary
BulkEditBean(IssueManager issueManager)
           
 
Method Summary
 void _setSelectedIssueGVsForTesting(java.util.List<org.ofbiz.core.entity.GenericValue> issues)
          Deprecated.  
 void addAvailablePreviousStep(int stepId)
           
 void addIssues(java.util.Collection<Issue> issues)
           
 void addRetainValue(java.lang.String fieldId)
           
 void clearAvailablePreviousSteps()
           
 java.util.Map<java.lang.String,BulkEditAction> getActions()
           
 java.lang.String getCheckboxName(Issue issue)
           
 int getCurrentStep()
           
 CustomField getCustomField(java.lang.String customFieldKey)
           
 java.lang.String getCustomFieldView(CustomField customField)
           
 java.util.Collection<FieldLayout> getFieldLayouts()
          Returns all the unique field layouts of the selected issues
 FieldScreenRenderer getFieldScreenRenderer()
           
 java.util.Map<java.lang.String,java.util.Map<java.lang.Long,java.lang.Long>> getFieldSubstitutionMap()
           
 java.util.Map<java.lang.String,java.lang.Object> getFieldValues()
           
 java.util.Map<java.lang.String,java.lang.Object> getFieldValuesHolder()
           
 Issue getFirstTargetIssueObject()
          This method is used to get a target issue that will provide the correct context (i.e.
static BulkEditBean getFromSession()
           
 java.util.Set<Issue> getInvalidIssues()
          Gets issues whose status is null
 java.util.Collection<org.ofbiz.core.entity.GenericValue> getInvalidStatuses()
          Gets a set of invalid statuses that are not valid in the destination workflow
 int getInvalidSubTaskCount()
           
 java.util.Set<java.lang.String> getInvalidSubTaskStatusesByType(java.lang.String subTaskTypeId)
           
 java.util.Set<java.lang.String> getInvalidSubTaskTypes()
           
 IssueOperation getIssueOperation()
           
 java.util.List<Issue> getIssuesFromSearchRequest()
           
 java.util.Collection<?> getIssuesInUse()
           
 org.ofbiz.core.entity.GenericValue getIssueType()
           
 java.util.Collection<IssueType> getIssueTypeObjects()
           
 java.util.Collection<java.lang.String> getIssueTypes()
           
 java.lang.String getKey()
          Returns a string that represents a "unique" identifier for this bulke edit bean
 int getMaxIssues()
          If there is a limit on the number of issues that can be bulk edited, this will return that number, otherwise -1.
 java.util.Map<?,?> getMessagedFieldLayoutItems()
           
 java.util.Collection<?> getMoveFieldLayoutItems()
           
 java.lang.String getOperationName()
           
 java.util.Map<java.lang.String,?> getParams()
           
 BulkEditBean getParentBulkEditBean()
           
 org.ofbiz.core.entity.GenericValue getProject()
           
 java.util.Collection<java.lang.Long> getProjectIds()
          returns a list of project ids for projects which the currently selected issues belong to.
 java.util.Collection<org.ofbiz.core.entity.GenericValue> getProjects()
           
 MultiBulkMoveBean getRelatedMultiBulkMoveBean()
           
 java.util.Collection<?> getRemovedFields()
           
 java.util.Set<java.lang.String> getRetainValues()
           
 java.util.List<Issue> getSelectedIssues()
          Returns a list of "selected" issues.
 java.util.List<Issue> getSelectedIssuesIncludingSubTasks()
           
 java.lang.String getSelectedTransitionName()
           
 WorkflowTransitionKey getSelectedWFTransitionKey()
           
 java.util.Map<java.lang.String,java.lang.String> getStatusMapHolder()
           
 BulkEditBean getSubTaskBulkEditBean()
           
 java.util.List<Issue> getSubTaskOfSelectedIssues()
           
 java.util.Collection<java.lang.String> getSubTaskStatusHolder()
           
 FieldLayout getTargetFieldLayout()
           
 FieldLayout getTargetFieldLayoutForType(java.lang.String targetTypeId)
           
 java.util.List<org.ofbiz.core.entity.GenericValue> getTargetIssueGVs()
          This is a convinience method for converting the list of objects to a list of GenericValues
 java.util.Map<Issue,Issue> getTargetIssueObjects()
           
 org.ofbiz.core.entity.GenericValue getTargetIssueTypeGV()
           
 java.lang.String getTargetIssueTypeId()
           
 IssueType getTargetIssueTypeObject()
           
 java.lang.Long getTargetPid()
           
 org.ofbiz.core.entity.GenericValue getTargetProjectGV()
           
 org.ofbiz.core.entity.GenericValue getTargetStatus(Issue issue)
           
 JiraWorkflow getTargetWorkflow()
           
 JiraWorkflow getTargetWorkflowByType(java.lang.String issueTypeId)
           
 java.util.List<WorkflowTransitionKey> getTransitionIdsForWorkflow(java.lang.String workflowName)
           
 java.util.List<java.lang.String> getTransitionIssueKeys(WorkflowTransitionKey workflowTransitionKey)
           
 java.lang.String getTransitionName(java.lang.String workflowName, java.lang.String actionDescriptorId)
           
 java.util.Set<java.lang.String> getWorkflowsInUse()
           
 org.apache.commons.collections.MultiMap getWorkflowTransitionMap()
           
 void initMultiBulkBean()
           
 void initMultiBulkBeanWithSubTasks()
           
 void initSelectedIssues(java.util.Collection<Issue> selectedIssues)
          Initialises the BulkEditBean with the selected issues
 boolean isAvailablePreviousStep(int stepId)
           
 boolean isChecked(Issue issue)
           
 boolean isHasMailServer()
          Check if a mail server has been specified.
 boolean isMultipleProjects()
           
 boolean isMutipleIssueTypes()
           
 boolean isOnlyContainsSubTasks()
           
 boolean isRetainChecked(java.lang.String fieldId)
           
 boolean isSendBulkNotification()
           
 boolean isSubTaskCollection()
           
 boolean isSubTaskOnly()
           
 boolean isTransitionChecked(WorkflowTransitionKey workflowTransitionKey)
           
 void populateStatusHolder()
           
 void populateSubTaskStatusHolder()
           
static void removeFromSession()
           
 void resetMoveData()
           
 void resetWorkflowTransitionSelection()
           
 void setActions(java.util.Map<java.lang.String,BulkEditAction> actions)
           
 void setCurrentStep(int currentStep)
           
 void setFieldScreenRenderer(FieldScreenRenderer fieldScreenRenderer)
           
 void setInvalidSubTaskStatusesByType(java.util.Map<java.lang.String,java.util.Set<java.lang.String>> invalidSubTaskStatusesByType)
           
 void setInvalidSubTaskTypes(java.util.Set<java.lang.String> invalidSubTaskTypes)
           
 void setIssuesFromSearchRequest(java.util.List<Issue> issuesFromSearchRequest)
           
 void setIssuesInUse(java.util.Collection<?> issuesInUse)
           
 void setMaxIssues(int maxIssues)
          Sets the maximum number of issues allowed to be bulk edited at once.
 void setMessagedFieldLayoutItems(java.util.Map<?,?> messagedFieldLayoutItems)
           
 void setMoveFieldLayoutItems(java.util.Collection<?> moveFieldLayoutItems)
           
 void setOperationName(java.lang.String operationName)
           
 void setParams(java.util.Map<java.lang.String,?> params)
           
 void setParentBulkEditBean(BulkEditBean parentBulkEditBean)
          If this BulkEditBean contains subtasks of another BulkEditBean, then we can set a pointer back to the BulkEditBean containing the parent issues.
 void setRelatedMultiBulkMoveBean(MultiBulkMoveBean relatedMultiBulkMoveBean)
           
 void setRemovedFields(java.util.Set<?> removedFields)
           
 void setRetainValues(java.util.Set<java.lang.String> retainValues)
           
 void setSelectedWFTransitionKey(WorkflowTransitionKey workflowTransitionKey)
           
 void setSendBulkNotification(boolean sendBulkNotification)
           
 void setSubTaskBulkEditBean(BulkEditBean subTaskBulkEditBean)
           
 void setSubTaskOfSelectedIssues(java.util.List<Issue> subTaskOfSelectedIssues)
           
 void setTargetFieldLayout()
          Sets the targetFieldLayout to the appropriate FieldLayout (aka "Field Configuration") for the target Project and Issue Type.
 void setTargetIssueObjects(java.util.Map<Issue,Issue> targetIssueObjects)
           
 void setTargetIssueTypeId(java.lang.String id)
           
 void setTargetProject(org.ofbiz.core.entity.GenericValue project)
           
 void setWorkflowTransitionMap(org.apache.commons.collections.MultiMap workflowTransitionMap)
           
static void storeToSession(BulkEditBean bulkEditBean)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUBTASK_STATUS_INFO

public static final java.lang.String SUBTASK_STATUS_INFO
See Also:
Constant Field Values

BULK_MOVE_OP

public static final java.lang.String BULK_MOVE_OP
See Also:
Constant Field Values

BULK_DELETE_OP

public static final java.lang.String BULK_DELETE_OP
See Also:
Constant Field Values

BULK_EDIT_OP

public static final java.lang.String BULK_EDIT_OP
See Also:
Constant Field Values

BULK_DELETE

public static final java.lang.String BULK_DELETE
See Also:
Constant Field Values

BULKEDIT_PREFIX

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

BulkEditBean

public BulkEditBean(IssueManager issueManager)
Method Detail

getParentBulkEditBean

public BulkEditBean getParentBulkEditBean()

initSelectedIssues

public void initSelectedIssues(java.util.Collection<Issue> selectedIssues)
Initialises the BulkEditBean with the selected issues

Parameters:
selectedIssues - Required selected Issues.

addIssues

public void addIssues(java.util.Collection<Issue> issues)

getSelectedIssues

public java.util.List<Issue> getSelectedIssues()
Returns a list of "selected" issues. For the "top level" BulkEditBean this should be the actual issues chosen by the user for the bulk operation.

The Bulk Move operation will then break this list up in groups of project and issue type and store each of these types in its own BulkEditBean, so for these nested BulkEditBeans this list may be a subset of the original selected issues. Furthermore when moving parent issues to a new Project, we will have to move any subtasks as well. In this case a third level of BulkEditBean is created and these ones will have subtasks that may not have been explicitly selected by the user at all.

Returns:
List of the Selected Issues

getSelectedIssuesIncludingSubTasks

public java.util.List<Issue> getSelectedIssuesIncludingSubTasks()

isChecked

public boolean isChecked(Issue issue)

isMultipleProjects

public boolean isMultipleProjects()

isMutipleIssueTypes

public boolean isMutipleIssueTypes()

getProject

public org.ofbiz.core.entity.GenericValue getProject()

getIssueType

public org.ofbiz.core.entity.GenericValue getIssueType()

getFieldLayouts

public java.util.Collection<FieldLayout> getFieldLayouts()
Returns all the unique field layouts of the selected issues

Returns:
Collection of the FieldLayouts.

getKey

public java.lang.String getKey()
Returns a string that represents a "unique" identifier for this bulke edit bean

Returns:
unique key formed from projects, issue types, target project if a subtask only bulkeditbean and size of the bean

getProjectIds

public java.util.Collection<java.lang.Long> getProjectIds()
returns a list of project ids for projects which the currently selected issues belong to.

Returns:
A list of project ids for projects which the currently selected issues belong to.

getProjects

public java.util.Collection<org.ofbiz.core.entity.GenericValue> getProjects()

getIssueTypes

public java.util.Collection<java.lang.String> getIssueTypes()

getIssueTypeObjects

public java.util.Collection<IssueType> getIssueTypeObjects()

getCheckboxName

public java.lang.String getCheckboxName(Issue issue)

getCustomField

public CustomField getCustomField(java.lang.String customFieldKey)
                           throws org.ofbiz.core.entity.GenericEntityException
Throws:
org.ofbiz.core.entity.GenericEntityException

getCustomFieldView

public java.lang.String getCustomFieldView(CustomField customField)
                                    throws FieldValidationException
Throws:
FieldValidationException

setParams

public void setParams(java.util.Map<java.lang.String,?> params)

getParams

public java.util.Map<java.lang.String,?> getParams()

setIssuesInUse

public void setIssuesInUse(java.util.Collection<?> issuesInUse)

addAvailablePreviousStep

public void addAvailablePreviousStep(int stepId)

clearAvailablePreviousSteps

public void clearAvailablePreviousSteps()

isAvailablePreviousStep

public boolean isAvailablePreviousStep(int stepId)

isHasMailServer

public boolean isHasMailServer()
Check if a mail server has been specified.

Returns:
boolean true if a mail server has been specified

getMoveFieldLayoutItems

public java.util.Collection<?> getMoveFieldLayoutItems()

setMoveFieldLayoutItems

public void setMoveFieldLayoutItems(java.util.Collection<?> moveFieldLayoutItems)

getTargetPid

public java.lang.Long getTargetPid()

setTargetProject

public void setTargetProject(org.ofbiz.core.entity.GenericValue project)

getTargetProjectGV

public org.ofbiz.core.entity.GenericValue getTargetProjectGV()

setTargetIssueTypeId

public void setTargetIssueTypeId(java.lang.String id)

getTargetIssueTypeId

public java.lang.String getTargetIssueTypeId()

getTargetIssueTypeGV

public org.ofbiz.core.entity.GenericValue getTargetIssueTypeGV()

getTargetIssueTypeObject

public IssueType getTargetIssueTypeObject()

populateStatusHolder

public void populateStatusHolder()
                          throws WorkflowException
Throws:
WorkflowException

getInvalidStatuses

public java.util.Collection<org.ofbiz.core.entity.GenericValue> getInvalidStatuses()
                                                                            throws WorkflowException
Gets a set of invalid statuses that are not valid in the destination workflow

Returns:
Set of GenericValue objects
Throws:
WorkflowException

getInvalidIssues

public java.util.Set<Issue> getInvalidIssues()
                                      throws WorkflowException
Gets issues whose status is null

Returns:
Set of Issue objects. Emoty Set if no invalid issues
Throws:
WorkflowException

getInvalidSubTaskTypes

public java.util.Set<java.lang.String> getInvalidSubTaskTypes()
                                                       throws WorkflowException
Throws:
WorkflowException

getInvalidSubTaskStatusesByType

public java.util.Set<java.lang.String> getInvalidSubTaskStatusesByType(java.lang.String subTaskTypeId)
                                                                throws WorkflowException
Throws:
WorkflowException

setTargetFieldLayout

public void setTargetFieldLayout()
                          throws FieldLayoutStorageException
Sets the targetFieldLayout to the appropriate FieldLayout (aka "Field Configuration") for the target Project and Issue Type.

Throws:
FieldLayoutStorageException - If the FieldLayoutManager cannot retrieve the FieldLayout.

getTargetFieldLayout

public FieldLayout getTargetFieldLayout()

getTargetFieldLayoutForType

public FieldLayout getTargetFieldLayoutForType(java.lang.String targetTypeId)
                                        throws FieldLayoutStorageException
Throws:
FieldLayoutStorageException

getTargetWorkflow

public JiraWorkflow getTargetWorkflow()
                               throws WorkflowException
Throws:
WorkflowException

getFirstTargetIssueObject

public Issue getFirstTargetIssueObject()
This method is used to get a target issue that will provide the correct context (i.e. project and issue type), for where you are moving to. The object returned is not mapped to a specific selected issue.

Returns:
an issue whose project and issue type are of where the you are moving to.

getTargetIssueObjects

public java.util.Map<Issue,Issue> getTargetIssueObjects()

setTargetIssueObjects

public void setTargetIssueObjects(java.util.Map<Issue,Issue> targetIssueObjects)

getTargetIssueGVs

public java.util.List<org.ofbiz.core.entity.GenericValue> getTargetIssueGVs()
This is a convinience method for converting the list of objects to a list of GenericValues

Returns:
list of GenericValue issue objects

getTargetStatus

public org.ofbiz.core.entity.GenericValue getTargetStatus(Issue issue)

getStatusMapHolder

public java.util.Map<java.lang.String,java.lang.String> getStatusMapHolder()

getRemovedFields

public java.util.Collection<?> getRemovedFields()

setRemovedFields

public void setRemovedFields(java.util.Set<?> removedFields)

resetMoveData

public void resetMoveData()

populateSubTaskStatusHolder

public void populateSubTaskStatusHolder()
                                 throws WorkflowException
Throws:
WorkflowException

getTargetWorkflowByType

public JiraWorkflow getTargetWorkflowByType(java.lang.String issueTypeId)
                                     throws WorkflowException
Throws:
WorkflowException

getSubTaskStatusHolder

public java.util.Collection<java.lang.String> getSubTaskStatusHolder()

isRetainChecked

public boolean isRetainChecked(java.lang.String fieldId)

isSubTaskCollection

public boolean isSubTaskCollection()

isSubTaskOnly

public boolean isSubTaskOnly()

getOperationName

public java.lang.String getOperationName()

setOperationName

public void setOperationName(java.lang.String operationName)

setInvalidSubTaskStatusesByType

public void setInvalidSubTaskStatusesByType(java.util.Map<java.lang.String,java.util.Set<java.lang.String>> invalidSubTaskStatusesByType)

setInvalidSubTaskTypes

public void setInvalidSubTaskTypes(java.util.Set<java.lang.String> invalidSubTaskTypes)

getInvalidSubTaskCount

public int getInvalidSubTaskCount()

getRetainValues

public java.util.Set<java.lang.String> getRetainValues()

setRetainValues

public void setRetainValues(java.util.Set<java.lang.String> retainValues)

addRetainValue

public void addRetainValue(java.lang.String fieldId)

getSubTaskOfSelectedIssues

public java.util.List<Issue> getSubTaskOfSelectedIssues()

setSubTaskOfSelectedIssues

public void setSubTaskOfSelectedIssues(java.util.List<Issue> subTaskOfSelectedIssues)

getIssuesFromSearchRequest

public java.util.List<Issue> getIssuesFromSearchRequest()

setIssuesFromSearchRequest

public void setIssuesFromSearchRequest(java.util.List<Issue> issuesFromSearchRequest)

getCurrentStep

public int getCurrentStep()

setCurrentStep

public void setCurrentStep(int currentStep)

getActions

public java.util.Map<java.lang.String,BulkEditAction> getActions()

setActions

public void setActions(java.util.Map<java.lang.String,BulkEditAction> actions)

getFieldValues

public java.util.Map<java.lang.String,java.lang.Object> getFieldValues()

getFieldValuesHolder

public java.util.Map<java.lang.String,java.lang.Object> getFieldValuesHolder()
Specified by:
getFieldValuesHolder in interface OperationContext

getIssueOperation

public IssueOperation getIssueOperation()
Specified by:
getIssueOperation in interface OperationContext

getIssuesInUse

public java.util.Collection<?> getIssuesInUse()

getSubTaskBulkEditBean

public BulkEditBean getSubTaskBulkEditBean()

setSubTaskBulkEditBean

public void setSubTaskBulkEditBean(BulkEditBean subTaskBulkEditBean)

getRelatedMultiBulkMoveBean

public MultiBulkMoveBean getRelatedMultiBulkMoveBean()

setRelatedMultiBulkMoveBean

public void setRelatedMultiBulkMoveBean(MultiBulkMoveBean relatedMultiBulkMoveBean)

isSendBulkNotification

public boolean isSendBulkNotification()

setSendBulkNotification

public void setSendBulkNotification(boolean sendBulkNotification)

getWorkflowTransitionMap

public org.apache.commons.collections.MultiMap getWorkflowTransitionMap()

setWorkflowTransitionMap

public void setWorkflowTransitionMap(org.apache.commons.collections.MultiMap workflowTransitionMap)

getWorkflowsInUse

public java.util.Set<java.lang.String> getWorkflowsInUse()

getTransitionIdsForWorkflow

public java.util.List<WorkflowTransitionKey> getTransitionIdsForWorkflow(java.lang.String workflowName)

getTransitionName

public java.lang.String getTransitionName(java.lang.String workflowName,
                                          java.lang.String actionDescriptorId)

getTransitionIssueKeys

public java.util.List<java.lang.String> getTransitionIssueKeys(WorkflowTransitionKey workflowTransitionKey)

setSelectedWFTransitionKey

public void setSelectedWFTransitionKey(WorkflowTransitionKey workflowTransitionKey)

getSelectedWFTransitionKey

public WorkflowTransitionKey getSelectedWFTransitionKey()

resetWorkflowTransitionSelection

public void resetWorkflowTransitionSelection()

isTransitionChecked

public boolean isTransitionChecked(WorkflowTransitionKey workflowTransitionKey)

getSelectedTransitionName

public java.lang.String getSelectedTransitionName()

setFieldScreenRenderer

public void setFieldScreenRenderer(FieldScreenRenderer fieldScreenRenderer)

getFieldScreenRenderer

public FieldScreenRenderer getFieldScreenRenderer()

_setSelectedIssueGVsForTesting

@Deprecated
public void _setSelectedIssueGVsForTesting(java.util.List<org.ofbiz.core.entity.GenericValue> issues)
Deprecated. 

Use for testing ONLY

Parameters:
issues -

getMessagedFieldLayoutItems

public java.util.Map<?,?> getMessagedFieldLayoutItems()

setMessagedFieldLayoutItems

public void setMessagedFieldLayoutItems(java.util.Map<?,?> messagedFieldLayoutItems)

initMultiBulkBean

public void initMultiBulkBean()

initMultiBulkBeanWithSubTasks

public void initMultiBulkBeanWithSubTasks()

isOnlyContainsSubTasks

public boolean isOnlyContainsSubTasks()

storeToSession

public static void storeToSession(BulkEditBean bulkEditBean)

getFromSession

public static BulkEditBean getFromSession()

removeFromSession

public static void removeFromSession()

setParentBulkEditBean

public void setParentBulkEditBean(BulkEditBean parentBulkEditBean)
If this BulkEditBean contains subtasks of another BulkEditBean, then we can set a pointer back to the BulkEditBean containing the parent issues. This is used so that the subtask issues have access to the new values in their parent issues. See JRA-13937 where we had to ensure that the subtasks in a Bulk Move could get to the new Security Level of their parents.

Parameters:
parentBulkEditBean - The BulkEditBean that contains parent issues of the issues (subtasks) in this BulkEditBean.

getMaxIssues

public int getMaxIssues()
If there is a limit on the number of issues that can be bulk edited, this will return that number, otherwise -1.

Returns:
-1 to indicate no limit on bulk editing issues, otherwise the number of the limit.

setMaxIssues

public void setMaxIssues(int maxIssues)
Sets the maximum number of issues allowed to be bulk edited at once. Use -1 to indicate no limit.

Parameters:
maxIssues - either -1 or a positive integer representing the maximum number of issues allowed for bulk edit.

getFieldSubstitutionMap

public java.util.Map<java.lang.String,java.util.Map<java.lang.Long,java.lang.Long>> getFieldSubstitutionMap()


Copyright © 2002-2010 Atlassian. All Rights Reserved.