I've not done what you want but suspect that the following approach would work.
1. Export the templates as reference data in XML format using the Project | Model Export | Export Reference data
2. Deploy the XML file containing the reference data as part of your installation
3. Import XML file as reference data
- you will need to write file handler to read the XML as a string
- then use an undocumented repository method CustomCommand which has the parameters
ClassName: String - "Repository"
MethodName: String - "ImportRefData"
Parameters: String - this will be the XML string containing your templates
Note this last method is undocumented so tread carefully!!
It may be worth a search on the forum to see if anybody else has found another way - I didn't see anything with a quick search.
Alternatively you could produce an MDG which contains your RTF templates and include this as part of you install. Probably a bit trickier until you are familiar with MDG's - although worth learning about some day.
Suggest you get the great books from Thomas Kilian (Scripting EA and Inside EA) if you want to start playing in these areas - really useful and saves time searching
Hope this helps.
-------
Found the following - which implies you could specify the file instead of XML string. May be worth a check.
Re: API support for Export/Import Reference Data
Reply #6 - Nov 21st, 2007, 2:46am Unsupported, undocumented, 7.0.818 and later:
Repository.CustomCommand("Repository", "ImportRefData", sXML)
or
Repository.CustomCommand("Repository", "ImportRefData", sFilename)
Back to top
The Sparx Team
[email protected]