com.aoindustries.website
Class SiteSettings

java.lang.Object
  extended by com.aoindustries.website.SiteSettings

public class SiteSettings
extends java.lang.Object

Provides site-wide settings.

Author:
AO Industries, Inc.

Constructor Summary
SiteSettings(javax.servlet.ServletContext servletContext)
           
 
Method Summary
 com.aoindustries.aoserv.client.Brand getBrand()
          Gets the Brand for this site.
 boolean getCanEditResources()
          Determines if this site allows direct editing of resource bundles.
 boolean getExceptionShowError()
          Defaults to false.
static SiteSettings getInstance(javax.servlet.ServletContext servletContext)
          Gets the proper settings instance as configured in the web.xml file.
 java.util.List<Skin.Language> getLanguages(javax.servlet.http.HttpServletRequest req)
          Gets the unmodifiable list of languages supported by this site.
 boolean getProtocolActionRedirectOnMismatch()
          Defaults to true.
 com.aoindustries.aoserv.client.AOServConnector getRootAOServConnector()
          Gets the root connector.
protected  java.lang.String getRootAOServConnectorPassword()
          Gets the password for the root AOServConnector.
protected  java.lang.String getRootAOServConnectorUsername()
          Gets the username for the root AOServConnector.
 java.util.List<Skin> getSkins()
          Gets the unmodifiable list of skins supported by this site.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SiteSettings

public SiteSettings(javax.servlet.ServletContext servletContext)
Method Detail

getInstance

public static SiteSettings getInstance(javax.servlet.ServletContext servletContext)
Gets the proper settings instance as configured in the web.xml file. This allows


getSkins

public java.util.List<Skin> getSkins()
Gets the unmodifiable list of skins supported by this site. The first one in the list will be used as the default skin, except if Text mode is determined as the default, then any skin named "Text" will be the default if available.


getRootAOServConnectorUsername

protected java.lang.String getRootAOServConnectorUsername()
Gets the username for the root AOServConnector.

See Also:
getRootAOServConnector()

getRootAOServConnectorPassword

protected java.lang.String getRootAOServConnectorPassword()
Gets the password for the root AOServConnector.

See Also:
getRootAOServConnector()

getRootAOServConnector

public com.aoindustries.aoserv.client.AOServConnector getRootAOServConnector()
                                                                      throws java.io.IOException
Gets the root connector. Because this potentially has unrestricted privileges, this must be used at an absolute minimum for situations where a user isn't logged-in but access to the master is required, such as for sign up requests.

Throws:
java.io.IOException

getBrand

public com.aoindustries.aoserv.client.Brand getBrand()
                                              throws java.io.IOException,
                                                     java.sql.SQLException
Gets the Brand for this site. The returned instance has the permissions of the site's RootAOServConnector and should therefore be used carefully to not allow privilege escelation.

Throws:
java.io.IOException
java.sql.SQLException

getLanguages

public java.util.List<Skin.Language> getLanguages(javax.servlet.http.HttpServletRequest req)
                                           throws java.io.IOException,
                                                  java.sql.SQLException
Gets the unmodifiable list of languages supported by this site. The flags are obtained from http://commons.wikimedia.org/wiki/National_insignia Then they are scaled to a height of 24 pixels, rendered in gimp 2. The off version is created by filling with black, opacity 25% in gimp 2.

Throws:
java.io.IOException
java.sql.SQLException

getProtocolActionRedirectOnMismatch

public boolean getProtocolActionRedirectOnMismatch()
Defaults to true.


getExceptionShowError

public boolean getExceptionShowError()
Defaults to false.


getCanEditResources

public boolean getCanEditResources()
Determines if this site allows direct editing of resource bundles.