sunlabs.brazil.sunlabs
Class SourceTemplate

java.lang.Object
  extended by sunlabs.brazil.template.Template
      extended by sunlabs.brazil.sunlabs.SourceTemplate (view source)
All Implemented Interfaces:
TemplateInterface

public class SourceTemplate
extends Template

Template class for incorporating the content of a local file into the current document.

  <source src=file
        [encoding=enc name=property eval=true|false reprocess=true|false]
  >
 
Attributes:
src
Where to find the document to source. Unless starting with "/", it is assumed to be relative to the document root.
eval
If true, all ${...} are evaluated as the file is read in from storage.
encoding
Specifies the character encoding to use. If not specified or invalid, the default encoding is used.
name
If set, the content is placed in the named variable. instead of being inserted in-line.
namespace
If "name" is specified, this indicates the namespace to use. defaults to "local". (See RewriteContext.getNamespaceProperties()).
reprocess
If true, and name is not set (e.g. the content is inserted in-line, then the content will be run through the normal template processing before being inserted into the current document.

Examples:
The form: <source src=xml.tmpl eval=true> can be used to read in XML templates (or template fragments) that contain ${...} constructs that get filled in as the template is read.

The form: <source src=section1.html reprocess=true> can be used as a convenient way to break a single logical file into separate sections. (Note: this isn't currently implemented in a very efficient way.


Field Summary
 
Fields inherited from class sunlabs.brazil.template.Template
debug
 
Constructor Summary
SourceTemplate()
           
 
Method Summary
 void tag_source(RewriteContext hr)
           
 
Methods inherited from class sunlabs.brazil.template.Template
done, init
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SourceTemplate

public SourceTemplate()
Method Detail

tag_source

public void tag_source(RewriteContext hr)

Version Kenai-svn-r24, Generated 08/18/09
Copyright (c) 2001-2009, Sun Microsystems.