org.springframework.extensions.surf.support
Class DefaultLinkBuilder

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
              extended by org.springframework.extensions.surf.support.DefaultLinkBuilder
All Implemented Interfaces:
LinkBuilder

public class DefaultLinkBuilder
extends RequestParameterLinkBuilder

The Default Web Framework implementation of LinkBuilder. This extends the default builder to provide better page URIs for enhanced search engine optimization. For references to a page: / /?f= For references to a page type: /type/ /type/?f= For refrences to an object: /obj/?o= /obj/?o=&f=

Author:
muzquiano

Field Summary
protected  String objectUri
           
protected  String pageTypeUri
           
protected  String pageUri
           
 
Constructor Summary
protected DefaultLinkBuilder(WebFrameworkServiceRegistry serviceRegistry)
           
 
Method Summary
 String object(RequestContext context, String resourceId, 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.
 void setObjectUri(String objectUri)
          Sets the object uri.
 void setPageTypeUri(String pageTypeUri)
          Sets the page type uri.
 void setPageUri(String pageUri)
          Sets the page uri.
 
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
 

Field Detail

pageUri

protected String pageUri

pageTypeUri

protected String pageTypeUri

objectUri

protected String objectUri
Constructor Detail

DefaultLinkBuilder

protected DefaultLinkBuilder(WebFrameworkServiceRegistry serviceRegistry)
Method Detail

setPageUri

public void setPageUri(String pageUri)
Sets the page uri.

Parameters:
pageUri - the new page uri

setPageTypeUri

public void setPageTypeUri(String pageTypeUri)
Sets the page type uri.

Parameters:
pageTypeUri - the new page type uri

setObjectUri

public void setObjectUri(String objectUri)
Sets the object uri.

Parameters:
objectUri - the new object uri

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
Overrides:
page in class RequestParameterLinkBuilder
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
Overrides:
pageType in class RequestParameterLinkBuilder
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 resourceId,
                     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
Overrides:
object in class RequestParameterLinkBuilder
Parameters:
context - The Request Context instance
resourceId - 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.