TemplateLoader query

I think that I have convinced myself that if I use templateload to load a document template, that it will not replace an existing template.  That is, if there is a document template named 'Invoice' in the system, then if I use templateload to load my modified invoice jrxml file, then it will create a second document template named 'Invoice'.

I have had a read of the source code, but I am afraid that it is not obvious what it is doing.

A related question: is there any way I can strip some of the existing templates (ie the ones I want to update) in the base db.sql file?  Can I just delete entries in the acts, document_acts, and documents? [The first two look easy - it is all text, but documents contains binary data and it is not easy to see what ends where.]

Note that this topic is related to my need to run repeated RxWorks to OPV conversions. Its a pain if one has to go through and delete the unwanted templates after every run.

I suppose the other way to do it is to run the initial dataload phase which would give me a database I could login to, clean that up and then export this as a new db.sql

Any comments/suggestions welcome.

Regards, Tim G

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: TemplateLoader query

The templateload.bat and templateload.sh scripts should replace any existing content that has the same name as the file being loaded.

i.e. if the file names are the same, then you shouldn't need to strip anything.

If they are different, then a new act.documentTemplate and entity.documentTemplate will be created for the template.

You can see what names are being matched on by running:

 select name from acts where arch_short_name = "act.documentTemplate"  

- Tim A

Re: TemplateLoader query

Thanks Tim. This information allowed me to have a play.  In the end I decided that the optimum approach was to edit db.sql to remove all document templates, and then use templateload to load my own invoice etc replacements and my reports PLUS the standard reports that I want to keep.

Essentially what I have done is remove the document templates from the base so that I can fully control the document templates.

I have attached db-nd.sql (as db-nd.txt so it would upload) - the 'no docs' version of db.sql.  If you want to include this in the release package, then section 1.4 of the readme would need the following added:

"Systems integrators may wish to use db-nd.sql instead of db.sql. This contains no document templates, and you will have to use the templateload facility to load the templates you require."

Regards, Tim G

AttachmentSize
db-nd.txt 2.76 MB

Re: TemplateLoader query

I think the easiest approach is just to remove the template loading step from the build, and make it a manual step at installation.

Raised as https://openvpms.atlassian.net/browse/OVPMS-1370

-Tim A

Syndicate content