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. The current implementation of the operation supports working with express report and ETL task objects.
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 structure of the data sources, on which express report is based.
'ETL task moniker'!Objects!'ETL task object index'!MtdTree - to get information about links of object with other ETL task objects.
The obtained objects with metadata are available after executing the operation in the els field.
Below is the example of using the GetTreeElements operation to get 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: