Class 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
  • Constructor Details

    • 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 object
      redirect - True if redirection allowed.
    • TemplateURI

      public TemplateURI(RunData runData, String template)
      Constructor, set Template
      Parameters:
      runData - A RunData object
      template - A Template Name
    • TemplateURI

      public TemplateURI(RunData runData, String template, boolean redirect)
      Constructor, set Template, set explicit redirection
      Parameters:
      runData - A RunData object
      template - A Template Name
      redirect - True if redirection allowed.
    • TemplateURI

      public TemplateURI(RunData runData, String template, String action)
      Constructor, set Template and Action
      Parameters:
      runData - A RunData object
      template - A Template Name
      action - 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 object
      template - A Template Name
      action - An Action Name
      redirect - 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 object
      redirect - True if redirection allowed.
    • TemplateURI

      public TemplateURI(ServerData serverData, String template)
      Constructor, set Template
      Parameters:
      serverData - A ServerData object
      template - A Template Name
    • TemplateURI

      public TemplateURI(ServerData serverData, String template, boolean redirect)
      Constructor, set Template, set explicit redirection
      Parameters:
      serverData - A ServerData object
      template - A Template Name
      redirect - True if redirection allowed.
    • TemplateURI

      public TemplateURI(ServerData serverData, String template, String action)
      Constructor, set Template and Action
      Parameters:
      serverData - A ServerData object
      template - A Template Name
      action - 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 object
      template - A Template Name
      action - An Action Name
      redirect - True if redirection allowed.
    • TemplateURI

      public TemplateURI(String template, String action)
      Constructor, user Turbine.getDefaultServerData(), set Template and Action
      Parameters:
      template - A Template Name
      action - An Action Name
  • Method Details

    • 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 class TurbineURI
      Parameters:
      type - Type of insertion (@see #add(char type, String name, String value))
      pp - A ParameterParser.