ZimletTemplateFiles: Difference between revisions

mNo edit summary
mNo edit summary
Line 2: Line 2:


for example,  
for example,  
<nowiki>
 
  export CLASSPATH=/opt/zimbra/jetty/webapps/zimbraAdmin/WEB-INF/classes
  export CLASSPATH=/opt/zimbra/jetty/webapps/zimbraAdmin/WEB-INF/classes
  zimbra@zimbra:~/jetty/webapps/service/zimlet/_dev/com_zimbra_hello_world/templates$ ~/bin/zmjava com/zimbra/kabuki/tools/templates/Template  MainView.template
  zimbra@zimbra:~/jetty/webapps/service/zimlet/_dev/com_zimbra_hello_world/templates$ ~/bin/zmjava com/zimbra/kabuki/tools/templates/Template  MainView.template
</nowiki>
 
will generate the MainView.template.js file that is then sent to the browser if needed by the Zimlet.
will generate the MainView.template.js file that is then sent to the browser if needed by the Zimlet.


== Future development suggestions ==
== Future development suggestions ==
it seem to me that .template -> .template.js generation is currently rather haphazard. The .template.js is included in the zimlet config.xml in the same way as a hand written .js - Zimbra is not aware that this is actually a compiled artifact. It would (to my mind) be better for the config.xml to list package source, which it can then deal with as appropriate.
it seem to me that .template -> .template.js generation is currently rather haphazard. The .template.js is included in the zimlet config.xml in the same way as a hand written .js - Zimbra is not aware that this is actually a compiled artifact. It would (to my mind) be better for the config.xml to list package source, which it can then deal with as appropriate.

Revision as of 07:02, 28 September 2008

Zimlet template files (actually Zimbra template files) are Javascript templates that work in a similar fashion to JSP - they are compiled from a html-fragment into a .js files using a tool found in Zimbra.

for example,

export CLASSPATH=/opt/zimbra/jetty/webapps/zimbraAdmin/WEB-INF/classes
zimbra@zimbra:~/jetty/webapps/service/zimlet/_dev/com_zimbra_hello_world/templates$ ~/bin/zmjava com/zimbra/kabuki/tools/templates/Template  MainView.template

will generate the MainView.template.js file that is then sent to the browser if needed by the Zimlet.

Future development suggestions

it seem to me that .template -> .template.js generation is currently rather haphazard. The .template.js is included in the zimlet config.xml in the same way as a hand written .js - Zimbra is not aware that this is actually a compiled artifact. It would (to my mind) be better for the config.xml to list package source, which it can then deal with as appropriate.

Jump to: navigation, search