org.apache.turbine.util.template
Class RelativeTemplateLink

java.lang.Object
  extended byorg.apache.turbine.util.DynamicURI
      extended byorg.apache.turbine.util.RelativeDynamicURI
          extended byorg.apache.turbine.util.template.RelativeTemplateLink
All Implemented Interfaces:
ApplicationTool, URI

Deprecated. Use RelativeTemplateLink instead.

public class RelativeTemplateLink
extends RelativeDynamicURI
implements ApplicationTool

A customized version of the RelativeDynamicURI to be used in Templates. Here's an example of its Velocity/WebMacro use:

$link.setPage("index.wm").addPathInfo("hello","world")
This would return: /myapp/servlet/myapp/template/index.wm/hello/world

Version:
$Id: RelativeTemplateLink.java 264148 2005-08-29 14:21:04Z henning $
Author:
John D. McNally, see the authors of TemplateLink

Field Summary
 
Fields inherited from class org.apache.turbine.util.DynamicURI
data, hasPathInfo, hasQueryData, HTTP, HTTPS, PATH_INFO, pathInfo, QUERY_DATA, queryData, redirect, reference, res, sd
 
Constructor Summary
RelativeTemplateLink()
          Deprecated. Default constructor.
RelativeTemplateLink(RunData data)
          Deprecated. Constructor.
 
Method Summary
 java.lang.String getPage()
          Deprecated. Gets the template variable used by the Template Service.
 java.lang.String getURI()
          Deprecated. Returns the URI leaving the source intact.
 void init(java.lang.Object data)
          Deprecated. This will initialise a TemplateLink object that was constructed with the default constructor (ApplicationTool method).
 void refresh()
          Deprecated. Refresh method - does nothing
 RelativeTemplateLink setEncodeURLOff()
          Deprecated. This will turn off the execution of res.encodeURL() by making res == null.
 RelativeTemplateLink setPage(java.lang.String template)
          Deprecated. Sets the template variable used by the Template Service.
 java.lang.String toString()
          Deprecated. Returns the URI.
 
Methods inherited from class org.apache.turbine.util.RelativeDynamicURI
toString
 
Methods inherited from class org.apache.turbine.util.DynamicURI
add, add, addPathInfo, addPathInfo, addPathInfo, addPathInfo, addPathInfo, addPathInfo, addQueryData, addQueryData, addQueryData, addQueryData, addQueryData, addQueryData, assertInitialized, getA, getContextPath, getReference, getScriptName, getServerData, getServerName, getServerPort, getServerScheme, init, init, remove, removePathInfo, removePathInfo, removeQueryData, removeQueryData, renderPathInfo, renderQueryString, setAction, setActionEvent, setContextPath, setReference, setScreen, setScriptName, setSecure, setSecure, setServerData, setServerName, setServerPort, setServerScheme
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RelativeTemplateLink

public RelativeTemplateLink()
Deprecated. 
Default constructor.

The init method must be called before use.


RelativeTemplateLink

public RelativeTemplateLink(RunData data)
Deprecated. 
Constructor.

Parameters:
data - a Turbine RunData object.
Method Detail

init

public void init(java.lang.Object data)
Deprecated. 
This will initialise a TemplateLink object that was constructed with the default constructor (ApplicationTool method).

Specified by:
init in interface ApplicationTool
Parameters:
data - assumed to be a RunData object

refresh

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

Specified by:
refresh in interface ApplicationTool

setEncodeURLOff

public RelativeTemplateLink setEncodeURLOff()
Deprecated. 
This will turn off the execution of res.encodeURL() by making res == null. This is a hack for cases where you don't want to see the session information

Returns:
instance of RelativeTemplateLink (this)

setPage

public RelativeTemplateLink setPage(java.lang.String template)
Deprecated. 
Sets the template variable used by the Template Service.

Parameters:
template - A String with the template name.
Returns:
instance of RelativeTemplateLink (this)

getPage

public java.lang.String getPage()
Deprecated. 
Gets the template variable used by the Template Service. It is only available after setPage() has been called.

Returns:
The template name.

toString

public java.lang.String toString()
Deprecated. 
Returns the URI. After rendering the URI, it clears the pathInfo and QueryString portions of the DynamicURI.

Overrides:
toString in class RelativeDynamicURI
Returns:
A String with the URI in the form http://foo.com/Turbine/template/index.wm/hello/world

getURI

public java.lang.String getURI()
Deprecated. 
Returns the URI leaving the source intact. Wraps directly to the DynamicURI.toString method of the superclass (avoiding the local toString implementation).

Returns:
A String with the URI in the form http://foo.com/Turbine/template/index.wm/hello/world


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