no.sesat.search.site.config
Class SiteConfiguration

java.lang.Object
  extended by no.sesat.search.site.config.SiteConfiguration
All Implemented Interfaces:
Serializable, SiteKeyedFactory

public final class SiteConfiguration
extends Object
implements SiteKeyedFactory, Serializable

SiteConfiguration properties.

Version:
$Id: SiteConfiguration.java 7225 2009-04-09 00:32:20Z ssmiweve $
See Also:
Serialized Form

Nested Class Summary
static interface SiteConfiguration.Context
           
 
Field Summary
static String ALLOW_LIST
          The property key for the allow list of ipaddresses.
static String DEFAULTTAB_KEY
          The Property key for the default tab/vertical for the site.
static String DISALLOW_LIST
          The property key for the disallow list of ipaddresses.
static String IS_SITESEARCH_KEY
          Property key to find out if this Site is a sitesearch*
static String NAME_KEY
          The key name used to identify an instance of SiteConfiguration.
static String PUBLISH_PHYSICAL_HOST
          The property key for the host serving the publishing content, use as host-header in importing requests.
static String PUBLISH_SYSTEM_URL
          The property key where publishing content ("/pub/") is imported from.
static String SITE_LOCALE_DEFAULT
          The property key to the site's default locale to use.
 
Method Summary
 Properties getProperties()
          Get all the properties.
 String getProperty(String key)
          Get a property
static SiteConfiguration instanceOf(Site site)
          Utility wrapper to the instanceOf(Context).
static SiteConfiguration instanceOf(SiteConfiguration.Context cxt)
          Find the correct instance handling this Site.
 boolean isSiteLocaleSupported(Locale locale)
          Does the site belonging to this SiteConfiguration support the provided locale.
 boolean remove(Site site)
          Remove the factory the maps to the given site.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME_KEY

public static final String NAME_KEY
The key name used to identify an instance of SiteConfiguration.

See Also:
Constant Field Values

SITE_LOCALE_DEFAULT

public static final String SITE_LOCALE_DEFAULT
The property key to the site's default locale to use.

See Also:
Constant Field Values

PUBLISH_SYSTEM_URL

public static final String PUBLISH_SYSTEM_URL
The property key where publishing content ("/pub/") is imported from. Related to SiteLocatorFilter.PUBLISH_DIR

See Also:
Constant Field Values

PUBLISH_PHYSICAL_HOST

public static final String PUBLISH_PHYSICAL_HOST
The property key for the host serving the publishing content, use as host-header in importing requests.

See Also:
Constant Field Values

IS_SITESEARCH_KEY

public static final String IS_SITESEARCH_KEY
Property key to find out if this Site is a sitesearch*

See Also:
Constant Field Values

DEFAULTTAB_KEY

public static final String DEFAULTTAB_KEY
The Property key for the default tab/vertical for the site.

See Also:
Constant Field Values

ALLOW_LIST

public static final String ALLOW_LIST
The property key for the allow list of ipaddresses. If not empty the client ipaddress must exist in the list to be able to use the skin.

See Also:
Constant Field Values

DISALLOW_LIST

public static final String DISALLOW_LIST
The property key for the disallow list of ipaddresses. The client ipaddress must not exist in the list to be able to use the skin.

See Also:
Constant Field Values
Method Detail

getProperties

public Properties getProperties()
Get all the properties. A defensive copy of the map is returned. Uses clone() as Collections.unmodifableMap(properties) gives an awkward to use Map So is a relatively expensive method to use.

Returns:
defensive copy of the map is returned.

getProperty

public String getProperty(String key)
Get a property

Parameters:
key - the property key
Returns:
the property value (or null if key doesn't exist in properties map)

instanceOf

public static SiteConfiguration instanceOf(SiteConfiguration.Context cxt)
Find the correct instance handling this Site. We need to use a Context instead of the Site directly so we can handle different styles of loading resources.

Parameters:
cxt - the context which defines which SiteConfiguration is applicable
Returns:
the applicable SiteConfiguration

instanceOf

public static SiteConfiguration instanceOf(Site site)
Utility wrapper to the instanceOf(Context). Makes the presumption we will be using the UrlResourceLoader to load the resource. Therefore can only be used within a running container, eg tomcat.

Parameters:
site - the site that the SiteConfiguration is applicable to
Returns:
the applicable SiteConfiguration.

remove

public boolean remove(Site site)
Description copied from interface: SiteKeyedFactory
Remove the factory the maps to the given site. *

Specified by:
remove in interface SiteKeyedFactory
Parameters:
site - remove factory corresponding to this site.
Returns:
true if a factory was successfully removed.

isSiteLocaleSupported

public boolean isSiteLocaleSupported(Locale locale)
Does the site belonging to this SiteConfiguration support the provided locale. The default site "generic.sesam" supports all locales. Otherwise the list of locales found in SITE_LOCALE_SUPPORTED is checked.

Parameters:
locale - the locale to check
Returns:
true if the locale is supported.


Copyright © 2005-2009 Schibsted ASA. All Rights Reserved.