org.springframework.extensions.surf.support
Class RequestParameterLinkBuilder
java.lang.Object
org.springframework.extensions.surf.support.BaseFactoryBean
org.springframework.extensions.surf.support.AbstractLinkBuilder
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
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RequestParameterLinkBuilder
protected RequestParameterLinkBuilder(WebFrameworkServiceRegistry serviceRegistry)
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 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
- Specified by:
pageType
in class AbstractLinkBuilder
- 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 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 instanceobjectId
- 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.