com.atlassian.jira.bc.subtask.conversion
Class DefaultSubTaskToIssueConversionService

java.lang.Object
  extended by com.atlassian.jira.bc.subtask.conversion.DefaultIssueConversionService
      extended by com.atlassian.jira.bc.subtask.conversion.DefaultSubTaskToIssueConversionService
All Implemented Interfaces:
IssueConversionService, SubTaskToIssueConversionService

public class DefaultSubTaskToIssueConversionService
extends DefaultIssueConversionService
implements SubTaskToIssueConversionService

Default implementation of SubTaskToIssueConversionService.


Field Summary
 
Fields inherited from class com.atlassian.jira.bc.subtask.conversion.DefaultIssueConversionService
fieldLayoutManager, fieldManager, issueTypeSchemeManager, jiraAuthenticationContext
 
Constructor Summary
DefaultSubTaskToIssueConversionService(PermissionManager permissionManager, WorkflowManager workflowManager, FieldLayoutManager fieldLayoutManager, IssueTypeSchemeManager issueTypeSchemeManager, JiraAuthenticationContext jiraAuthenticationContext, FieldManager fieldManager, IssueLinkManager issueLinkManager, SubTaskManager subTaskManager)
           
 
Method Summary
 boolean canConvertIssue(JiraServiceContext context, Issue issue)
          Determines if user can convert given issue.
protected  boolean canIssueSecurityFieldIgnore()
          A sub-task inherits its Security Level from its parent.
 void preStoreUpdates(JiraServiceContext context, IssueChangeHolder changeHolder, Issue currentIssue, MutableIssue targetIssue)
          Removes the parent link and adds change item.
 void validateTargetIssueType(JiraServiceContext context, Issue issue, IssueType issueType, String fieldNameIssueTypeId)
          Validates that the issue can be converted to given issue type.
 
Methods inherited from class com.atlassian.jira.bc.subtask.conversion.DefaultIssueConversionService
convertIssue, getFieldLayoutItems, getPermissionNeeded, getRemovedFields, getText, getText, getText, hasPermission, isShouldCheckFieldValue, isStatusChangeRequired, isStatusInWorkflowForProjectAndIssueType, populateFields, validateFields, validateTargetStatus
 
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.bc.subtask.conversion.IssueConversionService
convertIssue, getFieldLayoutItems, getRemovedFields, hasPermission, isStatusChangeRequired, populateFields, validateFields, validateTargetStatus
 

Constructor Detail

DefaultSubTaskToIssueConversionService

public DefaultSubTaskToIssueConversionService(PermissionManager permissionManager,
                                              WorkflowManager workflowManager,
                                              FieldLayoutManager fieldLayoutManager,
                                              IssueTypeSchemeManager issueTypeSchemeManager,
                                              JiraAuthenticationContext jiraAuthenticationContext,
                                              FieldManager fieldManager,
                                              IssueLinkManager issueLinkManager,
                                              SubTaskManager subTaskManager)
Method Detail

canConvertIssue

public boolean canConvertIssue(JiraServiceContext context,
                               Issue issue)
Description copied from interface: IssueConversionService
Determines if user can convert given issue.

Specified by:
canConvertIssue in interface IssueConversionService
Parameters:
context - JIRA Service Context
issue - issue to convert
Returns:
true if user can convert the given issue, false otherwise

validateTargetIssueType

public void validateTargetIssueType(JiraServiceContext context,
                                    Issue issue,
                                    IssueType issueType,
                                    String fieldNameIssueTypeId)
Description copied from interface: IssueConversionService
Validates that the issue can be converted to given issue type. Any errors are communicated back via error collection in the context.

Specified by:
validateTargetIssueType in interface IssueConversionService
Parameters:
context - jira service context
issue - issue to convert
issueType - target issue type
fieldNameIssueTypeId - form field name of the issue type id

canIssueSecurityFieldIgnore

protected boolean canIssueSecurityFieldIgnore()
A sub-task inherits its Security Level from its parent. As this issue will now no longer be a sub-task it must set its Security Level if required.

Specified by:
canIssueSecurityFieldIgnore in class DefaultIssueConversionService
Returns:
true if it is safe to ignore the security field.

preStoreUpdates

public void preStoreUpdates(JiraServiceContext context,
                            IssueChangeHolder changeHolder,
                            Issue currentIssue,
                            MutableIssue targetIssue)
Removes the parent link and adds change item.

Specified by:
preStoreUpdates in interface IssueConversionService
Parameters:
context - jira service context
changeHolder - holds all the change items
currentIssue - original issue with no updates
targetIssue - target issue with all fields updated


Copyright © 2002-2012 Atlassian. All Rights Reserved.