%ZEN.Utils
class %ZEN.Utils extends %Library.RegisteredObject
This class contains various utility methods needed by the ZEN framework.Method Inventory
- %BrowserSupportsHTML5()
- %DisplayErrorHTML()
- %DisplayErrorJS()
- %DisplayErrorSVG()
- %DrawClassDescription()
- %DrawPropertyDescription()
- %FindComponentClassByName()
- %GenerateIncludeFiles()
- %GenerateIncludeFilesForModules()
- %GenerateSchema()
- %GetIncludeDirectory()
- %GetLinksInPage()
- %GetPagesInApplication()
- %GetPhysicalIncludeDirectory()
- %GetPropertyValue()
- %GetUserIncludeDirectory()
- %InvalidateSchema()
- %IsPackageInCommonDirectory()
- %Log()
- %LoggingEnabled()
- %ObjectToXML()
- %PageToXML()
- %ParseFormalSpec()
- %ReadStreamIntoString()
- %SavePage()
- %ShowLog()
- %StartLog()
- %StopLog()
- BuildCSSString()
- ComponentDetailsClose()
- ComponentDetailsExecute()
- ComponentDetailsFetch()
- ConstructClassGraph()
- CreateZENPageClass()
- DrawClassDefinition()
- EnumerateApplicationsClose()
- EnumerateApplicationsExecute()
- EnumerateApplicationsFetch()
- EnumerateComponentsClose()
- EnumerateComponentsExecute()
- EnumerateComponentsFetch()
- EnumerateLogClose()
- EnumerateLogExecute()
- EnumerateLogFetch()
- EnumeratePackagesClose()
- EnumeratePackagesExecute()
- EnumeratePackagesFetch()
- GenerateSchema()
- GetCSSInfo()
- GetComponentAttrs()
- GetDefault()
- GetDefaultApplication()
- GetDefaultDomain()
- GetDefaultPackage()
- GetSchemaFile()
- IsComponentEmpty()
- IsPage()
- ParseCSS()
- ParseCSSFile()
- SetDefault()
- SetDefaultApplication()
- SetDefaultDomain()
- SetDefaultPackage()
- WriteCSSForComponent()
- WriteIncludeFilesForModule()
- WriteXMLSchema()
Parameters
parameter DOMAIN = %ZEN;
Methods
classmethod %BrowserSupportsHTML5(pUserAgent As %String = {$select($IsObject($get(%request)) As %request.UserAgent, 1 As "")}) as %Boolean
Helper method to determine whether the UserAgent in pUserAgent
supports HTML5. If pUserAgent is not supplied and the
%request
object exists,
the value of pUserAgent defaults to %request.UserAgent
.
classmethod %DisplayErrorHTML(pObject As %RegisteredObject, tSC As %Status)
Display a status code within an HTML element.
classmethod %DisplayErrorJS(pObject As %RegisteredObject, tSC As %Status)
Display a status code within JavaScript alert box.
classmethod %DisplayErrorSVG(pObject As %RegisteredObject, tSC As %Status)
Display a status code within an SVG element.
classmethod %DrawClassDescription(pClass As %String)
Write out description of the given class as HTML.
Write out description of the given property as HTML.
Given an xml namespace and a component name, return the class name
of the corresponding Zen component.
Generate include files for a given Zen package.
pPackage is the package name.
pPackage is the package name.
classmethod %GenerateIncludeFilesForModules(pPackage As %String, ByRef pModules, pAll As %Boolean = 0, pDisplay As %Boolean = 1) as %Status
Generate include files for a given Zen package and
list of modules.
pPackage is the package name.
pModules is a list of module names by package.
If pAll is true, then process all modules in the given package.
pPackage is the package name.
pModules is a list of module names by package.
If pAll is true, then process all modules in the given package.
classmethod %GenerateSchema() as %Status
Generate XML schema information needed for StudioAssist.
Return the physical directory in which common include files are written.
Utility method.
Return array of links within the given page class.
Return array of pages within the given application class.
classmethod %GetPhysicalIncludeDirectory(pPackage As %String, Output pStatus As %Status, Output pUrl As %String) as %String
Given a package name, return the physical directory into
which include files should be generated.
classmethod %GetPropertyValue(pObject As %ZEN.Component.object, pPropName As %String, Output pValue As %String) as %Status
Internal method: get value for a given
property of a given object. If the value is the default
do not set pValue.
Return the directory in which user include files are written.
classmethod %InvalidateSchema() as %Status
Invalidate the XML schema information needed for StudioAssist.
Studio will rebuild this information when user loads a document
in this namespace.
Test if include files for the given class package should be placed in the common
directory.
classmethod %Log(pType As %String, pClass As %String, pMethod As %String, pMessage As %String, pObject As %ZEN.Component.object = "")
Write information to the Zen event log.
pType is the type of event (a string such as "ERROR").
pClass is the class logging the event.
pMethod is the method logging the event.
pMessage is a message to log.
pObject, if present, is the object that is logging the event.
pClass is the class logging the event.
pMethod is the method logging the event.
pMessage is a message to log.
pObject, if present, is the object that is logging the event.
classmethod %LoggingEnabled() as %Boolean
Test if Zen event log is enabled.
classmethod %ObjectToXML(pStream As %Stream.GlobalCharacter, pObject As %ZEN.Component.object, ByRef pNSList, pLevel As %Integer = 1)
Serialize a component to XML. Used by the %PageToXML() method.
classmethod %PageToXML(pStream As %Stream.GlobalCharacter, pPage As %ZEN.Component.page) as %Status
Serialize a page object to an XML format compatible for
use within an XData Contents block.
This does not use the normal XML adaptor as it has special requirments (such as formatting and skipping properties with default values).
This does not use the normal XML adaptor as it has special requirments (such as formatting and skipping properties with default values).
Parse a formal spec (used by the delegator datatype class)
of the form: arg:type,arg:type, and return a $list as used
by the class compiler.
Given a stream, read its contents into a string.
If the stream does not fit, set pOverflow to 1.
classmethod %SavePage(pTargetPage As %ZEN.Component.page) as %Status
classmethod %ShowLog()
Write out the Zen event log to the console.
classmethod %StartLog()
Turn on the Zen event log.
This has the side effect of clearing the event log.
classmethod %StopLog()
Turn off the Zen event log.
classmethod BuildCSSString(ByRef pParse) as %String
Take an array of parsed CSS declarations and combine them into a single string.
classmethod ComponentDetailsFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) as %Status
classmethod ConstructClassGraph(pTopClass As %String, ByRef pGraph, pFilter As %String = "", pParentNode="")
Create a graph of a class pTopClass and its subclasses.
pFilter limits the search candidates: only classes that start with the filter value are considered.
pFilter limits the search candidates: only classes that start with the filter value are considered.
Called by wizards. Create a new ZEN page class.
classmethod DrawClassDefinition(pClass As %String)
Wrapper to invoke %DrawClassDefinition method for a class.
[Previously private]
classmethod EnumerateApplicationsFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) as %Status
classmethod EnumerateComponentsExecute(ByRef qHandle As %Binary, pParentClass As %String = "") as %Status
classmethod EnumerateComponentsFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) as %Status
classmethod EnumerateLogFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) as %Status
classmethod EnumeratePackagesFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) as %Status
classmethod GenerateSchema() as %Status
Generate the ZEN XML schema file
Get CSS info from generated CSS files.
pType is "HTML" or "SVG". (ignored)
Fills in array pInfo as follows:
pInfo(class,style) = comment
pInfo(class,style) = comment
Get list of attributes used by ZEN component comp.
Returns true if the component is defined.
Returns true if the component is defined.
Return default value of named property (used by Wizards).
classmethod GetDefaultApplication() as %String
Return default application name (used by Wizards).
classmethod GetDefaultDomain() as %String
Return default domain name (used by Wizards).
classmethod GetDefaultPackage() as %String
Return default package name (used by Wizards).
classmethod GetSchemaFile() as %String
Return file path for the ZEN XML Schema.
Determine if component class uses an empty XML element
(i.e., does not have child elements).
Determine if this component class is a page.
classmethod ParseCSS(pText As %String, Output pParse)
Utility method to parse a string, pText, containing one or more
CSS declarations.
Returns an array of parsed declarations in the form:
pParse(n) = $LB(prop,val)
pParse(n) = $LB(prop,val)
Utility method. Opens CSS file, pFileName, and finds all the
CSS declarations in it.
Fills in array pInfo as follows:
pInfo(class,style) = comment
pInfo(class,style) = comment
Set default value of named property (used by Wizards).
Set default application name (used by Wizards).
Set default domain name (used by Wizards).
Set default package name (used by Wizards).
classmethod WriteCSSForComponent(pClassName As %String, pStyleBlock As %String = "Style") as %Status
Write out the contents of the default CSS Style sheet for
a component.
This is used when pre-building a .css file for a package. pStyleBlock is the name of the XData block containing the CSS style definition.
This is used when pre-building a .css file for a package. pStyleBlock is the name of the XData block containing the CSS style definition.
classmethod WriteIncludeFilesForModule(pDirectory As %String, pModule As %String, ByRef pWorkList, pFlags As %String = "") as %Status
Utility method to write out JS and CSS Style Sheet files
for classes within a given module (contained in pWorkList.
If pFlags contains "-d", then no output is written. If pFlags contains "-s", then output is not stripped.
If pFlags contains "-d", then no output is written. If pFlags contains "-s", then output is not stripped.
Write out the XML schema for a ZEN page definition
Queries
query ComponentDetails(pClass As %String)
Returns a list of properties within a given ZEN component.
query EnumerateApplications()
Returns a list of available ZEN application classes
as well as logical application name.
query EnumerateComponents(pParentClass As %String)
Returns a list of available ZEN components.
This does *not* include any page components.
This does *not* include any page components.
query EnumerateLog()
Selects Time As %String, Type As %String, Job As %Integer, Namespace As %String, Class As %String, Method As %String, Message As %String, Object As %String
Returns a list of events from the Zen event log.
query EnumeratePackages(pFilter As %String = "")
Selects Name As %String
Returns a list of class packages (that start with pFilter).
Does not return % packages unless pFilter starts with "%".
Inherited Members
Inherited Methods
- %AddToSaveSet()
- %ClassIsLatestVersion()
- %ClassName()
- %ConstructClone()
- %DispatchClassMethod()
- %DispatchGetModified()
- %DispatchGetProperty()
- %DispatchMethod()
- %DispatchSetModified()
- %DispatchSetMultidimProperty()
- %DispatchSetProperty()
- %Extends()
- %GetParameter()
- %IsA()
- %IsModified()
- %New()
- %NormalizeObject()
- %ObjectModified()
- %OriginalNamespace()
- %PackageName()
- %RemoveFromSaveSet()
- %SerializeObject()
- %SetModified()
- %ValidateObject()