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 issues)
          Deprecated.  
 void addAvailablePreviousStep(int stepId)
           
 void addIssues(Collection issues)
           
 void addRetainValue(String fieldId)
           
 void clearAvailablePreviousSteps()
           
 Map getActions()
           
 String getCheckboxName(Issue issue)
           
 int getCurrentStep()
           
 CustomField getCustomField(String customFieldKey)
           
 Map getCustomFieldValues()
           
 Map getCustomFieldValuesHolder()
           
 String getCustomFieldView(CustomField customField)
           
 Collection getFieldLayouts()
          Returns all the unqiue field layouts of the selected issues
 FieldScreenRenderer getFieldScreenRenderer()
           
 Issue getFirstTargetIssueObject()
          This method is used to get a target issue that will provide the correct context (i.e.
static BulkEditBean getFromSession()
           
 Collection getInvalidIssues()
          Gets issues whose status is null
 Collection getInvalidStatuses()
          Gets a set of invalid statuses that are not valid in the destination workflow
 int getInvalidSubTaskCount()
           
 Collection getInvalidSubTaskStatusesByType(String subTaskTypeId)
           
 Collection getInvalidSubTaskTypes()
           
 IssueOperation getIssueOperation()
           
 List getIssuesFromSearchRequest()
           
 Collection getIssuesInUse()
           
 org.ofbiz.core.entity.GenericValue getIssueType()
           
 Collection getIssueTypeObjects()
           
 Collection getIssueTypes()
           
 String getKey()
          Returns a string that represents a "unique" identifier for this bulke edit bean
 Map getMessagedFieldLayoutItems()
           
 Collection getMoveFieldLayoutItems()
           
 String getOperationName()
           
 Map getParams()
           
 BulkEditBean getParentBulkEditBean()
           
 org.ofbiz.core.entity.GenericValue getProject()
           
 Collection getProjectIds()
          returns a list of project ids for projects which the currently selected issues belong to.
 Collection getProjects()
           
 MultiBulkMoveBean getRelatedMultiBulkMoveBean()
           
 Collection getRemovedFields()
           
 Collection getRetainValues()
           
 List getSelectedIssues()
          Returns a list of "selected" issues.
 List getSelectedIssuesIncludingSubTasks()
           
 String getSelectedTransitionName()
           
 WorkflowTransitionKey getSelectedWFTransitionKey()
           
 Map getStatusMapHolder()
           
 BulkEditBean getSubTaskBulkEditBean()
           
 List getSubTaskOfSelectedIssues()
           
 Collection getSubTaskStatusHolder()
           
 FieldLayout getTargetFieldLayout()
           
 FieldLayout getTargetFieldLayoutForType(String targetTypeId)
           
 List getTargetIssueGVs()
          This is a convinience method for converting the list of objects to a list of GenericValues
 Map 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 getTransitionIdsForWorkflow(String workflowName)
           
 List getTransitionIssueKeys(WorkflowTransitionKey workflowTransitionKey)
           
 String getTransitionName(String workflowName, String actionDescriptorId)
           
 Collection getWorkflowsInUse()
           
 org.apache.commons.collections.MultiMap getWorkflowTransitionMap()
           
 void initMultiBulkBean()
           
 void initMultiBulkBeanWithSubTasks()
           
 void initSelectedIssues(Collection selectedIssues)
          Initialises the BulkEditBean with the selected issues
 boolean isAvailablePreviousStep(int stepId)
           
 boolean isChecked(Issue issue)
           
 boolean isHasMailServer()
          Check if a mial sever 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 actions)
           
 void setCurrentStep(int currentStep)
           
 void setFieldScreenRenderer(FieldScreenRenderer fieldScreenRenderer)
           
 void setInvalidSubTaskStatusesByType(Map invalidSubTaskStatusesByType)
           
 void setInvalidSubTaskTypes(HashSet invalidSubTaskTypes)
           
 void setIssuesFromSearchRequest(List issuesFromSearchRequest)
           
 void setIssuesInUse(Collection issuesInUse)
           
 void setMessagedFieldLayoutItems(Map messagedFieldLayoutItems)
           
 void setMoveFieldLayoutItems(Collection moveFieldLayoutItems)
           
 void setOperationName(String operationName)
           
 void setParams(Map 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(HashSet removedFields)
           
 void setRetainValues(HashSet retainValues)
           
 void setSelectedWFTransitionKey(WorkflowTransitionKey workflowTransitionKey)
           
 void setSendBulkNotification(boolean sendBulkNotification)
           
 void setSubTaskBulkEditBean(BulkEditBean subTaskBulkEditBean)
           
 void setSubTaskOfSelectedIssues(List subTaskOfSelectedIssues)
           
 void setTargetFieldLayout()
          Sets the targetFieldLayout to the appropriate FieldLayout (aka "Field Configuration") for the target Project and Issue Type.
 void setTargetIssueObjects(Map 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 selectedIssues)
Initialises the BulkEditBean with the selected issues

Parameters:
selectedIssues - Required selected Issues.

addIssues

public void addIssues(Collection issues)

getSelectedIssues

public List 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 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 getFieldLayouts()
Returns all the unqiue 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 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 getProjects()

getIssueTypes

public Collection getIssueTypes()

getIssueTypeObjects

public Collection 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 params)

getParams

public Map 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 mial sever has been specified.

Returns:
boolean true if a mailserver 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 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 Collection getInvalidIssues()
                            throws WorkflowException
Gets issues whose status is null

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

getInvalidSubTaskTypes

public Collection getInvalidSubTaskTypes()
                                  throws WorkflowException
Throws:
WorkflowException

getInvalidSubTaskStatusesByType

public Collection 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 getTargetIssueObjects()

setTargetIssueObjects

public void setTargetIssueObjects(Map targetIssueObjects)

getTargetIssueGVs

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

getRemovedFields

public Collection getRemovedFields()

setRemovedFields

public void setRemovedFields(HashSet 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 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 invalidSubTaskStatusesByType)

setInvalidSubTaskTypes

public void setInvalidSubTaskTypes(HashSet invalidSubTaskTypes)

getInvalidSubTaskCount

public int getInvalidSubTaskCount()

getRetainValues

public Collection getRetainValues()

setRetainValues

public void setRetainValues(HashSet retainValues)

addRetainValue

public void addRetainValue(String fieldId)

getSubTaskOfSelectedIssues

public List getSubTaskOfSelectedIssues()

setSubTaskOfSelectedIssues

public void setSubTaskOfSelectedIssues(List subTaskOfSelectedIssues)

getIssuesFromSearchRequest

public List getIssuesFromSearchRequest()

setIssuesFromSearchRequest

public void setIssuesFromSearchRequest(List issuesFromSearchRequest)

getCurrentStep

public int getCurrentStep()

setCurrentStep

public void setCurrentStep(int currentStep)

getActions

public Map getActions()

setActions

public void setActions(Map actions)

getCustomFieldValues

public Map getCustomFieldValues()

getCustomFieldValuesHolder

public Map getCustomFieldValuesHolder()
Specified by:
getCustomFieldValuesHolder 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 Collection getWorkflowsInUse()

getTransitionIdsForWorkflow

public List getTransitionIdsForWorkflow(String workflowName)

getTransitionName

public String getTransitionName(String workflowName,
                                String actionDescriptorId)

getTransitionIssueKeys

public List 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

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


Copyright © 2002-2008 Atlassian. All Rights Reserved.