sunlabs.brazil.template
Class FormClientTemplate

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

public class FormClientTemplate
extends Template

[Deprecated, use the FormTemplate and SetTemplate 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. This will be used for e-business cards stored on java rings/cards. This template also incorporates the functionallity of the PropsTemplate, as the current scheme doesn't allow composition of template handler classes (at least for now). If a URL contains query data, and the value of the server property "uploadContains" occurs in the URL, then all of the query data is saved in the server on behalf of the client. IF no "uploadContains" string is set, all query data is saved on the server. The following Html entities processed by this class:

input
if the "name" attribute has saved data, the value attribute is replaced by the caved value. This allows default form values to be replaced by previous data submitted to the server by the client.
property
This tag is replaced by the value of a server property.
subst
This tag is replaced by the value previously uploaded to the the server from the client for this value.
tag, /tag
Inserts a "<" or ">" respectively, allowing parameters to be substituted inside of other entities. For example, suppose the client uploaded the value HOME as http://my.home.com/, and the server withes to create a link to that page. The template fragment: "<a href=<subst HOME>gt; won't work, as nested entities are not allowed. Instead, try: "<tag>a href=<subst HOME>lt;tag>


Field Summary
 
Fields inherited from class sunlabs.brazil.template.Template
debug
 
Constructor Summary
FormClientTemplate()
           
 
Method Summary
 boolean init(RewriteContext hr)
          Save a reference to our request properties.
 void tag_input(RewriteContext hr)
          Look for , and replace the value with the entry in the previously saved client data.
 void tag_property(RewriteContext hr)
          Convert the html tag "property" in to the request's property.
 void tag_slash_tag(RewriteContext hr)
           
 void tag_subst(RewriteContext hr)
          Tag to do substitution of previously uploaded data.
 void tag_tag(RewriteContext hr)
          Using the current scheme, there is no easy way to substitute into a tag parameter.
 
Methods inherited from class sunlabs.brazil.template.Template
done
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormClientTemplate

public FormClientTemplate()
Method Detail

init

public boolean init(RewriteContext hr)
Save a reference to our request properties. If the URL contains the upload string, save all of the query parameters on behalf of the user.

Specified by:
init in interface TemplateInterface
Overrides:
init in class Template

tag_input

public void tag_input(RewriteContext hr)
Look for , and replace the value with the entry in the previously saved client data.

Parameters:
hr - The rewrite Context

tag_property

public void tag_property(RewriteContext hr)
Convert the html tag "property" in to the request's property.

Parameters:
hr - The rewrite context

tag_subst

public void tag_subst(RewriteContext hr)
Tag to do substitution of previously uploaded data.

Parameters:
hr - The rewrite context.

tag_tag

public void tag_tag(RewriteContext hr)
Using the current scheme, there is no easy way to substitute into a tag parameter. So we'll invent a "magic" tag (called tag) that will allow us to create entities dynamically


tag_slash_tag

public void tag_slash_tag(RewriteContext hr)

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