Home > Class Reference > %SYS namespace > %ZEN.Mojo.Component.contentProvider

%ZEN.Mojo.Component.contentProvider

class %ZEN.Mojo.Component.contentProvider extends %ZEN.Component.composite

This class is used internally by InterSystems. You should not make direct use of it within your applications. There is no guarantee made about either the behavior or future operation of this class.

A content provider supplies a given base page with the information needed to display dynamic content including data and layout documents and client-side behaviors.
Basically this is a composite group containing multiple JSON providers and logic for client-side caching of the data served by the providers.
The list of provider to create is defined by the providerList.
There is always a pre-defined JSON provider, named "$code" to handle coded values.
In addition to the JSON providers, this component creates an instance of a %ZEN.Mojo.Component.contentTemplate class. This provides a way to inject dynamic behavior (i.e. methods) into a page without having to reload the entire page.

Property Inventory

Method Inventory

Parameters

parameter DEFAULTVISIBLE = 0;
This component is not visible.
parameter NAMESPACE = http://www.intersystems.com/zen/mojo;
Inherited description: This is the XML namespace used for library components.
parameter SYSMODULE = core;
Inherited description: If set, this indicates that this system component should be placed in the given "module". A module is a grouping of components within the same class package that share common include (js or css) files. Note that certain root classes are implicitly placed within the "core" module.
Classes outside of the Zen library should not set this, they should use the MODULE instead.

Properties

property OnGetCodeTable as %ZEN.Datatype.delegator (FORMALSPEC = "&pParameters:%String,*pObject:%RegisteredObject", RETURNTYPE = "%Status", ZENENCRYPT = 0);
Similar to the JSON provider's OnGetTargetObject callback. This callback is invoked to fetch the contents of a given code table.
Property methods: OnGetCodeTableDisplayToLogical(), OnGetCodeTableGet(), OnGetCodeTableIsValid(), OnGetCodeTableLogicalToDisplay(), OnGetCodeTableLogicalToOdbc(), OnGetCodeTableNormalize(), OnGetCodeTableSet()
property OnGetTemplateList as %ZEN.Datatype.delegator (FORMALSPEC = "&pParameters:%String,*pMetaData,*pData", RETURNTYPE = "%Status", ZENENCRYPT = 0);
Similar to the JSON provider's OnGetArray callback. This callback is invoked to fetch a list of available template classes along with a logical name and other data. This information can be used to drive an application menu from a set of templates.
Property methods: OnGetTemplateListDisplayToLogical(), OnGetTemplateListGet(), OnGetTemplateListIsValid(), OnGetTemplateListLogicalToDisplay(), OnGetTemplateListLogicalToOdbc(), OnGetTemplateListNormalize(), OnGetTemplateListSet()
property currTemplate as %ZEN.Datatype.string [ InitialExpression = "$default" ];
Name (key) of current template object.
Property methods: currTemplateDisplayToLogical(), currTemplateGet(), currTemplateIsValid(), currTemplateLogicalToDisplay(), currTemplateLogicalToOdbc(), currTemplateNormalize(), currTemplateSet()
property layout as %ZEN.Datatype.string (MAXLEN = 250, ZENENCRYPT = 0) [ InitialExpression = ..#DEFAULTLAYOUT ];
Specifies how components within this group should be layed out. (VALUELIST = ",vertical,horizontal")
Property methods: layoutDisplayToLogical(), layoutGet(), layoutIsValid(), layoutLogicalToDisplay(), layoutLogicalToOdbc(), layoutNormalize(), layoutSet()
property providerList as %ZEN.Datatype.csv;
Csv-list of json providers to create.
Property methods: providerListDisplayToLogical(), providerListGet(), providerListIsValid(), providerListLogicalToDisplay(), providerListLogicalToOdbc(), providerListNormalize(), providerListSet()
property templateClass as %ZEN.Datatype.className;
Initial template class.
Property methods: templateClassArrayBuildValueArray(), templateClassArrayCollectionToDisplay(), templateClassArrayCollectionToOdbc(), templateClassArrayDisplayToCollection(), templateClassArrayDisplayToLogical(), templateClassArrayGet(), templateClassArrayGetObject(), templateClassArrayGetObjectId(), templateClassArrayGetSwizzled(), templateClassArrayIsValid(), templateClassArrayLogicalToDisplay(), templateClassArrayLogicalToOdbc(), templateClassArrayNormalize(), templateClassArrayOdbcToCollection(), templateClassArraySet(), templateClassArraySetObject(), templateClassArraySetObjectId(), templateClassDisplayToLogical(), templateClassGet(), templateClassIsValid(), templateClassLogicalToDisplay(), templateClassLogicalToOdbc(), templateClassNormalize(), templateClassSet()
property templateClassArray as array of %ZEN.Datatype.className (XMLPROJECTION = "none");
Names of loaded contentTemplate classes supplying the content, indexed by key.
Property methods: templateClassArrayBuildValueArray(), templateClassArrayCollectionToDisplay(), templateClassArrayCollectionToOdbc(), templateClassArrayDisplayToCollection(), templateClassArrayDisplayToLogical(), templateClassArrayGet(), templateClassArrayGetObject(), templateClassArrayGetObjectId(), templateClassArrayGetSwizzled(), templateClassArrayIsValid(), templateClassArrayLogicalToDisplay(), templateClassArrayLogicalToOdbc(), templateClassArrayNormalize(), templateClassArrayOdbcToCollection(), templateClassArraySet(), templateClassArraySetObject(), templateClassArraySetObjectId()
property templateObjectArray as array of contentTemplate (XMLPROJECTION = "none");
Loaded template object(s), indexed by key.
Property methods: templateObjectArrayBuildValueArray(), templateObjectArrayCollectionToDisplay(), templateObjectArrayCollectionToOdbc(), templateObjectArrayDisplayToCollection(), templateObjectArrayGet(), templateObjectArrayGetObject(), templateObjectArrayGetObjectId(), templateObjectArrayGetSwizzled(), templateObjectArrayIsValid(), templateObjectArrayOdbcToCollection(), templateObjectArraySet(), templateObjectArraySetObject(), templateObjectArraySetObjectId()

Methods

final method %OnAfterCreateComposite() as %Status
Add children to this component.
method %OnGetProviderList(Output pList As %List) as %Status
Return a list defining what JSON providers should be created by this provider.
Returns:
pList(n) = $LB(name,[class])
final method GetJSONCodeTable(ByRef pParms, Output pObject As %RegisteredObject) as %Status [ ZenMethod ]
Server-side method to load code tables as JSON.
final classmethod GetJSONContent(ByRef pParms, Output pObject As %RegisteredObject) as %Status [ ZenMethod ]
Server-side method to provide content to JSON providers.
final method GetTemplateList(ByRef pParms, Output pMetaData, Output pData) as %Status [ ZenMethod ]
Invoke the OnGetTemplateList callback.
method SubmitJSONContent(pCommand As %String, pProvider As %ZEN.Auxiliary.jsonProvider, pSubmitObject As %RegisteredObject, ByRef pResponseObject As %RegisteredObject) as %Status [ ZenMethod ]
Submit handler for $submit json provider. This is called when the app calls submitData().
final clientmethod fetchCodeTable(key, force) [ Language = javascript ]
Fetch the code table with name key. If force, invalidate the cached value and fetch again.
final clientmethod getContent(which, key, criteria, force, notify) [ Language = javascript ]
Get the given content object.
which is the name of json provider. key is a key value
force is an optional argument, which if true, forces a server reload of data that comes from a json provider. Otherwise such data is held in a local cache.
Data is obtained as follows:
First, a call is made to the associated template object's getContent() method (if present). This call is passed the which and key arguments. If this call returns a non-null value, then this value is returned. If not, then the local cache is checked (unless force is true). If there is an object in the local cache under the same templateClass, which, and key values, then this value is returned.
Otherwise a request is made via the jsonProvider specified by which. If force is true, the jsonProvider is told to reload its contents from the server. The content object object returned from the json provider is then added to the local cache and this value is returned.
If notify is supplied, then the server update will be performed async (if supported) and notify if a function to call when the update is complete.
final clientmethod getTemplate() [ Language = javascript ]
Return the current template object.
final clientmethod getTemplateClass() [ Language = javascript ]
Return the current template class.
final clientmethod getTemplateInfo() [ Language = javascript ]
Return the templateInfo list.
clientmethod invalidate(which, key) [ Language = javascript ]
Invalidate the data cache for the given "provider" and key value.
final clientmethod loadTemplateNS(ns, type, key) [ Language = javascript ]
Load (if needed) and use a new template class with a given namespace and type (local class name).
If key is supplied, use this to keep a cached version of this template object.
final 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.

Inherited Members

Inherited Properties

Inherited Methods