GetTreeElements

Syntax

GetTreeElementsResult GetTreeElements(TreeId tTree, GetTreeElementsArg tArg)

Parameters

tTree. Moniker of the object, for which operation is executed.

tArg. Parameters of getting metadata tree.

Description

The GetTreeElements operation gets repository object metadata tree.

Comments

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:

The obtained objects with metadata are available after executing the operation in the els field.

Example

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.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetTreeElements xmlns="http://www.fsight.ru/PP.SOM.Som">
<tTree xmlns="">
  <id>S1!M!S!E1!Sheets!189!MtdTree</id>
  </tTree>
<tArg xmlns="">
<parent>
  <key />
  </parent>
<filter>
<text>
  <text>Item</text>
  <searchName>true</searchName>
  <searchId>false</searchId>
  </text>
  <includeParents>false</includeParents>
  </filter>
<pattern>
  <getParentKey>true</getParentKey>
  <getHasChildren>true</getHasChildren>
  <getLevel>true</getLevel>
  <getChildIndex>true</getChildIndex>
  <getChildrenCount>true</getChildrenCount>
  <getTerm>true</getTerm>
  <getClsIdDataType>true</getClsIdDataType>
  </pattern>
<range>
  <start>0</start>
  <count>100</count>
  </range>
  <filteredCount>true</filteredCount>
  </tArg>
  </GetTreeElements>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<GetTreeElementsResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<els xmlns="">
<e i="0" hc="1" c="1" h="0" l="1">
  <k>3</k>
  <n>Cube (elements)</n>
  <id>OBJ183</id>
  <p>2</p>
  <classId>1287</classId>
  <tag>eax.src</tag>
  </e>
<e i="0" hc="1" c="2" h="2" l="4">
  <k>7</k>
  <n>Items</n>
  <id />
  <p>5</p>
  <tag>eax.des</tag>
  </e>
<e i="0" hc="1" c="1" h="1" l="5">
  <k>13</k>
  <n>Item 1</n>
  <id>1</id>
  <p>7</p>
  <tag>eax.de</tag>
<term>
<it>
  <n>tag</n>
  <v>eax.de</v>
  </it>
<it>
  <n>key</n>
  <v>116</v>
  </it>
<it>
  <n>elKey</n>
  <v>1</v>
  </it>
  </term>
  </e>
<e i="0" hc="1" c="1" h="1" l="6">
  <k>15</k>
  <n>Item 2</n>
  <id>2</id>
  <p>13</p>
  <tag>eax.de</tag>
<term>
<it>
  <n>tag</n>
  <v>eax.de</v>
  </it>
<it>
  <n>key</n>
  <v>116</v>
  </it>
<it>
  <n>elKey</n>
  <v>2</v>
  </it>
  </term>
  </e>
<e i="0" hc="0" c="0" h="0" l="7">
  <k>16</k>
  <n>Item 3</n>
  <id>3</id>
  <p>15</p>
  <tag>eax.de</tag>
<term>
<it>
  <n>tag</n>
  <v>eax.de</v>
  </it>
<it>
  <n>key</n>
  <v>116</v>
  </it>
<it>
  <n>elKey</n>
  <v>3</v>
  </it>
  </term>
  </e>
<e i="1" hc="0" c="0" h="0" l="5">
  <k>14</k>
  <n>Item 4</n>
  <id>4</id>
  <p>7</p>
  <tag>eax.de</tag>
<term>
<it>
  <n>tag</n>
  <v>eax.de</v>
  </it>
<it>
  <n>key</n>
  <v>116</v>
  </it>
<it>
  <n>elKey</n>
  <v>4</v>
  </it>
  </term>
  </e>
  </els>
  <filteredCount xmlns="">6</filteredCount>
<id xmlns="">
  <id>S1!M!S!E1!Sheets!189!MtdTree</id>
  </id>
  </GetTreeElementsResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
 "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"
    }
  }
} :

JSON response:

{
 "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:

Working with Express Reports