org.meshcms.core
Class Configuration

java.lang.Object
  extended byorg.meshcms.core.Configuration
All Implemented Interfaces:
java.io.Serializable

public class Configuration
extends java.lang.Object
implements java.io.Serializable

Manages the configuration parameters of a website.

See Also:
Serialized Form

Field Summary
static java.lang.String[] DEFAULT_VISUAL_EXTENSIONS
          Contains the extensions of files that are visually editable by default.
static int IN_MEMORY_CACHE
          Value used to cache pages in memory.
static long LENGTH_OF_DAY
          The length of a day in milliseconds.
static long LENGTH_OF_HOUR
          The length of a hour in milliseconds.
static int MIXED_CACHE
          Value used to cache pages on disk and, if possible, in memory.
static int NO_CACHE
          Value used to disable page caching.
static int ON_DISK_CACHE
          Value used to cache pages on disk.
static int TIDY_ASK
           
static int TIDY_NO
           
static int TIDY_YES
           
 
Method Summary
 int getBackupLife()
          Returns the minimum time before deleting a backup file, measured in days.
 long getBackupLifeMillis()
          Returns the minimum time before deleting a backup file, measured in milliseconds.
 int getCacheType()
          Returns the type of cache to be used for pages.
 int getExcerptLength()
           
 java.lang.String getExportBaseURL()
           
 java.lang.String getExportCommand()
           
 java.lang.String getExportDir()
           
 java.lang.String getMailServer()
          Returns the name of the mail server (SMTP).
 java.lang.String getSiteAuthor()
          Returns the author name.
 java.lang.String getSiteAuthorURL()
          Returns the author's URL.
 java.lang.String getSiteDescription()
          Returns the website description.
 java.lang.String getSiteHost()
          Returns the main host name of this website.
 java.lang.String getSiteKeywords()
          Returns the keywords related to the website.
 java.lang.String getSiteName()
          Returns the site name.
 java.lang.String getSmtpPassword()
          Returns the SMTP password.
 java.lang.String getSmtpUsername()
          Returns the SMTP username.
 int getStatsLength()
          Returns the length of stats (hit counts) measured in days.
 int getTidy()
           
 int getUpdateInterval()
          Returns the minimum interval between two updates of the site map, measured in hours.
 long getUpdateIntervalMillis()
          Returns the minimum interval between two updates of the site map, measured in milliseconds.
 java.lang.String[] getVisualExtensions()
          Returns the extensions that denote file types that can be edited using the wysiwyg editor.
 boolean isAlwaysDenyDirectoryListings()
          Returns the state of directory list blocking.
 boolean isAlwaysRedirectWelcomes()
          Returns the state of the automatic redirection to welcome files.
 boolean isEditorModulesCollapsed()
          Returns the state of whether modules are collapsed in the editor.
 boolean isExportCheckDates()
           
 boolean isHideExceptions()
          Returns the state of exception hiding.
 boolean isHighQualityThumbnails()
           
 boolean isPasswordProtected()
           
 boolean isPreventHotlinking()
          Returns true if the option to prevent hotlinking is enabled.
 boolean isRedirectRoot()
           
 boolean isReplaceThumbnails()
           
 boolean isSearchMovedPages()
           
 boolean isUseAdminTheme()
          Returns true if the default MeshCMS theme is always used for the pages of the control panel.
static Configuration load(WebSite webSite)
          Loads the configuration from file or creates a new configuration with default values if the file doesn't exist.
 void setAlwaysDenyDirectoryListings(boolean alwaysDenyDirectoryListings)
          Enables or disables blocking of directory listings.
 void setAlwaysRedirectWelcomes(boolean alwaysRedirectWelcomes)
          Enables or disables automatic redirection to welcome files.
 void setBackupLife(int backupLife)
          Sets the minimum time before deleting a backup file, measured in days.
 void setCacheType(int cacheType)
          Sets the type of cache to be used for pages.
 void setEditorModulesCollapsed(boolean editorModulesCollapsed)
          Sets whether modules are collapsed in the editor or not.
 void setExcerptLength(int excerptLength)
           
 void setExportBaseURL(java.lang.String exportBaseURL)
           
 void setExportCheckDates(boolean exportCheckDates)
           
 void setExportCommand(java.lang.String exportCommand)
           
 void setExportDir(java.lang.String exportDir)
           
 void setHideExceptions(boolean hideExceptions)
          Enables or disables hiding of Java exceptions.
 void setHighQualityThumbnails(boolean highQualityThumbnails)
           
 void setMailServer(java.lang.String mailServer)
          Sets the name of the mail server (SMTP).
 void setPasswordProtected(boolean passwordProtected)
           
 void setPreventHotlinking(boolean preventHotlinking)
          Enables or disables hotlinking prevention.
 void setRedirectRoot(boolean redirectRoot)
           
 void setReplaceThumbnails(boolean replaceThumbnails)
           
 void setSearchMovedPages(boolean searchMovedPages)
           
 void setSiteAuthor(java.lang.String siteAuthor)
          Sets the author name.
 void setSiteAuthorURL(java.lang.String siteAuthorURL)
          Sets the author's URL.
 void setSiteDescription(java.lang.String siteDescription)
          Sets the website description.
 void setSiteHost(java.lang.String siteHost)
          Sets the main host name of this website.
 void setSiteKeywords(java.lang.String siteKeywords)
          Sets the keywords related to the website.
 void setSiteName(java.lang.String siteName)
          Sets the site name.
 void setSmtpPassword(java.lang.String smtpPassword)
          Sets the SMTP password.
 void setSmtpUsername(java.lang.String smtpUsername)
          Sets the SMTP username.
 void setStatsLength(int statsLength)
          Sets the length of stats (hit counts) measured in days.
 void setTidy(int tidy)
           
 void setUpdateInterval(int updateInterval)
          Sets the minimum interval between two updates of the site map, measured in hours.
 void setUseAdminTheme(boolean useAdminTheme)
          Sets if the default MeshCMS theme is always used for the pages of the control panel.
 void setVisualExtensions(java.lang.String[] visualExtensions)
          Sets the extensions that denote file types that can be edited using the wysiwyg editor.
 boolean store(WebSite webSite)
          Saves the current configuration to file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LENGTH_OF_HOUR

public static final long LENGTH_OF_HOUR
The length of a hour in milliseconds.

See Also:
Constant Field Values

LENGTH_OF_DAY

public static final long LENGTH_OF_DAY
The length of a day in milliseconds.

See Also:
Constant Field Values

DEFAULT_VISUAL_EXTENSIONS

public static final java.lang.String[] DEFAULT_VISUAL_EXTENSIONS
Contains the extensions of files that are visually editable by default.


NO_CACHE

public static final int NO_CACHE
Value used to disable page caching.

See Also:
Constant Field Values

IN_MEMORY_CACHE

public static final int IN_MEMORY_CACHE
Value used to cache pages in memory.

See Also:
Constant Field Values

ON_DISK_CACHE

public static final int ON_DISK_CACHE
Value used to cache pages on disk.

See Also:
Constant Field Values

MIXED_CACHE

public static final int MIXED_CACHE
Value used to cache pages on disk and, if possible, in memory.

See Also:
Constant Field Values

TIDY_NO

public static final int TIDY_NO
See Also:
Constant Field Values

TIDY_YES

public static final int TIDY_YES
See Also:
Constant Field Values

TIDY_ASK

public static final int TIDY_ASK
See Also:
Constant Field Values
Method Detail

isUseAdminTheme

public boolean isUseAdminTheme()
Returns true if the default MeshCMS theme is always used for the pages of the control panel.


setUseAdminTheme

public void setUseAdminTheme(boolean useAdminTheme)
Sets if the default MeshCMS theme is always used for the pages of the control panel.


isPreventHotlinking

public boolean isPreventHotlinking()
Returns true if the option to prevent hotlinking is enabled.


setPreventHotlinking

public void setPreventHotlinking(boolean preventHotlinking)
Enables or disables hotlinking prevention.


getBackupLife

public int getBackupLife()
Returns the minimum time before deleting a backup file, measured in days.


setBackupLife

public void setBackupLife(int backupLife)
Sets the minimum time before deleting a backup file, measured in days.


getStatsLength

public int getStatsLength()
Returns the length of stats (hit counts) measured in days.


setStatsLength

public void setStatsLength(int statsLength)
Sets the length of stats (hit counts) measured in days. Please note that this value is fixed when the web application is initialized, so if the value is changed, the new value won't be used until the next restart of the web application.


getUpdateInterval

public int getUpdateInterval()
Returns the minimum interval between two updates of the site map, measured in hours.


setUpdateInterval

public void setUpdateInterval(int updateInterval)
Sets the minimum interval between two updates of the site map, measured in hours.


getCacheType

public int getCacheType()
Returns the type of cache to be used for pages.

See Also:
setCacheType(int)

setCacheType

public void setCacheType(int cacheType)
Sets the type of cache to be used for pages. Possible values are NO_CACHE, IN_MEMORY_CACHE and ON_DISK_CACHE.


getMailServer

public java.lang.String getMailServer()
Returns the name of the mail server (SMTP).


setMailServer

public void setMailServer(java.lang.String mailServer)
Sets the name of the mail server (SMTP).


getSmtpUsername

public java.lang.String getSmtpUsername()
Returns the SMTP username.


setSmtpUsername

public void setSmtpUsername(java.lang.String smtpUsername)
Sets the SMTP username.


getSmtpPassword

public java.lang.String getSmtpPassword()
Returns the SMTP password.


setSmtpPassword

public void setSmtpPassword(java.lang.String smtpPassword)
Sets the SMTP password.


load

public static Configuration load(WebSite webSite)
Loads the configuration from file or creates a new configuration with default values if the file doesn't exist.


store

public boolean store(WebSite webSite)
Saves the current configuration to file.


getUpdateIntervalMillis

public long getUpdateIntervalMillis()
Returns the minimum interval between two updates of the site map, measured in milliseconds.


getBackupLifeMillis

public long getBackupLifeMillis()
Returns the minimum time before deleting a backup file, measured in milliseconds.


getVisualExtensions

public java.lang.String[] getVisualExtensions()
Returns the extensions that denote file types that can be edited using the wysiwyg editor.


setVisualExtensions

public void setVisualExtensions(java.lang.String[] visualExtensions)
Sets the extensions that denote file types that can be edited using the wysiwyg editor.


isAlwaysRedirectWelcomes

public boolean isAlwaysRedirectWelcomes()
Returns the state of the automatic redirection to welcome files.


setAlwaysRedirectWelcomes

public void setAlwaysRedirectWelcomes(boolean alwaysRedirectWelcomes)
Enables or disables automatic redirection to welcome files.


isAlwaysDenyDirectoryListings

public boolean isAlwaysDenyDirectoryListings()
Returns the state of directory list blocking.


setAlwaysDenyDirectoryListings

public void setAlwaysDenyDirectoryListings(boolean alwaysDenyDirectoryListings)
Enables or disables blocking of directory listings.


getSiteHost

public java.lang.String getSiteHost()
Returns the main host name of this website.


setSiteHost

public void setSiteHost(java.lang.String siteHost)
Sets the main host name of this website.


getSiteDescription

public java.lang.String getSiteDescription()
Returns the website description.


setSiteDescription

public void setSiteDescription(java.lang.String siteDescription)
Sets the website description.


getSiteKeywords

public java.lang.String getSiteKeywords()
Returns the keywords related to the website.


setSiteKeywords

public void setSiteKeywords(java.lang.String siteKeywords)
Sets the keywords related to the website.


getSiteAuthor

public java.lang.String getSiteAuthor()
Returns the author name.


setSiteAuthor

public void setSiteAuthor(java.lang.String siteAuthor)
Sets the author name.


getSiteName

public java.lang.String getSiteName()
Returns the site name.


setSiteName

public void setSiteName(java.lang.String siteName)
Sets the site name.


getSiteAuthorURL

public java.lang.String getSiteAuthorURL()
Returns the author's URL.


setSiteAuthorURL

public void setSiteAuthorURL(java.lang.String siteAuthorURL)
Sets the author's URL. Can be a website URL or a mailto. It is expected to be a full URL.


isHideExceptions

public boolean isHideExceptions()
Returns the state of exception hiding.


setHideExceptions

public void setHideExceptions(boolean hideExceptions)
Enables or disables hiding of Java exceptions. If enabled, exception will be catched and not rethrown.


isEditorModulesCollapsed

public boolean isEditorModulesCollapsed()
Returns the state of whether modules are collapsed in the editor.


setEditorModulesCollapsed

public void setEditorModulesCollapsed(boolean editorModulesCollapsed)
Sets whether modules are collapsed in the editor or not.


isHighQualityThumbnails

public boolean isHighQualityThumbnails()

setHighQualityThumbnails

public void setHighQualityThumbnails(boolean highQualityThumbnails)

isExportCheckDates

public boolean isExportCheckDates()

setExportCheckDates

public void setExportCheckDates(boolean exportCheckDates)

getExportBaseURL

public java.lang.String getExportBaseURL()

setExportBaseURL

public void setExportBaseURL(java.lang.String exportBaseURL)

getExportDir

public java.lang.String getExportDir()

setExportDir

public void setExportDir(java.lang.String exportDir)

getExportCommand

public java.lang.String getExportCommand()

setExportCommand

public void setExportCommand(java.lang.String exportCommand)

isSearchMovedPages

public boolean isSearchMovedPages()

setSearchMovedPages

public void setSearchMovedPages(boolean searchMovedPages)

isRedirectRoot

public boolean isRedirectRoot()

setRedirectRoot

public void setRedirectRoot(boolean redirectRoot)

isReplaceThumbnails

public boolean isReplaceThumbnails()

setReplaceThumbnails

public void setReplaceThumbnails(boolean replaceThumbnails)

getTidy

public int getTidy()

setTidy

public void setTidy(int tidy)

isPasswordProtected

public boolean isPasswordProtected()

setPasswordProtected

public void setPasswordProtected(boolean passwordProtected)

getExcerptLength

public int getExcerptLength()
Returns:
the excerptLength

setExcerptLength

public void setExcerptLength(int excerptLength)
Parameters:
excerptLength - the excerptLength to set