org.apache.tapestry.services
Interface LinkFactory

All Known Implementing Classes:
LinkFactoryImpl, PortletAssetLinkFactoryImpl, PortletLinkFactoryImpl

public interface LinkFactory

A source of ILinkinstances. This is primarily used by IEngineServices.

Since:
4.0
Author:
Howard M. Lewis Ship

Method Summary
 ILink constructLink(IEngineService service, boolean post, Map parameters, boolean stateful)
          Constructs an ILink.
 Object[] extractListenerParameters(IRequestCycle cycle)
          A secondary function of the service is to convert encoded (aka "squeezed") listener parameters back into an array of Objects.
 ServiceEncoder[] getServiceEncoders()
          Returns an array of ServiceEncoder, ordering into execution order.
 

Method Detail

constructLink

ILink constructLink(IEngineService service,
                    boolean post,
                    Map parameters,
                    boolean stateful)
Constructs an ILink.

Parameters:
service - the service for which the link is being generated
post - if true, then the link will be used for a post (not a get, i.e., for a HTML form); this may affect what information is encoded into the link
parameters - A map; keys are strings and values are strings or string arrays (exception: key ServiceConstants.PARAMETER is an array of objects. Certain keys, defined in ServiceConstants may have special meaning. The map will typically be modified internally. May not be null.
stateful - If true, then the final URL should be encoded (with the session id) if necessary. If false, the session encoding should not occur. The latter case is useful for services that will absolutely not need any access to user-specific state.

extractListenerParameters

Object[] extractListenerParameters(IRequestCycle cycle)
A secondary function of the service is to convert encoded (aka "squeezed") listener parameters back into an array of Objects. This does (barely) makes sense .. the link factory is responsible for encoding the listener parameters, it should be responsible for decoding them.

Parameters:
cycle - the current request cycle
Returns:
an array of Object[]. May return an empty array, but won't return null.

getServiceEncoders

ServiceEncoder[] getServiceEncoders()
Returns an array of ServiceEncoder, ordering into execution order. May return an empty array, but won't return null.



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