View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004024 | mantisbt | feature | public | 2004-07-08 03:21 | 2017-04-01 00:13 |
Reporter | Luebbe | Assigned To | dregad | ||
Priority | normal | Severity | feature | Reproducibility | N/A |
Status | closed | Resolution | no change required | ||
Platform | Firefox / XP | OS | Suse Linux | OS Version | Apache 2 |
Product Version | 0.19.0a1 | ||||
Summary | 0004024: Add XML Export to print_bug_page.php | ||||
Description | Hi Folks, included is a patch against Mantis 0.18.2 that adds xml export capability to mantis. array( 'print_all_bug_page_word', 'html', 'target="_blank"', 'ieicon.gif', 'Word View' ), | ||||
Steps To Reproduce | I had to include the source below, because I couldn't upload the file | ||||
Additional Information | <?php Mantis - a php based bugtracking system
header( 'Content-Disposition: attachment; filename="' . $t_export_title . '.xml"' );
?> | ||||
Tags | No tags attached. | ||||
Attached Files | bugzilla.dtd (1,551 bytes)
<!ELEMENT bugzilla (bug+)> <!ATTLIST bugzilla version CDATA #REQUIRED> <!ATTLIST bugzilla urlbase CDATA #REQUIRED> <!ATTLIST bugzilla maintainer CDATA #REQUIRED> <!ATTLIST bugzilla exporter CDATA #IMPLIED> <!ELEMENT bug (bug_id, exporter, urlbase, bug_status, resolution?, product, priority, version, rep_platform, assigned_to, delta_ts, component, reporter, target_milestone?, bug_severity, creation_ts, qa_contact?, status_whiteboard?, op_sys, short_desc?, keywords*, dependson*, blocks*, cc*, long_desc?, attachment*)> <!ATTLIST bug error (NotFound|NotPermitted) #IMPLIED> <!ELEMENT bug_id (#PCDATA)> <!ELEMENT short_desc (#PCDATA)> <!ELEMENT bug_status (#PCDATA)> <!ELEMENT dependson (#PCDATA)> <!ELEMENT blocks (#PCDATA)> <!ELEMENT product (#PCDATA)> <!ELEMENT priority (#PCDATA)> <!ELEMENT version (#PCDATA)> <!ELEMENT cc (#PCDATA)> <!ELEMENT rep_platform (#PCDATA)> <!ELEMENT assigned_to (#PCDATA)> <!ELEMENT delta_ts (#PCDATA)> <!ELEMENT component (#PCDATA)> <!ELEMENT reporter (#PCDATA)> <!ELEMENT target_milestone (#PCDATA)> <!ELEMENT bug_severity (#PCDATA)> <!ELEMENT creation_ts (#PCDATA)> <!ELEMENT qa_contact (#PCDATA)> <!ELEMENT op_sys (#PCDATA)> <!ELEMENT keywords (#PCDATA)> <!ELEMENT status_whiteboard (#PCDATA)> <!ELEMENT long_desc (who, bug_when, thetext)> <!ELEMENT who (#PCDATA)> <!ELEMENT bug_when (#PCDATA)> <!ELEMENT thetext (#PCDATA)> <!ELEMENT attachment (id, date, attach_desc, type, data)> <!ELEMENT id (#PCDATA)> <!ELEMENT date (#PCDATA)> <!ELEMENT desc (#PCDATA)> <!ELEMENT type (#PCDATA)> <!ELEMENT data (#PCDATA)> sample.xml (2,753 bytes)
<?xml version="1.0" encoding="ISO-8859-1"?> <mantis xmlns="http://www.mantisbt.org" xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.mantisbt.org mantis.xsd'> <issue id="5"> <category>Default</category> <priority id="40">high</priority> <severity id="50">minor</severity> <status id="10">new</status> <reporter id="4711">stefan</reporter> <summary>This is a summary</summary> <description>This is a super long and exhaustive description. Not really...</description> <reproducibility id="10">always</reproducibility> <date_submitted>1094586280</date_submitted> <last_update>1094586280</last_update> </issue> <issue id="6"> <category>Default</category> <priority id="20">low</priority> <severity id="80">block</severity> <status id="80">resolved</status> <reporter id="4711">stefan</reporter> <summary>Another summary</summary> <description>We are getting bored with this issue...</description> <version>HEAD</version> <build>20040907-17</build> <platform>Linux</platform> <os>Debian</os> <os_version>Sarge</os_version> <reproducibility id="30">sometimes</reproducibility> <steps_to_reproduce>1. Begin to yawn. 2. Feeling bored? If not, goto 1.</steps_to_reproduce> <additional_info>Sometimes it's easy to reproduce, sometimes not.</additional_info> <date_submitted>1094586280</date_submitted> <assigned_to id="4711">stefan</assigned_to> <projection id="70">major rework</projection> <eta id="40">< 1 week</eta> <resolution id="50">not a bug</resolution> <fixed_in_version>HEAD</fixed_in_version> <attachment> <filename>picture_of_me.jpg</filename> <size>63312</size> <content_type>image/jpeg</content_type> <timestamp>1094587086</timestamp> <download_url>http://localhost/mantis/file_download.php?file_id=403&type=bug</download_url> </attachment> <attachment> <filename>brain_dump.txt</filename> <size>5</size> <content_type>text/plain</content_type> <timestamp>10945889086</timestamp> <download_url>http://localhost/mantis/file_download.php?file_id=404&type=bug</download_url> </attachment> <relationship> <type>related to</type> <id>1</id> </relationship> <note private="true"> <author id="4711">stefan</author> <timestamp>10945889086</timestamp> <text>My own non-public note. Can you see it?</text> </note> <note> <author id="4711">stefan</author> <timestamp>10945889186</timestamp> <text>And now a public note.</text> </note> <last_update>1094586280</last_update> </issue> </mantis> sample.xml (2,809 bytes)
<?xml version="1.0" encoding="ISO-8859-1"?> <mantis xmlns="http://www.mantisbt.org" xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.mantisbt.org mantis.xsd'> <issue id="5"> <category>Default</category> <priority id="40">high</priority> <severity id="50">minor</severity> <status id="10">new</status> <reporter id="4711" login="stefan">Stefan B</reporter> <summary>This is a summary</summary> <description>This is a super long and exhaustive description. Not really...</description> <reproducibility id="10">always</reproducibility> <dateSubmitted>1094586280</dateSubmitted> <lastUpdate>1094586280</lastUpdate> </issue> <issue id="6"> <category>Default</category> <priority id="20">low</priority> <severity id="80">block</severity> <status id="80">resolved</status> <reporter id="4711" login="Stefan">Stefan B</reporter> <summary>Another summary</summary> <description>We are getting bored with this issue...</description> <version>HEAD</version> <build>20040907-17</build> <platform>Linux</platform> <os>Debian</os> <osVersion>Sarge</osVersion> <reproducibility id="30">sometimes</reproducibility> <stepsToReproduce>1. Begin to yawn. 2. Feeling bored? If not, goto 1.</stepsToReproduce> <additionalInfo>Sometimes it's easy to reproduce, sometimes not.</additionalInfo> <dateSubmitted>1094586280</dateSubmitted> <assignedTo id="4711" login="stefan">Stefan B</assignedTo> <projection id="70">major rework</projection> <eta id="40">< 1 week</eta> <resolution id="50">not a bug</resolution> <fixedInVersion>HEAD</fixedInVersion> <attachment> <filename>picture_of_me.jpg</filename> <size>63312</size> <contentType>image/jpeg</contentType> <timestamp>1094587086</timestamp> <downloadUrl>http://localhost/mantis/file_download.php?file_id=403&type=bug</downloadUrl> </attachment> <attachment> <filename>brain_dump.txt</filename> <size>5</size> <contentType>text/plain</contentType> <timestamp>10945889086</timestamp> <downloadUrl>http://localhost/mantis/file_download.php?file_id=404&type=bug</downloadUrl> </attachment> <relationship> <type>related to</type> <id>1</id> </relationship> <note private="true"> <author id="4711" login="stefan">Stefan B</author> <timestamp>10945889086</timestamp> <text>My own non-public note. Can you see it?</text> </note> <note> <author id="4711" login="stefan">Stefan B</author> <timestamp>10945889186</timestamp> <text>And now a public note.</text> </note> <lastUpdate>1094586280</lastUpdate> </issue> </mantis> mantis.dtd (1,736 bytes)
<!-- Mantis DTD for xml export--> <!-- root element <mantis>, composed by one or more <bug> elements --> <!ELEMENT mantis (bug+)> <!ATTLIST mantis version CDATA #REQUIRED urlbase CDATA #REQUIRED buglink CDATA #REQUIRED notelink CDATA #REQUIRED > <!ELEMENT bug ( id , description , additional_information? , steps_to_reproduce? , project_id , reporter_id , handler_id? , duplicate_id? , priority? , severity? , reproducibility? , status? , resolution? , projection? , date_submitted , last_updated , eta? , os? , os_build? , platform? , version? , fixed_in_version? , target_version? , build? , profile_id? , view_state , summary , category_id? , sponsorship_total? , sticky? ) > <!ELEMENT id (#PCDATA)> <!ELEMENT description (#PCDATA)> <!ELEMENT additional_information (#PCDATA)> <!ELEMENT steps_to_reproduce (#PCDATA)> <!ELEMENT project_id (#PCDATA)> <!ELEMENT reporter_id (#PCDATA)> <!ELEMENT handler_id (#PCDATA)> <!ELEMENT duplicate_id (#PCDATA)> <!ELEMENT priority (#PCDATA)> <!ELEMENT severity (#PCDATA)> <!ELEMENT reproducibility (#PCDATA)> <!ELEMENT status (#PCDATA)> <!ELEMENT resolution (#PCDATA)> <!ELEMENT projection (#PCDATA)> <!ELEMENT date_submitted (#PCDATA)> <!ELEMENT last_updated (#PCDATA)> <!ELEMENT eta (#PCDATA)> <!ELEMENT os (#PCDATA)> <!ELEMENT os_build (#PCDATA)> <!ELEMENT platform (#PCDATA)> <!ELEMENT version (#PCDATA)> <!ELEMENT fixed_in_version (#PCDATA)> <!ELEMENT target_version (#PCDATA)> <!ELEMENT build (#PCDATA)> <!ELEMENT view_state (#PCDATA)> <!ELEMENT summary (#PCDATA)> <!ELEMENT category_id (#PCDATA)> <!ELEMENT sponsorship_total (#PCDATA)> <!ELEMENT sticky (#PCDATA)> <!ELEMENT profile_id (#PCDATA)> exported_issues.xml (5,633 bytes)
<?xml version="1.0" ?> <!-- mantis export ..... --> <mantis version="1.2.0-SVN" urlbase="http://localhost/mantisgit/" buglink="#" notelink="~"> <bug> <id>8437</id> <description><![CDATA[The attached patch brings strings_italian.txt in sync with strings_english.txt:1.316]]></description> <project_id>1</project_id> <reporter_id>3361</reporter_id> <handler_id>4599</handler_id> <priority>30</priority> <severity>50</severity> <reproducibility>100</reproducibility> <status>80</status> <resolution>20</resolution> <projection>10</projection> <date_submitted>1191345694</date_submitted> <last_updated>1196966208</last_updated> <eta>10</eta> <version>1.1.0a4</version> <fixed_in_version>1.1.0rc4</fixed_in_version> <view_state>10</view_state> <summary><![CDATA[Update to italian translation]]></summary> <category_id>24</category_id> </bug> <bug> <id>6325</id> <description><![CDATA[ Hi all, I have done some customizations to mantis. If anyone is interested, I have added the DATETIME data type and the Simple Text Search on custom fields. It works great for me, but I'm a little noob of php so if you think that something is wrong.. let me know how to fix If you like it... use it! Byez MTW ]]></description> <additional_information><![CDATA[ The DATETIME uses the $g_normal_date_format instead of $g_short_date_format both in input and in output (print) on the right of the combo of hours and minutes I have printed the date format. I thought it could be useful to avoid misunderstandings between m/d/y and d/m/y but I think you can delete it if you don't like it. The Simple Text Search works on date/datetime fields as well, but for now I had to hardcode some MySQL specific SQL statement.. any idea to make it installation-independent is appreciated. :) ]]></additional_information> <project_id>1</project_id> <reporter_id>6464</reporter_id> <priority>30</priority> <severity>10</severity> <reproducibility>10</reproducibility> <status>10</status> <resolution>10</resolution> <projection>10</projection> <date_submitted>1128677600</date_submitted> <last_updated>1160545020</last_updated> <eta>10</eta> <version>1.0.0rc2</version> <view_state>10</view_state> <summary><![CDATA[Added DATETIME data type, added Simple Text Search on custom fields]]></summary> <category_id>18</category_id> </bug> <bug> <id>6155</id> <description><![CDATA[It will be good an option to be added into the configuration file that overrides encoding described in the language files. I'm from Bulgaria. We post issues to Mantis in Bulgarian, so the encoding we use is "Windows-1251". Since there is no Bulgarian language translation I must set in the language files (for example strings_english.txt) encoding to "Windows-1251". But not everyone that reports issues is familar with English, so someone want to chooce French or Italian or something else. Then I must change these languagesencodings also to "Windows-1251". If I upgrade to a new version, this procedure must be done again. ]]></description> <additional_information><![CDATA[Since I'm an experienced PHP web developer I'm interested in joining your team in development of Mantis. So if you are interested, please let me know. My e-mail is izhekov@ppartner.com.]]></additional_information> <project_id>1</project_id> <reporter_id>6424</reporter_id> <priority>30</priority> <severity>50</severity> <reproducibility>10</reproducibility> <status>10</status> <resolution>10</resolution> <projection>10</projection> <date_submitted>1124335156</date_submitted> <last_updated>1159094773</last_updated> <eta>10</eta> <view_state>10</view_state> <summary><![CDATA[[all lang] Using different language can cause mantis posted issues not to be viewable.]]></summary> <category_id>24</category_id> </bug> <bug> <id>6538</id> <description><![CDATA[When I try to use the italian vowels (html entities agrave or aacute, etc), they disappear from summary and description fields. I'm using MySQL 4.1 UTF8 on windows XP]]></description> <project_id>1</project_id> <reporter_id>5019</reporter_id> <priority>30</priority> <severity>60</severity> <reproducibility>10</reproducibility> <status>10</status> <resolution>10</resolution> <projection>10</projection> <date_submitted>1135738458</date_submitted> <last_updated>1139308376</last_updated> <eta>10</eta> <version>1.0.0rc4</version> <view_state>10</view_state> <summary><![CDATA[Italian characters problems]]></summary> <category_id>2</category_id> </bug> <bug> <id>2117</id> <description><![CDATA[even if in config_inc.php we set # --- language settings ----------- $g_default_language = 'italian'; # list the choices that the users are allowed to choose $g_language_choices_arr = array( 'italian', 'english'); the default language for "administrator" is still english, for all other users (ex. an user upgraded to admin) is italian.]]></description> <project_id>1</project_id> <reporter_id>788</reporter_id> <priority>30</priority> <severity>50</severity> <reproducibility>10</reproducibility> <status>40</status> <resolution>10</resolution> <projection>10</projection> <date_submitted>1023793989</date_submitted> <last_updated>1092020856</last_updated> <eta>10</eta> <os>Windows 2000</os> <platform>x86</platform> <version>none</version> <profile_id>315</profile_id> <view_state>10</view_state> <summary><![CDATA[default language for admin]]></summary> <category_id>5</category_id> </bug> </mantis> | ||||
Sorry for the triple report, but uploading files failed, even when zipped |
|
I didn't look at the patch in details, but I have the following issues:
edited on: 07-08-04 08:09 |
|
Recently I have written a patch against mantis-0.18.2 with allows a user to request a bug report in XML format. Basically, it is a copy of bug_view_advanced_page.php with all HTML markup replaced by XML tags. It's not complete as the attachments, relationships, notes, and history sections are always empty. I haven't found API functions to retrieve these values in pure data format. The only thing I found where functions to return these structures as HTML, and I have been too lazy to write my own ones. Maybe the attached patch gives you a start in writing a proper XML interface (which would allow Mantis to be integrated into IDEs like Eclipse, which has been my original goal...). |
|
stefanb, can you tell us more about your concept of integrating Mantis with IDEs? |
|
Sure, but there is not much of a concept. As Mantis is a PHP-only (i.e. web based) application and I don't want to contact the database directly (hard to maintain schema upgrades, re-invent the security model etc.) I came up with an HTTP-based approach based on XML. So the integration is as follows: Put server path (like http://bugs.mantisbt.org) together with your login and password(?) into a config file that can be read by the IDE. (Eclipse's plugin framework supportes this scenario directly.) If you want to see your bugs in the IDE, you open a view, the plugin code sends an HTTP request to SERVER_PATH + "/login.php" together with the parameters. After that, request a page like SERVER_PATH + "/view_all_bug_page_xml.php" (to be written) to get an overview on all bugs. Query or post parameters would specify the filter criteria. The result is the same as in /view_all_bug_page.xml (hence the name), except that the result is not HTML but XML. This XML tree can be unmarshalled into IDE objects and get displayed. Double-click on one of the displayed issues to open a detail view in the IDE. Behind the scenes, it sends an HTTP request to /bug_view_xml.php, the server returns the XML tree, the IDE renders it. That's all the "concept" I have. I do have a kind of "proof of concept" for Eclipse (which is my primary IDE), however, it's more than a hack: the first time after login, you get HTML instead of XML (because you do not have a cookie specifying the filter settings, and the method setting the cookie prints out the bug page as HTML), so you have to issue the request for getting all bugs/issues twice. Second, you get only 50 issues back (or whatever you have configured as your page size) which might be good or bad. Haven't decided finally. For the moment, this project is on ice, but it might become active again if Mantis starts having an XML interface... |
|
An IDE-Integration for Mantis would be great. If you ever plan to continue this, count me in. Have you thought about using Commons-HTTPClient? You could set the Filter-Cookie yourself. |
|
Actually, I do use commons-httpclient. The reason why I don't want to set the cookie myself is that I like to be as independent of changes in Mantis as possible. Doing it "the right way" would require to modify some files in core Mantis, which I try to avoid (at the moment). |
|
I attached bugzilla dtd to be used as a reference when designing the Mantis xml format. |
|
I uploaded an XML Schema Definition plus a sample.xml following this XSD as a proposal for the Mantis XML format. vboctor: I didn't follow the bugzilla.dtd at all. The main reason is, that there are several bug/issue trackers around and each one has a different XML format. If you want to export/import from/to these systems, the best way would to use dedicated XSLTs to transform one XML format into another. I do not think that this would be a hard task. Additionally, using the bugzilla.dtd for Mantis could lead to field mapping problems: Required bugzilla fields might not make sense within Mantis and would have to be filled with bogus values, while some Mantis fields might not have a representation in bugzilla and could not be exported/imported for that reason. |
|
I never meant that we should use bugzilla's DTD, I just attached it to get some ideas from it (if any). I already started working on an XSD. I will attach it here once it is done. |
|
If anyone has ideas about a good PHP library to use for generating(/parsing) of XML, please include it here. We are looking at a GPL. However, I was also looking at LGPL or something similar to another project I am doing. MiniXml (GPL): http://minixml.psychogenic.com/ |
|
I still don't see the point why you need a library for generating XML. (Parsing XML is a different thing, but that's not within scope of this issue.) I have enhanced my previous attempt to do export directly within PHP. Seems to work for me, besides missing Attachment and Relationship sections. I didn't find API calls to retrieve this information in raw (i.e. non HTML) format and I don't want to re-invent the wheel. Maybe you could browse through the patch and see if it suits your needs? |
|
Sorry, accidently uploaded the tar twice. @<people_with_admin_rights>: Maybe you can clean up a bit? The older mantis.xsd and sample.xml are obsoleted by the new uploads. Same goes for 0004024-bug_view_xml_php.gz |
|
We can generate xml manually, however, a library will simplify the following:
All the above points can be done manually though. I will have a look at your patch and get this thing going. |
|
Hi, I wrote some code to export the list of issues as a simple xml file, and just saw that here's already an related issue, so I'd attached it here. I never did any php programming before and I didn't test it much, so please treat it with great care ... :-) |
|
I've uploaded a small update to xml_export.php, it now writes the reporter, handler and project also as strings, not only the IDs. |
|
I've uploaded the attachment again (including minor fixes with respect to style guide) to issue 0007214 (including both freemind and xml export). |
|
I've checked-in the mind mapping feature implemented in 0007214. However, I haven't checked-in the xml export portion. giallu was working on xml export feature and part of this work is defining the format. |
|
@tandler, it would be useful to attached your xml export implementation here. If anyone has the lost attachments or a newer versions of them, please re-attach. |
|
Yes. I'm working on the XML export so I'll reassign this to myself |
|
For reference, I just attached the DTD I'm currently using and a sample XML file, exported from a filter, conforming to the DTD |
|
I had a quick look on the sample XML and here are my comments:
|
|
my very simple & straightforward XML export implementation is attached to 0007214 (bundled with the freemind export) although this rather belongs here. |
|
Removed assignment. giallu will not contribute to this issue in near future. |
|
I'm marking this as resolved on the grounds that we bundle the XmlImportExport plugin since Mantis 1.2, so I assume (without actually looking into the details of this issue) that the original requirement is satisfied. If not, I suggest to open a new issue to track any changes that should be implemented in the core plugin. |
|