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

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
                                          extended by com.atlassian.jira.web.action.issue.MoveIssueUpdateFields
All Implemented Interfaces:
OperationContext, ErrorCollection, I18nHelper, Assignable, IssueSummaryAware, AuthorizationSupport, Serializable, webwork.action.Action, webwork.action.CommandDriven, webwork.action.IllegalArgumentAware
Direct Known Subclasses:
MoveIssueConfirm

public class MoveIssueUpdateFields
extends MoveIssue
implements OperationContext

See Also:
Serialized Form

Nested Class Summary
 
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
 
Fields inherited from class com.atlassian.jira.web.action.issue.MoveIssue
constantsManager, fieldLayoutManager, fieldManager, issueFactory, SUBTASK_STATUS_PREFIX, 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
MoveIssueUpdateFields(SubTaskManager subTaskManager, ConstantsManager constantsManager, WorkflowManager workflowManager, FieldManager fieldManager, FieldLayoutManager fieldLayoutManager, IssueFactory issueFactory, FieldScreenRendererFactory fieldScreenRendererFactory, CommentService commentService, IssueSecurityHelper issueSecurityHelper, UserUtil userUtil)
           
 
Method Summary
 String doDefault()
          Handles the initial request to move an issue.
 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()
           
protected  Collection getCurrentCustomFieldObjects(String issueTypeId)
          Retrieve a collection of custom field objects associated with the specified issue type.
 Map getCustomFieldValuesHolder()
           
 String getFieldHtml(FieldLayoutItem fieldLayoutItem)
           
 String getFieldName(Field field)
           
protected  Collection getInvalidCustomFields(String currentIssueTypeId, String targetIssueTypeId)
          Retrieve the custom fields from the current issue that are not applicable in the target destination.
 Collection getMoveFieldLayoutItems()
           
protected  Collection getTargetCustomFieldObjects(String targetIssueTypeId)
          Returns a collection of target custom field objects.
 Collection getTargetCustomFields()
          Retrieve the custom fields that are applicable in the target destination.
protected  FieldLayout getTargetFieldLayout()
           
protected  Collection getTargetHiddenFields()
           
protected  MutableIssue getTargetIssueObject()
          Retrieves the issue from the IssueManager and updates the Project and IssueType, and possibly clears the security.
protected  MutableIssue getTargetIssueObjectWithSecurityLevel()
          Retrieves the issue from the IssueManager and updates the Project and IssueType.
protected  boolean isShouldCheckFieldValue(Issue origIssue, Field field)
          JRA-12671 - need to determine if we should call hasValue on the field.
protected  void popluateDefault(OrderableField orderableField)
           
protected  void populateFromParams(OrderableField orderableField)
           
 
Methods inherited from class com.atlassian.jira.web.action.issue.MoveIssue
getAllowedProjects, getBeanTargetStatusId, getConstantsManager, getCurrentIssueType, getCurrentStatusGV, getCurrentWorkflow, getFieldHtml, getFieldLayoutManager, getFieldManager, getIssueObject, getMoveIssueBean, getPrefixIssueTypeId, getPrefixTaskStatusId, getSubTasks, getSubtaskTargetIssueType, getSubTaskTargetStatus, getSubTaskTypesUsed, getTargetIssueType, getTargetIssueTypeGV, getTargetIssueTypeObject, getTargetPid, getTargetProject, getTargetProjectObj, getTargetStatusId, getTargetWorkflow, getTargetWorkflowStatuses, getTaskInvalidStatuses, getTasksWithStatus, getViewHtmlParams, getWorkflowForType, getWorkflowManager, isHasSubTasks, isIssueStatusValid, isStatusChangeRequired, isSubTask, isTaskStatusChangeRequired, isTaskStatusValid, isWorkflowMatch, redirectToSessionTimeoutPage, setBeanTargetStatusId, validateAttachmentMove, 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, getConglomerateCookieValue, getDateFormat, getDateTimeFormat, getDateTimeFormatter, getDescTranslation, getDmyDateFormatter, getField, getFlushedErrorMessages, getGlobalPermissionManager, getHint, getHintManager, getJiraContactHelper, getJiraServiceContext, getLanguage, getLoggedInUser, getNameTranslation, getOutlookDate, getPermissionManager, getProjectManager, getRandomHint, getReasons, getRedirect, getRedirectChecker, 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, returnMsgToUser, setConglomerateCookieValue, setInline, setReasons, setReturnUrl, setSelectedProjectId
 
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, getUserPreferences, getWatcherManager, hasAnyErrors, isIndexing, 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.issue.customfields.OperationContext
getFieldValuesHolder, getIssueOperation
 
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
 

Constructor Detail

MoveIssueUpdateFields

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

doDefault

public String doDefault()
Description copied from class: MoveIssue
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 MoveIssue
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.

getMoveFieldLayoutItems

public Collection getMoveFieldLayoutItems()

getTargetIssueObject

protected MutableIssue getTargetIssueObject()
Retrieves the issue from the IssueManager and updates the Project and IssueType, and possibly clears the security.

JRA-11605 - we need this method so that the display can prompt the user with values from system fields that are unencumbered by security level permission checks. It will set security level to null if the issue is moving somewhere that the old security level is no relevant.

Returns:
Target Issue Object with required Project and Issue Type added in.
See Also:
getTargetIssueObjectWithSecurityLevel()

getTargetIssueObjectWithSecurityLevel

protected MutableIssue getTargetIssueObjectWithSecurityLevel()
Retrieves the issue from the IssueManager and updates the Project and IssueType. The security level setting is left in place - see getTargetIssueObject() for an alternative method.

Returns:
Issue Object with required Project and Issue Type added in.
See Also:
getTargetIssueObject()

getTargetFieldLayout

protected FieldLayout getTargetFieldLayout()

getFieldHtml

public String getFieldHtml(FieldLayoutItem fieldLayoutItem)

getFieldName

public String getFieldName(Field field)

doValidation

protected void doValidation()
Overrides:
doValidation in class MoveIssue

popluateDefault

protected void popluateDefault(OrderableField orderableField)

populateFromParams

protected void populateFromParams(OrderableField orderableField)

doExecute

public String doExecute()
                 throws Exception
Description copied from class: MoveIssue
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 MoveIssue
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

isShouldCheckFieldValue

protected boolean isShouldCheckFieldValue(Issue origIssue,
                                          Field field)
JRA-12671 - need to determine if we should call hasValue on the field. For calculated custom fields, that are not in scope this isn't the case. This should prevent us from calling hasValue on calculated custom fields. protected to make it testable.

Parameters:
origIssue - The original issue in which we'll check the context
field - The field in question.
Returns:
true, if the field is not a custom value, or it is in scope in the original issue.

getTargetHiddenFields

protected Collection getTargetHiddenFields()

getCustomFieldValuesHolder

public Map getCustomFieldValuesHolder()

getCurrentCustomFieldObjects

protected Collection getCurrentCustomFieldObjects(String issueTypeId)
Retrieve a collection of custom field objects associated with the specified issue type.

Parameters:
issueTypeId - the id of the issue type.
Returns:
A collection of custom field objects associated with the specified issue type.

getTargetCustomFieldObjects

protected Collection getTargetCustomFieldObjects(String targetIssueTypeId)
Returns a collection of target custom field objects.

Parameters:
targetIssueTypeId - the id of the target issue type.
Returns:
a collection of target custom field objects.

getTargetCustomFields

public Collection getTargetCustomFields()
Retrieve the custom fields that are applicable in the target destination.

Returns:
A collection of the custom fields that are applicable in the target destination.

getInvalidCustomFields

protected Collection getInvalidCustomFields(String currentIssueTypeId,
                                            String targetIssueTypeId)
Retrieve the custom fields from the current issue that are not applicable in the target destination.

Parameters:
currentIssueTypeId - the id of the current issue type.
targetIssueTypeId - the id of the target issue type.
Returns:
A collection of the custom fields from the current issue that are not applicable in the target destination.


Copyright © 2002-2012 Atlassian. All Rights Reserved.