Package org.zkoss.zk.ui.impl
Class AbstractWebApp
java.lang.Object
org.zkoss.zk.ui.impl.AbstractWebApp
- All Implemented Interfaces:
org.zkoss.util.resource.Locator,Scope,WebAppCtrl,WebApp
- Direct Known Subclasses:
SimpleWebApp
A skeletal implementation of
WebApp.- Author:
- tomyeh
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Destroys this Web application.Returns the application name, never null.getAttribute(String name, boolean recurse) Returns the custom attribute associated with this object.Returns the AU decoder for this Web application, or null if not assigned.getBuild()Returns the build identifier, such as 2007121316.static final Stringfinal ConfigurationReturns the configuration.getDesktopCache(Session sess) Returns the desktop cache.Returns the desktop cache provider.Returns the failover manager, or null if not available.Returns the ID generator, or null if not available.Returns the session cache (never null).intgetSubversion(int portion) Returns a portion of the version in an integer by specifying its index.final UiEngineReturns the UI engine for this Web application (never null).Returns the UI factory for this Web application (never null).final StringReturns the ZK version, such as "1.1.0" and "2.0.0".booleanhasAttribute(String name, boolean recurse) Returns if a custom attribute is associated with this object.voidinit(Object context, Configuration config) Initializes this Web application.static StringLoads the build identifier.removeAttribute(String name, boolean recurse) Removes the custom attribute associated with this scope.voidsessionDestroyed(Session sess) Called when the native session of the specified session has been destroyedvoidsessionDidActivate(Session sess) voidsessionWillPassivate(Session sess) voidsetAppName(String name) Sets the application name.setAttribute(String name, Object value, boolean recurse) Sets the custom attribute associated with this scope, or the parent scope.voidsetAuDecoder(AuDecoder audec) Sets the AU decoder for this Web application.voidsetDesktopCacheProvider(DesktopCacheProvider provider) Sets the desktop provider for this Web application.voidsetFailoverManager(FailoverManager failover) Sets the failover manager for this Web application.voidsetIdGenerator(IdGenerator idgen) Sets the ID generator for this Web application.voidsetSessionCache(SessionCache cache) Sets the session cache for this Web application.voidsetUiEngine(UiEngine engine) Sets the UI engine for this Web application.voidsetUiFactory(UiFactory factory) Sets the UI factory for this Web application.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.zkoss.util.resource.Locator
getDirectoryMethods inherited from interface org.zkoss.zk.ui.ext.Scope
addScopeListener, hasAttribute, removeScopeListenerMethods inherited from interface org.zkoss.zk.ui.WebApp
getAttribute, getAttributes, getInitParameter, getInitParameterNames, getMimeType, getRealPath, getResource, getResourceAsStream, getResourcePaths, getResourceURI, getResourceURI, getServletContext, getUpdateURI, getUpdateURI, getWebApp, log, log, removeAttribute, setAttribute
-
Constructor Details
-
AbstractWebApp
protected AbstractWebApp()Constructor.Note: after constructed, it is not initialized completely. For example,
getConfiguration()returns null.WebManager will initialize it later such as initializing a
Configurationinstance by loading zk.xml, and then callinginit(java.lang.Object, org.zkoss.zk.ui.util.Configuration).
-
-
Method Details
-
getAppName
Description copied from interface:WebAppReturns the application name, never null. Developer can set it to any name that describes his application.Default: ZK
- Specified by:
getAppNamein interfaceWebApp
-
setAppName
Description copied from interface:WebAppSets the application name. Developer can set it to any name that describes his application.- Specified by:
setAppNamein interfaceWebApp
-
getVersion
Description copied from interface:WebAppReturns the ZK version, such as "1.1.0" and "2.0.0".- Specified by:
getVersionin interfaceWebApp- See Also:
-
WebApp.getSubversion(int)Utils.parseVersion(java.lang.String)Utils.compareVersion(int[], int[])
-
getBuild
Description copied from interface:WebAppReturns the build identifier, such as 2007121316.Each time ZK is built, a different build identifier is assigned.
-
getBuildStamp
-
getSubversion
public int getSubversion(int portion) Description copied from interface:WebAppReturns a portion of the version in an integer by specifying its index. For example, getSubversion(0) returns the so-called major version (2 in "2.4.0"), getSubversion(1) returns the so-called minor version (4 in "2.4.0"), and both getSubversion(2) and getSubversion(3) return 0.- Specified by:
getSubversionin interfaceWebApp- Parameters:
portion- which portion of the version; starting from 0. If you want to retrieve the major version, specify 0.- See Also:
-
getConfiguration
Description copied from interface:WebAppReturns the configuration.- Specified by:
getConfigurationin interfaceWebApp
-
getAttribute
Description copied from interface:ScopeReturns the custom attribute associated with this object.- Specified by:
getAttributein interfaceScoperecurse- whether to search its ancestor scope. If true and the current scope doen't define the attribute, it searches up its ancestor to see any of them has defined the specified attribute.
-
hasAttribute
Description copied from interface:ScopeReturns if a custom attribute is associated with this object.Notice that
nullis a valid value, so you can tell if an attribute is associated by examining the return value ofScope.getAttribute(java.lang.String).- Specified by:
hasAttributein interfaceScoperecurse- whether to search its ancestor scope. If true and the current scope doen't define the attribute, it searches up its ancestor to see any of them has defined the specified attribute.
-
setAttribute
Description copied from interface:ScopeSets the custom attribute associated with this scope, or the parent scope.- Specified by:
setAttributein interfaceScoperecurse- whether to look up the parent scope for the existence of the attribute.
If recurse is true and the attribute is defined in one of its ancestor (including page), the attribute is replaced. Otherwise, it is the same asScope.setAttribute(String,Object).
-
removeAttribute
Description copied from interface:ScopeRemoves the custom attribute associated with this scope.- Specified by:
removeAttributein interfaceScoperecurse- whether to look up the parent scope for the existence of the attribute.
If recurse is true and the attribute is defined in one of its ancestor (including page), the attribute is removed. Otherwise, it is the same asScope.removeAttribute(String).
-
init
Description copied from interface:WebAppCtrlInitializes this Web application.- Specified by:
initin interfaceWebAppCtrl- Parameters:
context- the servlet context, if servlets are used. Currently, ZK supports only servlets. In the future there might be more to support.config- the configuration (never null)
-
destroy
public void destroy()Description copied from interface:WebAppCtrlDestroys this Web application.Note; once destroyed, this instance cannot be used anymore.
- Specified by:
destroyin interfaceWebAppCtrl
-
getUiEngine
Description copied from interface:WebAppCtrlReturns the UI engine for this Web application (never null).- Specified by:
getUiEnginein interfaceWebAppCtrl
-
setUiEngine
Description copied from interface:WebAppCtrlSets the UI engine for this Web application. The UI engine is stateful so it is not safe to change it if there are active sessions.- Specified by:
setUiEnginein interfaceWebAppCtrl- Parameters:
engine- the UI engine
-
getDesktopCache
Description copied from interface:WebAppCtrlReturns the desktop cache. A shortcut ofWebAppCtrl.getDesktopCacheProvider()'sDesktopCacheProvider.getDesktopCache(org.zkoss.zk.ui.Session).- Specified by:
getDesktopCachein interfaceWebAppCtrl
-
getDesktopCacheProvider
Description copied from interface:WebAppCtrlReturns the desktop cache provider.- Specified by:
getDesktopCacheProviderin interfaceWebAppCtrl
-
setDesktopCacheProvider
Description copied from interface:WebAppCtrlSets the desktop provider for this Web application.- Specified by:
setDesktopCacheProviderin interfaceWebAppCtrl- Parameters:
provider- the desktop cache provider
-
getUiFactory
Description copied from interface:WebAppCtrlReturns the UI factory for this Web application (never null).- Specified by:
getUiFactoryin interfaceWebAppCtrl
-
setUiFactory
Description copied from interface:WebAppCtrlSets the UI factory for this Web application.- Specified by:
setUiFactoryin interfaceWebAppCtrl- Parameters:
factory- the UI factory
-
getFailoverManager
Description copied from interface:WebAppCtrlReturns the failover manager, or null if not available.- Specified by:
getFailoverManagerin interfaceWebAppCtrl
-
setFailoverManager
Description copied from interface:WebAppCtrlSets the failover manager for this Web application.- Specified by:
setFailoverManagerin interfaceWebAppCtrl- Parameters:
failover- the failover manager. If null, it means no failover manager at all.
-
getIdGenerator
Description copied from interface:WebAppCtrlReturns the ID generator, or null if not available.- Specified by:
getIdGeneratorin interfaceWebAppCtrl
-
setIdGenerator
Description copied from interface:WebAppCtrlSets the ID generator for this Web application.- Specified by:
setIdGeneratorin interfaceWebAppCtrl- Parameters:
idgen- the ID generator. If null, it means no (custom) ID generator at all.
-
getSessionCache
Description copied from interface:WebAppCtrlReturns the session cache (never null). The session cache is used to store ZK sessions.- Specified by:
getSessionCachein interfaceWebAppCtrl
-
setSessionCache
Description copied from interface:WebAppCtrlSets the session cache for this Web application.- Specified by:
setSessionCachein interfaceWebAppCtrl- Parameters:
cache- the session cache
-
getAuDecoder
Description copied from interface:WebAppCtrlReturns the AU decoder for this Web application, or null if not assigned.- Specified by:
getAuDecoderin interfaceWebAppCtrl
-
setAuDecoder
Description copied from interface:WebAppCtrlSets the AU decoder for this Web application.Default: null (using the system default).
- Specified by:
setAuDecoderin interfaceWebAppCtrl
-
sessionWillPassivate
InvokesgetDesktopCacheProvider()'sDesktopCacheProvider.sessionWillPassivate(org.zkoss.zk.ui.Session).- Specified by:
sessionWillPassivatein interfaceWebAppCtrl
-
sessionDidActivate
InvokesgetDesktopCacheProvider()'sDesktopCacheProvider.sessionDidActivate(org.zkoss.zk.ui.Session).- Specified by:
sessionDidActivatein interfaceWebAppCtrl
-
sessionDestroyed
Description copied from interface:WebAppCtrlCalled when the native session of the specified session has been destroyed- Specified by:
sessionDestroyedin interfaceWebAppCtrl
-
loadBuild
Loads the build identifier. This method is used only Internally
-