%ZEN.application
Class %ZEN.application Extends (%RegisteredObject, %CSP.Page) [ CompileAfter = %ZEN.Generator, Deprecated, Inheritance = right, System = 3 ]
This class is used to define a ZEN application. This is an instantiable CSP page.
Parameters
APPLICATIONNAME
Parameter APPLICATIONNAME As STRING;
Optional name of this application.
If not defined, the class name of the application is used. This is used for display purposes within some utilities but it not used at run-time.
HOMEPAGE
Parameter HOMEPAGE As STRING;
This is the URL of the main starting page of this application.
JSINCLUDES
Parameter JSINCLUDES As STRING;
Comma-separated list of additional JS include files that should be included for every page within the application.
CSSINCLUDES
Parameter CSSINCLUDES As STRING;
Comma-separated list of additional CSS include files that should be included for every page within the application.
The CSS files will be included after any component style sheets and before styles defined by this application class or the page class.
CSS3INCLUDES
Parameter CSS3INCLUDES As STRING;
Comma-separated list of additional CSS3 include files that should be included for every page within the application.
This is used when the page uses CSS3. The CSS files will be included after any component style sheets and before styles defined by this application class or the page class.
USERPACKAGES
Parameter USERPACKAGES As STRING;
Comma-separated list of User class packages whose HTML class and style definitions are in pre-generated include files. These include files will be used by every page within the application.
USERSVGPACKAGES
Parameter USERSVGPACKAGES As STRING;
Comma-separated list of User class packages whose SVG class and style definitions are in pre-generated include files. These include files will be used by every applicable page within the application.
Properties
%StatusCode
Property %StatusCode As %Status;
Status code for this object. If a page encounters errors when trying to create the application object instance, this property will be set to an error code.
XDatas
Style
XData Style
Defines application-wide overrides for style sheets. Any styles defined here will be rendered as part of every page within the application.
Methods
OnPreHTTP
ClassMethod OnPreHTTP() As %Boolean [ ServerOnly = 1 ]
%GetApplicationName
ClassMethod %GetApplicationName()
Return the display name of this application class.
%GetUserPackages
ClassMethod %GetUserPackages(Output pUserPackages As %String, Output pUserSVGPackages As %String)
Return the USERPACKAGE and USERSVGPACKAGE lists defined for this application class.
OnPage
ClassMethod OnPage() As %Status [ ServerOnly = 1 ]
Default OnPage handler-- only called if no HOMEPAGE is defined for this application.
%DrawStyleHTML
ClassMethod %DrawStyleHTML(pSuper As %Boolean = 0, pCSSLevel As %Integer = 2) [ CodeMode = objectgenerator ]
Write out HTML/CSS style sheet defined for this application.
This is based on the XData block, Style.
This style sheet is used to provide application-wide overrides for styles.
%LinkCSS
ClassMethod %LinkCSS(pFile As %String) As %String [ CodeMode = expression ]
Return string used to include a CSS file. [Previously private]
%LinkScript
ClassMethod %LinkScript(pFile As %String) As %String [ CodeMode = expression ]
Return string used to include a script file. [Previously private]
%OnGetJSResources
Method %OnGetJSResources(ByRef pResources As %String) As %Status
Applications can implement this callback method in order to define a set of client-side resources: javascript strings that have been localized.
This is the same as the Zen page callback method except that it is shared by all pages within an application.
This method should fill in the array pResources with a set of localized strings, indexed by resource id:
Set pResources("MyId") = $$$Text("Some string")
Javascript methods can refer to these resources using the helper function zenGetResource: alert(zenText('MyId'));
Zen defines a set of built-in resource strings using this mechanism. These have a "zen" prefix to keep them seperate from user ids.
Be sure to define the DOMAIN for your application class if you override this method.