@Component(value="appSettings") public class AppSettings extends Object implements org.springframework.context.ApplicationContextAware
Common site wide application settings accessible globally. Loaded in Spring Context as appSettings Note: Putting non-static App specific configs, inSiteApplication
presented a problem in situations where there is no web context. While testing we can rely on classes likeWicketTester
orSiteTester
however it has serious limitations and complications, specially when booting an App when the Web Context may not have yet kicked in.
Modifier and Type | Field and Description |
---|---|
Properties |
adminConfiguration |
Properties |
appConfiguration |
String |
APPLICATION_ENCODING_CHARSET
The Application/Project wide default Encoding
Charset defined by appConfiguration project.encoding.charset |
String |
APPLICATION_EXTENSION
Any default extension to apply to the user facing site/pages defined by
appConfiguration site.ext |
Class |
appUserType
Application default user Type (Class)
|
AuthorizationModule |
authModule |
String |
CDN_LOCATION
Location/Name for a Content Delivery Network
This is useful to set the base URL's for all resources if we wish to fetch them from a CDN The CDN Location should be independent of any protocol; and should represent the Domain Name. |
protected static ThreadLocal<AppSettings> |
configs |
String |
CONTEXT_BASE_ABSOLUTE_PATH
A reference to the Base path on the OS for files.
IF not defined, then is set automatically. |
SimpleDateFormat |
DATE_FORMAT |
String |
DATE_FORMAT_PATTERN |
int |
DEFAULT_DISPLAY_PAGE_SIZE
For admin Grids the Page size is defined by
adminConfiguration data.table.page.size |
Locale |
DEFAULT_LOCALE
Locale as null is not good.
|
javax.persistence.EntityManager |
entityManager |
static Date |
LICENSE_EXPIRES |
static String |
LICENSE_ISSUER |
static String |
LICENSED_TO |
String |
MODULE_EXTENSION
Any default extension to apply to the admin/module based site/pages defined by
adminConfiguration module.ext |
List<String> |
RESOURCE_FOLDER_BASE_PATHS
Defined by
appConfiguration site.resources.folder.base |
Boolean |
RESOURCE_REL_TO_WEB_CNTXT
If images/resources are loaded relative to Web-Context or absolute, defined by
appConfiguration site.resources.folder.mode.relative |
org.springframework.context.ApplicationContext |
springContext |
SpringConfiguredContainerFactory |
WICKET_CONTAINER_FACTORY |
Constructor and Description |
---|
AppSettings() |
public org.springframework.context.ApplicationContext springContext
public javax.persistence.EntityManager entityManager
public Properties appConfiguration
public Properties adminConfiguration
public AuthorizationModule authModule
public String CONTEXT_BASE_ABSOLUTE_PATH
public String APPLICATION_ENCODING_CHARSET
Charset
defined by appConfiguration
project.encoding.charsetpublic String APPLICATION_EXTENSION
appConfiguration
site.extpublic String MODULE_EXTENSION
adminConfiguration
module.extpublic int DEFAULT_DISPLAY_PAGE_SIZE
adminConfiguration
data.table.page.sizepublic Boolean RESOURCE_REL_TO_WEB_CNTXT
appConfiguration
site.resources.folder.mode.relativepublic List<String> RESOURCE_FOLDER_BASE_PATHS
appConfiguration
site.resources.folder.basepublic Locale DEFAULT_LOCALE
public Class appUserType
BasicUser
public SpringConfiguredContainerFactory WICKET_CONTAINER_FACTORY
SpringConfiguredContainerFactory
public static String LICENSED_TO
public static String LICENSE_ISSUER
public static Date LICENSE_EXPIRES
public String CDN_LOCATION
appConfiguration
cdn.locationpublic String DATE_FORMAT_PATTERN
public SimpleDateFormat DATE_FORMAT
protected static ThreadLocal<AppSettings> configs
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
@PostConstruct public final void init() throws Exception
Exception
public void setAppSettings()
public static void set(AppSettings appSettings)
public static AppSettings get()
public org.springframework.context.ApplicationContext getApplicationContext()
public Properties getAppConfiguration()
public void setAppConfiguration(Properties appConfiguration)
public Properties getAdminConfiguration()
public void setAdminConfiguration(Properties adminConfiguration)
public String getCONTEXT_BASE_ABSOLUTE_PATH()
public void setCONTEXT_BASE_ABSOLUTE_PATH(String cONTEXT_BASE_ABSOLUTE_PATH)
public String getAPPLICATION_ENCODING_CHARSET()
public void setAPPLICATION_ENCODING_CHARSET(String aPPLICATION_ENCODING_CHARSET)
public String getAPPLICATION_EXTENSION()
public void setAPPLICATION_EXTENSION(String aPPLICATION_EXTENSION)
public String getMODULE_EXTENSION()
public void setMODULE_EXTENSION(String mODULE_EXTENSION)
public int getDEFAULT_DISPLAY_PAGE_SIZE()
public void setDEFAULT_DISPLAY_PAGE_SIZE(int dEFAULT_DISPLAY_PAGE_SIZE)
public Boolean getRESOURCE_REL_TO_WEB_CNTXT()
public void setRESOURCE_REL_TO_WEB_CNTXT(Boolean rESOURCE_REL_TO_WEB_CNTXT)
public void setRESOURCE_FOLDER_BASE_PATHS(List<String> rESOURCE_FOLDER_BASE_PATHS)
public Locale getDEFAULT_LOCALE()
public void setDEFAULT_LOCALE(Locale dEFAULT_LOCALE)
public AuthorizationModule getAuthModule()
public void setAuthModule(AuthorizationModule authModule)
Copyright © 2018. All rights reserved.