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 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 String BULK_DELETE
           
static String BULK_DELETE_OP
           
static String BULK_EDIT_OP
           
static String BULK_MOVE_OP
           
static String BULKEDIT_PREFIX
           
static String SUBTASK_STATUS_INFO
           
 
Constructor Summary
BulkEditBean(IssueManager issueManager)
           
 
Method Summary
 void _setSelectedIssueGVsForTesting(List<org.ofbiz.core.entity.GenericValue> issues)
          Deprecated.  
 void addAvailablePreviousStep(int stepId)
           
 void addIssues(Collection<Issue> issues)
           
 void addRetainValue(String fieldId)
           
 void clearAvailablePreviousSteps()
           
 Map<String,BulkEditAction> getActions()
           
 String getCheckboxName(Issue issue)
           
 int getCurrentStep()
           
 CustomField getCustomField(String customFieldKey)
           
 String getCustomFieldView(CustomField customField)
           
 Collection<FieldLayout> getFieldLayouts()
          Returns all the unique field layouts of the selected issues
 FieldScreenRenderer getFieldScreenRenderer()
           
 Map<String,Object> getFieldValues()
           
 Map<String,Object> getFieldValuesHolder()
           
 Issue getFirstTargetIssueObject()
          This method is used to get a target issue that will provide the correct context (i.e.
static BulkEditBean getFromSession()
           
 Set<Issue> getInvalidIssues()
          Gets issues whose status is null
 Collection<org.ofbiz.core.entity.GenericValue> getInvalidStatuses()
          Gets a set of invalid statuses that are not valid in the destination workflow
 int getInvalidSubTaskCount()
           
 Set<String> getInvalidSubTaskStatusesByType(String subTaskTypeId)
           
 Set<String> getInvalidSubTaskTypes()
           
 IssueOperation getIssueOperation()
           
 List<Issue> getIssuesFromSearchRequest()
           
 Collection<?> getIssuesInUse()
           
 org.ofbiz.core.entity.GenericValue getIssueType()
           
 Collection<IssueType> getIssueTypeObjects()
           
 Collection<String> getIssueTypes()
           
 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.
 Map<?,?> getMessagedFieldLayoutItems()
           
 Collection<?> getMoveFieldLayoutItems()
           
 String getOperationName()
           
 Map<String,?> getParams()
           
 BulkEditBean getParentBulkEditBean()
           
 org.ofbiz.core.entity.GenericValue getProject()
           
 Collection<Long> getProjectIds()
          returns a list of project ids for projects which the currently selected issues belong to.
 Collection<org.ofbiz.core.entity.GenericValue> getProjects()
           
 MultiBulkMoveBean getRelatedMultiBulkMoveBean()
           
 Collection<?> getRemovedFields()
           
 Set<String> getRetainValues()
           
 List<Issue> getSelectedIssues()
          Returns a list of "selected" issues.
 List<Issue> getSelectedIssuesIncludingSubTasks()
           
 String getSelectedTransitionName()
           
 WorkflowTransitionKey getSelectedWFTransitionKey()
           
 Map<String,String> getStatusMapHolder()
           
 BulkEditBean getSubTaskBulkEditBean()
           
 List<Issue> getSubTaskOfSelectedIssues()
           
 Collection<String> getSubTaskStatusHolder()
           
 FieldLayout getTargetFieldLayout()
           
 FieldLayout getTargetFieldLayoutForType(String targetTypeId)
           
 List<org.ofbiz.core.entity.GenericValue> getTargetIssueGVs()
          This is a convinience method for converting the list of objects to a list of GenericValues
 Map<Issue,Issue> getTargetIssueObjects()
           
 org.ofbiz.core.entity.GenericValue getTargetIssueTypeGV()
           
 String getTargetIssueTypeId()
           
 IssueType getTargetIssueTypeObject()
           
 Long getTargetPid()
           
 org.ofbiz.core.entity.GenericValue getTargetProjectGV()
           
 org.ofbiz.core.entity.GenericValue getTargetStatus(Issue issue)
           
 JiraWorkflow getTargetWorkflow()
           
 JiraWorkflow getTargetWorkflowByType(String issueTypeId)
           
 List<WorkflowTransitionKey> getTransitionIdsForWorkflow(String workflowName)
           
 List<String> getTransitionIssueKeys(WorkflowTransitionKey workflowTransitionKey)
           
 String getTransitionName(String workflowName, String actionDescriptorId)
           
 Set<String> getWorkflowsInUse()
           
 org.apache.commons.collections.MultiMap getWorkflowTransitionMap()
           
 void initMultiBulkBean()
           
 void initMultiBulkBeanWithSubTasks()
           
 void initSelectedIssues(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(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(Map<String,BulkEditAction> actions)
           
 void setCurrentStep(int currentStep)
           
 void setFieldScreenRenderer(FieldScreenRenderer fieldScreenRenderer)
           
 void setInvalidSubTaskStatusesByType(Map<String,Set<String>> invalidSubTaskStatusesByType)
           
 void setInvalidSubTaskTypes(Set<String> invalidSubTaskTypes)
           
 void setIssuesFromSearchRequest(List<Issue> issuesFromSearchRequest)
           
 void setIssuesInUse(Collection<?> issuesInUse)
           
 void setMaxIssues(int maxIssues)
          Sets the maximum number of issues allowed to be bulk edited at once.
 void setMessagedFieldLayoutItems(Map<?,?> messagedFieldLayoutItems)
           
 void setMoveFieldLayoutItems(Collection<?> moveFieldLayoutItems)
           
 void setOperationName(String operationName)
           
 void setParams(Map<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(Set<?> removedFields)
           
 void setRetainValues(Set<String> retainValues)
           
 void setSelectedWFTransitionKey(WorkflowTransitionKey workflowTransitionKey)
           
 void setSendBulkNotification(boolean sendBulkNotification)
           
 void setSubTaskBulkEditBean(BulkEditBean subTaskBulkEditBean)
           
 void setSubTaskOfSelectedIssues(List<Issue> subTaskOfSelectedIssues)
           
 void setTargetFieldLayout()
          Sets the targetFieldLayout to the appropriate FieldLayout (aka "Field Configuration") for the target Project and Issue Type.
 void setTargetIssueObjects(Map<Issue,Issue> targetIssueObjects)
           
 void setTargetIssueTypeId(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 String SUBTASK_STATUS_INFO
See Also:
Constant Field Values

BULK_MOVE_OP

public static final String BULK_MOVE_OP
See Also:
Constant Field Values

BULK_DELETE_OP

public static final String BULK_DELETE_OP
See Also:
Constant Field Values

BULK_EDIT_OP

public static final String BULK_EDIT_OP
See Also:
Constant Field Values

BULK_DELETE

public static final String BULK_DELETE
See Also:
Constant Field Values

BULKEDIT_PREFIX

public static final 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(Collection<Issue> selectedIssues)
Initialises the BulkEditBean with the selected issues

Parameters:
selectedIssues - Required selected Issues.

addIssues

public void addIssues(Collection<Issue> issues)

getSelectedIssues

public 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 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 Collection<FieldLayout> getFieldLayouts()
Returns all the unique field layouts of the selected issues

Returns:
Collection of the FieldLayouts.

getKey

public 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 Collection<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 Collection<org.ofbiz.core.entity.GenericValue> getProjects()

getIssueTypes

public Collection<String> getIssueTypes()

getIssueTypeObjects

public Collection<IssueType> getIssueTypeObjects()

getCheckboxName

public String getCheckboxName(Issue issue)

getCustomField

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

getCustomFieldView

public String getCustomFieldView(CustomField customField)
                          throws FieldValidationException
Throws:
FieldValidationException

setParams

public void setParams(Map<String,?> params)

getParams

public Map<String,?> getParams()

setIssuesInUse

public void setIssuesInUse(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 Collection<?> getMoveFieldLayoutItems()

setMoveFieldLayoutItems

public void setMoveFieldLayoutItems(Collection<?> moveFieldLayoutItems)

getTargetPid

public Long getTargetPid()

setTargetProject

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

getTargetProjectGV

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

setTargetIssueTypeId

public void setTargetIssueTypeId(String id)

getTargetIssueTypeId

public String getTargetIssueTypeId()

getTargetIssueTypeGV

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

getTargetIssueTypeObject

public IssueType getTargetIssueTypeObject()

populateStatusHolder

public void populateStatusHolder()
                          throws WorkflowException
Throws:
WorkflowException

getInvalidStatuses

public 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 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 Set<String> getInvalidSubTaskTypes()
                                   throws WorkflowException
Throws:
WorkflowException

getInvalidSubTaskStatusesByType

public Set<String> getInvalidSubTaskStatusesByType(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(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 Map<Issue,Issue> getTargetIssueObjects()

setTargetIssueObjects

public void setTargetIssueObjects(Map<Issue,Issue> targetIssueObjects)

getTargetIssueGVs

public 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 Map<String,String> getStatusMapHolder()

getRemovedFields

public Collection<?> getRemovedFields()

setRemovedFields

public void setRemovedFields(Set<?> removedFields)

resetMoveData

public void resetMoveData()

populateSubTaskStatusHolder

public void populateSubTaskStatusHolder()
                                 throws WorkflowException
Throws:
WorkflowException

getTargetWorkflowByType

public JiraWorkflow getTargetWorkflowByType(String issueTypeId)
                                     throws WorkflowException
Throws:
WorkflowException

getSubTaskStatusHolder

public Collection<String> getSubTaskStatusHolder()

isRetainChecked

public boolean isRetainChecked(String fieldId)

isSubTaskCollection

public boolean isSubTaskCollection()

isSubTaskOnly

public boolean isSubTaskOnly()

getOperationName

public String getOperationName()

setOperationName

public void setOperationName(String operationName)

setInvalidSubTaskStatusesByType

public void setInvalidSubTaskStatusesByType(Map<String,Set<String>> invalidSubTaskStatusesByType)

setInvalidSubTaskTypes

public void setInvalidSubTaskTypes(Set<String> invalidSubTaskTypes)

getInvalidSubTaskCount

public int getInvalidSubTaskCount()

getRetainValues

public Set<String> getRetainValues()

setRetainValues

public void setRetainValues(Set<String> retainValues)

addRetainValue

public void addRetainValue(String fieldId)

getSubTaskOfSelectedIssues

public List<Issue> getSubTaskOfSelectedIssues()

setSubTaskOfSelectedIssues

public void setSubTaskOfSelectedIssues(List<Issue> subTaskOfSelectedIssues)

getIssuesFromSearchRequest

public List<Issue> getIssuesFromSearchRequest()

setIssuesFromSearchRequest

public void setIssuesFromSearchRequest(List<Issue> issuesFromSearchRequest)

getCurrentStep

public int getCurrentStep()

setCurrentStep

public void setCurrentStep(int currentStep)

getActions

public Map<String,BulkEditAction> getActions()

setActions

public void setActions(Map<String,BulkEditAction> actions)

getFieldValues

public Map<String,Object> getFieldValues()

getFieldValuesHolder

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

getIssueOperation

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

getIssuesInUse

public 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 Set<String> getWorkflowsInUse()

getTransitionIdsForWorkflow

public List<WorkflowTransitionKey> getTransitionIdsForWorkflow(String workflowName)

getTransitionName

public String getTransitionName(String workflowName,
                                String actionDescriptorId)

getTransitionIssueKeys

public List<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 String getSelectedTransitionName()

setFieldScreenRenderer

public void setFieldScreenRenderer(FieldScreenRenderer fieldScreenRenderer)

getFieldScreenRenderer

public FieldScreenRenderer getFieldScreenRenderer()

_setSelectedIssueGVsForTesting

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

Use for testing ONLY

Parameters:
issues -

getMessagedFieldLayoutItems

public Map<?,?> getMessagedFieldLayoutItems()

setMessagedFieldLayoutItems

public void setMessagedFieldLayoutItems(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.


Copyright © 2002-2009 Atlassian. All Rights Reserved.