ImportExportTagspublic class ImportExportUtilities extends Object implements ImportExportTags
This class provides functionality needed to import and export issues and their associated data as XML. This xml provides all the data necessary to import the issues into another instance of ITracker or some other issue tracking tool.
| Modifier and Type | Field | Description |
|---|---|---|
static int |
IMPORT_STAT_FIELDS |
|
static int |
IMPORT_STAT_ISSUES |
|
static int |
IMPORT_STAT_NEW |
|
static int |
IMPORT_STAT_PROJECTS |
|
static int |
IMPORT_STAT_RESOLUTIONS |
|
static int |
IMPORT_STAT_REUSED |
|
static int |
IMPORT_STAT_SEVERITIES |
|
static int |
IMPORT_STAT_STATUSES |
|
static int |
IMPORT_STAT_USERS |
ATTR_BIT, ATTR_CREATOR_ID, ATTR_DATE, ATTR_ID, ATTR_NAME, ATTR_ORDER, ATTR_STATUS, ATTR_SYSTEMID, ATTR_VALUE, DATE_FORMATTER, EXPORT_LOCALE, EXPORT_LOCALE_STRING, TAG_COMPONENT, TAG_COMPONENT_DESCRIPTION, TAG_COMPONENT_ID, TAG_COMPONENT_NAME, TAG_COMPONENTS, TAG_CONFIGURATION, TAG_CONFIGURATION_VERSION, TAG_CREATE_DATE, TAG_CREATOR, TAG_CUSTOM_FIELD, TAG_CUSTOM_FIELD_DATEFORMAT, TAG_CUSTOM_FIELD_LABEL, TAG_CUSTOM_FIELD_OPTION, TAG_CUSTOM_FIELD_REQUIRED, TAG_CUSTOM_FIELD_SORTOPTIONS, TAG_CUSTOM_FIELD_TYPE, TAG_CUSTOM_FIELDS, TAG_EMAIL, TAG_FIRST_NAME, TAG_HISTORY_ENTRY, TAG_ISSUE, TAG_ISSUE_ATTACHMENT, TAG_ISSUE_ATTACHMENT_CREATOR, TAG_ISSUE_ATTACHMENT_DESCRIPTION, TAG_ISSUE_ATTACHMENT_FILENAME, TAG_ISSUE_ATTACHMENT_ORIGFILE, TAG_ISSUE_ATTACHMENT_SIZE, TAG_ISSUE_ATTACHMENT_TYPE, TAG_ISSUE_ATTACHMENTS, TAG_ISSUE_COMPONENTS, TAG_ISSUE_DESCRIPTION, TAG_ISSUE_FIELD, TAG_ISSUE_FIELDS, TAG_ISSUE_HISTORY, TAG_ISSUE_PROJECT, TAG_ISSUE_RESOLUTION, TAG_ISSUE_SEVERITY, TAG_ISSUE_STATUS, TAG_ISSUE_VERSIONS, TAG_ISSUES, TAG_LAST_MODIFIED, TAG_LAST_NAME, TAG_LOGIN, TAG_OWNER, TAG_PROJECT, TAG_PROJECT_DESCRIPTION, TAG_PROJECT_FIELD_ID, TAG_PROJECT_FIELDS, TAG_PROJECT_NAME, TAG_PROJECT_OPTIONS, TAG_PROJECT_OWNER_ID, TAG_PROJECT_OWNERS, TAG_PROJECT_STATUS, TAG_PROJECTS, TAG_RESOLUTION, TAG_RESOLUTIONS, TAG_ROOT, TAG_SEVERITIES, TAG_SEVERITY, TAG_STATUS, TAG_STATUSES, TAG_SUPER_USER, TAG_TARGET_VERSION_ID, TAG_USER, TAG_USER_STATUS, TAG_USERS, TAG_VERSION, TAG_VERSION_DESCRIPTION, TAG_VERSION_ID, TAG_VERSION_NUMBER, TAG_VERSIONS| Constructor | Description |
|---|---|
ImportExportUtilities() |
| Modifier and Type | Method | Description |
|---|---|---|
static void |
export(AbstractEntity o,
OutputStream os) |
|
static void |
exportConfigModels(org.dom4j.io.XMLWriter writer,
SystemConfiguration config) |
|
static String |
exportIssues(List<Issue> issues,
SystemConfiguration config) |
Takes an array of IssueModels and exports them as XML suitable for import into another
instance of ITracker, or another issue tracking tool.
|
static boolean |
exportIssues(List<Issue> issues,
SystemConfiguration config,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
export the issues to an XML and write it to the response.
|
static void |
exportIssues(org.dom4j.io.XMLWriter writer,
List<Issue> issues,
SystemConfiguration config) |
|
static void |
exportIssuesModels(org.dom4j.io.XMLWriter writer,
List<Issue> issues) |
|
static void |
exportModel(org.dom4j.io.XMLWriter writer,
AbstractEntity abstractBean) |
|
static String |
exportModel(AbstractEntity abstractBean) |
Returns the appropriate XML block for a given model.
|
static void |
getConfigurationXML(org.dom4j.io.XMLWriter writer,
SystemConfiguration config) |
|
static String |
getConfigurationXML(SystemConfiguration config) |
Generates an XML block that encapsulates the system configuration for import or export.
|
static void |
getIssueXML(org.dom4j.io.XMLWriter writer,
Issue issue) |
|
static String |
getIssueXML(Issue issue) |
Generates an XML block that encapsulates an issue for import or export.
|
static String |
getProjectXML(Project project) |
Generates an XML block that encapsulates a project for import or export.
|
static void |
getUserXML(org.dom4j.io.XMLWriter writer,
User user) |
|
static String |
getUserXML(User user) |
Generates an XML block that encapsulates a user for import or export.
|
static AbstractEntity[] |
importIssues(Reader xmlReader) |
Takes an XML file matching the ITracker import/export DTD and returns an array
of AbstractBean objects.
|
static AbstractEntity |
importXml(InputSource is) |
public static final int IMPORT_STAT_NEW
public static final int IMPORT_STAT_REUSED
public static final int IMPORT_STAT_USERS
public static final int IMPORT_STAT_PROJECTS
public static final int IMPORT_STAT_ISSUES
public static final int IMPORT_STAT_STATUSES
public static final int IMPORT_STAT_SEVERITIES
public static final int IMPORT_STAT_RESOLUTIONS
public static final int IMPORT_STAT_FIELDS
public static AbstractEntity[] importIssues(Reader xmlReader) throws ImportExportException
xmlReader - an xml reader to importImportExportException - thrown if the xml can not be parsed into the appropriate objectspublic static boolean exportIssues(List<Issue> issues, SystemConfiguration config, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
issues - config - request - response - true the export was sucessful.javax.servlet.ServletExceptionIOExceptionpublic static AbstractEntity importXml(InputSource is) throws Exception
Exceptionpublic static void export(AbstractEntity o, OutputStream os) throws Exception
Exceptionpublic static void exportIssues(org.dom4j.io.XMLWriter writer,
List<Issue> issues,
SystemConfiguration config)
throws ImportExportException
ImportExportExceptionpublic static void exportConfigModels(org.dom4j.io.XMLWriter writer,
SystemConfiguration config)
throws IOException
IOExceptionpublic static void exportIssuesModels(org.dom4j.io.XMLWriter writer,
List<Issue> issues)
throws IOException
IOExceptionpublic static String exportIssues(List<Issue> issues, SystemConfiguration config) throws ImportExportException
issues - an array of Issue objects to exportImportExportException - thrown if the array of issues can not be exportedpublic static String exportModel(AbstractEntity abstractBean) throws ImportExportException
abstractBean - a model that extends AbstractEntityImportExportException - thrown if the given model can not be exportedpublic static void exportModel(org.dom4j.io.XMLWriter writer,
AbstractEntity abstractBean)
throws IOException
IOExceptionpublic static void getIssueXML(org.dom4j.io.XMLWriter writer,
Issue issue)
throws IOException
IOExceptionpublic static String getIssueXML(Issue issue)
issue - an Issue to generate the XML forpublic static String getProjectXML(Project project)
project - a Project to generate the XML forpublic static void getUserXML(org.dom4j.io.XMLWriter writer,
User user)
throws IOException
IOExceptionpublic static String getUserXML(User user)
user - a User to generate the XML forpublic static void getConfigurationXML(org.dom4j.io.XMLWriter writer,
SystemConfiguration config)
throws IOException
IOExceptionpublic static String getConfigurationXML(SystemConfiguration config)
config - a SystemConfiguration to generate the XML forCopyright © 2002–2019 itracker. All rights reserved.