Ticket #6199 (new New Feature)
Tool to convert v2 template files to v3
| Reported by: | fredck | Owned by: | |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | General | Version: | 3.4.1 |
| Keywords: | Cc: |
Description
While we don't have a plugin to load XML for templates (a la v2) (see #3588), we should at least provide a tool that makes it easier to convert old v2 templates to the new js v3 format.
Attachments
Change History
comment:1 Changed 18 months ago by fredck
- Status changed from new to review
This is a first proposal for this tool. We could keep it on the _dev folder, and also make it available in a public address so the documentation can point to it and users would be able to use it online as well.
comment:3 Changed 17 months ago by garry.yao
- Keywords Discuss added
Vote for delivering such utility as dev script instead of web pages.
comment:4 Changed 17 months ago by fredck
- Keywords Discussion added; Discuss removed
-1 to have it as dev script:
- It would be harder for people to use it.
- It would not be possible to have it as a page on the web, reachable by everybody, independent on the platform.
This is a first proposal. A script tool could be also considered in the future, but there is no reason to block this one because of this, considering that it has been already fully developed.
comment:5 Changed 16 months ago by Saare
- Status changed from review to review_failed
I also think this tool should not be a dev script.
Well I don't see any problems with the converter, just a bit of cosmetic:
- It'll be a good idea to fill the <title> tag.
- If the XML is invalid, the thrown message is The <Templates> node was not found. IMHO it should be something like "The XML file is not valid.".
comment:6 Changed 16 months ago by fredck
- Keywords Discussion removed
- Status changed from review_failed to review
The new patch has the <title> element filled.
The original XML error, sent from the parser, is still there, because it can help understand what exactly is wrong, instead of a generic message. I've changed the message a bit.
comment:8 Changed 15 months ago by garry.yao
- Status changed from review to review_failed
- JS string output are not properly escaped, e.g. line break and single quote;
- Browser compatibility, breaks in IE9 actually
The reason I don't like ad-hoc script also because the structure (formatting and semantic) are entirely hard encoded and thus would bring a maintenance issue later.
Finally, the reason that I don't like browser's XML API is that it's way complicated to code when comparing with a server-side version of the same functionality.

