org.springframework.extensions.surf.support
Class AbstractLinkBuilder

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

public abstract class AbstractLinkBuilder
extends BaseFactoryBean
implements LinkBuilder

Abstract base class for LinkBuilder implementations. This is provided as a convenience to developers who wish to build their own custom LinkBuilder variations. The Link Builder defines methods that are used generically to construct links to other pages, page types or objects within the system. In general, links are either to specific "known" pages or to page placeholders that must be resolved when the link is clicked. Example - a link to a page: String link = builder.page(context, "homepageInstance");

Author:
muzquiano

Constructor Summary
AbstractLinkBuilder(WebFrameworkServiceRegistry serviceRegistry)
           
 
Method Summary
 String object(RequestContext context, String objectId)
          Constructs a link to a given object.
 String object(RequestContext context, String objectId, String formatId)
          Constructs a link to a given object.
abstract  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)
          Constructs a link to a given page instance.
 String page(RequestContext context, String pageId, String formatId)
          Constructs a link to a given page for a given format.
 String page(RequestContext context, String pageId, String formatId, String objectId)
          Constructs a link to a given page for a given format.
abstract  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)
          Constructs a link to a given page type.
 String pageType(RequestContext context, String pageTypeId, String formatId)
          Constructs a link to a given page type for a given format.
 String pageType(RequestContext context, String pageTypeId, String formatId, String objectId)
          Constructs a link to a given page type for a given format.
abstract  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.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

AbstractLinkBuilder

public AbstractLinkBuilder(WebFrameworkServiceRegistry serviceRegistry)
Method Detail

page

public String page(RequestContext context,
                   String pageId)
Constructs a link to a given page instance. This will automatically use the default format.

Specified by:
page in interface LinkBuilder
Parameters:
context - The Request Context instance
pageId - The id of the page instance

page

public String page(RequestContext context,
                   String pageId,
                   String formatId)
Constructs a link to a given page for a given format.

Specified by:
page in interface LinkBuilder
Parameters:
context - The Request Context instance
pageId - The id of the page instance
formatId - The id of the format to render

page

public String page(RequestContext context,
                   String pageId,
                   String formatId,
                   String objectId)
Constructs a link to a given page for a given format. The provided object is passed in as context.

Specified by:
page in interface LinkBuilder
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

page

public abstract 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. The provided object is passed in as context. The provided parameters are appended to the URL.

Specified by:
page in interface LinkBuilder
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)
Constructs a link to a given page type. This will automatically use the default format.

Specified by:
pageType in interface LinkBuilder
Parameters:
context - The Request Context instance
pageTypeId - The type of the page

pageType

public String pageType(RequestContext context,
                       String pageTypeId,
                       String formatId)
Constructs a link to a given page type for a given format.

Specified by:
pageType in interface LinkBuilder
Parameters:
context - The Request Context instance
pageTypeId - The type of the page
formatId - The id of the format to render

pageType

public String pageType(RequestContext context,
                       String pageTypeId,
                       String formatId,
                       String objectId)
Constructs a link to a given page type for a given format. The provided object is passed in as context.

Specified by:
pageType in interface LinkBuilder
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

pageType

public abstract 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. The provided object is passed in as context. The provided parameters are appended to the URL.

Specified by:
pageType in interface LinkBuilder
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)
Constructs a link to a given object. This will automatically use the default format.

Specified by:
object in interface LinkBuilder
Parameters:
context - The Request Context instance
objectId - The id of the object

object

public String object(RequestContext context,
                     String objectId,
                     String formatId)
Constructs a link to a given object. This will automatically use the default format.

Specified by:
object in interface LinkBuilder
Parameters:
context - The Request Context instance
objectId - The id of the object
formatId - The id of the format to render

object

public abstract String object(RequestContext context,
                              String objectId,
                              String formatId,
                              Map<String,String> params)
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
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.