org.springframework.extensions.surf.support
Class RequestParameterLinkBuilder

java.lang.Object
  extended by org.springframework.extensions.surf.support.BaseFactoryBean
      extended by org.springframework.extensions.surf.support.AbstractLinkBuilder
          extended by org.springframework.extensions.surf.support.RequestParameterLinkBuilder
All Implemented Interfaces:
LinkBuilder
Direct Known Subclasses:
DefaultLinkBuilder

public class RequestParameterLinkBuilder
extends AbstractLinkBuilder

A link builder which supports linking to dispatch state via request parameters. This provides a very simple, request-parameter driven way of creating URLs. URLs are created according to the following design: For references to a page: ?p= ?p=&f= For references to a page type: ?pt= ?pt=&f= For references to an object: ?o= ?o=&f=

Author:
muzquiano

Constructor Summary
protected RequestParameterLinkBuilder(WebFrameworkServiceRegistry serviceRegistry)
           
 
Method Summary
 String object(RequestContext context, String objectId, String formatId, Map<String,String> params)
          Constructs a link to a given object.
 String page(RequestContext context, String pageId, String formatId, String objectId, Map<String,String> params)
          Constructs a link to a given page for a given format.
 String pageType(RequestContext context, String pageTypeId, String formatId, String objectId, Map<String,String> params)
          Constructs a link to a given page type for a given format.
 
Methods inherited from class org.springframework.extensions.surf.support.AbstractLinkBuilder
object, object, page, page, page, pageType, pageType, pageType
 
Methods inherited from class org.springframework.extensions.surf.support.BaseFactoryBean
getResourceService, getServiceRegistry, getWebFrameworkConfiguration, getWebFrameworkManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestParameterLinkBuilder

protected RequestParameterLinkBuilder(WebFrameworkServiceRegistry serviceRegistry)
Method Detail

page

public String page(RequestContext context,
                   String pageId,
                   String formatId,
                   String objectId,
                   Map<String,String> params)
Description copied from class: AbstractLinkBuilder
Constructs a link to a given page for a given format. The provided object is passed in as context. The provided parameters are appended to the URL.

Specified by:
page in interface LinkBuilder
Specified by:
page in class AbstractLinkBuilder
Parameters:
context - The Request Context instance
pageId - The id of the page instance
formatId - The id of the format to render
objectId - The id of the object
params - A map of name/value pairs to be appended to the URL

pageType

public String pageType(RequestContext context,
                       String pageTypeId,
                       String formatId,
                       String objectId,
                       Map<String,String> params)
Description copied from class: AbstractLinkBuilder
Constructs a link to a given page type for a given format. The provided object is passed in as context. The provided parameters are appended to the URL.

Specified by:
pageType in interface LinkBuilder
Specified by:
pageType in class AbstractLinkBuilder
Parameters:
context - The Request Context instance
pageTypeId - The type of the page
formatId - The id of the format to render
objectId - The id of the object
params - A map of name/value pairs to be appended to the URL

object

public String object(RequestContext context,
                     String objectId,
                     String formatId,
                     Map<String,String> params)
Description copied from class: AbstractLinkBuilder
Constructs a link to a given object. The provided object is passed in as context. The provided parameters are appended to the URL.

Specified by:
object in interface LinkBuilder
Specified by:
object in class AbstractLinkBuilder
Parameters:
context - The Request Context instance
objectId - The id of the object
formatId - The id of the format to render
params - A map of name/value pairs to be appended to the URL


Copyright © 2009 SpringSource, Inc. All Rights Reserved.