org.apache.turbine.services.pull.tools
Class ContentTool

java.lang.Object
  extended byorg.apache.turbine.services.pull.tools.ContentTool
All Implemented Interfaces:
ApplicationTool

public class ContentTool
extends java.lang.Object
implements ApplicationTool

Terribly simple tool to translate URIs into Turbine Links. Equivalent to URIUtils.getAbsoluteLink() in a pull tool.

If you're missing any routines from the 'old' $content tool concerning path_info or query data, you did use the wrong tool then. You should've used the TemplateLink tool which should be available as "$link" in your context.

This is an application pull tool for the template system. You should not use it in a normal application!

Version:
$Id: ContentTool.java 534527 2007-05-02 16:10:59Z tv $
Author:
Henning P. Schmiedehausen

Field Summary
static boolean CONTENT_TOOL_ENCODING_DEFAULT
          Default Value for CONTENT_TOOL_ENCODING_KEY
static java.lang.String CONTENT_TOOL_ENCODING_KEY
          Should this tool add Container Encoding to the URIs returned?
static java.lang.String CONTENT_TOOL_PREFIX
          Prefix for Parameters for this tool
static boolean CONTENT_TOOL_RELATIVE_DEFAULT
          Default Value for CONTENT_TOOL_RELATIVE_KEY
static java.lang.String CONTENT_TOOL_RELATIVE_KEY
          Should this tool return relative URIs or absolute?
 
Constructor Summary
ContentTool()
          C'tor
 
Method Summary
 java.lang.String getAbsoluteURI(java.lang.String path)
          Returns the Turbine URI of a given Path.
 java.lang.String getRelativeURI(java.lang.String path)
          Returns the Turbine URI of a given Path.
 java.lang.String getURI(java.lang.String path)
          Returns the Turbine URI of a given Path
 void init(java.lang.Object data)
          This will initialise a ContentTool object that was constructed with the default constructor (ApplicationTool method).
 void refresh()
          Refresh method - does nothing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTENT_TOOL_PREFIX

public static final java.lang.String CONTENT_TOOL_PREFIX
Prefix for Parameters for this tool

See Also:
Constant Field Values

CONTENT_TOOL_ENCODING_KEY

public static final java.lang.String CONTENT_TOOL_ENCODING_KEY
Should this tool add Container Encoding to the URIs returned? True might cause trouble e.g. if you run with Apache HTTP Daemon / Tomcat Combo. Default is false (like Turbine 2.2)

See Also:
Constant Field Values

CONTENT_TOOL_ENCODING_DEFAULT

public static final boolean CONTENT_TOOL_ENCODING_DEFAULT
Default Value for CONTENT_TOOL_ENCODING_KEY

See Also:
Constant Field Values

CONTENT_TOOL_RELATIVE_KEY

public static final java.lang.String CONTENT_TOOL_RELATIVE_KEY
Should this tool return relative URIs or absolute? Default: Absolute.

See Also:
Constant Field Values

CONTENT_TOOL_RELATIVE_DEFAULT

public static final boolean CONTENT_TOOL_RELATIVE_DEFAULT
Default Value for CONTENT_TOOL_RELATIVE_KEY

See Also:
Constant Field Values
Constructor Detail

ContentTool

public ContentTool()
C'tor

Method Detail

init

public void init(java.lang.Object data)
This will initialise a ContentTool 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()
Refresh method - does nothing

Specified by:
refresh in interface ApplicationTool

getURI

public java.lang.String getURI(java.lang.String path)
Returns the Turbine URI of a given Path

Parameters:
path - The path to translate
Returns:
Turbine translated absolute path

getAbsoluteURI

public java.lang.String getAbsoluteURI(java.lang.String path)
Returns the Turbine URI of a given Path. The result is always an absolute path starting with the server scheme (http/https).

Parameters:
path - The path to translate
Returns:
Turbine translated absolute path

getRelativeURI

public java.lang.String getRelativeURI(java.lang.String path)
Returns the Turbine URI of a given Path. The result is always relative to the context of the application.

Parameters:
path - The path to translate
Returns:
Turbine translated absolute path


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