cPlan Metadata Samples
Spectre has a metadata input tag which can be used to retrieve information about a data source:
metadata {
cbase-input "Accounts.cbase"
}
There is an optional type tag that allows you to fetch defined properties. These types are:
calcs, dimensions, inputs
With this Build File:
build {
list-input name="list" {
data """Str Num Dat
ABC 1 2021/02/24
DEF 2 2021/02/25
abc 3 2021/02/26
def 4 2021/02/27
"""
column "Str" {
property "Description" "Column Desc"
property "Definition" "Letter Strings(3)"
custom-property "My custom column property" "MyProp-C"
}
column "Num"
column "Dat"
}
output "/bugsdata/46000s/46180/cbase-props-gh.cbase" name="cbase-props-gh"
property "Description" "Test Property Table"
property "Date Dimension" "Dat"
property "Current Date" "2021/02/25"
custom-property "My custom table property" "MyProp-T"
}
And this Dive file:
dive {
cplan {
metadata type="calcs" {
cbase-input "cbase-props-gh.cbase"
}
}
detail-window {
all-cbase-columns
}
}
The resulting dive window shows these calcs properties:
Given the following Dive and cPlan:
dive {
cplan {
metadata type="dimension-properties" {
cplan {
list-input {
data """Str Num Dat
ABC 1 2021/02/24
DEF 2 2021/02/25
abc 3 2021/02/26
def 4 2021/02/27
"""
column "Str" {
property "Description" "Column Desc"
property "Definition" "Letter Strings(3)"
property "Reference" "Random Strings"
custom-property "My custom column property" "MyProp-Col"
}
column "Num" {
property "Description" "A number"
}
column "Dat"
}
dimension "StrX" `value("Str") + "X"` {
property "Description" "An extra dimension"
property "Definition" "Same as Str, but with X at the end"
custom-property "My custom dimension property" "MyPropDim-X"
}
calc "Num" {
// "Description" is inherited
property "Good Direction" "Down"
custom-property "My custom calc property" "MyProp-Calc"
}
property "Description" "Cplan Desc"
property "Date Dimension" "Dat"
property "Current Date" "2021/02/25"
custom-property "My custom table property" "MyProp-Tble"
}
}
}
detail-window {
all-cbase-columns
}
}
The Dive window shows the following dimension-properties table.
Using a multilevel cPlan:
dive {
cplan {
metadata type="inputs" {
cplan {
multilevel {
cbase-input "/cbases/002_concat.cbase" name="First"
cbase-input "/cbases/012-simple-build_sales.cbase" name="Second"
}
}
}
}
detail-window {
all-cbase-columns
}
}
With type inputs, the metadata in the dive window is limited to the following.
With this Build file:
build {
list-input name="list" {
data """Str Num Dat
ABC 1 2021/02/24
DEF 2 2021/02/25
abc 3 2021/02/26
def 4 2021/02/27
"""
column "Str" {
property "Description" "Column Desc"
property "Definition" "Letter Strings(3)"
custom-property "My custom column property" "MyProp-C"
}
column "Num"
column "Dat"
}
output "/bugsdata/46000s/46180/cbase-props-gh.cbase" name="cbase-props-gh"
property "Description" "Test Property Table"
property "Date Dimension" "Dat"
property "Current Date" "2021/02/25"
custom-property "My custom table property" "MyProp-T"
}
Using this Dive:
dive {
cplan {
metadata type="calc-properties" {
cbase-input "cbase-props-gh.cbase"
}
}
detail-window {
all-cbase-columns
}
}
The Dive window displays the following calc-properties metadata:
Using this Build:
build {
list-input name="list" {
data """Str Num Dat
ABC 1 2021/02/24
DEF 2 2021/02/25
abc 3 2021/02/26
def 4 2021/02/27
"""
column "Str" {
property "Description" "Column Desc"
property "Definition" "Letter Strings(3)"
custom-property "My custom column property" "MyProp-C"
}
column "Num"
column "Dat"
}
output "/bugsdata/46000s/46180/cbase-props-gh.cbase" name="cbase-props-gh"
property "Description" "Test Property Table"
property "Date Dimension" "Dat"
property "Current Date" "2021/02/25"
custom-property "My custom table property" "MyProp-T"
}
With this Dive:
dive {
cplan {
metadata type="dimension-properties" {
cbase-input "cbase-props-gh.cbase"
}
}
detail-window {
all-cbase-columns
}
}
Displays this metadata about dimension-properties in the dive window:
With these two builds:
build {
list-input name="list" {
data """Str Num Dat
A 1 2021/02/24
B 2 2021/02/25
"""
column "Str" {
custom-property "Prop A" "A"
}
column "Num"
column "Dat"
}
output "/bugsdata/46000s/46180/cbase-props.cbase" name="cbase-props"
custom-property "Prop B" "B"
property "Description" "Table Desc"
property "Date Dimension" "Dat"
property "Default Current Date" "2021/02/25"
}
build {
list-input name="list" {
data """Str Num Dat
ABC 1 2021/02/24
DEF 2 2021/02/25
abc 3 2021/02/26
def 4 2021/02/27
"""
column "Str" {
property "Description" "Column Desc"
property "Definition" "Letter Strings(3)"
custom-property "My custom column property" "MyProp-C"
}
column "Num"
column "Dat"
}
output "/bugsdata/46000s/46180/cbase-props-gh.cbase" name="cbase-props-gh"
property "Description" "Test Property Table"
property "Date Dimension" "Dat"
property "Current Date" "2021/02/25"
custom-property "My custom table property" "MyProp-T"
}
If you dive on the cBases as a multilevel:
dive {
cplan {
metadata type="input-properties" {
cplan {
multilevel {
cbase-input "cbase-props.cbase" name="First"
cbase-input "cbase-props-gh.cbase" name="Second"
}
}
}
}
detail-window {
all-cbase-columns
}
}
The resulting metadata window displays these input-properties:
With the following Build script:
build {
list-input name="list" {
data """Str Num Dat
ABC 1 2021/02/24
DEF 2 2021/02/25
abc 3 2021/02/26
def 4 2021/02/27
"""
column "Str" {
property "Description" "Column Desc"
property "Definition" "Letter Strings(3)"
custom-property "My custom column property" "MyProp-C"
}
column "Num"
column "Dat"
}
output "/bugsdata/46000s/46180/cbase-props-gh.cbase" name="cbase-props-gh"
property "Description" "Test Property Table"
property "Date Dimension" "Dat"
property "Current Date" "2021/02/25"
custom-property "My custom table property" "MyProp-T"
}
The properties for the cBase appear in the cBase Viewer:
The following Dive:
dive {
cplan {
metadata type="cplan-properties" {
cbase-input "cbase-props-gh.cbase"
}
}
detail-window {
all-cbase-columns
}
}
Produces the following window and cplan-properties table: