org.apache.tapestry5.internal.services
Interface LinkFactory

All Known Implementing Classes:
LinkFactoryImpl

public interface LinkFactory

A source for Link objects.

See Also:
LinkCreationListener

Method Summary
 Link createComponentEventLink(Page page, String nestedId, String eventType, boolean forForm, Object... context)
          Creates a stateful action link.
 Link createPageRenderLink(Page page, boolean override, Object... activationContext)
          Creates a render link for the page.
 Link createPageRenderLink(String logicalPageName, boolean override, Object... context)
          As with createPageRenderLink(Page, boolean, Object[]), but the page is specified by logical name, rather than as an instance.
 LinkCreationHub getLinkCreationHub()
          Returns the hub, used to register and de-register LinkCreationListeners.
 

Method Detail

createComponentEventLink

Link createComponentEventLink(Page page,
                              String nestedId,
                              String eventType,
                              boolean forForm,
                              Object... context)
Creates a stateful action link. Action links are built for components. Action links are encoded by the current request (that is, bound to the current request's session, if any).

Parameters:
page -
nestedId -
eventType - the type of event to trigger
forForm - true if the link is for a form, false otherwise
context - Additional path data, each value will be converted to a string and appended to the URI @return a link
See Also:
ComponentResourcesCommon.createActionLink(String, boolean, Object[])

createPageRenderLink

Link createPageRenderLink(Page page,
                          boolean override,
                          Object... activationContext)
Creates a render link for the page. If an activation context is supplied then that context is built into the URI. If no activation context is supplied, then the activation context is obtained from the page itself, by triggering a passivate event on its root component.

When the activationContext is an empty array, the targetted page is checked to see if it can provide an activation context. This is accomplished by triggering a "passivate" event on the targetted page. If the override parameter is true, this will not occur (even when the activation context is empty).

Parameters:
page - the page to which a link should be created
override - if true, then the provided activation context is always used even if empty
activationContext - the activation context for the page
Returns:
a link
See Also:
ComponentResourcesCommon.createPageLink(String, boolean, Object[])

createPageRenderLink

Link createPageRenderLink(String logicalPageName,
                          boolean override,
                          Object... context)
As with createPageRenderLink(Page, boolean, Object[]), but the page is specified by logical name, rather than as an instance. Note: renamed from createPageLink() in 5.1.

Parameters:
logicalPageName - the logical name of the page to generate a link to
override - if true, then the provided activation context is always used even if empty
context - activation context for the page
Returns:
a link

getLinkCreationHub

LinkCreationHub getLinkCreationHub()
Returns the hub, used to register and de-register LinkCreationListeners.

Returns:
the hub


Copyright © 2006-2009 Apache Software Foundation. All Rights Reserved.