Categories > OpenTBS with ODT >

My templates doesn't work

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Fábio Tramasoli
Date: 2006-01-14
Time: 17:42

My templates doesn't work

I'm creating templates, even the 'hello world' test, and the class just can't generate the final document. When I try using the example that came with the package, everyting goes fine, but, when I open that SXW file, edit it with a word and save it, the class doesn't understand the marks of the template engine.
I've tried editing the templates on the OOo 1.1.3, 1.9.xx and 2.0.1 all on windows, with SXW and ODT files, nothing that I edit works again.
I'm wondering if my system or my OOo instalation are wrong or something like this.
By: Fábio Tramasoli
Date: 2006-01-14
Time: 18:44

Re: My templates doesn't work

I've solved my problem.
Now that I know the solution, I'm wondering the cause.
Explanation:
my content.xml file from the SXW, ODT, etc packages where NOT updating. I started debuging the class and found the SaveXmlToDoc() function, then I've made a step-by-step in it and found that after the call to the zip exe my file was not changing. Then I looked at the zip parameter to see what was the "-u -j -m".
-m > remove files
-j > ignore directories
-u > only updated or new files
Then I've figured out that the -u parameter, for some unknow reason was not sending MY content.xml file to the output OOo file.
Once I've cutted out that parameter MY templates started working in the same minute.(???)
I've made capitol the word MY because only the templates that I have created or modified suffer of this strange problem, the files included with the distribution never had problems.

Once again, I'm using MS Windows XP SP2 and OpenOffice 2.0.1(I have deleted the others after solving my issue).

Thanks for the help and sorry for bother you with such a dumm problem, but I don't know why this is happening and would like if someone help me to understand.

Best Regards!
By: Tom
Date: 2006-01-15
Time: 15:57

Re: My templates doesn't work

One of the differences  with Windows is that it _mosty_ keeps files "write protected" -- that may be what's happening.

Try this

* open the Windows Explorer in the appropriate folder/directory
* right-click on  the folder , select "Properties"
* In the "General" tab, at the bottom, UNcheck "Attributes: read only"
* Save
* Then test your prgrams/templates.

HTH
By: Fábio Tramasoli
Date: 2006-01-15
Time: 20:39

Re: My templates doesn't work

Thanks, Tom, but I do write new contents in the conten.xml file, the problem was to update the old one of the template.odt that I've created with OOo 2.0.1. The zip.exe program, I'm still wondering why, thinks that my file the updated 'content.xml' is not uploaded to the new odt
:D