Home > Class Reference > %SYS namespace > %ZEN.Utils

%ZEN.Utils

class %ZEN.Utils extends %Library.RegisteredObject

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

Method Inventory

Parameters

parameter DOMAIN = %ZEN;

Methods

classmethod %BrowserSupportsHTML5(pUserAgent As %String = {$select($IsObject($get(%request)) As %request.UserAgent, 1 As "")}) as %Boolean [ Language = objectscript ]
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) [ Language = objectscript ]
Display a status code within an HTML element.
classmethod %DisplayErrorJS(pObject As %RegisteredObject, tSC As %Status) [ Language = objectscript ]
Display a status code within JavaScript alert box.
classmethod %DisplayErrorSVG(pObject As %RegisteredObject, tSC As %Status) [ Language = objectscript ]
Display a status code within an SVG element.
classmethod %DrawClassDescription(pClass As %String) [ Language = objectscript ]
Write out description of the given class as HTML.
classmethod %DrawPropertyDescription(pClass As %String, pProperty As %String) [ Language = objectscript ]
Write out description of the given property as HTML.
classmethod %FindComponentClassByName(pNamespace As %String, pName As %String) as %String [ Language = objectscript ]
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 [ Language = objectscript ]
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 [ Language = objectscript ]
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 [ Language = objectscript ]
Generate XML schema information needed for StudioAssist.
classmethod %GetIncludeDirectory(Output pUrl As %String) as %String [ Language = objectscript ]
Return the physical directory in which common include files are written.
classmethod %GetLinksInPage(pPage As %String, Output pList As %String) [ Language = objectscript ]
Utility method. Return array of links within the given page class.
classmethod %GetPagesInApplication(pApplication As %String, Output pList As %String) [ Language = objectscript ]
Return array of pages within the given application class.
classmethod %GetPhysicalIncludeDirectory(pPackage As %String, Output pStatus As %Status, Output pUrl As %String) as %String [ Language = objectscript ]
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 [ Language = objectscript ]
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 [ Language = objectscript ]
Return the directory in which user include files are written.
classmethod %InvalidateSchema() as %Status [ Language = objectscript ]
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 [ Language = objectscript ]
Test if include files for the given class package should be placed in the common directory.
classmethod %JavaInstalled() as %Status [ Language = objectscript ]
Helper method to determine whether java is installed Wraps ##class(%Net.Remote.Service).GetJavaVersion() to provide clear error message ZenMethod wrapper is defined in %ZEN.Component.abstractPage Returns a $$$OK if Java is installed
classmethod %Log(pType As %String, pClass As %String, pMethod As %String, pMessage As %String, pObject As %ZEN.Component.object = "") [ Language = objectscript ]
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 [ Language = objectscript ]
Test if Zen event log is enabled.
classmethod %ObjectToXML(pStream As %Stream.GlobalCharacter, pObject As %ZEN.Component.object, ByRef pNSList, pLevel As %Integer = 1) [ Language = objectscript ]
Serialize a component to XML. Used by the %PageToXML() method.
classmethod %PageToXML(pStream As %Stream.GlobalCharacter, pPage As %ZEN.Component.page) as %Status [ Language = objectscript ]
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 [ Language = objectscript ]
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 [ Language = objectscript ]
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 [ Language = objectscript ]
classmethod %ShowLog() [ Language = objectscript ]
Write out the Zen event log to the console.
classmethod %StartLog() [ Language = objectscript ]
Turn on the Zen event log. This has the side effect of clearing the event log.
classmethod %StopLog() [ Language = objectscript ]
Turn off the Zen event log.
classmethod BuildCSSString(ByRef pParse) as %String [ Language = objectscript ]
Take an array of parsed CSS declarations and combine them into a single string.
classmethod ComponentDetailsClose(ByRef qHandle As %Binary) as %Status [ Language = objectscript ]
classmethod ComponentDetailsExecute(ByRef qHandle As %Binary, pClass As %String) as %Status [ Language = objectscript ]
classmethod ComponentDetailsFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) as %Status [ Language = objectscript ]
classmethod ConstructClassGraph(pTopClass As %String, ByRef pGraph, pFilter As %String = "", pParentNode="") [ Language = objectscript ]
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 [ Language = objectscript ]
Called by wizards. Create a new ZEN page class.
classmethod DrawClassDefinition(pClass As %String) [ Language = objectscript ]
Wrapper to invoke %DrawClassDefinition method for a class. [Previously private]
classmethod EnumerateApplicationsClose(ByRef qHandle As %Binary) as %Status [ Language = objectscript ]
classmethod EnumerateApplicationsExecute(ByRef qHandle As %Binary) as %Status [ Language = objectscript ]
classmethod EnumerateApplicationsFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) as %Status [ Language = objectscript ]
classmethod EnumerateComponentsClose(ByRef qHandle As %Binary) as %Status [ Language = objectscript ]
classmethod EnumerateComponentsExecute(ByRef qHandle As %Binary, pParentClass As %String = "") as %Status [ Language = objectscript ]
classmethod EnumerateComponentsFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) as %Status [ Language = objectscript ]
classmethod EnumerateLogClose(ByRef qHandle As %Binary) as %Status [ Language = objectscript ]
classmethod EnumerateLogExecute(ByRef qHandle As %Binary) as %Status [ Language = objectscript ]
classmethod EnumerateLogFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) as %Status [ Language = objectscript ]
classmethod EnumeratePackagesClose(ByRef qHandle As %Binary) as %Status [ Language = objectscript ]
classmethod EnumeratePackagesExecute(ByRef qHandle As %Binary, pFilter As %String = "") as %Status [ Language = objectscript ]
classmethod EnumeratePackagesFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) as %Status [ Language = objectscript ]
classmethod GenerateSchema() as %Status [ Language = objectscript ]
Generate the ZEN XML schema file
classmethod GetCSSInfo(ByRef pInfo, pType As %String = "HTML") as %Status [ Language = objectscript ]
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 [ Language = objectscript ]
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 [ Language = objectscript ]
Return default value of named property (used by Wizards).
classmethod GetDefaultApplication() as %String [ Language = objectscript ]
Return default application name (used by Wizards).
classmethod GetDefaultDomain() as %String [ Language = objectscript ]
Return default domain name (used by Wizards).
classmethod GetDefaultPackage() as %String [ Language = objectscript ]
Return default package name (used by Wizards).
classmethod GetSchemaFile() as %String [ Language = objectscript ]
Return file path for the ZEN XML Schema.
classmethod IsComponentEmpty(pClass As %String) as %Boolean [ Language = objectscript ]
Determine if component class uses an empty XML element (i.e., does not have child elements).
classmethod IsPage(pClass As %String) as %Boolean [ Language = objectscript ]
Determine if this component class is a page.
classmethod ParseCSS(pText As %String, Output pParse) [ Language = objectscript ]
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 [ Language = objectscript ]
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) [ Language = objectscript ]
Set default value of named property (used by Wizards).
classmethod SetDefaultApplication(pName As %String) as %String [ Language = objectscript ]
Set default application name (used by Wizards).
classmethod SetDefaultDomain(pName As %String) as %String [ Language = objectscript ]
Set default domain name (used by Wizards).
classmethod SetDefaultPackage(pName As %String) as %String [ Language = objectscript ]
Set default package name (used by Wizards).
classmethod WriteCSSForComponent(pClassName As %String, pStyleBlock As %String = "Style") as %Status [ Language = objectscript ]
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 [ Language = objectscript ]
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 [ Language = objectscript ]
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

FeedbackOpens in a new window