Class AbstractWebApp

    • Method Detail

      • getAppName

        public java.lang.String getAppName()
        Description copied from interface: WebApp
        Returns the application name, never null. Developer can set it to any name that describes his application.

        Default: ZK

        Specified by:
        getAppName in interface WebApp
      • setAppName

        public void setAppName​(java.lang.String name)
        Description copied from interface: WebApp
        Sets the application name. Developer can set it to any name that describes his application.
        Specified by:
        setAppName in interface WebApp
      • getBuild

        public java.lang.String getBuild()
        Description copied from interface: WebApp
        Returns the build identifier, such as 2007121316.

        Each time ZK is built, a different build identifier is assigned.

        Specified by:
        getBuild in interface WebApp
      • getBuildStamp

        public static final java.lang.String getBuildStamp()
      • getSubversion

        public int getSubversion​(int portion)
        Description copied from interface: WebApp
        Returns 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:
        getSubversion in interface WebApp
        Parameters:
        portion - which portion of the version; starting from 0. If you want to retrieve the major version, specify 0.
        See Also:
        WebApp.getVersion()
      • getAttribute

        public java.lang.Object getAttribute​(java.lang.String name,
                                             boolean recurse)
        Description copied from interface: Scope
        Returns the custom attribute associated with this object.
        Specified by:
        getAttribute in interface Scope
        recurse - 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

        public boolean hasAttribute​(java.lang.String name,
                                    boolean recurse)
        Description copied from interface: Scope
        Returns if a custom attribute is associated with this object.

        Notice that null is a valid value, so you can tell if an attribute is associated by examining the return value of Scope.getAttribute(java.lang.String).

        Specified by:
        hasAttribute in interface Scope
        recurse - 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

        public java.lang.Object setAttribute​(java.lang.String name,
                                             java.lang.Object value,
                                             boolean recurse)
        Description copied from interface: Scope
        Sets the custom attribute associated with this scope, or the parent scope.
        Specified by:
        setAttribute in interface Scope
        recurse - 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 as Scope.setAttribute(String,Object).
      • removeAttribute

        public java.lang.Object removeAttribute​(java.lang.String name,
                                                boolean recurse)
        Description copied from interface: Scope
        Removes the custom attribute associated with this scope.
        Specified by:
        removeAttribute in interface Scope
        recurse - 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 as Scope.removeAttribute(String).
      • init

        public void init​(java.lang.Object context,
                         Configuration config)
        Description copied from interface: WebAppCtrl
        Initializes this Web application.
        Specified by:
        init in interface WebAppCtrl
        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: WebAppCtrl
        Destroys this Web application.

        Note; once destroyed, this instance cannot be used anymore.

        Specified by:
        destroy in interface WebAppCtrl
      • getUiEngine

        public final UiEngine getUiEngine()
        Description copied from interface: WebAppCtrl
        Returns the UI engine for this Web application (never null).
        Specified by:
        getUiEngine in interface WebAppCtrl
      • setUiEngine

        public void setUiEngine​(UiEngine engine)
        Description copied from interface: WebAppCtrl
        Sets 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:
        setUiEngine in interface WebAppCtrl
        Parameters:
        engine - the UI engine
      • getUiFactory

        public UiFactory getUiFactory()
        Description copied from interface: WebAppCtrl
        Returns the UI factory for this Web application (never null).
        Specified by:
        getUiFactory in interface WebAppCtrl
      • setUiFactory

        public void setUiFactory​(UiFactory factory)
        Description copied from interface: WebAppCtrl
        Sets the UI factory for this Web application.
        Specified by:
        setUiFactory in interface WebAppCtrl
        Parameters:
        factory - the UI factory
      • setFailoverManager

        public void setFailoverManager​(FailoverManager failover)
        Description copied from interface: WebAppCtrl
        Sets the failover manager for this Web application.
        Specified by:
        setFailoverManager in interface WebAppCtrl
        Parameters:
        failover - the failover manager. If null, it means no failover manager at all.
      • setIdGenerator

        public void setIdGenerator​(IdGenerator idgen)
        Description copied from interface: WebAppCtrl
        Sets the ID generator for this Web application.
        Specified by:
        setIdGenerator in interface WebAppCtrl
        Parameters:
        idgen - the ID generator. If null, it means no (custom) ID generator at all.
      • getSessionCache

        public SessionCache getSessionCache()
        Description copied from interface: WebAppCtrl
        Returns the session cache (never null). The session cache is used to store ZK sessions.
        Specified by:
        getSessionCache in interface WebAppCtrl
      • setSessionCache

        public void setSessionCache​(SessionCache cache)
        Description copied from interface: WebAppCtrl
        Sets the session cache for this Web application.
        Specified by:
        setSessionCache in interface WebAppCtrl
        Parameters:
        cache - the session cache
      • getAuDecoder

        public AuDecoder getAuDecoder()
        Description copied from interface: WebAppCtrl
        Returns the AU decoder for this Web application, or null if not assigned.
        Specified by:
        getAuDecoder in interface WebAppCtrl
      • setAuDecoder

        public void setAuDecoder​(AuDecoder audec)
        Description copied from interface: WebAppCtrl
        Sets the AU decoder for this Web application.

        Default: null (using the system default).

        Specified by:
        setAuDecoder in interface WebAppCtrl
      • sessionDestroyed

        public void sessionDestroyed​(Session sess)
        Description copied from interface: WebAppCtrl
        Called when the native session of the specified session has been destroyed
        Specified by:
        sessionDestroyed in interface WebAppCtrl
      • loadBuild

        public static java.lang.String loadBuild()
        Loads the build identifier. This method is used only Internally