%DeepSee.CubeDefinition
Class %DeepSee.CubeDefinition Extends %RegisteredObject [ Abstract, CompileAfter = (%DeepSee.Model.cube, %DeepSee.Generator), System = 4 ]
Subclasses of this class are used to define "cubes" that can be queried by the DeepSee engine.
The Cube XDATA block defines the contents of a DeepSee cube (dimensions and measures) as an XML document. When a subclass of this class is compiled, it generates the indexed fact table that holds the data for this cube.
This class also provides the APIs needs to explore a cube's metadata that are used by the DeepSee utilities.
Parameters
TRANSFORMXSL
Parameter TRANSFORMXSL As STRING;
This parameter is used to transform original cube definition. If it is defined in subclass then the cube definition is piped through XSLT transformation. XSL is taken from XData block named in this parameter.
TRANSFORMERCLASS
Parameter TRANSFORMERCLASS As STRING;
This parameter is used to transform original cube definition. If it is defined in a subclass then the cube definition is piped through the transformation defined in the class named by this parameter.
USECUBEVERSIONS
Parameter USECUBEVERSIONS = 0;
This parameter controls whether the compile of this class will utilize the cube versioning mechanism. If set to 1, the current class definition will act as a generator for a distinct version of the cube.
The version attribute of the
XDatas
Cube
XData Cube [ XMLNamespace = "http://www.intersystems.com/deepsee" ]
This projection is used to keep track of when Cubes are compiled or deleted. This XData section provides the definition of the cube.
Methods
%GetModel
ClassMethod %GetModel() As %DeepSee.Model.cube [ CodeMode = objectgenerator, Final, GenerateAfter = (%OnProcessFact, %OnApplyOverrides), Internal ]
Return an instance of the %DeepSee.Model.cube meta-data object that describes this cube.
%UpdateSharesIndex
ClassMethod %UpdateSharesIndex(pCubeName As %String) As %Status [ Internal ]
Update the "sharesIndex" for the given cube.
%GetSourceInfo
ClassMethod %GetSourceInfo(Output pInfo) As %Status [ CodeMode = objectgenerator, Final, GenerateAfter = %GetModel, Internal ]
Return information on the source data for this cube.
%GetCountName
ClassMethod %GetCountName() As %String [ CodeMode = objectgenerator, Final, GenerateAfter = %GetModel, Internal ]
Return the logical name for the %COUNT measure used by this cube.
%GetCountCaption
ClassMethod %GetCountCaption() As %String [ CodeMode = objectgenerator, Final, GenerateAfter = %GetModel, Internal ]
Return the (localized) caption for the %COUNT measure used by this cube. Returns "" if this has not been overridden by the cube.
%GetListingCaption
ClassMethod %GetListingCaption(pListing As %String) As %String [ CodeMode = objectgenerator, Final, GenerateAfter = %GetModel, Internal ]
Return the (localized) caption for a given listing within this cube.
%GetListingDescription
ClassMethod %GetListingDescription(pListing As %String) As %String [ CodeMode = objectgenerator, Final, GenerateAfter = %GetModel, Internal ]
Return the (localized) description for a given listing within this cube.
%GetListingFieldCaption
ClassMethod %GetListingFieldCaption(pField As %String) As %String [ CodeMode = objectgenerator, Final, GenerateAfter = %GetModel, Internal ]
Return the (localized) caption for a given listing field within this cube.
%GetListingFieldDescription
ClassMethod %GetListingFieldDescription(pField As %String) As %String [ CodeMode = objectgenerator, Final, GenerateAfter = %GetModel, Internal ]
Return the (localized) description for a given listing field within this cube.
%GetLevelMemberCaption
ClassMethod %GetLevelMemberCaption(pDimNo As %Integer, pHierNo As %Integer, pLevelNo As %Integer, pName As %String) As %String [ CodeMode = objectgenerator, Final, GenerateAfter = %GetModel, Internal ]
For a pre-defined member within a given level in this cube, return its (localized) caption (display name).
%GetMemberCaption
ClassMethod %GetMemberCaption(pDimName As %String, pHierName As %String = "", pLevelName As %String = "", pPropName As %String = "") As %String [ CodeMode = objectgenerator, Final, GenerateAfter = %GetModel, Internal ]
For a given dimension, hierarchy, and level return its localized caption. The pPropName may be used to reference either a property or a pre-defined
%GetMemberDescription
ClassMethod %GetMemberDescription(pDimName As %String, pHierName As %String = "", pLevelName As %String = "", pPropName As %String = "") As %String [ CodeMode = objectgenerator, Final, GenerateAfter = %GetModel, Internal ]
For a given dimension, hierarchy, and level return its localized description. The pPropName may be used to reference either a property or a pre-defined
%GetCellCachePreLoads
ClassMethod %GetCellCachePreLoads(Output pList) As %Status [ CodeMode = objectgenerator, Final, GenerateAfter = %GetModel, Internal ]
Return the list of cell-cache values that should be pre-loaded. On return pList will contain an array of the form:
pList(n,spec) = factNo
%BuildFactTable
ClassMethod %BuildFactTable(pVerbose As %Boolean = 0, pFactList As %String = "") As %Status [ CodeMode = objectgenerator, GenerateAfter = (%GetModel, %OnProcessFact), Internal ]
Build the entire fact table with data from the source table.
If pVerbose is true, then status information is written to the console.
Users should not call this method; they should used the %BuildCube method in the %DeepSee.Utils class.
%UpdateFacts
ClassMethod %UpdateFacts(pStartId As %String, pEndId As %String = "", pBatchMode As %Boolean = 0, pVerbose As %Boolean = 0, pTaskGroup As %String = "", Output pUpdates As %Integer, pRefProp As %String = "", pRefID As %String = "", ByRef pDimTables) As %Status [ CodeMode = objectgenerator, GenerateAfter = (%GetModel, %OnProcessFact) ]
Update Fact indices with data from the source table.
Read all rows from the source table between pStartId and pEndId.
If pEndId is missing (""), then update one fact with source id pStartId
. If pVerbose is true, then write status information to the console.
pTaskGroup is used when this method is called by the DeepSee TaskMaster.
If pBatchMode is true, then perform the update in batch mode.
%UpdateFactsList
ClassMethod %UpdateFactsList(pFactList As %String = "", pStartId As %String, pEndId As %String = "", pBatchMode As %Boolean = 0, pVerbose As %Boolean = 0, pTaskGroup As %String = "", Output pUpdates As %Integer, pRefProp As %String = "", pRefID As %String = "", ByRef pDimTables) As %Status [ CodeMode = objectgenerator, GenerateAfter = (%GetModel, %OnProcessFact) ]
Update Fact indices with data from selected columns in the source table.
The fact list is limited using the pFactList parameter, which can be either a comma-delimited list or a $LB. Read all rows from the source table between pStartId and pEndId.
If pEndId is missing (""), then update one fact with source id pStartId
. If pVerbose is true, then write status information to the console.
pTaskGroup is used when this method is called by the DeepSee TaskMaster.
If pBatchMode is true, then perform the update in batch mode.
%DeleteFact
ClassMethod %DeleteFact(pSourceId As %String) As %Status [ CodeMode = objectgenerator, GenerateAfter = (%GetModel, %OnProcessFact) ]
Delete facts from this cube that correspond to rows in the source table with source id pSourceId
. If pVerbose is true, then write status information to the console.
%CheckSourceId
ClassMethod %CheckSourceId(pSourceId As %String, pVerbose As %Boolean = 0, pStatus As %Status) As %Boolean [ CodeMode = objectgenerator, GenerateAfter = (%GetModel, %OnProcessFact) ]
Check to make sure a given ID exists in the source table.
%GetSourceIds
ClassMethod %GetSourceIds(Output pStartId As %String, Output pEndId As %String) As %Status [ CodeMode = objectgenerator, GenerateAfter = (%GetModel, %OnGetSourceIds), Internal ]
Find the starting and ending id values for this cube's source data class.
This is used when populating an entire cube.
%OnGetSourceIds
ClassMethod %OnGetSourceIds(Output pStartId As %String, Output pEndId As %String) As %Status [ Abstract ]
If implemented, this method is called when a cube is being completely rebuilt *and* the rebuild is not using parallel processing.
On return pStartId and pEndId must contain the first and last row id values for this cube's source data table, such that a query of the form:
SELECT ... FROM SOURCE WHERE %ID BETWEEN pStartId AND pEndId
will return all the rows of the source table.
This gives the developer the opportunity to bypass the built-in query that fetchs these values.
%KillCache
ClassMethod %KillCache() As %Status [ Final ]
Delete all cached values for this cube.
%KillCellCache
ClassMethod %KillCellCache() As %Status [ Final ]
Delete the cell cache for this cube.
%KillResultsCache
ClassMethod %KillResultsCache() As %Status [ Final ]
Delete the results cache for this cube.
%KillFacts
ClassMethod %KillFacts() As %Status [ CodeMode = objectgenerator, GenerateAfter = %GetModel ]
Delete all Facts as well as cached results from the cube.
%OnKillFacts
ClassMethod %OnKillFacts() As %Status
Notification that all facts have been deleted.
If implemented, this is called when the %KillFacts is called.
%OnBuildCube
ClassMethod %OnBuildCube(pFactList As %List) As %Status
Notification that this cube is about to be built.
If the build is invoked using a selected pFactList, this list will be passed to the callback in a $LB format.
%OnAfterBuildCube
ClassMethod %OnAfterBuildCube(pBuildStatus As %Status, pBuildErrors As %Boolean = 0) As %Status
Notification that this cube has completed its build.
The status of the overall build is contained in pBuildStatus. If the build is otherwise successful, the value of pBuildStatus can be changed within the callback to become the new status returned by %BuildCube. If there were any build errors in the individual facts the count of these errors is reported in pBuildErrors
%OnProcessFact
ClassMethod %OnProcessFact(pID As %String, ByRef pFacts As %String, Output pSkip As %Boolean, pInsert As %Boolean) As %Status [ Abstract ]
Notification that a fact within the cube is to be processed (inserted or updated).
pID is the id of the row in the source data being processed.
pFacts is an array containing the values that will be used for the row, subscripted by fact name.
pSkip is a boolean value returned by reference; If true then the record is not processed.
pInsert is true if the current fact will be inserted into the cube's fact table.
%OnAfterProcessFact
ClassMethod %OnAfterProcessFact(pID As %String, ByRef pFactArray As %String, pUpdateStatus As %Status) As %Status [ Abstract ]
Notification that a fact within the cube has been processed (inserted or updated). This method does not allow for any intervention of the processing of the fact, but rather provides an opportunity to react to success or failure in processing. The return status is ignored by the caller.
pID is the id of the row in the source data being processed.
pFacts is an array containing the values that will be used for the row, subscripted by fact name.
pUpdateStatus is the status about to be returned by %ProcessFact. If an error is passed in, this error will already be logged in the DeepSee logs and the ^DeepSee.BuildErrors global.
%GetFactCount
ClassMethod %GetFactCount() As %Integer
Return number of facts in this cube's fact table.
%GetFactClass
ClassMethod %GetFactClass() As %String
Return name of the fact class used by this cube.
%GetFactIdRange
ClassMethod %GetFactIdRange(Output pStartId As %Integer, Output pEndId As %Integer) As %Status [ Final ]
Return the approximate starting and ending id values for this cubes fact table.
%GetCubeName
ClassMethod %GetCubeName() As %String [ CodeMode = objectgenerator, GenerateAfter = %GetModel ]
Return the logical name of the cube defined by this class (in its original case).
%IsAbstract
ClassMethod %IsAbstract() As %Boolean [ CodeMode = objectgenerator, GenerateAfter = %GetModel ]
Test whether this cube is abstract or not.
%IsCompound
ClassMethod %IsCompound(Output pJoinList As %String) As %Boolean
Test whether this cube is compound or not.
%GetCubeCaption
ClassMethod %GetCubeCaption() As %String [ CodeMode = objectgenerator, GenerateAfter = %GetModel ]
Return the caption of the cube defined by this class. If not defined, the cube name is returned.
%GetPrecomputeLevel
ClassMethod %GetPrecomputeLevel() As %Integer [ CodeMode = objectgenerator, GenerateAfter = %GetModel ]
Return the precompute level of the cube defined by this class.
%CanDrillThrough
ClassMethod %CanDrillThrough() As %Boolean
Test if this cube supports drill through (listing) queries.
%GetRelationshipId
ClassMethod %GetRelationshipId(pRelationName As %String, pKey As %String, Output pID As %Integer) As %Status [ CodeMode = objectgenerator, GenerateAfter = %GetModel ]
Take cube relationship with name pRelationName and transform the original key value pKey into the id of the corresponding fact in the fact table and return it via pID.
%OnExecuteListing
ClassMethod %OnExecuteListing(pSQL As %String) As %Status
Notification that a listing (drillthrough) query is about to be executed.
This is called immediately before a listing query is executed. This is useful for cases where additional setup work is required before a listing query can run.
pSQL is the listing query that will be executed.
%GetFilterSpec
ClassMethod %GetFilterSpec() As %String [ Final ]
Return the filter spec for this cube, if any.
%OnGetFilterSpec
ClassMethod %OnGetFilterSpec(pFilterSpec As %String) As %String
This callback gives a Cube a chance to programmatically define a filter spec.
%GetDefaultListing
ClassMethod %GetDefaultListing() As %String [ Final ]
Return the name of the default listing for this cube, if any.
%OnGetDefaultListing
ClassMethod %OnGetDefaultListing() As %String
This callback gives a cube a chance to programmatically return the name of the listing to use as its default listing. This must be the name of a defined listing within the cube. Return "" to use the pre-defined default listing.
%GetActionList
ClassMethod %GetActionList(ByRef pActions As %List) As %Status [ Final, Internal ]
Return list of possible actions for this Cube. This list is supplied from the KPI class specified by the cube's actionClass property, if defined. This drives the list of action selections for widget connected to this cube. This takes the form:
pActions(n)=$LB(name,caption)
%InjectFact
ClassMethod %InjectFact(ByRef pFactId As %String, ByRef pValues As %String, pDimensionsOnly As %Boolean = 0, pFactList As %String = "") As %Status [ CodeMode = objectgenerator, GenerateAfter = (%GetModel, %OnProcessFact) ]
Inject a fact into the fact table for this cube that is not associated with the source data table.
pFactId is the id of the fact in the fact table. Set this to "" for an insert. On return it will contain the id used for the fact.
pValues is an array of fact values subscripted by sourceProperty name (case must match exactly. If pDimensionsOnly is true, then only the dimension tables for the cube are affected; no facts are inserted.
%OnGetModel
ClassMethod %OnGetModel(pXSL As %String, tSource As %Stream.TmpCharacter, Output tOutput As %BinaryStream) As %Status [ Internal ]
Callback used for XSL transforms.
%OnApplyOverrides
ClassMethod %OnApplyOverrides() As %Status [ CodeMode = objectgenerator ]
If implemented, this is called before the cube model is processed. It gives the class a change to modify the ^DeepSee.Overrides global.
%Lookup
ClassMethod %Lookup(pTermList As %String = "", pKey As %String = "", pDefault As %String, pField As %String = "VALUE") As %String
Lookup a single value with the given key and DeepSee term list name. This can be invoked by source expressions within this cube.
pTermList is the name (with no extension) of the termlist.
pKey is the key to lookup within the termlist.
pDefault is an optional default value to return if the key is not found within the termlist.
pField is an optional field to lookup within the termlist. By default, this is the "value" field.
%Rule
ClassMethod %Rule(pRuleName As %String = "") As %String
Invoke a Business Rule on the current record within the source class. pID should contain the object id of the record within the source class. This can be invoked by source expressions within this cube.
%OnGetComputedMembers
ClassMethod %OnGetComputedMembers(pDimName As %String, pHierName As %String, pLevelName As %String, ByRef pMemberList, pRollupKey As %String = "", ByRef pRange As %String = "") As %Status
This callback gives a Cube a chance to programmatically provide a set of members for a computed dimension.
Find the set of members for this computed dimension object satisfying pRollupKey and pRange (if applicable for this implementation).
This is passed and returns:
pMemberList($I(pMemberList)) = $LB(id (expression for MDX computed dimension),caption,key,[format])