|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmagoffin.matt.ma2.biz.impl.SystemBizImpl
public class SystemBizImpl
Standard implementation of UserBiz.
Note: the init() method should be called after
configuring this class but before calling any other methods; the
finish() should be called when finished using.
The init() method will attempt to populate the backend
database with all available time zones if none are found in the
database already.
TimeZone.getDefault()'s getID().DomainObjectFactory implementation
to use for creating instances of our domain objects.ThemeDao implementation
to use.TimeZoneDao implementation
to use.
| Field Summary | |
|---|---|
static java.lang.String |
PLUGIN_CONFIG_KEY
The plugin configuration key. |
static java.lang.String |
SHARED_ALBUM_TEMPLATE_KEY
The model key where the shared Album is placed. |
static java.lang.String |
THEME_PROPERTY_CREATED_DATE_FORMAT
The theme created date property date format. |
| Fields inherited from interface magoffin.matt.ma2.biz.SystemBiz |
|---|
SETTING_KEY_SETUP_COMPLETE, SETTING_KEY_SETUP_REQUIRE_ADMIN, THEME_PROPERTIES_FILE_NAME, THEME_PROPERTY_AUTHOR, THEME_PROPERTY_AUTHOR_EMAIL, THEME_PROPERTY_CREATED_DATE, THEME_PROPERTY_NAME, THEME_XSLT_FILE_NAME |
| Constructor Summary | |
|---|---|
SystemBizImpl()
|
|
| 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. |
|
void |
finish()
Call to release any class resources when finished using. |
|
AlbumDao |
getAlbumDao()
|
|
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. |
|
java.lang.String |
getDefaultThemeName()
|
|
java.util.Map<java.lang.String,java.lang.Object> |
getDefaultThemeTemplate()
|
|
TimeZone |
getDefaultTimeZone()
Get the system's default time zone. |
|
java.lang.String |
getDefaultTimeZoneCode()
|
|
DomainObjectFactory |
getDomainObjectFactory()
|
|
java.lang.String |
getExternalThemeDirectory()
|
|
magoffin.matt.xweb.util.MessagesSource |
getMessages()
|
|
|
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. |
|
magoffin.matt.xweb.util.XwebParamDao |
getSettingsDao()
|
|
java.lang.String |
getSharedAlbumUrl(Album album,
BizContext context)
Get the Matte URL for a shared album. |
|
java.lang.String |
getSharedAlbumUrlTemplate()
|
|
Theme |
getThemeById(java.lang.Long themeId)
Get a Theme by its ID. |
|
ThemeDao |
getThemeDao()
|
|
org.springframework.core.io.Resource |
getThemeResource(Theme theme,
java.lang.String path,
BizContext context)
Get a Theme resource. |
|
TimeZoneDao |
getTimeZoneDao()
|
|
TimeZone |
getTimeZoneForCode(java.lang.String code)
Get a specific TimeZone instance based on its code. |
|
void |
init()
Call to initialize the class after configuring properties. |
|
boolean |
isApplicationConfigured()
Return the status of the overall application configuration. |
|
void |
onApplicationEvent(org.springframework.context.ApplicationEvent event)
|
|
void |
setAlbumDao(AlbumDao albumDao)
|
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
|
|
void |
setCacheDirectory(java.io.File cacheDirectory)
|
|
void |
setCollectionRootDirectory(java.io.File collectionRootDirectory)
|
|
void |
setDefaultThemeName(java.lang.String defaultThemeName)
|
|
void |
setDefaultThemeTemplate(java.util.Map<java.lang.String,java.lang.Object> defaultThemeTemplate)
|
|
void |
setDefaultTimeZoneCode(java.lang.String defaultTimeZoneCode)
|
|
void |
setDomainObjectFactory(DomainObjectFactory domainObjectFactory)
|
|
void |
setExternalThemeDirectory(java.lang.String externalThemeDirectory)
|
|
void |
setMessages(magoffin.matt.xweb.util.MessagesSource messages)
|
|
void |
setResourceDirectory(java.io.File resourceDirectory)
|
|
void |
setSettingsDao(magoffin.matt.xweb.util.XwebParamDao settingsDao)
|
|
void |
setSharedAlbumUrlTemplate(java.lang.String sharedAlbumUrlTemplate)
|
|
void |
setThemeDao(ThemeDao themeDao)
|
|
void |
setTimeZoneDao(TimeZoneDao timeZoneDao)
|
|
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. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String THEME_PROPERTY_CREATED_DATE_FORMAT
public static final java.lang.String SHARED_ALBUM_TEMPLATE_KEY
public static final java.lang.String PLUGIN_CONFIG_KEY
| Constructor Detail |
|---|
public SystemBizImpl()
| Method Detail |
|---|
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionpublic void onApplicationEvent(org.springframework.context.ApplicationEvent event)
onApplicationEvent in interface org.springframework.context.ApplicationListenerpublic void init()
public <T extends Plugin> java.util.List<T> getPluginsOfType(java.lang.Class<T> pluginType)
SystemBiz
getPluginsOfType in interface SystemBizT - the plugin class to getpluginType - the type of plugins to get
public void finish()
public boolean isApplicationConfigured()
SystemBizThis 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.
isApplicationConfigured in interface SystemBizpublic java.util.List<Theme> getAvailableThemes()
SystemBiz
getAvailableThemes in interface SystemBizpublic Theme getThemeById(java.lang.Long themeId)
SystemBiz
getThemeById in interface SystemBizthemeId - the Theme ID
public java.util.List<TimeZone> getAvailableTimeZones()
SystemBiz
getAvailableTimeZones in interface SystemBizpublic java.util.List<Locale> getAvailableLocales()
SystemBiz
getAvailableLocales in interface SystemBizpublic TimeZone getTimeZoneForCode(java.lang.String code)
SystemBiz
getTimeZoneForCode in interface SystemBizcode - the time zone code
public TimeZone getDefaultTimeZone()
SystemBiz
getDefaultTimeZone in interface SystemBizpublic java.io.File getCollectionRootDirectory()
SystemBiz
getCollectionRootDirectory in interface SystemBiz
public org.springframework.core.io.Resource getThemeResource(Theme theme,
java.lang.String path,
BizContext context)
SystemBiz
getThemeResource in interface SystemBiztheme - the themepath - the path of the resource to getcontext - the current context
public java.io.File getCacheDirectory()
SystemBiz
getCacheDirectory in interface SystemBizpublic Theme getDefaultTheme()
SystemBiz
getDefaultTheme in interface SystemBiz
public java.lang.Long storeTheme(Theme theme,
BizContext context)
SystemBizThis method will accept new Theme instances as well as updates to existing themes.
storeTheme in interface SystemBiztheme - the theme to storecontext - the current context
public java.lang.String getSharedAlbumUrl(Album album,
BizContext context)
SystemBiz
getSharedAlbumUrl in interface SystemBizalbum - the album to get the URL forcontext - the current context
public java.lang.Long storeTheme(AddThemeCommand themeCommand,
BizContext context)
SystemBiz
storeTheme in interface SystemBizthemeCommand - the theme command datacontext - the current context
public void exportTheme(Theme theme,
java.io.OutputStream out,
java.io.File baseDirectory,
BizContext context)
SystemBizCalling 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.
exportTheme in interface SystemBiztheme - the theme to exportout - the stream to output the theme tobaseDirectory - the base directory the Theme is stored in,
or if null use the default external theme directorycontext - the currenent context
public void deleteTheme(Theme theme,
BizContext context)
SystemBizNote that internal themes cannot be deleted.
deleteTheme in interface SystemBiztheme - the Theme to deletecontext - the current contextpublic DomainObjectFactory getDomainObjectFactory()
public void setDomainObjectFactory(DomainObjectFactory domainObjectFactory)
domainObjectFactory - The domainObjectFactory to set.public TimeZoneDao getTimeZoneDao()
public void setTimeZoneDao(TimeZoneDao timeZoneDao)
timeZoneDao - The timeZoneDao to set.public java.lang.String getDefaultTimeZoneCode()
public void setDefaultTimeZoneCode(java.lang.String defaultTimeZoneCode)
defaultTimeZoneCode - The defaultTimeZoneCode to set.public void setCollectionRootDirectory(java.io.File collectionRootDirectory)
collectionRootDirectory - The collectionRootDirectory to set.public void setCacheDirectory(java.io.File cacheDirectory)
cacheDirectory - The cacheDirectory to set.public ThemeDao getThemeDao()
public void setThemeDao(ThemeDao themeDao)
themeDao - The themeDao to set.public java.lang.String getDefaultThemeName()
public void setDefaultThemeName(java.lang.String defaultThemeName)
defaultThemeName - The defaultThemeName to set.public java.util.Map<java.lang.String,java.lang.Object> getDefaultThemeTemplate()
public void setDefaultThemeTemplate(java.util.Map<java.lang.String,java.lang.Object> defaultThemeTemplate)
defaultThemeTemplate - The defaultThemeTemplate to set.public java.lang.String getSharedAlbumUrlTemplate()
public void setSharedAlbumUrlTemplate(java.lang.String sharedAlbumUrlTemplate)
sharedAlbumUrlTemplate - The sharedAlbumUrlTemplate to set.public java.lang.String getExternalThemeDirectory()
public void setExternalThemeDirectory(java.lang.String externalThemeDirectory)
externalThemeDirectory - the externalThemeDirectory to setpublic AlbumDao getAlbumDao()
public void setAlbumDao(AlbumDao albumDao)
albumDao - the albumDao to setpublic magoffin.matt.xweb.util.XwebParamDao getSettingsDao()
public void setSettingsDao(magoffin.matt.xweb.util.XwebParamDao settingsDao)
settingsDao - the settingsDao to setpublic java.io.File getResourceDirectory()
SystemBiz
getResourceDirectory in interface SystemBizpublic void setResourceDirectory(java.io.File resourceDirectory)
resourceDirectory - the resourceDirectory to setpublic magoffin.matt.xweb.util.MessagesSource getMessages()
public void setMessages(magoffin.matt.xweb.util.MessagesSource messages)
messages - the messages to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||