GetTreeElementsResult GetTreeElements(TreeId tTree, GetTreeElementsArg tArg)
tTree. Moniker of the object, for which operation is executed.
tArg. Parameters of getting metadata tree.
The GetTreeElements operation gets repository object metadata tree.
This operation gets information about some repository object as an element tree. Information stored in the elements can be further used to create formulas. To execute the operation, in the tTree field specify the created tree moniker, and in the tArg field specify parameters for getting elements with metadata.
The moniker is created in one of the following formats:
express report moniker!Sheets!sheet key!MtdTree. To get information about the structure of the sources, on which express report is based.
ETL task moniker!Objects!object index in ETL task!MtdTree. To get information about links between the object and other objects in ETL task.
moniker of calculated cube!Params!MtdTree. For details about the parameters that can be used in calculated cube formulas.
moniker from the cachedDatasetId field!MtdTree. To get the fields that can be used during data filtering setup of a relational object.
information panel moniker!Sources!source key!Expressions!calculated fact key!Ufe!Tree. To get the list of elements that can be used in calculated fact formula.
The obtained elements with metadata will be available after executing the operation in the els field.
Below is the example of getting metadata tree for the specified express report sheet. The request contains express report moniker and sheet key. The response contains a set of metadata elements.
{
"GetTreeElements" :
{
"tTree" :
{
"id" : "S1!M!S!E1!Sheets!189!MtdTree"
},
"tArg" :
{
"parent" :
{
"key" : ""
},
"filter" :
{
"text" :
{
"text" : "Element",
"searchName" : "true",
"searchId" : "false"
},
"includeParents" : "false"
},
"pattern" :
{
"getParentKey" : "true",
"getHasChildren" : "true",
"getLevel" : "true",
"getChildIndex" : "true",
"getChildrenCount" : "true",
"getTerm" : "true",
"getClsIdDataType" : "true"
},
"range" :
{
"start" : "0",
"count" : "100"
},
"filteredCount" : "true"
}
}
}
{
"GetTreeElementsResult" :
{
"els" :
{
"e" :
[
{
"@c" : "1",
"@h" : "0",
"@i" : "0",
"@hc" : "1",
"@l" : "1",
"k" : "3",
"n" : "Cube (elements)",
"id" : "OBJ183",
"p" : "2",
"classId" : "1287",
"tag" : "eax.src"
},
{
"@c" : "2",
"@h" : "2",
"@i" : "0",
"@hc" : "1",
"@l" : "4",
"k" : "7",
"n" : "Elements",
"id" : "",
"p" : "5",
"tag" : "eax.des"
},
{
"@c" : "1",
"@h" : "1",
"@i" : "0",
"@hc" : "1",
"@l" : "5",
"k" : "13",
"n" : "Element 1",
"id" : "1",
"p" : "7",
"tag" : "eax.de",
"term" :
{
"it" :
[
{
"n" : "tag",
"v" : "eax.de"
},
{
"n" : "key",
"v" : "116"
},
{
"n" : "elKey",
"v" : "1"
}
]
}
},
{
"@c" : "1",
"@h" : "1",
"@i" : "0",
"@hc" : "1",
"@l" : "6",
"k" : "15",
"n" : "Element 2",
"id" : "2",
"p" : "13",
"tag" : "eax.de",
"term" :
{
"it" :
[
{
"n" : "tag",
"v" : "eax.de"
},
{
"n" : "key",
"v" : "116"
},
{
"n" : "elKey",
"v" : "2"
}
]
}
},
{
"@c" : "0",
"@h" : "0",
"@i" : "0",
"@hc" : "0",
"@l" : "7",
"k" : "16",
"n" : "Element 3",
"id" : "3",
"p" : "15",
"tag" : "eax.de",
"term" :
{
"it" :
[
{
"n" : "tag",
"v" : "eax.de"
},
{
"n" : "key",
"v" : "116"
},
{
"n" : "elKey",
"v" : "3"
}
]
}
},
{
"@c" : "0",
"@h" : "0",
"@i" : "1",
"@hc" : "0",
"@l" : "5",
"k" : "14",
"n" : "Element 4",
"id" : "4",
"p" : "7",
"tag" : "eax.de",
"term" :
{
"it" :
[
{
"n" : "tag",
"v" : "eax.de"
},
{
"n" : "key",
"v" : "116"
},
{
"n" : "elKey",
"v" : "4"
}
]
}
}
]
},
"filteredCount" : "6",
"id" :
{
"id" : "S1!M!S!E1!Sheets!189!MtdTree"
}
}
}
public static GetTreeElementsResult GetSheetMetadata(EaxId moniker, ulong sheetKey)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tGet = new GetTreeElements()
{
tArg = new GetTreeElementsArg()
{
parent = new ElKey() { key = "" },
filter = new TreeElsFilter()
{
includeParents = false,
text = new TreeTextFilter()
{
searchId = false,
searchName = true,
text = "Element"
}
},
filteredCount = true,
pattern = new TreeElsPattern()
{
getChildIndex = true,
getChildrenCount = true,
getClsIdDataType = true,
getHasChildren = true,
getLevel = true,
getParentKey = true,
getTerm = true
},
range = new ListRange()
{
start = 0,
count = 100
}
},
tTree = new TreeId() { id = moniker.id + "!Sheets!" + sheetKey.ToString() + "!MtdTree" }
};
//Get information
var result = somClient.GetTreeElements(tGet);
return result;
}
See also: