com.atlassian.jira.external
Class ExternalUtils

java.lang.Object
  extended by com.atlassian.jira.external.ExternalUtils

public class ExternalUtils
extends java.lang.Object


Field Summary
static java.lang.String CF_PREFIX
           
static java.lang.String GENERIC_CONTENT_TYPE
           
static java.lang.String TYPE_SEPERATOR
           
 
Constructor Summary
ExternalUtils(ProjectManager projectManager, PermissionSchemeManager permissionSchemeManager, IssueManager issueManager, JiraAuthenticationContext authenticationContext, VersionManager versionManager, ProjectComponentManager componentManager, com.opensymphony.user.UserManager userManager, CustomFieldManager customFieldManager, OptionsManager optionsManager, org.ofbiz.core.entity.GenericDelegator genericDelegator, com.atlassian.core.action.ActionDispatcher actionDispatcher, ConstantsManager constantsManager, WorkflowManager workflowManager, IssueTypeScreenSchemeManager issueTypeScreenSchemeManager, FieldScreenManager fieldScreenManager, PermissionManager permissionManager, IssueFactory issueFactory, AttachmentManager attachmentManager, IssueLinkTypeManager issueLinkTypeManager, IssueLinkManager issueLinkManager, FieldManager fieldManager, ApplicationProperties applicationProperties, IssueTypeSchemeManager issueTypeSchemeManager, CommentManager commentManager, UserUtil userUtil)
           
 
Method Summary
 void addComments(org.ofbiz.core.entity.GenericValue issue, ExternalComment externalComment, boolean dispatchEvent)
          Adds an external comment to an issue and portentially dispatches and event about this.
 void addComments(org.ofbiz.core.entity.GenericValue issue, ExternalComment externalComment, boolean dispatchEvent, boolean tweakIssueUpdateDate)
          Adds an external comment to an issue and portentially dispatches and event about this and also updates the issue updated date.
 java.lang.String addConstant(java.lang.String constantName, java.lang.String constantType)
           
protected  java.lang.String addConstant(java.lang.String constantName, java.lang.String constantType, java.util.Map<java.lang.String,java.lang.String> extraParams)
           
 void addOptions(CustomField customFieldObject, ExternalCustomFieldValue customFieldValue, org.ofbiz.core.entity.GenericValue issueGV)
           
 void associateCustomFieldWithScreen(CustomField customField, FieldScreen screen)
           
 void associateProjectCategory(org.ofbiz.core.entity.GenericValue project, org.ofbiz.core.entity.GenericValue projectCategory)
           
 void attachFile(ExternalAttachment externalAttachment, org.ofbiz.core.entity.GenericValue issueGv)
           
 boolean canActivateNumberOfUsers(int numberOfUsers)
           
protected  void checkStatus(Issue issue, java.lang.String status)
           
 Issue convertExternalIssueToIssue(ExternalIssue externalIssue, ExternalProject project, ImportObjectIdMappings mappings)
           
 org.ofbiz.core.entity.GenericValue createComponent(ExternalProject externalProject, ExternalComponent externalComponent)
           
 CustomField createCustomField(ExternalCustomFieldValue customFieldValue)
           
 org.ofbiz.core.entity.GenericValue createIssue(Issue issue, java.lang.String status, java.lang.String resolution)
           
protected  org.ofbiz.core.entity.GenericValue createIssue(java.util.Map fields)
           
 void createIssueLink(ExternalLink externalLink, ImportObjectIdMappings mappings)
           
 org.ofbiz.core.entity.GenericValue createProject(ExternalProject externalProject)
           
 org.ofbiz.core.entity.GenericValue createProjectCategory(java.lang.String projectCategoryName)
           
 com.opensymphony.user.User createUser(ExternalUser externalUser)
           
 Version createVersion(ExternalProject externalProject, ExternalVersion externalVersion)
           
 java.lang.String extractCustomFieldId(java.lang.String customfieldId)
           
 java.lang.String extractCustomFieldType(java.lang.String customfieldId)
           
 org.ofbiz.core.entity.GenericValue getComponent(ExternalProject externalProject, ExternalComponent externalComponent)
           
 org.ofbiz.core.entity.GenericValue getConstant(java.lang.String constantName, java.lang.String constantType)
           
 CustomField getCustomField(ExternalCustomFieldValue customFieldValue)
           
 CustomField getCustomField(java.lang.String customfieldId)
           
 com.atlassian.core.util.DateUtils getDateUtils()
           
 com.opensymphony.user.User getJiraUser(ExternalUser externalUser)
           
 org.ofbiz.core.entity.GenericValue getProject(ExternalProject externalProject)
           
 org.ofbiz.core.entity.GenericValue getProjectCategory(java.lang.String projectCategoryName)
           
static java.lang.String getTextDataFromMimeMessage(java.lang.String s)
           
 Version getVersion(ExternalProject externalProject, ExternalVersion externalVersion)
           
 boolean isIssueLinkingOn()
           
 MutableIssue newIssueInstance()
           
 void setCurrentWorkflowStep(org.ofbiz.core.entity.GenericValue issue, java.lang.String status, java.lang.String resolution)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GENERIC_CONTENT_TYPE

public static final java.lang.String GENERIC_CONTENT_TYPE
See Also:
Constant Field Values

TYPE_SEPERATOR

public static final java.lang.String TYPE_SEPERATOR
See Also:
Constant Field Values

CF_PREFIX

public static final java.lang.String CF_PREFIX
See Also:
Constant Field Values
Constructor Detail

ExternalUtils

public ExternalUtils(ProjectManager projectManager,
                     PermissionSchemeManager permissionSchemeManager,
                     IssueManager issueManager,
                     JiraAuthenticationContext authenticationContext,
                     VersionManager versionManager,
                     ProjectComponentManager componentManager,
                     com.opensymphony.user.UserManager userManager,
                     CustomFieldManager customFieldManager,
                     OptionsManager optionsManager,
                     org.ofbiz.core.entity.GenericDelegator genericDelegator,
                     com.atlassian.core.action.ActionDispatcher actionDispatcher,
                     ConstantsManager constantsManager,
                     WorkflowManager workflowManager,
                     IssueTypeScreenSchemeManager issueTypeScreenSchemeManager,
                     FieldScreenManager fieldScreenManager,
                     PermissionManager permissionManager,
                     IssueFactory issueFactory,
                     AttachmentManager attachmentManager,
                     IssueLinkTypeManager issueLinkTypeManager,
                     IssueLinkManager issueLinkManager,
                     FieldManager fieldManager,
                     ApplicationProperties applicationProperties,
                     IssueTypeSchemeManager issueTypeSchemeManager,
                     CommentManager commentManager,
                     UserUtil userUtil)
Method Detail

getProject

public org.ofbiz.core.entity.GenericValue getProject(ExternalProject externalProject)

createProject

public org.ofbiz.core.entity.GenericValue createProject(ExternalProject externalProject)
                                                 throws ExternalException
Throws:
ExternalException

createVersion

public Version createVersion(ExternalProject externalProject,
                             ExternalVersion externalVersion)

getVersion

public Version getVersion(ExternalProject externalProject,
                          ExternalVersion externalVersion)

createComponent

public org.ofbiz.core.entity.GenericValue createComponent(ExternalProject externalProject,
                                                          ExternalComponent externalComponent)

getComponent

public org.ofbiz.core.entity.GenericValue getComponent(ExternalProject externalProject,
                                                       ExternalComponent externalComponent)

createUser

public com.opensymphony.user.User createUser(ExternalUser externalUser)

canActivateNumberOfUsers

public boolean canActivateNumberOfUsers(int numberOfUsers)

getJiraUser

public com.opensymphony.user.User getJiraUser(ExternalUser externalUser)

createIssue

public org.ofbiz.core.entity.GenericValue createIssue(Issue issue,
                                                      java.lang.String status,
                                                      java.lang.String resolution)
                                               throws ExternalException
Throws:
ExternalException

checkStatus

protected void checkStatus(Issue issue,
                           java.lang.String status)
                    throws WorkflowException,
                           ExternalException
Throws:
WorkflowException
ExternalException

createIssue

protected org.ofbiz.core.entity.GenericValue createIssue(java.util.Map fields)
                                                  throws CreateException
Throws:
CreateException

setCurrentWorkflowStep

public void setCurrentWorkflowStep(org.ofbiz.core.entity.GenericValue issue,
                                   java.lang.String status,
                                   java.lang.String resolution)
                            throws org.ofbiz.core.entity.GenericEntityException,
                                   WorkflowException
Throws:
org.ofbiz.core.entity.GenericEntityException
WorkflowException

getCustomField

public CustomField getCustomField(ExternalCustomFieldValue customFieldValue)

getCustomField

public CustomField getCustomField(java.lang.String customfieldId)

addOptions

public void addOptions(CustomField customFieldObject,
                       ExternalCustomFieldValue customFieldValue,
                       org.ofbiz.core.entity.GenericValue issueGV)

createCustomField

public CustomField createCustomField(ExternalCustomFieldValue customFieldValue)

extractCustomFieldType

public java.lang.String extractCustomFieldType(java.lang.String customfieldId)

extractCustomFieldId

public java.lang.String extractCustomFieldId(java.lang.String customfieldId)

associateCustomFieldWithScreen

public void associateCustomFieldWithScreen(CustomField customField,
                                           FieldScreen screen)

addComments

public void addComments(org.ofbiz.core.entity.GenericValue issue,
                        ExternalComment externalComment,
                        boolean dispatchEvent)
                 throws ExternalException
Adds an external comment to an issue and portentially dispatches and event about this. The issue updated date will be set to now via this method.

Parameters:
issue - the issue GV
externalComment - the external Comment to add
dispatchEvent - whether to dispatch an issue updated event
Throws:
ExternalException - if something bad happens

addComments

public void addComments(org.ofbiz.core.entity.GenericValue issue,
                        ExternalComment externalComment,
                        boolean dispatchEvent,
                        boolean tweakIssueUpdateDate)
                 throws ExternalException
Adds an external comment to an issue and portentially dispatches and event about this and also updates the issue updated date. When doing a CSV import one might not want the event dispatched nor the issue updated date changed.

Parameters:
issue - the issue GV
externalComment - the external Comment to add
dispatchEvent - whether to dispatch an issue updated event
tweakIssueUpdateDate - whether to tweak the issue updated date or not
Throws:
ExternalException - if something bad happens

attachFile

public void attachFile(ExternalAttachment externalAttachment,
                       org.ofbiz.core.entity.GenericValue issueGv)
                throws ExternalException
Throws:
ExternalException

createIssueLink

public void createIssueLink(ExternalLink externalLink,
                            ImportObjectIdMappings mappings)
                     throws ExternalException
Throws:
ExternalException

getConstant

public org.ofbiz.core.entity.GenericValue getConstant(java.lang.String constantName,
                                                      java.lang.String constantType)

addConstant

public java.lang.String addConstant(java.lang.String constantName,
                                    java.lang.String constantType)
                             throws ExternalException
Throws:
ExternalException

addConstant

protected java.lang.String addConstant(java.lang.String constantName,
                                       java.lang.String constantType,
                                       java.util.Map<java.lang.String,java.lang.String> extraParams)
                                throws ExternalException
Throws:
ExternalException

convertExternalIssueToIssue

public Issue convertExternalIssueToIssue(ExternalIssue externalIssue,
                                         ExternalProject project,
                                         ImportObjectIdMappings mappings)
                                  throws ImportException
Throws:
ImportException

newIssueInstance

public MutableIssue newIssueInstance()

getTextDataFromMimeMessage

public static java.lang.String getTextDataFromMimeMessage(java.lang.String s)

getDateUtils

public com.atlassian.core.util.DateUtils getDateUtils()

isIssueLinkingOn

public boolean isIssueLinkingOn()

getProjectCategory

public org.ofbiz.core.entity.GenericValue getProjectCategory(java.lang.String projectCategoryName)

createProjectCategory

public org.ofbiz.core.entity.GenericValue createProjectCategory(java.lang.String projectCategoryName)
                                                         throws ExternalException
Throws:
ExternalException

associateProjectCategory

public void associateProjectCategory(org.ofbiz.core.entity.GenericValue project,
                                     org.ofbiz.core.entity.GenericValue projectCategory)


Copyright © 2002-2010 Atlassian. All Rights Reserved.