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').
Method Summary |
void |
doImport(MantisImportBean.MappingBean mappingBean,
DatabaseConnectionBean connectionBean,
boolean enableNotifications,
boolean reuseExistingUsers,
boolean addToDevelopersGroup,
boolean reindex,
java.lang.String[] projectNames,
com.opensymphony.user.User importer)
Main method of this bean. |
protected int |
getMantisFeaturePriority()
In Mantis, 'features' are just 'bugs' with a priority of 'feature'. |
protected java.lang.String |
getMantisUsername(java.sql.ResultSet resultSet)
"We would like to have all user names follow the name.lastname convention (“joe.bloggs”) even when in Mantis
they may use shortcuts (“joe”). |
protected void |
logAttachmentLocation(java.lang.String diskfile,
java.io.File jiraAttachFile)
Hook for recording which Mantis attachment filename maps to which JIRA attachment filename. |
protected void |
resetAttachmentLog()
|
Methods inherited from class com.atlassian.jira.util.MantisImportBean |
cleanMantisFilename, closePS, createChangeHistory, createComponent, createFixForVersionAssociation, createMantisCustomField, createProject, createUser, createVersion, escapeMantisString, getAllMantisProjects, getFullNameFromEmail, getImportLog, getMantisIdFromString, getProjectKey, getProjectList, importAttachments, importComments, importComponents, importIssue, importIssues, importProjects, importUser, importVersions, log, retrieveImportedIssues, rewriteMantisBuglinks |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CustomMantisImportBean
public CustomMantisImportBean()
doImport
public void doImport(MantisImportBean.MappingBean mappingBean,
DatabaseConnectionBean connectionBean,
boolean enableNotifications,
boolean reuseExistingUsers,
boolean addToDevelopersGroup,
boolean reindex,
java.lang.String[] projectNames,
com.opensymphony.user.User importer)
throws java.lang.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:
java.lang.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 java.lang.String getMantisUsername(java.sql.ResultSet resultSet)
throws java.sql.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:
java.sql.SQLException
logAttachmentLocation
protected void logAttachmentLocation(java.lang.String diskfile,
java.io.File jiraAttachFile)
throws java.io.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:
java.io.IOException
resetAttachmentLog
protected void resetAttachmentLog()
Copyright © 2002-2005 Atlassian. All Rights Reserved.