com.atlassian.jira.util
Class CustomMantisImportBean
java.lang.Object
com.atlassian.jira.util.MantisImportBean
com.atlassian.jira.util.CustomMantisImportBean
public class CustomMantisImportBean
- extends MantisImportBean
A variant of the MantisImportBean meeting some special customer requirements:
- A log (/tmp/attachments.txt) is kept of where attachments are created.
- Normally, features will be set to priority 'major'. In this importer, features are set to a custom priority, 'Mantis - Feature'.
- JIRA usernames are derived from the email address (from 'joe.bloggs@foo.com', we get 'joe.bloggs').
Fields inherited from class com.atlassian.jira.util.MantisImportBean |
MANTIS_CF_TYPE_CHECKBOX, MANTIS_CF_TYPE_DATE, MANTIS_CF_TYPE_EMAIL, MANTIS_CF_TYPE_ENUM, MANTIS_CF_TYPE_FLOAT, MANTIS_CF_TYPE_LIST, MANTIS_CF_TYPE_MULTILIST, MANTIS_CF_TYPE_NUMERIC, MANTIS_CF_TYPE_STRING, MANTIS_ID_CF_NAME, MANTIS_ID_FORMAT, MANTIS_ID_TYPE, MANTIS_TO_JIRA_CF_SEARCHER_MAPPINGS, MANTIS_TO_JIRA_CF_TYPE_MAPPINGS |
Constructor Summary |
CustomMantisImportBean(IssueIndexManager indexManager,
org.ofbiz.core.entity.GenericDelegator genericDelegator,
ProjectManager projectManager,
PermissionSchemeManager permissionSchemeManager,
CacheManager cacheManager,
IssueManager issueManager,
VersionManager versionManager,
ProjectComponentManager projectComponentManager,
CustomFieldManager customFieldManager,
IssueTypeScreenSchemeManager issueTypeScreenSchemeManager,
PermissionManager permissionManager,
OptionsManager optionsManager,
ExternalUtils externalUtils,
CommentManager commentManager,
IssueFactory issueFactory,
ProjectService projectService,
UserUtil userUtil)
|
Methods inherited from class com.atlassian.jira.util.MantisImportBean |
cleanMantisFilename, closePS, createChangeHistory, createComponent, createMantisIdCustomFieldValue, createProject, createUser, createVersion, escapeMantisString, getAllMantisProjects, getFullNameFromEmail, getImportLog, getMantisIdFromString, getNonExistentAssociatedUsers, getProjectKey, getProjectList, importAttachments, importComments, importComponents, importIssue, importIssues, importProjects, importUser, importVersions, log, retrieveImportedIssues, rewriteMantisBuglinksInText |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CustomMantisImportBean
public CustomMantisImportBean(IssueIndexManager indexManager,
org.ofbiz.core.entity.GenericDelegator genericDelegator,
ProjectManager projectManager,
PermissionSchemeManager permissionSchemeManager,
CacheManager cacheManager,
IssueManager issueManager,
VersionManager versionManager,
ProjectComponentManager projectComponentManager,
CustomFieldManager customFieldManager,
IssueTypeScreenSchemeManager issueTypeScreenSchemeManager,
PermissionManager permissionManager,
OptionsManager optionsManager,
ExternalUtils externalUtils,
CommentManager commentManager,
IssueFactory issueFactory,
ProjectService projectService,
UserUtil userUtil)
doImport
public void doImport(MantisImportBean.MappingBean mappingBean,
DatabaseConnectionBean connectionBean,
boolean enableNotifications,
boolean reuseExistingUsers,
boolean addToDevelopersGroup,
boolean reindex,
String[] projectNames,
User importer)
throws Exception,
IndexException,
org.ofbiz.core.entity.GenericEntityException
- Description copied from class:
MantisImportBean
- Main method of this bean. Creates JIRA projects mirroring those found in a Mantis database.
- Overrides:
doImport
in class MantisImportBean
- Parameters:
mappingBean
- Mappings from Mantis to JIRA, including project key, statuses, etcenableNotifications
- Whether to send email notifications for newly created issuesreuseExistingUsers
- Do we try to reuse existing users, or doImport a unique user for every Mantis user?addToDevelopersGroup
- Whether to add new users to the 'jira-developers' groupreindex
- Whether to reindex after the importprojectNames
- Array of Mantis project names to importimporter
- User doing the import
- Throws:
Exception
IndexException
org.ofbiz.core.entity.GenericEntityException
getMantisFeaturePriority
protected int getMantisFeaturePriority()
- Description copied from class:
MantisImportBean
- In Mantis, 'features' are just 'bugs' with a priority of 'feature'.
In JIRA we have a separate 'Feature' entity, which needs to be assigned a priority.
This method chooses that default priority.
- Overrides:
getMantisFeaturePriority
in class MantisImportBean
getMantisUsername
protected String getMantisUsername(ResultSet resultSet)
throws SQLException
- "We would like to have all user names follow the name.lastname convention ("joe.bloggs") even when in Mantis
they may use shortcuts ("joe"). This is important as we have an increasing number of Daves and Stephens !"
- Overrides:
getMantisUsername
in class MantisImportBean
- Throws:
SQLException
logAttachmentLocation
protected void logAttachmentLocation(String diskfile,
File jiraAttachFile)
throws IOException
- Description copied from class:
MantisImportBean
- Hook for recording which Mantis attachment filename maps to which JIRA attachment filename.
- Overrides:
logAttachmentLocation
in class MantisImportBean
- Throws:
IOException
resetAttachmentLog
protected void resetAttachmentLog()
Copyright © 2002-2009 Atlassian. All Rights Reserved.