|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.jira.bc.subtask.conversion.DefaultIssueConversionService
public abstract class DefaultIssueConversionService
| Field Summary | |
|---|---|
protected FieldLayoutManager |
fieldLayoutManager
|
protected FieldManager |
fieldManager
|
protected IssueTypeSchemeManager |
issueTypeSchemeManager
|
protected JiraAuthenticationContext |
jiraAuthenticationContext
|
| Constructor Summary | |
|---|---|
DefaultIssueConversionService(PermissionManager permissionManager,
WorkflowManager workflowManager,
FieldLayoutManager fieldLayoutManager,
IssueTypeSchemeManager issueTypeSchemeManager,
JiraAuthenticationContext jiraAuthenticationContext,
FieldManager fieldManager)
|
|
| Method Summary | |
|---|---|
protected abstract boolean |
canIssueSecurityFieldIgnore()
For an issue to subtask conversion, we can safely ignore the issue security field since the subtask will always take the security level of the parent issue. |
void |
convertIssue(JiraServiceContext context,
Issue currentIssue,
MutableIssue updatedIssue)
This is the core method that converts given issue to an issue represented by updatedIssue. |
Collection |
getFieldLayoutItems(JiraServiceContext context,
Issue originalIssue,
Issue targetIssue)
Retrieves the collection of FieldLayoutItem
required to be entered from converting issue from given issue to given target issue. |
protected int |
getPermissionNeeded()
Allows sub-classes override to use another permission |
Collection |
getRemovedFields(JiraServiceContext context,
Issue origIssue,
Issue targetIssue)
Retrieves the fields that have values on the issue but are no longer needed. |
protected String |
getText(String key)
Translates a given key using i18n bean |
protected String |
getText(String key,
Object param)
Translates a given key using i18n bean, passing in param |
protected String |
getText(String key,
String param0,
String param1)
Translates a given key using i18n bean, passing in params |
boolean |
hasPermission(JiraServiceContext context,
Issue issue)
Checks the user's permission to convert given issue. |
protected boolean |
isShouldCheckFieldValue(JiraServiceContext context,
Issue origIssue,
Field field)
JRA-12671 - need to determine if we should call hasValue on the field. |
boolean |
isStatusChangeRequired(JiraServiceContext context,
Issue issue,
IssueType issueType)
Determines if the workflow status exists in the target workflow (based on current project and target issue type). |
protected boolean |
isStatusInWorkflowForProjectAndIssueType(Status status,
Long projectId,
String issueTypeId)
Retrieves the workflow for given project and issue type combination and checks whether the given status is in this workflow. |
void |
populateFields(JiraServiceContext context,
OperationContext operationContext,
I18nHelper i18nHelper,
Issue targetIssue,
Collection fieldLayoutItems)
Populates the operationContext from the params in the ActionContext
In case of invalid values, new error messages are added to the context's error collection under the
fieldName. |
void |
validateFields(JiraServiceContext context,
OperationContext operationContext,
I18nHelper i18nHelper,
Issue targetIssue,
Collection fieldLayoutItems)
Validates that all fields inputed have valid values. |
void |
validateTargetStatus(JiraServiceContext context,
Status status,
String fieldName,
Issue issue,
IssueType issueType)
Validates that the target status is a valid status for the issue's project and the target issue type. |
| 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 |
|---|
canConvertIssue, preStoreUpdates, validateTargetIssueType |
| Field Detail |
|---|
protected final FieldLayoutManager fieldLayoutManager
protected final IssueTypeSchemeManager issueTypeSchemeManager
protected final JiraAuthenticationContext jiraAuthenticationContext
protected final FieldManager fieldManager
| Constructor Detail |
|---|
public DefaultIssueConversionService(PermissionManager permissionManager,
WorkflowManager workflowManager,
FieldLayoutManager fieldLayoutManager,
IssueTypeSchemeManager issueTypeSchemeManager,
JiraAuthenticationContext jiraAuthenticationContext,
FieldManager fieldManager)
| Method Detail |
|---|
public boolean hasPermission(JiraServiceContext context,
Issue issue)
IssueConversionService
hasPermission in interface IssueConversionServicecontext - jira service contextissue - issue to check the permission on
protected int getPermissionNeeded()
public boolean isStatusChangeRequired(JiraServiceContext context,
Issue issue,
IssueType issueType)
IssueConversionService
isStatusChangeRequired in interface IssueConversionServicecontext - jira service contextissue - issue to convertissueType - target issue type
public void validateTargetStatus(JiraServiceContext context,
Status status,
String fieldName,
Issue issue,
IssueType issueType)
IssueConversionService
validateTargetStatus in interface IssueConversionServicecontext - jira service contextstatus - target statusfieldName - form field nameissue - issue to convertissueType - target issue type
protected boolean isStatusInWorkflowForProjectAndIssueType(Status status,
Long projectId,
String issueTypeId)
status - issue statusprojectId - project idissueTypeId - issue type id
public Collection getFieldLayoutItems(JiraServiceContext context,
Issue originalIssue,
Issue targetIssue)
IssueConversionServiceFieldLayoutItem
required to be entered from converting issue from given issue to given target issue.
getFieldLayoutItems in interface IssueConversionServicecontext - jira service contextoriginalIssue - Current IssuetargetIssue - Issue with updated issue type
FieldLayoutItem that require values, never nullprotected abstract boolean canIssueSecurityFieldIgnore()
public void populateFields(JiraServiceContext context,
OperationContext operationContext,
I18nHelper i18nHelper,
Issue targetIssue,
Collection fieldLayoutItems)
IssueConversionServiceActionContext
In case of invalid values, new error messages are added to the context's error collection under the
fieldName.
populateFields in interface IssueConversionServicecontext - jira service contextoperationContext - contains Map (CustomFieldValuesHolder) where field values will be populatedi18nHelper - helper bean for i18n (needed by fields)targetIssue - Current issue with updated parent, issue type and statusfieldLayoutItems - Collection of FieldLayoutItem that required input
public Collection getRemovedFields(JiraServiceContext context,
Issue origIssue,
Issue targetIssue)
IssueConversionService
getRemovedFields in interface IssueConversionServicecontext - jira service contextorigIssue - issuetargetIssue - issue
OrderableField, never null
protected boolean isShouldCheckFieldValue(JiraServiceContext context,
Issue origIssue,
Field field)
context - The service context needed for the remote userorigIssue - The original issue in which we'll check the contextfield - The field in question.
public void validateFields(JiraServiceContext context,
OperationContext operationContext,
I18nHelper i18nHelper,
Issue targetIssue,
Collection fieldLayoutItems)
IssueConversionService
validateFields in interface IssueConversionServicecontext - jira service contextoperationContext - contains Map (CustomFieldValuesHolder) containing values to be validatedi18nHelper - helper bean for i18n (needed by fields)targetIssue - Current issue with updated parent, issue type and statusfieldLayoutItems - Collection of FieldLayoutItem that required input
public void convertIssue(JiraServiceContext context,
Issue currentIssue,
MutableIssue updatedIssue)
IssueConversionService
convertIssue in interface IssueConversionServicecontext - jira service context, any error are added herecurrentIssue - original issueupdatedIssue - target issueprotected String getText(String key)
key - key to translate
protected String getText(String key,
Object param)
key - key to transkateparam - param to insert into property
protected String getText(String key,
String param0,
String param1)
key - key to transkateparam0 - 1st param to insert into propertyparam1 - 2nd param to insert into property
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||