stable

Clone or download

Read-only

feat: Introduce tool to help conversion from xml to php

Please see tools/utils/xml-templates-to-php/README.md for description and usage. This has been used to convert "Issue tracking" tracker template[0] in another contribution. Other XML templates might need further adjustments since not all fields conversion are implemented yet. In order to test this I suggest to checkout previous version of the issue template: ``` git checkout 13.5 tools/utils/setup_templates/issues/issue_template.xml cd tools/utils/xml-templates-to-php composer install php index.php convert-tracker --src ../setup_templates/issues/issue_template.xml --tracker-id T448 ``` (don't forget to reset issue_template.xml after your test 😜) You can also test with another template, for example: ``` php index.php convert-tracker --src ../setup_templates/agile_alm/agile_alm_template.xml --tracker-id T478 ``` However some errors will be printed on the console since not all types of field or semantic are implemented yet. Generated code can then be integrated in Tuleap codebase, after manual adjustments (extract specific code snippets in their plugins, reformating, extract constants, …). Part of request #22651: Convert Issue XML template to PHP code [0]: See https://gerrit.tuleap.net/c/tuleap/+/23739 Change-Id: I1fffaeaf7e038ccebfcd98e3bce9718340c64ca6

Modified Files

Name
M Makefile +1 −1 Go to diff View file
A tests/unit/Tuleap/Tools/Xml2Php/Tracker/FormElement/ContainerConvertorTest.php +142 −0 Go to diff View file
A tests/unit/Tuleap/Tools/Xml2Php/Tracker/FormElement/DateConvertorTest.php +165 −0 Go to diff View file
A tests/unit/Tuleap/Tools/Xml2Php/Tracker/FormElement/SelectboxConvertorTest.php +347 −0 Go to diff View file
A tests/unit/Tuleap/Tools/Xml2Php/Tracker/FormElement/TextConvertorTest.php +165 −0 Go to diff View file
A tests/unit/Tuleap/Tools/Xml2Php/Tracker/Report/CriterionConvertorTest.php +137 −0 Go to diff View file
A tests/unit/Tuleap/Tools/Xml2Php/Tracker/Report/Renderer/CardwallConvertorTest.php +98 −0 Go to diff View file
A tests/unit/Tuleap/Tools/Xml2Php/Tracker/Report/Renderer/GraphOnTrackersConvertorTest.php +141 −0 Go to diff View file
A tests/unit/Tuleap/Tools/Xml2Php/Tracker/Report/Renderer/TableConvertorTest.php +131 −0 Go to diff View file
A tests/unit/Tuleap/Tools/Xml2Php/Tracker/Report/ReportConvertorTest.php +127 −0 Go to diff View file
A tests/unit/Tuleap/Tools/Xml2Php/Tracker/SemanticConvertorTest.php +227 −0 Go to diff View file
A tests/unit/Tuleap/Tools/Xml2Php/Tracker/TrackerConvertorTest.php +181 −0 Go to diff View file
M tests/unit/bootstrap.php +2 −0 Go to diff View file
A tools/utils/xml-templates-to-php/.gitignore +1 −0 Go to diff View file
A tools/utils/xml-templates-to-php/README.md +19 −0 Go to diff View file
A tools/utils/xml-templates-to-php/composer.json +16 −0 Go to diff View file
A tools/utils/xml-templates-to-php/composer.lock +3059 −0 Go to diff View file
A tools/utils/xml-templates-to-php/index.php +15 −0 Go to diff View file
A tools/utils/xml-templates-to-php/src/ConvertTrackerCommand.php +116 −0 Go to diff View file
A tools/utils/xml-templates-to-php/src/Tracker/FormElement/ContainerConvertor.php +58 −0 Go to diff View file
A tools/utils/xml-templates-to-php/src/Tracker/FormElement/DateConvertor.php +53 −0 Go to diff View file
A tools/utils/xml-templates-to-php/src/Tracker/FormElement/FieldConvertor.php +73 −0 Go to diff View file
A tools/utils/xml-templates-to-php/src/Tracker/FormElement/FormElementConvertor.php +100 −0 Go to diff View file
A tools/utils/xml-templates-to-php/src/Tracker/FormElement/FormElementConvertorBuilder.php +105 −0 Go to diff View file
A tools/utils/xml-templates-to-php/src/Tracker/FormElement/IdToNameMapping.php +48 −0 Go to diff View file
A tools/utils/xml-templates-to-php/src/Tracker/FormElement/SelectboxConvertor.php +140 −0 Go to diff View file
A tools/utils/xml-templates-to-php/src/Tracker/FormElement/TextConvertor.php +76 −0 Go to diff View file
A tools/utils/xml-templates-to-php/src/Tracker/FormElement/UnableToFindNameForIdException.php +27 −0 Go to diff View file
A tools/utils/xml-templates-to-php/src/Tracker/Report/CriterionConvertor.php +89 −0 Go to diff View file
A tools/utils/xml-templates-to-php/src/Tracker/Report/Renderer/CardwallConvertor.php +84 −0 Go to diff View file
A tools/utils/xml-templates-to-php/src/Tracker/Report/Renderer/GraphOnTrackersConvertor.php +172 −0 Go to diff View file
A tools/utils/xml-templates-to-php/src/Tracker/Report/Renderer/RendererConvertor.php +36 −0 Go to diff View file
A tools/utils/xml-templates-to-php/src/Tracker/Report/Renderer/RendererConvertorBuilder.php +47 −0 Go to diff View file
A tools/utils/xml-templates-to-php/src/Tracker/Report/Renderer/TableConvertor.php +98 −0 Go to diff View file
A tools/utils/xml-templates-to-php/src/Tracker/Report/ReportConvertor.php +103 −0 Go to diff View file
A tools/utils/xml-templates-to-php/src/Tracker/SemanticConvertor.php +174 −0 Go to diff View file
A tools/utils/xml-templates-to-php/src/Tracker/TrackerConvertor.php +312 −0 Go to diff View file