org.apache.turbine.util.template
Class TemplatePageAttributes

java.lang.Object
  extended byorg.apache.turbine.util.template.TemplatePageAttributes
All Implemented Interfaces:
ApplicationTool

Deprecated. Use HtmlPageAttributes along with VelocityOnlyLayout instead

public class TemplatePageAttributes
extends java.lang.Object
implements ApplicationTool

Template context tool that will set various attributes of the HTML page. It is automatically placed in the Template context as '$page'. Here's an example of some uses:


 $page.setBgColor("#ffffff");
 $page.setBgColor("white");
 $page.setBackground("/images/standardbg.jpeg");
 $page.setTitle("This is the title!");
 $page.setKeywords("turbine, cool, servlet framework");
 $page.setStyleSheet("/style.css");
 

Version:
$Id: TemplatePageAttributes.java 264148 2005-08-29 14:21:04Z henning $
Author:
Sean Legassick

Constructor Summary
TemplatePageAttributes()
          Deprecated. Default constructor.
TemplatePageAttributes(RunData data)
          Deprecated. Construct a new instance with the given RunData object.
 
Method Summary
 TemplatePageAttributes addAttribute(java.lang.String name, java.lang.String value)
          Deprecated. Adds an attribute to the BODY tag.
 java.lang.String getTitle()
          Deprecated. Get the title in the page.
 void init(java.lang.Object data)
          Deprecated. Initialise this instance with the given RunData object.
 void refresh()
          Deprecated. Refresh method - does nothing
 TemplatePageAttributes setBackground(java.lang.String url)
          Deprecated. Set the background image for the BODY tag.
 TemplatePageAttributes setBgColor(java.lang.String color)
          Deprecated. Set the background color for the BODY tag.
 TemplatePageAttributes setDescription(java.lang.String description)
          Deprecated. Add a description META tag to the HEAD of the page.
 TemplatePageAttributes setHttpEquiv(java.lang.String httpEquiv, java.lang.String content)
          Deprecated. Sets a HttpEquiv META tag in the HEAD of the page, usage:
setHttpEquiv("refresh", "5; URL=http://localhost/nextpage.html")
setHttpEquiv("Expires", "Tue, 20 Aug 1996 14:25:27 GMT")
 TemplatePageAttributes setKeywords(java.lang.String keywords)
          Deprecated. Set a keywords META tag in the HEAD of the page.
 TemplatePageAttributes setLinkColor(java.lang.String color)
          Deprecated. Set the link color for the BODY tag.
 TemplatePageAttributes setScript(java.lang.String url)
          Deprecated. Adds a LINK to a javascript file to the HEAD of the page.
 TemplatePageAttributes setStyle(java.lang.String styleText)
          Deprecated. Adds a STYLE element to the HEAD of the page with the provided content.
 TemplatePageAttributes setStyleSheet(java.lang.String url)
          Deprecated. Adds a LINK to a CSS styleshet to the HEAD of the page.
 TemplatePageAttributes setStyleSheet(java.lang.String url, java.lang.String media)
          Deprecated. Adds a LINK to a CSS stylesheet to the HEAD of the page, allowing the media type to be specified.
 TemplatePageAttributes setTextColor(java.lang.String color)
          Deprecated. Set the text color for the BODY tag.
 TemplatePageAttributes setTitle(java.lang.String intitle)
          Deprecated. Set the title in the page.
 TemplatePageAttributes setVlinkColor(java.lang.String color)
          Deprecated. Set the visited link color for the BODY tag.
 java.lang.String toString()
          Deprecated. A dummy toString method that returns an empty string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TemplatePageAttributes

public TemplatePageAttributes()
Deprecated. 
Default constructor. The init method must be called before use


TemplatePageAttributes

public TemplatePageAttributes(RunData data)
Deprecated. 
Construct a new instance with the given RunData object.

Parameters:
data - a RunData instance
Method Detail

init

public void init(java.lang.Object data)
Deprecated. 
Initialise this instance with the given RunData object. (ApplicationTool method)

Specified by:
init in interface ApplicationTool
Parameters:
data - Assumed to be a RunData instance

refresh

public void refresh()
Deprecated. 
Refresh method - does nothing

Specified by:
refresh in interface ApplicationTool

setTitle

public TemplatePageAttributes setTitle(java.lang.String intitle)
Deprecated. 
Set the title in the page. This returns an empty String so that the template doesn't complain about getting a null return value.

Parameters:
intitle - A String with the title.

getTitle

public java.lang.String getTitle()
Deprecated. 
Get the title in the page. This returns an empty String if empty so that the template doesn't complain about getting a null return value.

Returns:
A String with the title.

setStyleSheet

public TemplatePageAttributes setStyleSheet(java.lang.String url)
Deprecated. 
Adds a LINK to a CSS styleshet to the HEAD of the page.

Parameters:
url - A String.
Returns:
A TemplatePageAttributes (self).

setStyleSheet

public TemplatePageAttributes setStyleSheet(java.lang.String url,
                                            java.lang.String media)
Deprecated. 
Adds a LINK to a CSS stylesheet to the HEAD of the page, allowing the media type to be specified.

Parameters:
url - The value for the href attribute.
media - The value for the media attribute.
Returns:
a TemplatePageAttributes (self).

setStyle

public TemplatePageAttributes setStyle(java.lang.String styleText)
Deprecated. 
Adds a STYLE element to the HEAD of the page with the provided content.

Parameters:
styleText - The contents of the style tag.
Returns:
a TemplatePageAttributes (self).

setScript

public TemplatePageAttributes setScript(java.lang.String url)
Deprecated. 
Adds a LINK to a javascript file to the HEAD of the page.

Parameters:
url - A String.
Returns:
A TemplatePageAttributesEx (self).

setKeywords

public TemplatePageAttributes setKeywords(java.lang.String keywords)
Deprecated. 
Set a keywords META tag in the HEAD of the page.

Parameters:
keywords - A String.
Returns:
A TemplatePageAttributes (self).

setHttpEquiv

public TemplatePageAttributes setHttpEquiv(java.lang.String httpEquiv,
                                           java.lang.String content)
Deprecated. 
Sets a HttpEquiv META tag in the HEAD of the page, usage:
setHttpEquiv("refresh", "5; URL=http://localhost/nextpage.html")
setHttpEquiv("Expires", "Tue, 20 Aug 1996 14:25:27 GMT")

Parameters:
httpEquiv - The value to use for the http-equiv attribute.
content - The text for the content attribute of the meta tag.
Returns:
A TemplatePageAttributes (self).

setDescription

public TemplatePageAttributes setDescription(java.lang.String description)
Deprecated. 
Add a description META tag to the HEAD of the page.

Parameters:
description - A String.
Returns:
A TemplatePageAttributes (self).

setBackground

public TemplatePageAttributes setBackground(java.lang.String url)
Deprecated. 
Set the background image for the BODY tag.

Parameters:
url - A String.
Returns:
A TemplatePageAttributes (self).

setBgColor

public TemplatePageAttributes setBgColor(java.lang.String color)
Deprecated. 
Set the background color for the BODY tag. You can use either color names or color values (e.g. "white" or "#ffffff" or "ffffff").

Parameters:
color - A String.
Returns:
A TemplatePageAttributes (self).

setTextColor

public TemplatePageAttributes setTextColor(java.lang.String color)
Deprecated. 
Set the text color for the BODY tag. You can use either color names or color values (e.g. "white" or "#ffffff" or "ffffff").

Parameters:
color - A String.
Returns:
A TemplatePageAttributes (self).

setLinkColor

public TemplatePageAttributes setLinkColor(java.lang.String color)
Deprecated. 
Set the link color for the BODY tag. You can use either color names or color values (e.g. "white" or "#ffffff" or "ffffff").

Parameters:
color - A String.
Returns:
A TemplatePageAttributes (self).

setVlinkColor

public TemplatePageAttributes setVlinkColor(java.lang.String color)
Deprecated. 
Set the visited link color for the BODY tag.

Parameters:
color - A String.
Returns:
A TemplatePageAttributes (self).

addAttribute

public TemplatePageAttributes addAttribute(java.lang.String name,
                                           java.lang.String value)
Deprecated. 
Adds an attribute to the BODY tag.

Parameters:
name - A String.
value - A String.
Returns:
A TemplatePageAttributes (self).

toString

public java.lang.String toString()
Deprecated. 
A dummy toString method that returns an empty string.

Returns:
An empty String ("").


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.