Skip to main content

%ZEN.Mojo.basePage

class %ZEN.Mojo.basePage extends %ZEN.Mojo.abstractPage

Base page for pages within Zen Mojo. This pages provides a standard layout and set of base components.

Property Inventory

Method Inventory

Parameters

parameter ALLOWMOBILE = 0;
This restricts mobile access to this page Calls with WMOBILE=1 are only allowed if this is set to 1
parameter APPLICATION = %ZEN.Mojo.baseApplication;
Class name of application this page belongs to. This is set by the %OnCreateApplication method.
parameter PAGENAME = Zen Mojo;
Displayed name of this page. Overriden by application class.
parameter PROVIDERLIST = data,layout;
List of JSON providers created for this page. Used by contentProvider.
parameter TEMPLATECLASS;
Starting template class for this page Used by contentProvider. This is overriden by application settings, if provided.

Properties

property remoteBrokerAddress as %ZEN.Datatype.string;
Should point to your remote server broker file e.g. "http://yourcorporateserver:port/csp/yourcspapp/%25CSP.Broker.cls"
Property methods: remoteBrokerAddressDisplayToLogical(), remoteBrokerAddressGet(), remoteBrokerAddressIsValid(), remoteBrokerAddressLogicalToDisplay(), remoteBrokerAddressLogicalToOdbc(), remoteBrokerAddressNormalize(), remoteBrokerAddressSet()
property remoteNamespace as %ZEN.Datatype.string;
Should point to the namespace of your remote server you want to connect to.
Property methods: remoteNamespaceDisplayToLogical(), remoteNamespaceGet(), remoteNamespaceIsValid(), remoteNamespaceLogicalToDisplay(), remoteNamespaceLogicalToOdbc(), remoteNamespaceNormalize(), remoteNamespaceSet()
property templateDispatchBaseNamespace as %ZEN.Datatype.string [ InitialExpression = "http://www.intersystems.com/zen/mojo" ];
If templateDispatchMode is set to true this is the base xml namespace which is used for loading templates. The name of the content provider will be added automatically.
Property methods: templateDispatchBaseNamespaceDisplayToLogical(), templateDispatchBaseNamespaceGet(), templateDispatchBaseNamespaceIsValid(), templateDispatchBaseNamespaceLogicalToDisplay(), templateDispatchBaseNamespaceLogicalToOdbc(), templateDispatchBaseNamespaceNormalize(), templateDispatchBaseNamespaceSet()
property templateDispatchMode as %ZEN.Datatype.boolean [ InitialExpression = 0 ];
If this property is set to true the page will automatically dispatch getContent() requests to different templates based on contentProvider name and key. templateDispatchBaseNamespace needs to be set if this property is true. The contentProvider name will be added to the templateDispatchBaseNamespace used for loading a template within this xml namespace and the requested key as a classname. If the templateDispatchBaseNamespace is "http://www.intersystems.com/zen/mojo/sample" and the PROVIDERLIST lists "data,layout" a getContent() call for contentProvider 'data' and key 'home' will load a template in the xml namespace "http://www.intersystems.com/zen/mojo/sample/data" and the class name "home" before the template method onGetContent gets invoked. Following the same approach a getContent() call for contentProvider 'layout' and key 'home' will load a template in the xml namespace "http://www.intersystems.com/zen/mojo/sample/layout" and the class name "home".
Property methods: templateDispatchModeDisplayToLogical(), templateDispatchModeGet(), templateDispatchModeIsValid(), templateDispatchModeLogicalToDisplay(), templateDispatchModeLogicalToOdbc(), templateDispatchModeLogicalToXSD(), templateDispatchModeNormalize(), templateDispatchModeSet(), templateDispatchModeXSDToLogical()
property zenMojoVersion as %ZEN.Datatype.string [ InitialExpression = ##class(%ZEN.Mojo.Utils).#VERSION ];
Zen Mojo Version
Property methods: zenMojoVersionDisplayToLogical(), zenMojoVersionGet(), zenMojoVersionIsValid(), zenMojoVersionLogicalToDisplay(), zenMojoVersionLogicalToOdbc(), zenMojoVersionNormalize(), zenMojoVersionSet()

Methods

method %GetTemplateClassByName(pName As %String) as %String
Return a template class name from the template list given its name/area. Return "" if not found.
method %OnAfterCreatePage() as %Status
This callback is called after the server-side page object and all of its children are created.
method %OnGetSubtemplateList(Output pSubtemplates, pForLocalization As %Boolean = 0) as %Status
Overridden by subclasses to get an actual list of available subtemplate classes. pSubtemplates should use the following structure:
Set pSubtemplates(n) = $listbuild("template-name","Template.Class","templateNamespace")

Additional fields may be included if %OnGetSubtemplateMeta()() is overridden.
method %OnGetSubtemplateMeta() as %List
Overridden by subclasses to allow extra fields to be included in the data returned from %OnGetSubtemplateList()(). This method should return a $list of field names.
method %OnGetTemplateList(Output pTemplates, pForLocalization As %Boolean = 0) as %Status
Overridden by subclasses to get an actual list of available template classes. pTemplates should use the following structure:
Set pTemplates(n) = $listbuild("name","Template.Class","templateNamespace")

Additional fields may be included if %OnGetTemplateMeta()() is overridden.
method %OnGetTemplateMeta() as %List
Overridden by subclasses to allow extra fields to be included in the data returned from %OnGetTemplateList()(). This method should return a $list of field names.
method GetSubtemplateList(ByRef pParameters, Output pMetaData, Output pData) as %Status [ ZenMethod ]
Return array of sub-template classes.
method GetTemplateList(ByRef pParameters, Output pMetaData, Output pData) as %Status [ ZenMethod ]
Return array of template classes.
method ZMojoDrawBackgroundDiv(pSeed As %String) as %Status [ ZenMethod ]
Draw the HTML div for the entire page background. This method will be removed in a future release, in which it will not be necessary to override this method.
method ZMojoDrawContentBackground(pSeed As %String) as %Status [ ZenMethod ]
Draw background of content div. This method will be removed in a future release, in which it will not be necessary to override this method.
method ZMojoDrawFooterGroup(pSeed As %String) as %Status [ ZenMethod ]
Draw the footer group. This method will be removed in a future release, in which it will not be necessary to override this method.
method ZMojoDrawHeaderImage(pSeed As %String) as %Status [ ZenMethod ]
Draw the logo in the header. This method will be removed in a future release, in which it will not be necessary to override this method.
Draw the quick links menu This method will be removed in a future release, in which it will not be necessary to override this method.
clientmethod adjustContentSize(load, width, height) [ Language = javascript ]
Adjust size of components within the content area.
clientmethod adjustSizes() [ Language = javascript ]
Force adjustment of content area sizes.
clientmethod changeAreaHandler() [ Language = javascript ]
Notification that we have moved to a new "area".
Implement in a subclass.
clientmethod getContent(providerName, key, criteria, force, notify) [ Language = javascript ]
Return content from the content provider. The call sequence is:
  1. Call onGetContent in the currently loaded template.
  2. Check the local cache of the content provider for the providerName/key/criteria combination.
  3. Call %OnGetJSONContent in the currently loaded template. (server call)

In case one of the above methods returns anything except null this will be used as the return value. Otherwise the next step in the call sequence is taken.

providerName Type: string.
The provider which is asked to return data.

key Type: string.
The key identifies which data bundle should be returned by the provider.

criteria Type: JSON object.
No specific structure enforced. Can be used to provide additional arguments to the provider.

force Type: Boolean - Defaults to false
If false, data gets returned from the local cache if present If true, the local cache is cleared before the provider is called

notify Type: Function
If omitted a potential call to the server will be synchronous. You can provide a notify function which gets called every 200ms, until the call to the server is finished and data is stored in the local cache. The function takes one argument (final) which is false until the call is finished and true for the final call.

clientmethod getContentHeight() [ Language = javascript ]
Return the desired height of the content panel (not including the header and footer). Subclasses may override this.
clientmethod getContentProvider() [ Language = javascript ]
Return the content provider for this page.
clientmethod getContentWidth() [ Language = javascript ]
Return an object containing the desired width and left (left offset) content panel. This is the width and left offset for the header, content, and footer. Subclasses may override this.
clientmethod getCurrArea() [ Language = javascript ]
Return the current application "area".
clientmethod getFooterHeight() [ Language = javascript ]
Return the height of the zMojoFooterGroup. This method will be removed in a future release, in which it will not be necessary to override this method.
clientmethod getHeaderHeight() [ Language = javascript ]
Return the height of the zMojoHeaderPane. This method will be removed in a future release, in which it will not be necessary to override this method.
clientmethod getMaxContentWidth() [ Language = javascript ]
In non-embed mode, maximum width of page content area. This method will be removed in a future release, in which it will not be necessary to override this method.
clientmethod getSubtemplate() [ Language = javascript ]
Return the current "sub-template" object.
clientmethod getSubtemplateInfo(area) [ Language = javascript ]
Get the list of subtemplates for a given "area".
clientmethod getSubtemplateProvider() [ Language = javascript ]
Return the subtemplate content provider for this page.
clientmethod getTemplate() [ Language = javascript ]
Return the current "template" object.
clientmethod getTemplateForArea(area) [ Language = javascript ]
For a given "area", return the template class.
This methods looks up the template in the content provider template list.
clientmethod gotoArea(area, key1, key2, nohistory) [ Language = javascript ]
Navigate to a new "area" and subsection. If nohistory is true, then do not push this change onto the history stack.
clientmethod gotoAreaKB(evt, area, key1, key2, nohistory) [ Language = javascript ]
Version of gotoArea for keyboard events.
clientmethod invalidate(docViewId, providerName) [ Language = javascript ]
Invalidate cached data for the given docView component and data element within the content provider.
clientmethod loadSubtemplate(key) [ Language = javascript ]
Load a "subtemplate" object.
clientmethod loadSubtemplateNS(ns, type, name) [ Language = javascript ]
Load a new "sub-template" object.
clientmethod loadTemplateNS(ns, type, area) [ Language = javascript ]
Load a new "template" object for a "area".
clientmethod onPopstateHandler(evt) [ Language = javascript ]
Subclass notification that a "popstate" event has occurred.
clientmethod onlayoutHandler(load) [ Language = javascript ]
Layout handler.
This adjusts the built-in components of the framework. Use adjustContentSize() to adjust the size of your content.
clientmethod popState() [ Language = javascript ]
Pop the most recent "state" onto the local history stack. (but do not modify the browser history).
clientmethod popstateHandler(evt) [ Language = javascript ]
Notification that a "popstate" event has occurred. This is fired when the user presses the back button and there is a pushed state in the history stack.
clientmethod pushState(type, area, key1, key2) [ Language = javascript ]
Push the given "state" onto the history stack.
clientmethod showMessage(msg) [ Language = javascript ]
Display a message to the user. Use this in place of alert for messages that are supposed to be delivered by the application; reserve alert for diagnostic messages.
clientmethod submitData(key, data, notify) [ Language = javascript ]
Submit data to the server for processing.
key is a app-defined key value.
data is an object to submit.
notify is a javascript function. If supplied, the data is submitted asynchronously and this function is called when the operation is complete.
clientmethod updateView(docViewId, providerName, dataKey, criteria, notify) [ Language = javascript ]
Update the given docView component.
Updates the content provider with name providerName using the new data key value dataKey.
If notify is a function, then update asychronously and invoke the notify function when complete.

Inherited Members

Inherited Properties

Inherited Methods

Subclasses

FeedbackOpens in a new tab