org.springframework.extensions.surf.site
Class SiteUtil

java.lang.Object
  extended by org.springframework.extensions.surf.site.SiteUtil

public class SiteUtil
extends Object

Helper functions for web sites

Author:
muzquiano

Constructor Summary
SiteUtil()
           
 
Method Summary
protected static WebFrameworkConfigElement getConfig()
          Returns the web framework configuration element
static Page getRootPage(RequestContext context)
          Returns the root page for the current request context
static Page getRootPage(RequestContext context, Configuration siteConfiguration)
          Returns the root page for the given site configuration
static Configuration getSiteConfiguration(RequestContext context)
          Returns the site configuration object to use for the current request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SiteUtil

public SiteUtil()
Method Detail

getRootPage

public static Page getRootPage(RequestContext context)
Returns the root page for the current request context

Parameters:
context - the context
Returns:
the root page

getRootPage

public static Page getRootPage(RequestContext context,
                               Configuration siteConfiguration)
Returns the root page for the given site configuration

Parameters:
context -
siteConfiguration -
Returns:
the root page instance

getSiteConfiguration

public static Configuration getSiteConfiguration(RequestContext context)
Returns the site configuration object to use for the current request. At present, this is a very simple calculation since we either look to the current application default site id or we use a default. In the future, we will seek to support multiple site configurations per web application (i.e. one might be for html, another for wireless, another for print channel).

Parameters:
context - the context
Returns:
the site configuration

getConfig

protected static WebFrameworkConfigElement getConfig()
Returns the web framework configuration element

Returns:
the config


Copyright © 2009 SpringSource, Inc. All Rights Reserved.