org.springframework.extensions.surf.support
Class DefaultLinkBuilder
java.lang.Object
org.springframework.extensions.surf.support.BaseFactoryBean
org.springframework.extensions.surf.support.AbstractLinkBuilder
org.springframework.extensions.surf.support.RequestParameterLinkBuilder
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
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
pageUri
protected String pageUri
pageTypeUri
protected String pageTypeUri
objectUri
protected String objectUri
DefaultLinkBuilder
protected DefaultLinkBuilder(WebFrameworkServiceRegistry serviceRegistry)
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 instancepageId
- The id of the page instanceformatId
- The id of the format to renderobjectId
- The id of the objectparams
- 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 instancepageTypeId
- The type of the pageformatId
- The id of the format to renderobjectId
- The id of the objectparams
- 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 instanceresourceId
- The id of the objectformatId
- The id of the format to renderparams
- A map of name/value pairs to be appended to the URL
Copyright © 2009 SpringSource, Inc. All Rights Reserved.