Package org.apache.turbine.util.uri
Class TemplateURI
- java.lang.Object
-
- org.apache.turbine.util.uri.BaseURI
-
- org.apache.turbine.util.uri.TurbineURI
-
- org.apache.turbine.util.uri.TemplateURI
-
- All Implemented Interfaces:
URI
,URIConstants
public class TemplateURI extends TurbineURI
This class allows you to keep all the information needed for a single link at one place. It keeps your query data, path info, the server scheme, name, port and the script path. It is tuned for usage with a Template System e.g. Velocity. If you must generate a Turbine Link in a Template System, use this class.- Version:
- $Id$
- Author:
- Henning P. Schmiedehausen
-
-
Field Summary
-
Fields inherited from interface org.apache.turbine.util.uri.URIConstants
CGI_ACTION_PARAM, CGI_SCREEN_PARAM, CGI_TEMPLATE_PARAM, EVENT_PREFIX, FTP_PORT, HTTP, HTTP_PORT, HTTPS, HTTPS_PORT, PATH_INFO, QUERY_DATA, URI_SCHEME_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description TemplateURI()
Empty C'tor.TemplateURI(String template, String action)
Constructor, user Turbine.getDefaultServerData(), set Template and ActionTemplateURI(RunData runData)
Constructor with a RunData objectTemplateURI(RunData runData, boolean redirect)
Constructor, set explicit redirectionTemplateURI(RunData runData, String template)
Constructor, set TemplateTemplateURI(RunData runData, String template, boolean redirect)
Constructor, set Template, set explicit redirectionTemplateURI(RunData runData, String template, String action)
Constructor, set Template and ActionTemplateURI(RunData runData, String template, String action, boolean redirect)
Constructor, set Template and Action, set explicit redirectionTemplateURI(ServerData serverData)
Constructor with a ServerData objectTemplateURI(ServerData serverData, boolean redirect)
Constructor, set explicit redirectionTemplateURI(ServerData serverData, String template)
Constructor, set TemplateTemplateURI(ServerData serverData, String template, boolean redirect)
Constructor, set Template, set explicit redirectionTemplateURI(ServerData serverData, String template, String action)
Constructor, set Template and ActionTemplateURI(ServerData serverData, String template, String action, boolean redirect)
Constructor, set Template and Action, set explicit redirection
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
add(int type, org.apache.fulcrum.parser.ParameterParser pp)
Method for a quick way to add all the parameters in a ParameterParser.void
clearTemplate()
Clears the template= value for this URL.void
setTemplate(String template)
Sets the template= value for this URL.-
Methods inherited from class org.apache.turbine.util.uri.TurbineURI
add, add, addPathInfo, addPathInfo, addPathInfo, addPathInfo, addPathInfo, addPathInfo, addPathInfo, addQueryData, addQueryData, addQueryData, addQueryData, addQueryData, addQueryData, addQueryData, clearAction, clearResponse, clearScreen, getAbsoluteLink, getPathInfo, getQueryData, getRelativeLink, hasPathInfo, hasQueryData, remove, removePathInfo, removePathInfo, removeQueryData, removeQueryData, setAction, setActionEvent, setEvent, setPathInfo, setQueryData, setScreen, toString
-
Methods inherited from class org.apache.turbine.util.uri.BaseURI
encodeResponse, getContextAndScript, getContextPath, getReference, getResponse, getSchemeAndPort, getScriptName, getServerName, getServerPort, getServerScheme, hasReference, isRedirect, setContextPath, setRedirect, setReference, setResponse, setScriptName, setSecure, setSecure, setServerName, setServerPort, setServerScheme
-
-
-
-
Constructor Detail
-
TemplateURI
public TemplateURI()
Empty C'tor. Uses Turbine.getDefaultServerData().
-
TemplateURI
public TemplateURI(RunData runData)
Constructor with a RunData object- Parameters:
runData
- A RunData object
-
TemplateURI
public TemplateURI(RunData runData, boolean redirect)
Constructor, set explicit redirection- Parameters:
runData
- A RunData objectredirect
- True if redirection allowed.
-
TemplateURI
public TemplateURI(RunData runData, String template)
Constructor, set Template- Parameters:
runData
- A RunData objecttemplate
- A Template Name
-
TemplateURI
public TemplateURI(RunData runData, String template, boolean redirect)
Constructor, set Template, set explicit redirection- Parameters:
runData
- A RunData objecttemplate
- A Template Nameredirect
- True if redirection allowed.
-
TemplateURI
public TemplateURI(RunData runData, String template, String action)
Constructor, set Template and Action- Parameters:
runData
- A RunData objecttemplate
- A Template Nameaction
- An Action Name
-
TemplateURI
public TemplateURI(RunData runData, String template, String action, boolean redirect)
Constructor, set Template and Action, set explicit redirection- Parameters:
runData
- A RunData objecttemplate
- A Template Nameaction
- An Action Nameredirect
- True if redirection allowed.
-
TemplateURI
public TemplateURI(ServerData serverData)
Constructor with a ServerData object- Parameters:
serverData
- A ServerData object
-
TemplateURI
public TemplateURI(ServerData serverData, boolean redirect)
Constructor, set explicit redirection- Parameters:
serverData
- A ServerData objectredirect
- True if redirection allowed.
-
TemplateURI
public TemplateURI(ServerData serverData, String template)
Constructor, set Template- Parameters:
serverData
- A ServerData objecttemplate
- A Template Name
-
TemplateURI
public TemplateURI(ServerData serverData, String template, boolean redirect)
Constructor, set Template, set explicit redirection- Parameters:
serverData
- A ServerData objecttemplate
- A Template Nameredirect
- True if redirection allowed.
-
TemplateURI
public TemplateURI(ServerData serverData, String template, String action)
Constructor, set Template and Action- Parameters:
serverData
- A ServerData objecttemplate
- A Template Nameaction
- An Action Name
-
TemplateURI
public TemplateURI(ServerData serverData, String template, String action, boolean redirect)
Constructor, set Template and Action, set explicit redirection- Parameters:
serverData
- A ServerData objecttemplate
- A Template Nameaction
- An Action Nameredirect
- True if redirection allowed.
-
TemplateURI
public TemplateURI(String template, String action)
Constructor, user Turbine.getDefaultServerData(), set Template and Action- Parameters:
template
- A Template Nameaction
- An Action Name
-
-
Method Detail
-
setTemplate
public void setTemplate(String template)
Sets the template= value for this URL. By default it adds the information to the path_info instead of the query data. An empty value (null or "") cleans out an existing value.- Parameters:
template
- A String with the template value.
-
clearTemplate
public void clearTemplate()
Clears the template= value for this URL.
-
add
protected void add(int type, org.apache.fulcrum.parser.ParameterParser pp)
Method for a quick way to add all the parameters in a ParameterParser.If the type is P (0), then add name/value to the pathInfo hashtable.
If the type is Q (1), then add name/value to the queryData hashtable.
- Overrides:
add
in classTurbineURI
- Parameters:
type
- Type of insertion (@see #add(char type, String name, String value))pp
- A ParameterParser.
-
-