org.springframework.extensions.webscripts
Class ScriptLinkBuilder

java.lang.Object
  extended by org.springframework.extensions.webscripts.ScriptBase
      extended by org.springframework.extensions.webscripts.ScriptLinkBuilder
All Implemented Interfaces:
Serializable

public final class ScriptLinkBuilder
extends ScriptBase

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.springframework.extensions.webscripts.ScriptBase
context, properties
 
Constructor Summary
ScriptLinkBuilder(RequestContext context)
          Constructs a new ScriptLinkBuilder object.
 
Method Summary
protected  ScriptableMap buildProperties()
           
 String object(String objectId)
          Constructs a link to a given object.
 String object(String objectId, String formatId)
          Constructs a link to a given object.
 String object(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 page(String pageId)
          Constructs a link to a given page instance.
 String page(String pageId, String formatId)
          Constructs a link to a given page for a given format.
 String page(String pageId, String formatId, String objectId)
          Constructs a link to a given page for a given format.
 String pageType(String pageTypeId)
          Constructs a link to a given page type.
 String pageType(String pageTypeId, String formatId)
          Constructs a link to a given page type for a given format.
 String pageType(String pageTypeId, String formatId, String objectId)
          Constructs a link to a given page type for a given format.
 String pageType(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.webscripts.ScriptBase
getConfig, getModel, getObject, getProperties, getRequestContext, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScriptLinkBuilder

public ScriptLinkBuilder(RequestContext context)
Constructs a new ScriptLinkBuilder object.

Parameters:
context - The request context instance for the current request
Method Detail

buildProperties

protected ScriptableMap buildProperties()
Specified by:
buildProperties in class ScriptBase

page

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

Parameters:
pageId - The id of the page instance

page

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

Parameters:
pageId - The id of the page instance
formatId - The id of the format to render

page

public String page(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.

Parameters:
pageId - The id of the page instance
formatId - The id of the format to render
objectId - The id of the object

page

public 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.

Parameters:
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(String pageTypeId)
Constructs a link to a given page type. This will automatically use the default format.

Parameters:
context - The Request Context instance
pageTypeId - The type of the page

pageType

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

Parameters:
pageTypeId - The type of the page
formatId - The id of the format to render

pageType

public String pageType(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.

Parameters:
pageTypeId - The type of the page
formatId - The id of the format to render
objectId - The id of the object

pageType

public String pageType(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.

Parameters:
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(String objectId)
Constructs a link to a given object. This will automatically use the default format.

Parameters:
objectId - The id of the object

object

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

Parameters:
objectId - The id of the object
formatId - The id of the format to render

object

public String object(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.

Parameters:
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.