abstract class %DeepSee.CubeDefinition
extends %RegisteredObject
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.
parameter TRANSFORMERCLASS;
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.
parameter TRANSFORMXSL;
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.
classmethod %CanDrillThrough()
as %Boolean
Test if this cube supports drill through (listing) queries.
classmethod %DeleteFact(pSourceId As %String)
as %Status
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.
classmethod %GetCubeCaption()
as %String
Return the caption of the cube defined by this class.
If not defined, the cube name is returned.
classmethod %GetCubeName()
as %String
Return the logical name of the cube defined by this class (in its original case).
final classmethod %GetDefaultListing()
as %String
Return the name of the default listing for this cube, if any.
classmethod %GetFactClass()
as %String
Return name of the fact class used by this cube.
classmethod %GetFactCount()
as %Integer
Return number of facts in this cube's fact table.
final classmethod %GetFactIdRange(Output pStartId As %Integer, Output pEndId As %Integer)
as %Status
Return the approximate starting and ending id values for this cubes fact table.
final classmethod %GetFilterSpec()
as %String
Return the filter spec for this cube, if any.
classmethod %GetPrecomputeLevel()
as %Integer
Return the precompute level of the cube defined by this class.
classmethod %GetRelationshipId(pRelationName As %String, pKey As %String, Output pID As %Integer)
as %Status
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.
classmethod %InjectFact(ByRef pFactId As %String, ByRef pValues As %String)
as %Status
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.
classmethod %IsAbstract()
as %Boolean
Test whether this cube is abstract or not.
classmethod %IsCompound(Output pJoinList As %String)
as %Boolean
Test whether this cube is compound or not.
final classmethod %KillCache()
as %Status
Delete all cached values for this cube.
final classmethod %KillCellCache()
as %Status
Delete the cell cache for this cube.
classmethod %KillFacts()
as %Status
Delete all Facts as well as cached results from the cube.
final classmethod %KillResultsCache()
as %Status
Delete the results cache for this cube.
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.
classmethod %OnApplyOverrides()
as %Status
If implemented, this is called before the cube model is processed.
It gives the class a change to modify the ^DeepSee.Overrides global.
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.
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.
classmethod %OnGetFilterSpec(pFilterSpec As %String)
as %String
This callback gives a Cube a chance to programmatically define a filter spec.
abstract classmethod %OnGetSourceIds(Output pStartId As %String, Output pEndId As %String)
as %Status
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.
classmethod %OnKillFacts()
as %Status
Notification that all facts have been deleted.
If implemented, this is called when the %KillFacts
abstract classmethod %OnProcessFact(pID As %String, ByRef pFacts As %String, Output pSkip As %Boolean, pInsert As %Boolean)
as %Status
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.
classmethod %Rule(pRuleName As %String = "")
as %String
Invoke an Ensemble 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.
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
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.