com.atlassian.jira.web.action.issue
Class MoveIssue

java.lang.Object
  extended by webwork.action.ActionSupport
      extended by com.atlassian.jira.action.JiraActionSupport
          extended by com.atlassian.jira.web.action.JiraWebActionSupport
              extended by com.atlassian.jira.web.action.ProjectActionSupport
                  extended by com.atlassian.jira.web.action.IssueActionSupport
                      extended by com.atlassian.jira.web.action.issue.AbstractIssueSelectAction
                          extended by com.atlassian.jira.web.action.issue.AbstractViewIssue
                              extended by com.atlassian.jira.web.action.issue.AbstractCommentableIssue
                                  extended by com.atlassian.jira.web.action.issue.AbstractCommentableAssignableIssue
                                      extended by com.atlassian.jira.web.action.issue.MoveIssue
All Implemented Interfaces:
OperationContext, ErrorCollection, I18nHelper, Assignable, IssueSummaryAware, AuthorizationSupport, Serializable, webwork.action.Action, webwork.action.CommandDriven, webwork.action.IllegalArgumentAware
Direct Known Subclasses:
MoveIssueSubtasks, MoveIssueUpdateFields, MoveIssueUpdateWorkflow, MoveSubTask, MoveSubTaskChooseOperation, MoveSubTaskParent

public class MoveIssue
extends AbstractCommentableAssignableIssue

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.atlassian.jira.web.action.JiraWebActionSupport
JiraWebActionSupport.MessageType
 
Nested classes/interfaces inherited from interface com.atlassian.jira.util.ErrorCollection
ErrorCollection.Reason
 
Nested classes/interfaces inherited from interface com.atlassian.jira.util.I18nHelper
I18nHelper.BeanFactory
 
Field Summary
protected  ConstantsManager constantsManager
           
protected  FieldLayoutManager fieldLayoutManager
           
protected  FieldManager fieldManager
           
protected  IssueFactory issueFactory
           
static String SUBTASK_STATUS_PREFIX
           
protected  WorkflowManager workflowManager
           
 
Fields inherited from class com.atlassian.jira.web.action.issue.AbstractCommentableIssue
userUtil
 
Fields inherited from class com.atlassian.jira.web.action.issue.AbstractIssueSelectAction
id, ISSUE_PERMISSION_ERROR, PREPOPULATED_ISSUE_OBJECT
 
Fields inherited from class com.atlassian.jira.web.action.IssueActionSupport
attachmentManager
 
Fields inherited from class com.atlassian.jira.web.action.ProjectActionSupport
projectManager
 
Fields inherited from class com.atlassian.jira.web.action.JiraWebActionSupport
ISSUE_NOT_FOUND_RESULT, PERMISSION_VIOLATION_RESULT, request, RETURN_URL_PARAMETER, savedFilters
 
Fields inherited from class com.atlassian.jira.action.JiraActionSupport
log
 
Fields inherited from class webwork.action.ActionSupport
command, errorMap, errorMessages
 
Fields inherited from interface webwork.action.Action
ERROR, INPUT, LOGIN, NONE, SUCCESS
 
Constructor Summary
MoveIssue(SubTaskManager subTaskManager, ConstantsManager constantsManager, WorkflowManager workflowManager, FieldManager fieldManager, FieldLayoutManager fieldLayoutManager, IssueFactory issueFactory, FieldScreenRendererFactory fieldScreenRendererFactory, CommentService commentService, UserUtil userUtil)
           
 
Method Summary
 String doDefault()
          Handles the initial request to move an issue.
protected  String doExecute()
          Handles the request to submit the input from the first step of the wizard, the submitted information is the target project and the target issue type.
protected  void doValidation()
           
 Collection getAllowedProjects()
           
 String getBeanTargetStatusId()
           
 ConstantsManager getConstantsManager()
           
 String getCurrentIssueType()
           
 org.ofbiz.core.entity.GenericValue getCurrentStatusGV()
           
 JiraWorkflow getCurrentWorkflow()
           
 String getFieldHtml(String fieldId)
           
protected  FieldLayoutManager getFieldLayoutManager()
           
protected  FieldManager getFieldManager()
           
 MutableIssue getIssueObject(org.ofbiz.core.entity.GenericValue issue)
           
 MoveIssueBean getMoveIssueBean()
           
 String getPrefixIssueTypeId(String issueType)
           
 String getPrefixTaskStatusId(String taskTypeId, String taskStatusId)
           
 Collection getSubTasks()
          Retrieves the collection of sub-tasks associated with the current issue.
 String getSubtaskTargetIssueType(String subtaskIssueType)
          Get the target issue type for a migrating issue type.
 String getSubTaskTargetStatus(String taskTypeId, String taskStatusId)
          Retrieve the task status associated with this type and current status.
 Collection getSubTaskTypesUsed()
          Gets the collection of sub-task types used in the sub-tasks associated with the current issue.
 String getTargetIssueType()
           
 org.ofbiz.core.entity.GenericValue getTargetIssueTypeGV()
           
 IssueType getTargetIssueTypeObject()
           
 Long getTargetPid()
           
 org.ofbiz.core.entity.GenericValue getTargetProject()
           
 Project getTargetProjectObj()
           
 String getTargetStatusId()
           
 JiraWorkflow getTargetWorkflow()
           
 Collection getTargetWorkflowStatuses(String issueTypeId)
          Retrieve a collection of target workflow statuses from the workflow associated with the specified issue type id.
 Collection getTaskInvalidStatuses(String typeId)
           
 Collection getTasksWithStatus(String invalidStatusId)
           
protected  Map getViewHtmlParams()
           
 JiraWorkflow getWorkflowForType(Long projectId, String issueTypeId)
           
protected  WorkflowManager getWorkflowManager()
           
 boolean isHasSubTasks()
          Checks if the current issue has sub-tasks.
 boolean isIssueStatusValid()
           
 boolean isStatusChangeRequired()
          Checks if the current statuses of the issue and its sub-tasks do not exist in the target workflow.
 boolean isSubTask()
          Determines whether the issue is a sub task - i.e.
 boolean isTaskStatusChangeRequired()
           
 boolean isTaskStatusValid(String typeId, String statusId)
           
 boolean isWorkflowMatch(String currentIssueTypeId, String targetIssueTypeId)
          Check if the workflow is the same for the current and target issue types
protected  String redirectToSessionTimeoutPage()
           
 void setBeanTargetStatusId(String targetStatusId)
           
protected  void validateAttachmentMove()
           
protected  void validateCreateIssue()
           
 
Methods inherited from class com.atlassian.jira.web.action.issue.AbstractCommentableAssignableIssue
assigneeChanged, getAssignee, getAssignIn, hasAssigneePermission, setAssignee
 
Methods inherited from class com.atlassian.jira.web.action.issue.AbstractCommentableIssue
createComment, doCommentValidation, getComment, getCommentLevel, getDisplayParams, getFieldScreenRendererLayoutItemForField, getFieldScreenRendererWithAllFields, getFieldValuesHolder, getGroupLevel, getGroupLevels, getIssueOperation, getOrderableField, getRoleLevels, populateCommentFields, setComment, setCommentLevel, setFieldValuesHolder, setGroupLevel
 
Methods inherited from class com.atlassian.jira.web.action.issue.AbstractViewIssue
getAttachments, getPossibleComponents, getPossibleVersions, getPossibleVersionsReleasedFirst
 
Methods inherited from class com.atlassian.jira.web.action.issue.AbstractIssueSelectAction
addErrorMessage, assertIssueIsValid, cameFromIssue, cameFromParent, getId, getIssue, getIssueObject, getIssueObjectWithoutDatabaseRead, getIssuePath, getKey, getLayoutBean, getParentIssueObject, getProject, getSecurityLevel, getSubTaskManager, getSummaryIssue, getViewIssueKey, getViewUrl, isEditable, isEditable, isHasEditIssuePermission, isIssueExists, isIssueValid, isSubTaskCreatable, isWorkflowAllowsEdit, redirectToView, refreshIssueObject, setId, setIssueObject, setKey, setViewIssueKey
 
Methods inherited from class com.atlassian.jira.web.action.IssueActionSupport
addIssueToHistory, clearSelectedIssue, getAttachmentManager, getCurrentFailedLoginCount, getCurrentJQL, getCustomFieldManager, getDaysPerWeek, getEverLoggedIn, getHoursPerDay, getIssueManager, getLastFailedLogin, getLastLogin, getLoginCount, getPossibleVersions, getPossibleVersionsReleasedFirst, getPrettyDuration, getPreviousLogin, getSearchRequest, getSelectedIssueId, getSessionPagerFilterManager, getSessionSearchRequestManager, getSessionSearchRequestManagerFactory, getSessionSelectedIssueManager, getTotalFailedLoginCount, getUrlEncoded, getWorkflow, getWorkflowTransitionDescription, getWorkflowTransitionDisplayName, isCustomFieldHidden, isElevatedSecurityCheckRequired, isFieldHidden, isFieldHidden, isTimeTrackingEnabled, setSearchRequest, setSelectedIssueId, updateSearchRequest
 
Methods inherited from class com.atlassian.jira.web.action.ProjectActionSupport
getBrowsableProjects, getBrowseableProjects, getSelectedProjectId, setSelectedProject, setSelectedProject
 
Methods inherited from class com.atlassian.jira.web.action.JiraWebActionSupport
addError, addErrorCollection, addErrorMessage, addErrorMessageByKeyIfAbsent, addErrorMessageIfAbsent, addReason, addReasons, forceRedirect, getAdministratorContactLink, getApplicationProperties, getAuthorizationSupport, getConglomerateCookieValue, getDateFormat, getDateTimeFormat, getDateTimeFormatter, getDescTranslation, getDmyDateFormatter, getField, getFlushedErrorMessages, getGlobalPermissionManager, getHint, getHintManager, getJiraContactHelper, getJiraServiceContext, getLanguage, getLoggedInApplicationUser, getLoggedInUser, getNameTranslation, getOutlookDate, getPermissionManager, getProjectManager, getRandomHint, getReasons, getRedirect, getRedirect, getRedirectSanitiser, getReturnUrl, getReturnUrlForCancelLink, getSearchSortDescriptions, getSelectedProject, getSelectedProjectObject, getServerId, getTimeFormat, getUriValidator, getUserFullName, getUserManager, getUserProjectHistoryManager, getVersionManager, getWebworkStack, getWebworkStack, getXsrfToken, hasErrorMessage, hasErrorMessageByKey, htmlEncode, insertContextPath, isHasIssuePermission, isHasIssuePermission, isHasPermission, isHasPermission, isHasPermission, isHasProjectPermission, isHasProjectPermission, isInlineDialogMode, isSystemAdministrator, isUserExists, returnComplete, returnComplete, returnCompleteWithInlineRedirect, returnCompleteWithInlineRedirectAndMsg, returnCompleteWithInlineRedirectAndMsg, returnMsgToUser, returnMsgToUser, setConglomerateCookieValue, setInline, setReasons, setReturnUrl, setSelectedProjectId, urlEncode
 
Methods inherited from class com.atlassian.jira.action.JiraActionSupport
addErrorMessages, addErrorMessages, addErrors, addIllegalArgumentException, execute, getActionName, getComponentInstanceOfType, getDefaultResourceBundle, getDelegator, getI18nHelper, getKeysForPrefix, getLocale, getOfBizDelegator, getRemoteUser, getResult, getText, getText, getText, getText, getText, getText, getText, getText, getText, getText, getText, getText, getText, getText, getUnescapedText, getUntransformedRawText, getUserPreferences, getWatcherManager, hasAnyErrors, isIndexing, isKeyDefined, removeKeyOrAddError
 
Methods inherited from class webwork.action.ActionSupport
addError, getCommandName, getErrorMessages, getErrors, getHasErrorMessages, getHasErrors, getPropertyEditorMessage, getTexts, getTexts, getTimezone, invalidInput, invokeCommand, isCommand, setCommand, setErrorMessages, setErrors, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.jira.web.action.issue.IssueSummaryAware
getLoggedInUser
 
Methods inherited from interface com.atlassian.jira.util.ErrorCollection
addError, addErrorMessages, addErrors, getErrorMessages, getErrors, hasAnyErrors, setErrorMessages
 
Methods inherited from interface webwork.action.CommandDriven
getCommandName, setCommand
 

Field Detail

SUBTASK_STATUS_PREFIX

public static final String SUBTASK_STATUS_PREFIX
See Also:
Constant Field Values

constantsManager

protected final ConstantsManager constantsManager

workflowManager

protected final WorkflowManager workflowManager

fieldManager

protected final FieldManager fieldManager

fieldLayoutManager

protected final FieldLayoutManager fieldLayoutManager

issueFactory

protected final IssueFactory issueFactory
Constructor Detail

MoveIssue

public MoveIssue(SubTaskManager subTaskManager,
                 ConstantsManager constantsManager,
                 WorkflowManager workflowManager,
                 FieldManager fieldManager,
                 FieldLayoutManager fieldLayoutManager,
                 IssueFactory issueFactory,
                 FieldScreenRendererFactory fieldScreenRendererFactory,
                 CommentService commentService,
                 UserUtil userUtil)
Method Detail

doExecute

protected String doExecute()
                    throws Exception
Handles the request to submit the input from the first step of the wizard, the submitted information is the target project and the target issue type.

If the issue has sub-tasks it redirects to MoveIssueSubtasks.doDefault() so that the tasks issue types can be mapped; otherwise, it redirects to MoveIssueUpdateWorkflow.doDefault()

Overrides:
doExecute in class webwork.action.ActionSupport
Returns:
It actually doesn't return anything. If the issue has sub-tasks it redirects to MoveIssueSubtasks.doDefault() so that the tasks issue types can be mapped; otherwise, it redirects to MoveIssueUpdateWorkflow.doDefault()
Throws:
Exception

doDefault

public String doDefault()
                 throws Exception
Handles the initial request to move an issue. It returns the view responsible for rendering the first step of the wizard, if the user is authorised to perform the move and if the issue exists.

Overrides:
doDefault in class AbstractCommentableAssignableIssue
Returns:
"securitybreach" if the user is not authorised to move the issue; Action.ERROR if the issue can't be found (which means it was probably deleted), or if the user isn't authorised to browse the issue; otherwise, Action.INPUT} is returned to render the view for the first step of the wizard.
Throws:
Exception

doValidation

protected void doValidation()
Overrides:
doValidation in class AbstractCommentableAssignableIssue

redirectToSessionTimeoutPage

protected String redirectToSessionTimeoutPage()

validateAttachmentMove

protected void validateAttachmentMove()

validateCreateIssue

protected void validateCreateIssue()
                            throws org.ofbiz.core.entity.GenericEntityException
Throws:
org.ofbiz.core.entity.GenericEntityException

getTargetPid

public Long getTargetPid()

getTargetStatusId

public String getTargetStatusId()

getTargetProject

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

getTargetProjectObj

public Project getTargetProjectObj()

getTargetIssueTypeGV

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

getTargetIssueTypeObject

public IssueType getTargetIssueTypeObject()

getTargetWorkflow

public JiraWorkflow getTargetWorkflow()
                               throws WorkflowException
Throws:
WorkflowException

getCurrentWorkflow

public JiraWorkflow getCurrentWorkflow()
                                throws WorkflowException,
                                       org.ofbiz.core.entity.GenericEntityException
Throws:
WorkflowException
org.ofbiz.core.entity.GenericEntityException

getWorkflowForType

public JiraWorkflow getWorkflowForType(Long projectId,
                                       String issueTypeId)
                                throws WorkflowException
Throws:
WorkflowException

getCurrentStatusGV

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

getTargetIssueType

public String getTargetIssueType()

getCurrentIssueType

public String getCurrentIssueType()

getAllowedProjects

public Collection getAllowedProjects()

isSubTask

public boolean isSubTask()
Description copied from class: AbstractIssueSelectAction
Determines whether the issue is a sub task - i.e. if it has any incoming sub-task issue links

Overrides:
isSubTask in class AbstractIssueSelectAction
Returns:
whether the issue is a sub task.

getTargetWorkflowStatuses

public Collection getTargetWorkflowStatuses(String issueTypeId)
Retrieve a collection of target workflow statuses from the workflow associated with the specified issue type id.

Parameters:
issueTypeId - the id of the specified issue type.
Returns:
A collection of target workflow statuses from the workflow associated with the specified issue type id.

isWorkflowMatch

public boolean isWorkflowMatch(String currentIssueTypeId,
                               String targetIssueTypeId)
Check if the workflow is the same for the current and target issue types

Parameters:
currentIssueTypeId - the id of the issue's current issue type.
targetIssueTypeId - the id of the target issue type.
Returns:
true if the workflows associated to the current and target issue types are the same; otherwise, false.

isHasSubTasks

public boolean isHasSubTasks()
Checks if the current issue has sub-tasks.

Returns:
true if sub-tasks have been enabled and the current issue has sub-tasks; otherwise, false.

getSubTasks

public Collection getSubTasks()
Retrieves the collection of sub-tasks associated with the current issue.

Returns:
The collection of sub-tasks associated with the current issue.

getSubTaskTypesUsed

public Collection getSubTaskTypesUsed()
Gets the collection of sub-task types used in the sub-tasks associated with the current issue.

Returns:
The collection of sub-task types used in the sub-tasks associated with the current issue.

getPrefixTaskStatusId

public String getPrefixTaskStatusId(String taskTypeId,
                                    String taskStatusId)

getPrefixIssueTypeId

public String getPrefixIssueTypeId(String issueType)

getSubTaskTargetStatus

public String getSubTaskTargetStatus(String taskTypeId,
                                     String taskStatusId)
Retrieve the task status associated with this type and current status.

Parameters:
taskTypeId - the id of the task type.
taskStatusId - the id of the task status.
Returns:
The task status associated with this type and current status.

isStatusChangeRequired

public boolean isStatusChangeRequired()
Checks if the current statuses of the issue and its sub-tasks do not exist in the target workflow. This is used to determine if step 2 requires input from the user, i.e. If all current statuses exist in the target workflows - no input is needed.

Returns:
true if the current statuses of the issue and its sub-tasks do not exist in the target workflow; otherwise, false.

isTaskStatusChangeRequired

public boolean isTaskStatusChangeRequired()
                                   throws WorkflowException
Throws:
WorkflowException

isIssueStatusValid

public boolean isIssueStatusValid()
                           throws WorkflowException
Throws:
WorkflowException

isTaskStatusValid

public boolean isTaskStatusValid(String typeId,
                                 String statusId)
                          throws WorkflowException
Throws:
WorkflowException

getTaskInvalidStatuses

public Collection getTaskInvalidStatuses(String typeId)
                                  throws WorkflowException
Throws:
WorkflowException

getTasksWithStatus

public Collection getTasksWithStatus(String invalidStatusId)
                              throws WorkflowException
Throws:
WorkflowException

getFieldLayoutManager

protected FieldLayoutManager getFieldLayoutManager()

getConstantsManager

public ConstantsManager getConstantsManager()
Overrides:
getConstantsManager in class JiraWebActionSupport

getWorkflowManager

protected WorkflowManager getWorkflowManager()

getMoveIssueBean

public MoveIssueBean getMoveIssueBean()

setBeanTargetStatusId

public void setBeanTargetStatusId(String targetStatusId)

getBeanTargetStatusId

public String getBeanTargetStatusId()

getFieldHtml

public String getFieldHtml(String fieldId)
                    throws Exception
Throws:
Exception

getViewHtmlParams

protected Map getViewHtmlParams()

getIssueObject

public MutableIssue getIssueObject(org.ofbiz.core.entity.GenericValue issue)

getFieldManager

protected FieldManager getFieldManager()

getSubtaskTargetIssueType

public String getSubtaskTargetIssueType(String subtaskIssueType)
Get the target issue type for a migrating issue type.

NOTE: This is currently used solely in moveissue-updateworkflow.jsp to construct a dropdown of statuses for the subtask target issue type.

Parameters:
subtaskIssueType - the current issue type id
Returns:
the target issue type id


Copyright © 2002-2012 Atlassian. All Rights Reserved.