Package org.apache.tapestry5.services
Interface ComponentEventLinkEncoder
-
- All Known Implementing Classes:
ComponentEventLinkEncoderImpl
,LinkTransformerInterceptor
public interface ComponentEventLinkEncoder
Responsible for creatingLink
s for page render requests and for component event requests, and for parsing incoming paths to identify requests that are component event or page render requests. This centralizes some logic that was scattered about in Tapestry 5.0.- Since:
- 5.1.0.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Link
createComponentEventLink(ComponentEventRequestParameters parameters, boolean forForm)
Creates a link that encapsulates a component event request, includingPersistentLocale
(if set).Link
createPageRenderLink(PageRenderRequestParameters parameters)
Creates a Link that encapsulates a page render request, including activation context andPersistentLocale
(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.
-
-
-
Method Detail
-
createPageRenderLink
Link createPageRenderLink(PageRenderRequestParameters parameters)
Creates a Link that encapsulates a page render request, including activation context andPersistentLocale
(if set). Passes the resulting Link through thePageRenderLinkTransformer
chain of command, returning the result.- Parameters:
parameters
- defining page to render and context- Returns:
- link for the page render
-
createComponentEventLink
Link createComponentEventLink(ComponentEventRequestParameters parameters, boolean forForm)
Creates a link that encapsulates a component event request, includingPersistentLocale
(if set). Forms:- /context/pagename:eventname -- event on the page, no action context
- /context/pagename:eventname/foo/bar -- event on the page with action context "foo", "bar"
- /context/pagename.foo.bar -- event on component foo.bar within the page, default event, no action context
- /context/pagename.foo.bar/baz.gnu -- event on component foo.bar within the page, default event, with action context "baz", "gnu"
- /context/pagename.bar.baz:eventname/foo/gnu -- event on component bar.baz within the page with action context "foo" , "gnu"
Request.getPath()
will already have stripped that off. We can act as if the context is always "/" (the path always starts with a slash). Passes the resulting Link through theComponentEventLinkTransformer
chain of command, returning the result.- Parameters:
parameters
- defining page, component, activation context and other detailsforForm
- true if the event link will trigger a form submission- Returns:
- link for the component event
-
decodeComponentEventRequest
ComponentEventRequestParameters decodeComponentEventRequest(Request request)
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 thePersistentLocale
... but only if the locale is a component event.- Parameters:
request
- incoming request- Returns:
- component event request details, if a component event request
-
decodePageRenderRequest
PageRenderRequestParameters decodePageRenderRequest(Request request)
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 thePersistentLocale
... but only if the request is a page render.- Parameters:
request
- incoming request- Returns:
- page render request details, if a page render request
-
-