magoffin.matt.ma2.biz
Interface SystemBiz

All Known Implementing Classes:
SystemBizImpl

public interface SystemBiz

Business API for system settings and functions.

Version:
$Revision: 43 $ $Date: 2007-10-21 11:10:01 +1300 (Sun, 21 Oct 2007) $
Author:
Matt Magoffin (spamsqr@msqr.us)

Field Summary
static java.lang.String SETTING_KEY_SETUP_COMPLETE
          The setting key for the setup complete flag.
static java.lang.String SETTING_KEY_SETUP_REQUIRE_ADMIN
          The setting key for the setup: require admin flag.
static java.lang.String THEME_PROPERTIES_FILE_NAME
          The name of the optional theme properties file.
static java.lang.String THEME_PROPERTY_AUTHOR
          The theme property for the author.
static java.lang.String THEME_PROPERTY_AUTHOR_EMAIL
          The theme property for the author's email.
static java.lang.String THEME_PROPERTY_CREATED_DATE
          The theme property for the created date (yyyy-mm-dd format).
static java.lang.String THEME_PROPERTY_NAME
          The theme property for the name.
static java.lang.String THEME_XSLT_FILE_NAME
          The name of the required theme XSLT file.
 
Method Summary
 void deleteTheme(Theme theme, BizContext context)
          Delete a Theme.
 void exportTheme(Theme theme, java.io.OutputStream out, java.io.File baseDirectory, BizContext context)
          Export a Theme, and associated resources.
 java.util.List<Locale> getAvailableLocales()
          Get a list of available locales.
 java.util.List<Theme> getAvailableThemes()
          Get a list of available themes.
 java.util.List<TimeZone> getAvailableTimeZones()
          Get a list of available time zones.
 java.io.File getCacheDirectory()
          Get a directory for caching items in.
 java.io.File getCollectionRootDirectory()
          Get the root directory to store all collections within.
 Theme getDefaultTheme()
          Get a default theme.
 TimeZone getDefaultTimeZone()
          Get the system's default time zone.
<T extends Plugin>
java.util.List<T>
getPluginsOfType(java.lang.Class<T> pluginType)
          Get all registered plugins of a specific type.
 java.io.File getResourceDirectory()
          Get a directory for storing user resources in.
 java.lang.String getSharedAlbumUrl(Album album, BizContext context)
          Get the Matte URL for a shared album.
 Theme getThemeById(java.lang.Long themeId)
          Get a Theme by its ID.
 org.springframework.core.io.Resource getThemeResource(Theme theme, java.lang.String path, BizContext context)
          Get a Theme resource.
 TimeZone getTimeZoneForCode(java.lang.String code)
          Get a specific TimeZone instance based on its code.
 boolean isApplicationConfigured()
          Return the status of the overall application configuration.
 java.lang.Long storeTheme(AddThemeCommand themeCommand, BizContext context)
          Store a Theme, and associated resources, in the back end.
 java.lang.Long storeTheme(Theme theme, BizContext context)
          Store a Theme in the back end.
 

Field Detail

THEME_XSLT_FILE_NAME

static final java.lang.String THEME_XSLT_FILE_NAME
The name of the required theme XSLT file.

See Also:
Constant Field Values

THEME_PROPERTIES_FILE_NAME

static final java.lang.String THEME_PROPERTIES_FILE_NAME
The name of the optional theme properties file.

See Also:
Constant Field Values

THEME_PROPERTY_NAME

static final java.lang.String THEME_PROPERTY_NAME
The theme property for the name.

See Also:
Constant Field Values

THEME_PROPERTY_AUTHOR

static final java.lang.String THEME_PROPERTY_AUTHOR
The theme property for the author.

See Also:
Constant Field Values

THEME_PROPERTY_AUTHOR_EMAIL

static final java.lang.String THEME_PROPERTY_AUTHOR_EMAIL
The theme property for the author's email.

See Also:
Constant Field Values

THEME_PROPERTY_CREATED_DATE

static final java.lang.String THEME_PROPERTY_CREATED_DATE
The theme property for the created date (yyyy-mm-dd format).

See Also:
Constant Field Values

SETTING_KEY_SETUP_COMPLETE

static final java.lang.String SETTING_KEY_SETUP_COMPLETE
The setting key for the setup complete flag.

See Also:
Constant Field Values

SETTING_KEY_SETUP_REQUIRE_ADMIN

static final java.lang.String SETTING_KEY_SETUP_REQUIRE_ADMIN
The setting key for the setup: require admin flag.

See Also:
Constant Field Values
Method Detail

getAvailableTimeZones

java.util.List<TimeZone> getAvailableTimeZones()
Get a list of available time zones.

Returns:
list of time zones

getAvailableLocales

java.util.List<Locale> getAvailableLocales()
Get a list of available locales.

Returns:
list of locales

getTimeZoneForCode

TimeZone getTimeZoneForCode(java.lang.String code)
Get a specific TimeZone instance based on its code.

Parameters:
code - the time zone code
Returns:
the TimeZone if available, null if not found

getDefaultTimeZone

TimeZone getDefaultTimeZone()
Get the system's default time zone.

Returns:
default time zone

getCollectionRootDirectory

java.io.File getCollectionRootDirectory()
Get the root directory to store all collections within.

Returns:
a file representing the directory to store collections in

getCacheDirectory

java.io.File getCacheDirectory()
Get a directory for caching items in.

Returns:
a file representing the directory to cache items in

getResourceDirectory

java.io.File getResourceDirectory()
Get a directory for storing user resources in.

Returns:
a file representing the directory to use for user resources

getDefaultTheme

Theme getDefaultTheme()
Get a default theme.

Returns:
theme

getThemeById

Theme getThemeById(java.lang.Long themeId)
Get a Theme by its ID.

Parameters:
themeId - the Theme ID
Returns:
the Theme, or null if not found

getAvailableThemes

java.util.List<Theme> getAvailableThemes()
Get a list of available themes.

Returns:
list of themes

storeTheme

java.lang.Long storeTheme(Theme theme,
                          BizContext context)
Store a Theme in the back end.

This method will accept new Theme instances as well as updates to existing themes.

Parameters:
theme - the theme to store
context - the current context
Returns:
the stored theme's primary key

getThemeResource

org.springframework.core.io.Resource getThemeResource(Theme theme,
                                                      java.lang.String path,
                                                      BizContext context)
Get a Theme resource.

Parameters:
theme - the theme
path - the path of the resource to get
context - the current context
Returns:
the Resource

storeTheme

java.lang.Long storeTheme(AddThemeCommand themeCommand,
                          BizContext context)
Store a Theme, and associated resources, in the back end.

Parameters:
themeCommand - the theme command data
context - the current context
Returns:
the stored theme's primary key

exportTheme

void exportTheme(Theme theme,
                 java.io.OutputStream out,
                 java.io.File baseDirectory,
                 BizContext context)
Export a Theme, and associated resources.

Calling this method will write a Zip archive of the theme and all it's associated resources to the supplied OutputStream. This method shall not close the OutputStream when finished.

Parameters:
theme - the theme to export
out - the stream to output the theme to
baseDirectory - the base directory the Theme is stored in, or if null use the default external theme directory
context - the currenent context

deleteTheme

void deleteTheme(Theme theme,
                 BizContext context)
Delete a Theme.

Note that internal themes cannot be deleted.

Parameters:
theme - the Theme to delete
context - the current context

getSharedAlbumUrl

java.lang.String getSharedAlbumUrl(Album album,
                                   BizContext context)
Get the Matte URL for a shared album.

Parameters:
album - the album to get the URL for
context - the current context
Returns:
the URL as a String

isApplicationConfigured

boolean isApplicationConfigured()
Return the status of the overall application configuration.

This configuration setting means the application has been started at least once and subsequently configured for the first time, and properly set up. Some other services may not want to start up if the application is not configured.

Returns:
boolean

getPluginsOfType

<T extends Plugin> java.util.List<T> getPluginsOfType(java.lang.Class<T> pluginType)
Get all registered plugins of a specific type.

Type Parameters:
T - the plugin class to get
Parameters:
pluginType - the type of plugins to get
Returns:
a read-only list of registred plugins, or an empty list if none available