|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.scooterframework.admin.EnvConfig
public class EnvConfig
EnvConfig class configures the application during startup time.
You can add more mappings by using the additional.mimetypes property in the environment.properties file. Or you can create your own content handler plugin by extending the Plugin class and implementing the ContentHandler interface.
Method Summary | |
---|---|
boolean |
allowAutoCRUD()
Alias of allowDefaultControllerClass method. |
boolean |
allowCacheAssociatedObjects(java.lang.String modelClassName)
Checks if using second-level cache. |
boolean |
allowDataBrowser()
Checks if DataBroser is allowed. |
boolean |
allowDefaultActionMethod()
Checks if a default action name is used when an action method is not obtained from parsing a url. |
boolean |
allowDefaultControllerClass()
Checks if a built-in default controller class is allowed to use. |
boolean |
allowDisplayingErrorDetails()
Checks if displaying error details is allowed. |
boolean |
allowForwardToActionNameViewWhenActionNotExist()
Checks if action name is used as a view when the action does not exist. |
boolean |
allowForwardToControllerNameViewWhenControllerNotExist()
Checks if controller name is used as a view when the controller does not exist. |
boolean |
allowRecordBenchmark()
Checks if bench mark info is allowed to record. |
boolean |
allowRecordBenchmarkInHeader()
Checks if bench mark info is allowed to record in header. |
java.lang.String |
applyPasswordScheme(java.lang.String password)
|
java.lang.String |
getActionExtension()
Returns action extension |
static java.lang.String |
getActionUriFor(java.lang.String action)
Returns action URI for a specific action method. |
static java.lang.String |
getActionUriFor(java.lang.String controllerPath,
java.lang.String action)
Returns action URI for a controller path with a specific action method. |
java.lang.String |
getCompileErrorPageURI()
Returns compile error page URI. |
java.lang.String |
getControllerClassName(java.lang.String controllerPath)
Returns full controller class name. |
java.lang.String |
getControllerClassPrefix()
Returns controller class name prefix. |
java.lang.String |
getControllerClassSuffix()
Returns controller class name suffix. |
java.lang.String |
getControllerName(java.lang.String fullClassName)
Returns controller name in lower case. |
java.lang.String |
getDefaultActionMethod()
Returns default method name of a controller class. |
java.lang.String |
getDefaultCacheName()
Returns default cache name |
java.lang.String |
getDefaultCacheProviderName()
Returns default cache provider name |
java.util.Properties |
getDefaultCacheProviderProperties()
Returns default cache provider properties |
java.lang.String |
getDefaultViewFilesDirectory()
Returns directory name which contains default view files. |
java.lang.String |
getDefaultViewFilesDirectoryForREST()
Returns directory name which contains default view files for builtin RestfulCRUDController or RestfulRequestProcessor. |
org.apache.commons.fileupload.disk.DiskFileItemFactory |
getDiskFileItemFactory()
Returns DiskFileItemFactory instance for file upload. |
java.lang.String |
getErrorPageURI()
Returns error page URI. |
boolean |
getFlushCacheOnChange()
Checks if using second-level cache for all model classes. |
java.lang.String |
getGlobalCountry()
Returns the country for the configured locale. |
java.lang.String |
getGlobalLanguage()
Returns the language for the configured locale. |
java.util.Locale |
getGlobalLocale()
Returns configured locale. |
java.lang.String |
getGlobalVariant()
Returns the variant for the configured locale. |
ActiveRecord |
getHomeInstance(java.lang.String model)
Returns home instance of a model. |
static EnvConfig |
getInstance()
|
java.util.Collection<java.lang.String> |
getLocalFlushCacheExceptions(java.lang.String modelClassName)
Returns a collection methods that are exceptional to the setting of useRequestCache and useSecondLevelCache. |
java.util.Collection<java.lang.String> |
getLocalUseCacheExceptions(java.lang.String modelClassName)
Returns a collection methods that are exceptional to the setting of useRequestCache and useSecondLevelCache. |
long |
getMaximumBytesPerUploadedFile()
Returns the maximum allowed bytes of an upload file. |
int |
getMaximumBytesPerUploadedFileInMemory()
Returns the threshold, in bytes, below which items will be retained in memory and above which they will be stored as a file. |
long |
getMaximumTotalBytesPerUploadRequest()
Returns the maximum allowed bytes of an upload request. |
java.lang.String |
getMessageResourcesFileBase()
Returns the base name of message files. |
java.lang.String |
getMimeType(java.lang.String extension)
Returns MIME type corresponding the specific extension. |
java.util.Map<java.lang.String,java.lang.String> |
getMimeTypeMap()
Returns the extension/mimetype mapping. |
java.lang.String |
getModelClassName(java.lang.String model)
Returns full model class name. |
java.lang.String |
getModelClassNameFromControllerClassName(java.lang.String controllerClassName)
Returns model class name based on controller class name. |
java.lang.String |
getModelClassPrefix()
Returns model class name prefix. |
java.lang.String |
getModelClassSuffix()
Returns model class name suffix. |
java.lang.String |
getPasswordScheme()
Returns password scheme |
java.util.Properties |
getPluginProperties(java.lang.String pluginName)
Returns plugin properties |
java.util.Iterator<java.lang.String> |
getPredefinedCacheProviderNames()
Returns cache provider names |
java.util.Properties |
getPredefinedCacheProviderProperties(java.lang.String providerName)
Returns cache provider properties |
java.util.Properties |
getProperties()
Returns all properties. |
java.lang.String |
getProperty(java.lang.String key)
Returns a String property corresponding to a key. |
java.lang.String |
getProperty(java.lang.String key,
java.lang.String defaultValue)
Returns a String property corresponding to a key. |
static java.lang.String |
getRealPath()
Returns real path of the application. |
java.lang.String |
getRootURL()
Returns root url. |
java.lang.String |
getServerType()
Returns server type |
org.apache.commons.fileupload.servlet.ServletFileUpload |
getServletFileUpload()
Returns ServletFileUpload instance for file upload. |
java.lang.String |
getSiteAdminPassword()
Returns site admin password. |
java.lang.String |
getSiteAdminUsername()
Returns site admin username. |
java.lang.String |
getUploadFileRepository()
Returns file directory for storing uploaded files. |
boolean |
getUseSecondLevelCache()
Checks if using second-level cache for all model classes. |
boolean |
getUseThreadCache()
Checks if using thread cache for all model classes. |
java.lang.String |
getViewExtension()
Returns view extension |
static java.lang.String |
getViewURI(java.lang.String controller,
java.lang.String actionOrView)
Returns view URI for a controller with a specific action. |
static java.lang.String |
getViewURI(java.lang.String controller,
java.lang.String actionOrView,
java.lang.String defaultViewDir)
Returns a view URI. |
java.lang.String |
getWebPageDirectoryName()
Returns directory name which contains all web pages. |
boolean |
hasMimeTypeFor(java.lang.String extension)
Checks if the specific extension has a registered MIME type. |
boolean |
isHighlightable(java.lang.String fileExtension)
Checks if the content of the file can be highlighted. |
boolean |
isTextFile(java.io.File file)
Checks whether a file is a text file. |
boolean |
isTextFile(java.lang.String extension)
Checks whether a file extension indicates that it is a text file. |
void |
update(java.util.Observable o,
java.lang.Object arg)
|
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 EXTENSION_MIMETYPES_RESOURCE
public static final java.lang.String DATA_PROPERTIES_FILE
public static final java.lang.String DEFAULT_VALUE_defaultViewFilesDirectory
public static final java.lang.String DEFAULT_VALUE_siteAdminUsername
public static final java.lang.String DEFAULT_VALUE_siteAdminPassword
public static final java.lang.String DEFAULT_VALUE_modelClassPrefix
public static final java.lang.String DEFAULT_VALUE_modelClassSuffix
public static final java.lang.String DEFAULT_VALUE_controllerClassPrefix
public static final java.lang.String DEFAULT_VALUE_controllerClassSuffix
public static final java.lang.String DEFAULT_VALUE_allowDefaultControllerClass
public static final java.lang.String DEFAULT_VALUE_actionExtension
public static final java.lang.String DEFAULT_VALUE_defaultActionMethod
public static final java.lang.String DEFAULT_VALUE_allowDefaultActionMethod
public static final java.lang.String DEFAULT_VALUE_webPageDirectoryName
public static final java.lang.String DEFAULT_VALUE_allowForwardToControllerNameViewWhenControllerNotExist
public static final java.lang.String DEFAULT_VALUE_allowForwardToActionNameViewWhenActionNotExist
public static final java.lang.String DEFAULT_VALUE_runningEnvironment
public static final java.lang.String DEFAULT_VALUE_passwordScheme
public static final java.lang.String DEFAULT_VALUE_benchmark
public static final java.lang.String DEFAULT_VALUE_benchmarkInHeader
public static final java.lang.String DEFAULT_VALUE_locale_language
public static final java.lang.String DEFAULT_VALUE_locale_country
public static final java.lang.String DEFAULT_VALUE_locale_variant
public static final java.util.Locale DEFAULT_VALUE_gloabalLocale
public static final java.lang.String DEFAULT_VALUE_messageResourcesFileBase
public static final java.lang.String DEFAULT_VALUE_viewExtension
public static final java.lang.String DEFAULT_VALUE_rootURL
public static final java.lang.String DEFAULT_VALUE_errorPageURI
public static final java.lang.String DEFAULT_VALUE_compileErrorPageURI
public static final java.lang.String DEFAULT_VALUE_allowDisplayingErrorDetails
public static final java.lang.String DEFAULT_VALUE_allowDataBrowser
public static final java.lang.String DEFAULT_VALUE_additionalMimeTypes
public static final java.lang.String DEFAULT_VALUE_additionalSinglePlural
public static final java.lang.String DEFAULT_VALUE_defaultCacheProvider
public static final java.lang.String DEFAULT_VALUE_defaultCacheName
public static final java.lang.String DEFAULT_VALUE_useRequestCache
public static final java.lang.String DEFAULT_VALUE_useSecondLevelCache
public static final java.lang.String DEFAULT_VALUE_flushCacheOnChange
public static final java.lang.String DEFAULT_VALUE_localUseCacheExceptions
public static final java.lang.String DEFAULT_VALUE_localFlushCacheExceptions
public static final java.lang.String DEFAULT_VALUE_allowCacheAssociatedObjects
public static final java.lang.String DEFAULT_VALUE_upload_file_repository
public static final java.lang.String DEFAULT_VALUE_maximum_bytes_per_uploaded_file_in_memory
public static final java.lang.String DEFAULT_VALUE_maximum_total_bytes_per_upload_request
public static final java.lang.String DEFAULT_VALUE_maximum_bytes_per_uploaded_file
Method Detail |
---|
public static EnvConfig getInstance()
public void update(java.util.Observable o, java.lang.Object arg)
update
in interface java.util.Observer
public java.util.Properties getProperties()
public java.lang.String getProperty(java.lang.String key)
public java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
public java.lang.String getSiteAdminUsername()
public java.lang.String getSiteAdminPassword()
public java.lang.String getActionExtension()
public java.lang.String getViewExtension()
public java.lang.String getRootURL()
public java.lang.String getControllerClassPrefix()
public java.lang.String getControllerClassSuffix()
public boolean allowDefaultControllerClass()
public boolean allowAutoCRUD()
public java.lang.String getDefaultActionMethod()
public boolean allowDefaultActionMethod()
public java.lang.String getModelClassPrefix()
public java.lang.String getModelClassSuffix()
public java.lang.String getWebPageDirectoryName()
public static java.lang.String getActionUriFor(java.lang.String action)
Examples: getActionUriFor("list") => list.do (extension = .do)
action
- the action method
public static java.lang.String getActionUriFor(java.lang.String controllerPath, java.lang.String action)
Examples: getActionUriFor("/posts", "list") => /posts/list.do
controllerPath
- path to the actionaction
- the action method
public static java.lang.String getViewURI(java.lang.String controller, java.lang.String actionOrView)
Returns view URI for a controller with a specific action.
If there is no extension type in the view name, the view is treated as an extension type defined in config properties file. For example, if the view is "show", the view could be treated as "show.jsp" action if the view.extension property is defined as ".jsp". The directory path for view files is set by the webpage.directory.name property in properties file.
Examples: If your JSP web pages are under webapp: webpage.directory.name="" getViewURI("posts", "list") => /posts/list.jsp If your jsp web pages are under WEB-INF/views: webpage.directory.name="WEB-INF/views" (default) getViewURI("posts", "list") => /WEB-INF/views/posts/list.jsp
controller
- controller nameactionOrView
- the action method name or view name
public static java.lang.String getViewURI(java.lang.String controller, java.lang.String actionOrView, java.lang.String defaultViewDir)
controller
- the name of the controlleractionOrView
- the action method name or view name
public static java.lang.String getRealPath()
public java.lang.String getDefaultViewFilesDirectory()
public java.lang.String getDefaultViewFilesDirectoryForREST()
public boolean allowForwardToControllerNameViewWhenControllerNotExist()
public boolean allowForwardToActionNameViewWhenActionNotExist()
public java.lang.String getServerType()
public java.lang.String getPasswordScheme()
public java.lang.String applyPasswordScheme(java.lang.String password)
public java.lang.String getControllerClassName(java.lang.String controllerPath)
controllerPath
- controller path
public java.lang.String getControllerName(java.lang.String fullClassName)
fullClassName
- full class name of the controller
public java.lang.String getModelClassName(java.lang.String model)
model
- model name
public java.lang.String getModelClassNameFromControllerClassName(java.lang.String controllerClassName)
public ActiveRecord getHomeInstance(java.lang.String model)
Returns home instance of a model.
A home instance of a record is a read-only instance for a model type. Its main function is to provide meta information of the model and some finder methods.
model
- name corresponding to the model home instance
public boolean allowRecordBenchmark()
public boolean allowRecordBenchmarkInHeader()
public java.util.Locale getGlobalLocale()
public java.lang.String getGlobalLanguage()
public java.lang.String getGlobalCountry()
public java.lang.String getGlobalVariant()
public java.lang.String getMessageResourcesFileBase()
public java.lang.String getErrorPageURI()
public java.lang.String getCompileErrorPageURI()
public boolean allowDisplayingErrorDetails()
public boolean allowDataBrowser()
public java.util.Properties getPredefinedCacheProviderProperties(java.lang.String providerName)
public java.util.Iterator<java.lang.String> getPredefinedCacheProviderNames()
public java.lang.String getDefaultCacheProviderName()
public java.lang.String getDefaultCacheName()
public java.util.Properties getDefaultCacheProviderProperties()
public boolean getUseThreadCache()
public boolean getUseSecondLevelCache()
public boolean getFlushCacheOnChange()
public java.util.Collection<java.lang.String> getLocalUseCacheExceptions(java.lang.String modelClassName)
public java.util.Collection<java.lang.String> getLocalFlushCacheExceptions(java.lang.String modelClassName)
public boolean allowCacheAssociatedObjects(java.lang.String modelClassName)
public java.util.Properties getPluginProperties(java.lang.String pluginName)
public java.util.Map<java.lang.String,java.lang.String> getMimeTypeMap()
public java.lang.String getMimeType(java.lang.String extension)
extension
- The extension string.
public boolean hasMimeTypeFor(java.lang.String extension)
extension
- The extension string.
public java.lang.String getUploadFileRepository()
public int getMaximumBytesPerUploadedFileInMemory()
public long getMaximumTotalBytesPerUploadRequest()
public long getMaximumBytesPerUploadedFile()
public org.apache.commons.fileupload.disk.DiskFileItemFactory getDiskFileItemFactory()
public org.apache.commons.fileupload.servlet.ServletFileUpload getServletFileUpload()
public boolean isTextFile(java.io.File file)
file
- the file to check
public boolean isTextFile(java.lang.String extension)
extension
- the file extension to check
public boolean isHighlightable(java.lang.String fileExtension)
fileExtension
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |