|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.jira.util.MantisImportBean
Nested Class Summary | |
static class |
MantisImportBean.DefaultMappingBean
Class mapping Mantis ids (see lang/strings_english.txt in the Mantis source) to JIRA IDs |
protected static interface |
MantisImportBean.MappingBean
|
class |
MantisImportBean.UserRole
|
Field Summary | |
(package private) java.lang.StringBuffer |
importLog
|
static java.lang.String |
MANTIS_ID_CF_NAME
|
static java.text.DecimalFormat |
MANTIS_ID_FORMAT
|
static java.lang.String |
MANTIS_ID_TYPE
|
Constructor Summary | |
MantisImportBean()
|
Method Summary | |
java.lang.String |
cleanMantisFilename(java.lang.String filename)
Return a clean filename from Mantis |
protected static void |
closePS(java.sql.PreparedStatement ps)
|
protected void |
createChangeHistory(int bug_id,
org.ofbiz.core.entity.GenericValue issue)
Store the original mantis bug id in the change history. |
protected boolean |
createComponent(java.lang.String projectName,
java.lang.String componentName,
java.lang.String description)
|
protected void |
createFixForVersionAssociation(int mantisStatus,
org.ofbiz.core.entity.GenericValue issue,
java.lang.String project,
java.lang.String component)
|
protected void |
createMantisCustomField(int bug_id,
org.ofbiz.core.entity.GenericValue issue)
|
protected boolean |
createProject(java.lang.String product,
java.lang.String description)
|
protected com.opensymphony.user.User |
createUser(java.lang.String mantisEmail,
java.lang.String mantisUsername,
int mantisUserid,
java.lang.String fullName,
java.lang.String password)
|
protected boolean |
createVersion(java.lang.String project,
java.lang.String versionName)
|
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. |
java.lang.String |
escapeMantisString(java.lang.String str)
|
static java.util.List |
getAllMantisProjects(DatabaseConnectionBean connectionBean)
Get a list of available Mantis projects. |
java.lang.String |
getFullNameFromEmail(java.lang.String email,
java.lang.String username)
Infers the user's full name from other information. |
java.lang.String |
getImportLog()
|
protected int |
getMantisFeaturePriority()
In Mantis, 'features' are just 'bugs' with a priority of 'feature'. |
java.lang.Integer |
getMantisIdFromString(java.lang.String s)
Return an integer prefix of a string, if any. |
protected java.lang.String |
getMantisUsername(java.sql.ResultSet resultSet)
Return a JIRA username from a row in the Mantis user table. |
java.lang.String |
getProjectKey(java.lang.String name)
|
java.lang.String |
getProjectList(java.lang.String[] selectList)
Generate SQL-friendly quoted comma-separated list of projects. |
protected void |
importAttachments(java.sql.Connection conn,
java.sql.PreparedStatement attachPrepStatement,
int bug_id,
org.ofbiz.core.entity.GenericValue issue)
|
protected void |
importComments(java.sql.Connection conn,
int bug_id,
org.ofbiz.core.entity.GenericValue issue)
|
protected void |
importComponents(java.sql.Connection conn,
java.lang.String projectName,
int projectId)
|
protected org.ofbiz.core.entity.GenericValue |
importIssue(java.sql.ResultSet resultSet,
java.sql.Connection conn,
java.sql.ResultSet textResultSet,
java.lang.String projectName)
Import an issue from Mantis |
protected void |
importIssues(java.sql.Connection conn,
java.lang.String projectName,
int projectId)
|
protected void |
importProjects(java.sql.Connection conn,
java.lang.String selectedProjects)
|
protected void |
importUser(java.sql.Connection conn,
int mantisId)
|
protected void |
importVersions(java.sql.Connection conn,
java.lang.String projectName,
int projectId)
|
protected void |
log(java.lang.String s)
|
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 java.util.Map |
retrieveImportedIssues()
Return a map of mantisKey (Integer) -> Jira Issues Id (Integer). |
java.lang.String |
rewriteMantisBuglinks(java.lang.String str)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
java.lang.StringBuffer importLog
public static final java.lang.String MANTIS_ID_CF_NAME
public static final java.text.DecimalFormat MANTIS_ID_FORMAT
public static final java.lang.String MANTIS_ID_TYPE
Constructor Detail |
public MantisImportBean()
Method Detail |
public static java.util.List getAllMantisProjects(DatabaseConnectionBean connectionBean) throws java.sql.SQLException
java.sql.SQLException
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
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
java.lang.Exception
IndexException
org.ofbiz.core.entity.GenericEntityException
public java.lang.String getProjectList(java.lang.String[] selectList)
protected void importIssues(java.sql.Connection conn, java.lang.String projectName, int projectId) throws java.lang.Exception, com.opensymphony.workflow.InvalidRoleException, com.opensymphony.workflow.InvalidInputException, CreateException, java.sql.SQLException
java.lang.Exception
com.opensymphony.workflow.InvalidRoleException
com.opensymphony.workflow.InvalidInputException
CreateException
java.sql.SQLException
protected org.ofbiz.core.entity.GenericValue importIssue(java.sql.ResultSet resultSet, java.sql.Connection conn, java.sql.ResultSet textResultSet, java.lang.String projectName) throws java.lang.Exception, com.opensymphony.workflow.InvalidRoleException, com.opensymphony.workflow.InvalidInputException, CreateException, java.sql.SQLException
resultSet
- mantis_bug_table rowconn
- JDBC ConnectiontextResultSet
- mantis_bug_text_table rowprojectName
- Name of issue's project
java.lang.Exception
com.opensymphony.workflow.InvalidRoleException
com.opensymphony.workflow.InvalidInputException
CreateException
java.sql.SQLException
protected int getMantisFeaturePriority()
public java.lang.String escapeMantisString(java.lang.String str)
public java.lang.String rewriteMantisBuglinks(java.lang.String str)
public java.lang.Integer getMantisIdFromString(java.lang.String s)
protected void createFixForVersionAssociation(int mantisStatus, org.ofbiz.core.entity.GenericValue issue, java.lang.String project, java.lang.String component) throws org.ofbiz.core.entity.GenericEntityException
org.ofbiz.core.entity.GenericEntityException
protected void importComments(java.sql.Connection conn, int bug_id, org.ofbiz.core.entity.GenericValue issue) throws java.lang.Exception, org.ofbiz.core.entity.GenericEntityException
java.lang.Exception
org.ofbiz.core.entity.GenericEntityException
protected void createChangeHistory(int bug_id, org.ofbiz.core.entity.GenericValue issue) throws java.lang.Exception
java.lang.Exception
protected void createMantisCustomField(int bug_id, org.ofbiz.core.entity.GenericValue issue) throws java.lang.Exception
java.lang.Exception
protected java.util.Map retrieveImportedIssues() throws org.ofbiz.core.entity.GenericEntityException
org.ofbiz.core.entity.GenericEntityException
protected void importComponents(java.sql.Connection conn, java.lang.String projectName, int projectId) throws java.sql.SQLException, org.ofbiz.core.entity.GenericEntityException
java.sql.SQLException
org.ofbiz.core.entity.GenericEntityException
protected boolean createComponent(java.lang.String projectName, java.lang.String componentName, java.lang.String description) throws org.ofbiz.core.entity.GenericEntityException
org.ofbiz.core.entity.GenericEntityException
protected void importVersions(java.sql.Connection conn, java.lang.String projectName, int projectId) throws java.sql.SQLException, org.ofbiz.core.entity.GenericEntityException
java.sql.SQLException
org.ofbiz.core.entity.GenericEntityException
protected boolean createVersion(java.lang.String project, java.lang.String versionName) throws org.ofbiz.core.entity.GenericEntityException
org.ofbiz.core.entity.GenericEntityException
protected void importProjects(java.sql.Connection conn, java.lang.String selectedProjects) throws java.lang.Exception, org.ofbiz.core.entity.GenericEntityException, com.opensymphony.workflow.InvalidInputException
java.lang.Exception
org.ofbiz.core.entity.GenericEntityException
com.opensymphony.workflow.InvalidInputException
protected boolean createProject(java.lang.String product, java.lang.String description) throws org.ofbiz.core.entity.GenericEntityException
org.ofbiz.core.entity.GenericEntityException
protected void importUser(java.sql.Connection conn, int mantisId) throws java.sql.SQLException
java.sql.SQLException
protected java.lang.String getMantisUsername(java.sql.ResultSet resultSet) throws java.sql.SQLException
java.sql.SQLException
protected com.opensymphony.user.User createUser(java.lang.String mantisEmail, java.lang.String mantisUsername, int mantisUserid, java.lang.String fullName, java.lang.String password)
protected void importAttachments(java.sql.Connection conn, java.sql.PreparedStatement attachPrepStatement, int bug_id, org.ofbiz.core.entity.GenericValue issue) throws java.lang.Exception
java.lang.Exception
public java.lang.String cleanMantisFilename(java.lang.String filename)
protected void logAttachmentLocation(java.lang.String diskfile, java.io.File jiraAttachFile) throws java.io.IOException
java.io.IOException
public java.lang.String getProjectKey(java.lang.String name)
public java.lang.String getFullNameFromEmail(java.lang.String email, java.lang.String username)
protected void log(java.lang.String s)
protected static void closePS(java.sql.PreparedStatement ps)
public java.lang.String getImportLog()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |