org.norther.tammi.spray.template.tool
Class TaskTool

java.lang.Object
  extended by org.norther.tammi.core.pool.RecyclableSupport
      extended by org.norther.tammi.core.pool.PoolableSupport
          extended by org.norther.tammi.spray.engine.tool.GlobalTool
              extended by org.norther.tammi.spray.engine.tool.ContextTool
                  extended by org.norther.tammi.spray.media.tool.MediaTool
                      extended by org.norther.tammi.spray.media.tool.LinkTool
                          extended by org.norther.tammi.spray.template.tool.TaskTool
All Implemented Interfaces:
Serializable, Cloneable, EventListener, Poolable, Recyclable, ContextBindingListener
Direct Known Subclasses:
BlobTool

public class TaskTool
extends LinkTool

Extends the link tool to support links to template filters. Example:

$link.setPage("index.html").addPathInfo("hello","world") would return http://foo.com/template/index.html/hello/world

Based on TemplateLink in the Apache Jakarta Turbine project.

Version:
$Id: TaskTool.java,v 1.27 2010-02-10 08:46:52 cvsimp Exp $
Author:
Dave Bryson, Jon S. Stevens, Ilkka Priha
See Also:
Serialized Form

Constructor Summary
TaskTool()
          Constructs a new link.
 
Method Summary
 void dispose()
          Disposes the object by setting its disposed flag.
 String getFlow()
          Gets the linked flow of the request.
protected  FlowFilter getFlowFilter()
          Gets the flow filter from the filter stack.
 String getForm()
          Gets the linked form.
protected  FormFilter getFormFilter()
          Gets the form filter from the filter stack.
 String getPage()
          Gets the linked page.
protected  PageFilter getPageFilter()
          Gets the page filter from the filter stack.
 String getSkin()
          Gets the linked skin.
protected  SkinFilter getSkinFilter()
          Gets the skin filter from the filter stack.
 String getTask()
          Gets the linked task.
protected  void linkModified()
          A callback informing subclasses about a modified link.
 TaskTool resetFlow()
          Resets the default flow.
 TaskTool resetForm()
          Resets the default form.
 TaskTool resetPage()
          Resets the default page.
 TaskTool resetSkin()
          Resets the default form.
 TaskTool setFlow(String flow, Object... params)
          Sets the flow of the link with parameters.
 TaskTool setForm(String form)
          Sets the linked form.
 TaskTool setPage(String page)
          Sets the page of the link.
 TaskTool setSkin(String skin)
          Sets the linked skin.
 TaskTool setStep(int index, Object... params)
          Sets the step of the current flow of the link with parameters.
 TaskTool setStep(String flow, int index, Object... params)
          Sets the flow and step of the link with parameters.
 TaskTool setTask(String task)
          Sets the linked task.
 LinkTool use()
          Uses the current URL.
 TaskTool useFlow()
          Uses the current flow and step.
 TaskTool usePage()
          Uses the current page.
 
Methods inherited from class org.norther.tammi.spray.media.tool.LinkTool
addPathInfo, addPathInfo, addPathInfo, addPathInfo, addPathInfo, addPathInfo, addQueryString, addQueryString, addQueryString, addQueryString, addQueryString, addQueryString, addQueryString, checkPermission, clear, clearBookmark, clearPathInfo, clearQueryString, clone, encodePathInfo, encodeQueryString, exists, getBookmark, getFilter, getHost, getHostFilter, getLink, getLinkAnchor, getLinkAnchors, getLinkAnchors, getLinkBranch, getLinked, getLinkFilter, getLocale, getPathInfo, getPipe, getPipeAnchor, getPipeAnchors, getPipeAnchors, getPipeBranch, getPipeFilter, getPort, getScheme, getScriptName, getService, getServiceAnchor, getServiceAnchors, getServiceAnchors, getServiceBranch, getServiceFilter, getServletPath, getSource, getTerminal, getURL, isAbsolute, isEncoded, isPathInfoParsed, isRedirected, isSecure, removeHost, removeLink, removeLinked, removePathInfo, removePipe, removeQueryString, removeService, reset, resetHost, resetLink, resetPipe, resetService, setAbsolute, setAbsolute, setBookmark, setEncoded, setEncoded, setHost, setLink, setLinked, setLocale, setPathInfo, setPathInfo, setPipe, setPort, setRedirected, setRedirected, setScheme, setScriptName, setSecure, setSecure, setService, setServletPath, setSource, setSource, setTerminal, setURL, toString, useTerminal, useUser
 
Methods inherited from class org.norther.tammi.spray.media.tool.MediaTool
toMediaFile, toURL, toURL
 
Methods inherited from class org.norther.tammi.spray.engine.tool.ContextTool
getFilterChain, getFilterKey, getPrincipal, getRequest, getResponse, isFilterChanged
 
Methods inherited from class org.norther.tammi.spray.engine.tool.GlobalTool
getContext, getContextToolFilter, getMBeanServer, isBound, nop, valueBound, valueUnbound
 
Methods inherited from class org.norther.tammi.core.pool.PoolableSupport
disposed, recycled
 
Methods inherited from class org.norther.tammi.core.pool.RecyclableSupport
isDisposed, recycle
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.norther.tammi.core.pool.Recyclable
isDisposed, recycle
 

Constructor Detail

TaskTool

public TaskTool()
Constructs a new link.

Method Detail

dispose

public void dispose()
Description copied from class: RecyclableSupport
Disposes the object by setting its disposed flag.

Specified by:
dispose in interface Recyclable
Overrides:
dispose in class LinkTool

use

public LinkTool use()
Description copied from class: LinkTool
Uses the current URL.

Overrides:
use in class LinkTool
Returns:
the updated tool.

getTask

public String getTask()
Gets the linked task.

Returns:
the task or null.

setTask

public TaskTool setTask(String task)
Sets the linked task.

Parameters:
task - the task.
Returns:
the updated link.
Throws:
NullPointerException - if not settable.

resetForm

public TaskTool resetForm()
Resets the default form.

Returns:
the updated tool.

getForm

public String getForm()
Gets the linked form.

Returns:
the form or null.

setForm

public TaskTool setForm(String form)
Sets the linked form.

Parameters:
form - the form.
Returns:
the updated tool.
Throws:
NullPointerException - if not settable.

resetSkin

public TaskTool resetSkin()
Resets the default form.

Returns:
the updated tool.

getSkin

public String getSkin()
Gets the linked skin.

Returns:
the skin or null.

setSkin

public TaskTool setSkin(String skin)
Sets the linked skin.

Parameters:
skin - the skin.
Returns:
the updated tool.
Throws:
NullPointerException - if not settable.

resetPage

public TaskTool resetPage()
Resets the default page.

Returns:
the updated tool.

usePage

public TaskTool usePage()
Uses the current page.

Returns:
the updated tool.

getPage

public String getPage()
Gets the linked page.

Returns:
the page or null.

setPage

public TaskTool setPage(String page)
Sets the page of the link. Absolute paths point to the template engine root and relative paths are relative to the current page template path.

Parameters:
page - the page.
Returns:
the updated tool.
Throws:
NullPointerException - if not settable.

resetFlow

public TaskTool resetFlow()
Resets the default flow.

Returns:
the updated tool.

useFlow

public TaskTool useFlow()
Uses the current flow and step.

Returns:
the updated tool.

getFlow

public String getFlow()
Gets the linked flow of the request.

Returns:
the linked flow or null.

setFlow

public TaskTool setFlow(String flow,
                        Object... params)
Sets the flow of the link with parameters.

Parameters:
flow - the flow.
params - parameters.
Returns:
the updated tool.
Throws:
NullPointerException - if not settable.

setStep

public TaskTool setStep(String flow,
                        int index,
                        Object... params)
Sets the flow and step of the link with parameters.

Parameters:
flow - the flow.
index - the step index.
params - parameters.
Returns:
the updated tool.
Throws:
NullPointerException - if not settable.

setStep

public TaskTool setStep(int index,
                        Object... params)
Sets the step of the current flow of the link with parameters.

Parameters:
index - the step index.
params - parameters.
Returns:
the updated tool.
Throws:
NullPointerException - if not settable.

linkModified

protected void linkModified()
Description copied from class: LinkTool
A callback informing subclasses about a modified link.

Overrides:
linkModified in class LinkTool

getFormFilter

protected FormFilter getFormFilter()
Gets the form filter from the filter stack.

Returns:
the form filter or null.

getSkinFilter

protected SkinFilter getSkinFilter()
Gets the skin filter from the filter stack.

Returns:
the skin filter or null.

getPageFilter

protected PageFilter getPageFilter()
Gets the page filter from the filter stack.

Returns:
the page filter or null.

getFlowFilter

protected FlowFilter getFlowFilter()
Gets the flow filter from the filter stack.

Returns:
the flow filter or null.


Copyright © 2004 The Norther Organization. All rights reserved.