sunlabs.brazil.template |
|
Java Source File Name | Type | Comment |
AddHeaderTemplate.java | Class | Template class for adding arbitrary mime headers to a reply.
Add a header onto the response, removing the tag from the HTML.
<addheader name1=value1 name2=value2 ...>
where name is the name of an HTTP header, and
value is its value. |
BSLTemplate.java | Class | The BSLTemplate takes an HTML document with embedded "BSL"
markup tags in it and evaluates those special tags to produce a
standard HTML document.
BSL stands for Brazil Scripting Language. |
ChangedTemplate.java | Class | This Template adds an icon to HREFs to indicate when the
file being referred to is new, changed, or unchanged with respect
to the user's session. |
ContentTemplate.java | Class | Template class for extracting content out of remote html page
This class is used by the TemplateHandler, for extracting
the "content" out of html documents for later integration with
a look-and-feel template using one or more of:
PropsTemplate ,
BSLTemplate ,
or
sunlabs.brazil.filter.ReplaceFilter ,
The plan is to snag the title and the content, and put them into
request properties. |
CountTemplate.java | Class | SAMPLE Template class for counting links and images in a page. |
DebugTemplate.java | Class | Template class for printing stuff to stderr (for template debugging)
This class is used by the TemplateHandler
A new HTML tag,
<debug> is defined. |
DirectoryTemplate.java | Class | Put current directory information (based on the URL) into the
request properties. |
FormClientTemplate.java | Class | [Deprecated, use the FormTemplate and ConfigFileHandler instead]
SAMPLE Template class for substituting Default values into html forms
The data is retrieved from the client, and sent back to
the client later on. |
FormTemplate.java | Class | Template class for substituting Default values into html forms
This class is used by the TemplateHandler.
The default values in form tags are replaced by the server property that
matches the field name. |
HighlightTemplate.java | Class | Template class for highlighting text that matches a regular expression.
All text between html/xml entities is matched against a regular expression.
For each portion of text that matches the expression, a pair of
html/xml tags is added on either side of all matched text.
Highlighting is automatically turned off inside of head, script, style,
and server tags.
Properties. |
IncludeTemplate.java | Class | Template class for substituting html pages into an html page.
This class is used by the TemplateHandler. |
ModifiedTemplate.java | Class | Template class for computing last-modified times
for content that is processed through templates.
For traditional web content that is stored in a file, it is easy to
keep track of the last time the content changed, simply by looking at the
modify-time attribute of the file. |
NoImageTemplate.java | Class | SAMPLE Template class for removing all images
from a web page, and replacing them with their alt strings
This class is used by the TemplateHandler
Each image is replaced by a text string defined by the server property
"template", which the first "%" replaced by the contents of the
alt attribute. |
PropsTemplate.java | Class | Template class for substituting request properties into an HTML page
This class is used by the TemplateHandler
The following request properties are used:
- query
- The query parameters are placed into the request object,
prefixed by the value assigned to "query".
- headers
- The mime headers are placed into the request object,
prefixed by the value assigned to "headers".
|
RedirectTemplate.java | Class | |
RewriteContext.java | Class | A variant containing instance variables that may be referenced by
rewriting filters. |
SetTemplate.java | Class | Template (and handler) class for Setting a value into the request props.
This class is used by the TemplateHandler.
The tag<set> is processed with the following
attributes:
- name=value
- The name of the entry to set in the request properties.
- value=value
- The value to set.
|
SqlTemplate.java | Class | Sample Template class for running SQL queries via jdbc and
placing the results into the request properties for further processing.
Foreach session, a connection is made to an sql database via jdbc.
Session reconnection is attempted if the server connection breaks.
An SQL query is issued, with the results populating the request properties.
The following server properties are used:
- driver
- The name of the jdbc driver class for the desired database.
Currently, only one driver may be specified.
(e.g.
|
Template.java | Class | Parent for all classes that are templates. |
TemplateHandler.java | Class | The TemplateHandler reads a template file from
the document root, based on the URL, and passes the content through
one or more template filters.
The following configuration parameters are used to initialize this
Handler :
-
prefix
- Only URLs beginning with this string will be candidates for
template processing.
|
TemplateRunner.java | Class | Class for processing html templates.
An html template is an ordinary html string, with additional
application specific tags added (sort of like XML). |
TOCTemplate.java | Class | Template class for extracting table of contents information
out of an html page by examining the "H1" tags, and setting
request properties that can be used to build a table of contents. |
UrlNavBarTemplate.java | Class | Template class for dynamically generating a navigation bar
by looking at portions of the url.
Given url:
/main/next/last/foo.html
Generate the request properties for the directories:
main, next, and last.
The properties will be:
NAV.main=/main/
NAV.next=/main/next/ ....
NAV.=main/next/....
These properties may be incorporated into web pages using the
BSLTemplate's <foreach> tag, using a delimeter of "/" to
iterate over the listings.
The follow request properties are consulted:
- prepend
- Use as a prefix on the property name, instead
of "NAV.".
- includeDir
- Normally, if the URL refers to the directory (
e.g.
|