This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.

For information on migrating to InterSystems IRIS, see How to Migrate to InterSystems IRIS, available on the WRC Distributions page (login required).

%ZEN.Utils

class %ZEN.Utils extends %Library.RegisteredObject

This class contains various utility methods needed by the ZEN framework.

Method Inventory (Including Private)

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.
classmethod %DrawPropertyDescription(pClass As %String, pProperty As %String)
Write out description of the given property as HTML.
classmethod %FindComponentClassByName(pNamespace As %String, pName As %String) as %String
Given an xml namespace and a component name, return the class name of the corresponding Zen component.
classmethod %GenerateIncludeFiles(pPackage As %String, pType As %String = "") as %Status
Generate include files for a given Zen package.
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.
classmethod %GenerateSchema() as %Status
Generate XML schema information needed for StudioAssist.
classmethod %GetIncludeDirectory(Output pUrl As %String) as %String
Return the physical directory in which common include files are written.
classmethod %GetLinksInPage(pPage As %String, Output pList As %String)
Utility method. Return array of links within the given page class.
classmethod %GetPagesInApplication(pApplication As %String, Output pList As %String)
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.
classmethod %GetUserIncludeDirectory(Output pUrl As %String) as %String
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.
classmethod %IsPackageInCommonDirectory(pPackage As %String, Output pCommon As %Boolean) as %Status
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.
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).
classmethod %ParseFormalSpec(pSpec As %String) as %List
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.
classmethod %ReadStreamIntoString(pStream As %Stream, Output pOverflow As %Boolean) as %String
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 ComponentDetailsClose(ByRef qHandle As %Binary) as %Status
classmethod ComponentDetailsExecute(ByRef qHandle As %Binary, pClass As %String) as %Status
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.
classmethod CreateZENPageClass(pPage As %String, pAppClass As %String) as %Status
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 EnumerateApplicationsClose(ByRef qHandle As %Binary) as %Status
classmethod EnumerateApplicationsExecute(ByRef qHandle As %Binary) as %Status
classmethod EnumerateApplicationsFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) as %Status
classmethod EnumerateComponentsClose(ByRef qHandle As %Binary) 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 EnumerateLogClose(ByRef qHandle As %Binary) as %Status
classmethod EnumerateLogExecute(ByRef qHandle As %Binary) as %Status
classmethod EnumerateLogFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) as %Status
classmethod EnumeratePackagesClose(ByRef qHandle As %Binary) as %Status
classmethod EnumeratePackagesExecute(ByRef qHandle As %Binary, pFilter As %String = "") 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
classmethod GetCSSInfo(ByRef pInfo, pType As %String = "HTML") as %Status
Get CSS info from generated CSS files. pType is "HTML" or "SVG". (ignored) Fills in array pInfo as follows:
pInfo(class,style) = comment
classmethod GetComponentAttrs(comp As %String, ByRef attrs, ByRef cats) as %Boolean
Get list of attributes used by ZEN component comp.
Returns true if the component is defined.
classmethod GetDefault(pSetting As %String, pDefault As %String = "") as %String
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.
classmethod IsComponentEmpty(pClass As %String) as %Boolean
Determine if component class uses an empty XML element (i.e., does not have child elements).
classmethod IsPage(pClass As %String) as %Boolean
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)
classmethod ParseCSSFile(pFileName As %String, ByRef pInfo) as %Status
Utility method. Opens CSS file, pFileName, and finds all the CSS declarations in it. Fills in array pInfo as follows:
pInfo(class,style) = comment
classmethod SetDefault(pSetting As %String, pName As %String)
Set default value of named property (used by Wizards).
classmethod SetDefaultApplication(pName As %String) as %String
Set default application name (used by Wizards).
classmethod SetDefaultDomain(pName As %String) as %String
Set default domain name (used by Wizards).
classmethod SetDefaultPackage(pName As %String) as %String
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.
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.
classmethod WriteXMLSchema(pFile As %String = "") as %Status
Write out the XML schema for a ZEN page definition

Queries

query ComponentDetails(pClass As %String)
Selects Name As %String, Type As %String, Description As %String, Category As %String
Returns a list of properties within a given ZEN component.
query EnumerateApplications()
Selects ClassName As %String, Name As %String
Returns a list of available ZEN application classes as well as logical application name.
query EnumerateComponents(pParentClass As %String)
Selects ClassName As %String, Name As %String, NameSpace As %String, Empty As %Boolean
Returns a list of available ZEN 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 (Including Private)

Feedback