public class

BulkEditBeanImpl

extends Object
implements BulkEditBean
java.lang.Object
   ↳ com.atlassian.jira.web.bean.BulkEditBeanImpl

Class Overview

Implementation of BulkEditBean.

BulkEditBean was originally a concrete class, but it has been made abstract in order to separate API and implementation in JIRA.

Summary

[Expand]
Inherited Constants
From interface com.atlassian.jira.web.bean.BulkEditBean
Public Constructors
BulkEditBeanImpl(IssueManager issueManager)
Public Methods
@Deprecated void _setSelectedIssueGVsForTesting(List<GenericValue> issues)
This method is deprecated. No replacement.
void addAvailablePreviousStep(int stepId)
void addIssues(Collection<Issue> issues)
void addRetainValue(String fieldId)
void addTransitionErrors(String issueKey, Collection<String> errors)
void clearAvailablePreviousSteps()
Map<StringBulkEditAction> getActions()
BulkEditMultiSelectFieldBean getBulkEditMultiSelectFieldBean()
Returns BulkEditMultiSelectFieldBean which stores change mode options for multi select system fields (Affects Version/s, Fix Version/s, Labels, Components)
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<StringMap<LongLong>> getFieldSubstitutionMap()
Map<StringObject> getFieldValues()
Map<StringObject> getFieldValuesHolder()
Issue getFirstTargetIssueObject()
This method is used to get a target issue that will provide the correct context (i.e.
Set<Issue> getInvalidIssues()
Gets issues whose status is null
Collection<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()
IssueType getIssueType()
Collection<IssueType> getIssueTypeObjects()
Collection<String> getIssueTypes()
List<Issue> getIssuesFromSearchRequest()
Collection<?> getIssuesInUse()
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()
String getParentIssueKey()
Gets the destination parent issue for issue->subtask conversion.
Issue getParentIssueObject()
returns object from database, the object is queried by getParentIssueKey().
Project getProject()
Collection<Long> getProjectIds()
returns a list of project ids for projects which the currently selected issues belong to.
Collection<Project> getProjectObjects()
Collection<GenericValue> getProjects()
@return
String getRedirectUrl()
Returns the redirect URL.
MultiBulkMoveBean getRelatedMultiBulkMoveBean()
Collection<?> getRemovedFields()
Set<String> getRetainValues()
List<Issue> getSelectedIssues()
Returns a list of "selected" issues.
List<Issue> getSelectedIssuesIncludingSubTasks()
String getSelectedTransitionName()
WorkflowTransitionKey getSelectedWFTransitionKey()
String getSingleIssueKey()
Gets the issue key for this bean as previously set by setSingleIssueKey(String).
Project getSingleProject()
Returns the single Project if there is only one Project in this BulkEditBean, otherwise throws an IllegalStateException.
Map<StringString> getStatusMapHolder()
BulkEditBean getSubTaskBulkEditBean()
List<Issue> getSubTaskOfSelectedIssues()
Collection<String> getSubTaskStatusHolder()
FieldLayout getTargetFieldLayout()
FieldLayout getTargetFieldLayoutForType(String targetTypeId)
List<GenericValue> getTargetIssueGVs()
This is a convinience method for converting the list of objects to a list of GenericValues
Map<IssueIssue> getTargetIssueObjects()
IssueType getTargetIssueType()
String getTargetIssueTypeId()
IssueType getTargetIssueTypeObject()
Long getTargetPid()
Project getTargetProject()
Status getTargetStatus(Issue issue)
Status getTargetStatusObject(Issue issue)
JiraWorkflow getTargetWorkflow()
JiraWorkflow getTargetWorkflowByType(String issueTypeId)
Map<StringCollection<String>> getTransitionErrors(Integer maxCount)
Get the transition errors after bulk issue transition
List<WorkflowTransitionKey> getTransitionIdsForWorkflow(String workflowName)
List<String> getTransitionIssueKeys(WorkflowTransitionKey workflowTransitionKey)
String getTransitionName(String workflowName, String actionDescriptorId)
MultiMap getWorkflowTransitionMap()
Set<String> getWorkflowsInUse()
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 isRedirectUrlSet()
Whether the URL to return to has been set yet.
boolean isRetainChecked(String fieldId)
boolean isSendBulkNotification()
boolean isSingleMode()
Indicates where this bean is being used to move a single issue with subtasks.
boolean isSubTaskCollection()
boolean isSubTaskOnly()
boolean isTranisitionErrorsLimited(Integer maxCount)
boolean isTransitionChecked(WorkflowTransitionKey workflowTransitionKey)
void populateStatusHolder()
void populateSubTaskStatusHolder()
void resetMoveData()
void resetWorkflowTransitionSelection()
void setActions(Map<StringBulkEditAction> actions)
void setCurrentStep(int currentStep)
void setFieldScreenRenderer(FieldScreenRenderer fieldScreenRenderer)
void setInvalidSubTaskStatusesByType(Map<StringSet<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 setParentIssueKey(String parentIssueKey)
Sets the destination parent issue for issue->subtask conversion.
void setRedirectUrl(String redirectUrl)
Sets the URL to which user should be redirected once the bulk operation is finished.
void setRelatedMultiBulkMoveBean(MultiBulkMoveBean relatedMultiBulkMoveBean)
void setRemovedFields(Set<?> removedFields)
void setRetainValues(Set<String> retainValues)
void setSelectedWFTransitionKey(WorkflowTransitionKey workflowTransitionKey)
void setSendBulkNotification(boolean sendBulkNotification)
void setSingleIssueKey(String singleIssueKey)
Sets this bean to "single issue mode".
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<IssueIssue> targetIssueObjects)
void setTargetIssueTypeId(String id)
void setTargetProject(GenericValue project)
void setTargetProject(Project project)
void setWorkflowTransitionMap(MultiMap workflowTransitionMap)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.issue.customfields.OperationContext
From interface com.atlassian.jira.web.bean.BulkEditBean
From interface com.atlassian.jira.web.bean.SingleIssueModeEditBean

Public Constructors

public BulkEditBeanImpl (IssueManager issueManager)

Public Methods

@Deprecated public void _setSelectedIssueGVsForTesting (List<GenericValue> issues)

This method is deprecated.
No replacement.

Use for testing ONLY

public void addAvailablePreviousStep (int stepId)

public void addIssues (Collection<Issue> issues)

public void addRetainValue (String fieldId)

public void addTransitionErrors (String issueKey, Collection<String> errors)

public void clearAvailablePreviousSteps ()

public Map<StringBulkEditAction> getActions ()

public BulkEditMultiSelectFieldBean getBulkEditMultiSelectFieldBean ()

Returns BulkEditMultiSelectFieldBean which stores change mode options for multi select system fields (Affects Version/s, Fix Version/s, Labels, Components)

Returns

public String getCheckboxName (Issue issue)

public int getCurrentStep ()

public CustomField getCustomField (String customFieldKey)

Throws
GenericEntityException

public String getCustomFieldView (CustomField customField)

public Collection<FieldLayout> getFieldLayouts ()

Returns all the unique field layouts of the selected issues

Returns
  • Collection of the FieldLayouts.

public FieldScreenRenderer getFieldScreenRenderer ()

public Map<StringMap<LongLong>> getFieldSubstitutionMap ()

public Map<StringObject> getFieldValues ()

public Map<StringObject> getFieldValuesHolder ()

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.

public Set<Issue> getInvalidIssues ()

Gets issues whose status is null

Returns
  • Set of Issue objects. Emoty Set if no invalid issues

public Collection<GenericValue> getInvalidStatuses ()

Gets a set of invalid statuses that are not valid in the destination workflow

Returns
  • Set of GenericValue objects

public int getInvalidSubTaskCount ()

public Set<String> getInvalidSubTaskStatusesByType (String subTaskTypeId)

public Set<String> getInvalidSubTaskTypes ()

public IssueOperation getIssueOperation ()

public IssueType getIssueType ()

public Collection<IssueType> getIssueTypeObjects ()

public Collection<String> getIssueTypes ()

public List<Issue> getIssuesFromSearchRequest ()

public Collection<?> getIssuesInUse ()

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

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.

public Map<?, ?> getMessagedFieldLayoutItems ()

public Collection<?> getMoveFieldLayoutItems ()

public String getOperationName ()

public Map<String, ?> getParams ()

public BulkEditBean getParentBulkEditBean ()

public String getParentIssueKey ()

Gets the destination parent issue for issue->subtask conversion.

Returns
  • Destination parent issue key

public Issue getParentIssueObject ()

returns object from database, the object is queried by getParentIssueKey().

Returns

public Project getProject ()

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.

public Collection<Project> getProjectObjects ()

public Collection<GenericValue> getProjects ()

@return

public String getRedirectUrl ()

Returns the redirect URL. See setRedirectUrl(String).

public MultiBulkMoveBean getRelatedMultiBulkMoveBean ()

public Collection<?> getRemovedFields ()

public Set<String> getRetainValues ()

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

public List<Issue> getSelectedIssuesIncludingSubTasks ()

public String getSelectedTransitionName ()

public WorkflowTransitionKey getSelectedWFTransitionKey ()

public String getSingleIssueKey ()

Gets the issue key for this bean as previously set by setSingleIssueKey(String).

Returns
  • the issue key or null if there is none.

public Project getSingleProject ()

Returns the single Project if there is only one Project in this BulkEditBean, otherwise throws an IllegalStateException.

Returns
  • the single Project if there is only one Project in this BulkEditBean, otherwise throws an IllegalStateException.

public Map<StringString> getStatusMapHolder ()

public BulkEditBean getSubTaskBulkEditBean ()

public List<Issue> getSubTaskOfSelectedIssues ()

public Collection<String> getSubTaskStatusHolder ()

public FieldLayout getTargetFieldLayout ()

public FieldLayout getTargetFieldLayoutForType (String targetTypeId)

public List<GenericValue> getTargetIssueGVs ()

This is a convinience method for converting the list of objects to a list of GenericValues

Returns
  • list of GenericValue issue objects

public Map<IssueIssue> getTargetIssueObjects ()

public IssueType getTargetIssueType ()

public String getTargetIssueTypeId ()

public IssueType getTargetIssueTypeObject ()

public Long getTargetPid ()

public Project getTargetProject ()

public Status getTargetStatus (Issue issue)

public Status getTargetStatusObject (Issue issue)

public JiraWorkflow getTargetWorkflow ()

public JiraWorkflow getTargetWorkflowByType (String issueTypeId)

public Map<StringCollection<String>> getTransitionErrors (Integer maxCount)

Get the transition errors after bulk issue transition

Parameters
maxCount max count of errors to return or null for no limits.
Returns
  • transition errors after bulk issue transition

public List<WorkflowTransitionKey> getTransitionIdsForWorkflow (String workflowName)

public List<String> getTransitionIssueKeys (WorkflowTransitionKey workflowTransitionKey)

public String getTransitionName (String workflowName, String actionDescriptorId)

public MultiMap getWorkflowTransitionMap ()

public Set<String> getWorkflowsInUse ()

public void initMultiBulkBean ()

public void initMultiBulkBeanWithSubTasks ()

public void initSelectedIssues (Collection<Issue> selectedIssues)

Initialises the BulkEditBean with the selected issues

Parameters
selectedIssues Required selected Issues.

public boolean isAvailablePreviousStep (int stepId)

public boolean isChecked (Issue issue)

public boolean isHasMailServer ()

Check if a mail server has been specified.

Returns
  • boolean true if a mail server has been specified

public boolean isMultipleProjects ()

public boolean isMutipleIssueTypes ()

public boolean isOnlyContainsSubTasks ()

public boolean isRedirectUrlSet ()

Whether the URL to return to has been set yet.

Returns

public boolean isRetainChecked (String fieldId)

public boolean isSendBulkNotification ()

public boolean isSingleMode ()

Indicates where this bean is being used to move a single issue with subtasks.

Returns
  • true if this bulk edit bean is used for single issue move operation

public boolean isSubTaskCollection ()

public boolean isSubTaskOnly ()

public boolean isTranisitionErrorsLimited (Integer maxCount)

public boolean isTransitionChecked (WorkflowTransitionKey workflowTransitionKey)

public void populateStatusHolder ()

public void populateSubTaskStatusHolder ()

public void resetMoveData ()

public void resetWorkflowTransitionSelection ()

public void setActions (Map<StringBulkEditAction> actions)

public void setCurrentStep (int currentStep)

public void setFieldScreenRenderer (FieldScreenRenderer fieldScreenRenderer)

public void setInvalidSubTaskStatusesByType (Map<StringSet<String>> invalidSubTaskStatusesByType)

public void setInvalidSubTaskTypes (Set<String> invalidSubTaskTypes)

public void setIssuesFromSearchRequest (List<Issue> issuesFromSearchRequest)

public void setIssuesInUse (Collection<?> issuesInUse)

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.

public void setMessagedFieldLayoutItems (Map<?, ?> messagedFieldLayoutItems)

public void setMoveFieldLayoutItems (Collection<?> moveFieldLayoutItems)

public void setOperationName (String operationName)

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

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.

public void setParentIssueKey (String parentIssueKey)

Sets the destination parent issue for issue->subtask conversion.

Parameters
parentIssueKey Parent issue key

public void setRedirectUrl (String redirectUrl)

Sets the URL to which user should be redirected once the bulk operation is finished. This is used only if a progress indicator is displayed to the user while the operation is being executed.

public void setRelatedMultiBulkMoveBean (MultiBulkMoveBean relatedMultiBulkMoveBean)

public void setRemovedFields (Set<?> removedFields)

public void setRetainValues (Set<String> retainValues)

public void setSelectedWFTransitionKey (WorkflowTransitionKey workflowTransitionKey)

public void setSendBulkNotification (boolean sendBulkNotification)

public void setSingleIssueKey (String singleIssueKey)

Sets this bean to "single issue mode".

Set single issue key to be moved via bulk edit workflow.

Parameters
singleIssueKey key for single issue to be moved

public void setSubTaskBulkEditBean (BulkEditBean subTaskBulkEditBean)

public void setSubTaskOfSelectedIssues (List<Issue> subTaskOfSelectedIssues)

public void setTargetFieldLayout ()

Sets the targetFieldLayout to the appropriate FieldLayout (aka "Field Configuration") for the target Project and Issue Type.

public void setTargetIssueObjects (Map<IssueIssue> targetIssueObjects)

public void setTargetIssueTypeId (String id)

public void setTargetProject (GenericValue project)

public void setTargetProject (Project project)

public void setWorkflowTransitionMap (MultiMap workflowTransitionMap)