org.apache.tapestry5.internal.services
Class ComponentEventLinkEncoderImpl

java.lang.Object
  extended by org.apache.tapestry5.internal.services.ComponentEventLinkEncoderImpl
All Implemented Interfaces:
ComponentEventLinkEncoder

public class ComponentEventLinkEncoderImpl
extends Object
implements ComponentEventLinkEncoder


Constructor Summary
ComponentEventLinkEncoderImpl(ComponentClassResolver componentClassResolver, ContextPathEncoder contextPathEncoder, LocalizationSetter localizationSetter, Request request, Response response, RequestSecurityManager requestSecurityManager, RequestPathOptimizer optimizer, PersistentLocale persistentLocale, boolean encodeLocaleIntoPath)
           
 
Method Summary
 void appendContext(boolean seperatorRequired, EventContext context, StringBuilder builder)
           
 Link createComponentEventLink(ComponentEventRequestParameters parameters, boolean forForm)
          Creates a link that encapsulates a component event request, including PersistentLocale (if set).
 Link createPageRenderLink(PageRenderRequestParameters parameters)
          Creates a Link that encapsulates a page render request, including activation context and PersistentLocale (if set).
 ComponentEventRequestParameters decodeComponentEventRequest(Request request)
          Checks the request, primarily the path, to determine the if the request is a component event request.
 PageRenderRequestParameters decodePageRenderRequest(Request request)
          Checks the request, primarily the path, to determine the if the request is a page render request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentEventLinkEncoderImpl

public ComponentEventLinkEncoderImpl(ComponentClassResolver componentClassResolver,
                                     ContextPathEncoder contextPathEncoder,
                                     LocalizationSetter localizationSetter,
                                     Request request,
                                     Response response,
                                     RequestSecurityManager requestSecurityManager,
                                     RequestPathOptimizer optimizer,
                                     PersistentLocale persistentLocale,
                                     @Symbol(value="tapestry.encode-locale-into-path")
                                     boolean encodeLocaleIntoPath)
Method Detail

createPageRenderLink

public Link createPageRenderLink(PageRenderRequestParameters parameters)
Description copied from interface: ComponentEventLinkEncoder
Creates a Link that encapsulates a page render request, including activation context and PersistentLocale (if set).

Specified by:
createPageRenderLink in interface ComponentEventLinkEncoder
Parameters:
parameters - defining page to render and context
Returns:
link for the page render

createComponentEventLink

public Link createComponentEventLink(ComponentEventRequestParameters parameters,
                                     boolean forForm)
Description copied from interface: ComponentEventLinkEncoder
Creates a link that encapsulates a component event request, including PersistentLocale (if set).

Forms:

The persistent locale may be placed in between the context name and the page name, i.e., "/context/fr/SomePage".

In many cases the context name is blank, so the path begins with a "/" and then the locale name or page name.

The page name portion may itself consist of a series of folder names, i.e., "admin/user/create". The context portion isn't the concern of this code, since Request.getPath() will already have stripped that off. We can act as if the context is always "/" (the path always starts with a slash).

Specified by:
createComponentEventLink in interface ComponentEventLinkEncoder
Parameters:
parameters - defining page, component, activation context and other details
forForm - true if the event link will trigger a form submission
Returns:
link for the component event

decodeComponentEventRequest

public ComponentEventRequestParameters decodeComponentEventRequest(Request request)
Description copied from interface: ComponentEventLinkEncoder
Checks the request, primarily the path, to determine the if the request is a component event request. As a side-effect (necessary for historical reasons), responsible for setting the locale for the thread, including the PersistentLocale ... but only if the reuqest is a component event.

Specified by:
decodeComponentEventRequest in interface ComponentEventLinkEncoder
Parameters:
request - incoming request
Returns:
component event request details, if a component event request

decodePageRenderRequest

public PageRenderRequestParameters decodePageRenderRequest(Request request)
Description copied from interface: ComponentEventLinkEncoder
Checks the request, primarily the path, to determine the if the request is a page render request. As a side-effect (necessary for historical reasons), responsible for setting the locale for the thread, including the PersistentLocale ... but only if the reuqest is a component event.

Specified by:
decodePageRenderRequest in interface ComponentEventLinkEncoder
Parameters:
request - incoming request
Returns:
page render request details, if a page render request

appendContext

public void appendContext(boolean seperatorRequired,
                          EventContext context,
                          StringBuilder builder)


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