|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.click.service.XmlConfigService
Provides a Click XML configuration service class.
This class reads Click configuration information from a file named click.xml. The service will first lookup the click.xml under the applications WEB-INF directory, and if not found attempt to load the configuration file from the classpath root. Configuring Click through the click.xml file is the most common technique. However you can instruct Click to use a different service implementation. Please seeConfigService for more details.
| Nested Class Summary | |
static class |
XmlConfigService.ExcludePage
Provide an Excluded Page class. |
| Field Summary |
| Fields inherited from interface net.sf.click.service.ConfigService |
CONTEXT_NAME, ERROR_PATH, MODE_DEBUG, MODE_DEVELOPMENT, MODE_PRODUCTION, MODE_PROFILE, MODE_TRACE, NOT_FOUND_PATH |
| Constructor Summary | |
XmlConfigService()
|
|
| Method Summary | |
Format |
createFormat()
Create and return a new format object instance. |
String |
getApplicationMode()
Return the application mode String value: ["production", "profile", "development", "debug"]. |
String |
getCharset()
Return the Click application charset or null if not defined. |
Class |
getErrorPageClass()
Return the error handling page Page Class. |
FileUploadService |
getFileUploadService()
Return the application file upload service, which is used to parse multi-part file upload post requests. |
Locale |
getLocale()
Return the Click application locale or null if not defined. |
LogService |
getLogService()
Return the Click application log service. |
Class |
getNotFoundPageClass()
Return the page not found Page Class. |
Class |
getPageClass(String path)
Return the page Class for the given path. |
List |
getPageClassList()
Return the list of configured page classes. |
Field |
getPageField(Class pageClass,
String fieldName)
Return the public field of the given name for the pageClass, or null if not defined. |
Field[] |
getPageFieldArray(Class pageClass)
Return an array public fields for the given page class. |
Map |
getPageFields(Class pageClass)
Return Map of public fields for the given page class. |
Map |
getPageHeaders(String path)
Return the headers of the page for the given path. |
String |
getPagePath(Class pageClass)
Return the path for the given page Class. |
ServletContext |
getServletContext()
Return the application servlet context. |
TemplateService |
getTemplateService()
Return the application templating service. |
boolean |
isJspPage(String path)
Return true if JSP exists for the given ".htm" path. |
boolean |
isPagesAutoBinding()
Return true if auto binding is enabled. |
boolean |
isProductionMode()
Return true if the application is in "production" mode. |
boolean |
isProfileMode()
Return true if the application is in "profile" mode. |
void |
onDestroy()
Destroy the ConfigurationService. |
void |
onInit(ServletContext servletContext)
Initialize the ConfigurationService with the given application servlet context. |
InputSource |
resolveEntity(String publicId,
String systemId)
This method resolves the click.dtd for the XML parser using the classpath resource: /net/sf/click/click.dtd. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public XmlConfigService()
| Method Detail |
public void onInit(ServletContext servletContext)
throws Exception
ConfigService
onInit in interface ConfigServiceservletContext - the application servlet context
Exception - if an error occurs initializing the applicationConfigService.onInit(ServletContext)public void onDestroy()
ConfigService
onDestroy in interface ConfigServiceConfigService.onDestroy()public String getApplicationMode()
getApplicationMode in interface ConfigServicepublic String getCharset()
ConfigService
getCharset in interface ConfigServiceConfigService.getCharset()public FileUploadService getFileUploadService()
ConfigService
getFileUploadService in interface ConfigServiceConfigService.getFileUploadService()public TemplateService getTemplateService()
ConfigService
getTemplateService in interface ConfigServiceConfigService.getTemplateService()public Format createFormat()
ConfigService
createFormat in interface ConfigServiceConfigService.createFormat()public Locale getLocale()
ConfigService
getLocale in interface ConfigServiceConfigService.getLocale()public LogService getLogService()
ConfigService
getLogService in interface ConfigServiceConfigService.getLogService()public boolean isPagesAutoBinding()
ConfigService
isPagesAutoBinding in interface ConfigServiceConfigService.isPagesAutoBinding()public boolean isProductionMode()
ConfigService
isProductionMode in interface ConfigServiceConfigService.isProductionMode()public boolean isProfileMode()
ConfigService
isProfileMode in interface ConfigServiceConfigService.isProfileMode()public boolean isJspPage(String path)
ConfigService
isJspPage in interface ConfigServicepath - the Page ".htm" path
ConfigService.isJspPage(String)public Class getPageClass(String path)
ConfigService
getPageClass in interface ConfigServicepath - the page path
ConfigService.getPageClass(String)public String getPagePath(Class pageClass)
ConfigService
getPagePath in interface ConfigServicepageClass - the page class
IllegalArgumentException - if the Page Class is not configured
with a unique pathConfigService.getPagePath(Class)public List getPageClassList()
ConfigService
getPageClassList in interface ConfigServiceConfigService.getPageClassList()public Map getPageHeaders(String path)
ConfigService
getPageHeaders in interface ConfigServicepath - the path of the page
ConfigService.getPageHeaders(String)public Class getNotFoundPageClass()
ConfigService
getNotFoundPageClass in interface ConfigServiceConfigService.getNotFoundPageClass()public Class getErrorPageClass()
ConfigService
getErrorPageClass in interface ConfigServiceConfigService.getErrorPageClass()
public Field getPageField(Class pageClass,
String fieldName)
ConfigService
getPageField in interface ConfigServicepageClass - the page classfieldName - the name of the field
ConfigService.getPageField(Class, String)public Field[] getPageFieldArray(Class pageClass)
ConfigService
getPageFieldArray in interface ConfigServicepageClass - the page class
ConfigService.getPageFieldArray(Class)public Map getPageFields(Class pageClass)
ConfigService
getPageFields in interface ConfigServicepageClass - the page class
ConfigService.getPageFields(Class)public ServletContext getServletContext()
ConfigService
getServletContext in interface ConfigServiceConfigService.getServletContext()
public InputSource resolveEntity(String publicId,
String systemId)
throws SAXException,
IOException
resolveEntity in interface EntityResolverpublicId - the DTD public idsystemId - the DTD system id
SAXException - if an error occurs parsing the document
IOException - if an error occurs reading the documentEntityResolver.resolveEntity(String, String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||