Index of /src/template
Name Last modified Size Description
Parent Directory -
Chunk.java 20-Aug-2008 13:30 36K
ContentSource.java 20-Aug-2008 13:30 24K
TemplateSet.java 20-Aug-2008 12:15 20K
TemplateSetSlice.java 20-Aug-2008 12:24 1.9K
TextFilter.java 20-Aug-2008 12:24 17.9K
cardtable.xml 31-Aug-2002 09:54 755
howto.html 20-Aug-2008 08:52 7.2K
javadoc/ 20-Aug-2008 12:15 -
Chunk - a simple, powerful templating tool for java.
TemplateSet and Chunk are a handy couple of classes for use in
applications which need to build dynamic SGML-based documents such as
HTML pages or XML.
The primary goal is to separate business logic code (what to present)
and HTML (how to present it).
Proper use can ease the maintenance burden of large web-based
applications by separating out building blocks of HTML and XML from
the java code. These blocks may then be modified independently from
the java application.
Proper use depends on the vigilance of the developer to resist the
urge to define as inline Strings any and all text or layout which will
appear in a java-generated page. The full power of templating can
only be achieved if the developers adhere diligently to this
principle.
The payoff is tremendous. Simple changes such as moving a few things
around on a page or changing color schemes or wording can be
accomplished without recompiling or taking up valuable developer
resources.
The code itself becomes a clean exercise in choosing which template
blocks -- or "chunks" -- to assemble together under various
conditions, and/or how to glue a particular template "skin" onto a
particular business object for display.
Chunk provides an elegant interface which handles overall document
assembly as well as the object-template "glue" process. It sets out
configurable conventions for marking up templates with placeholder
tags for dynamic data. The central algorithm is an efficient
search-and-replace routine for expanding templates on-the-fly with
arbitrary data.
TemplateSet provides a framework for accessing repositories of
template files. It allows for definition of multiple small
mix-and-match template pieces in a single file, and provides caching
options for templates which results in a significant reduction in
actual file i/o.
See javadoc for basic documentation and examples of use.
The com.x5.template package is (c) 2007 Tom McClure
http://www.x5software.com/
Licensing terms:
Free for any and all commercial and non-commercial use provided that
the following message appears along with any released software
copyright:
"Template engine (c) 2007 Tom McClure."
In other words, free as long you give me credit.
$10,000 per application if you prefer not to give me credit.