Below is the example of using the GetDimMetadata operation to get information about structure of repository dictionary. The request contains the dictionary moniker and the pattern that determines what data must be extracted. The response contains the obtained information.
{ "GetDimMetadata" : { "tDim" : { "id" : "S1!M!S!S1" }, "tArg" : {
"pattern" : { "obInst" : "false", "getDescr" : "true", "getAttrs" : "true", "getLevs" : "true", "getCompound" : "true" } } } }
{ "GetDimMetadataResult" : { "id" : { "id" : "S1!M!S!S1" }, "data" :
{ "descr" : { "k" : "116", "id" : "DIM_1", "n" : "Dim_1", "vis" : "1", "cls" : { "k" : "1025"
} }, "attrs" : { "it" : [ { "k" : "117", "id" : "NAME", "n" : "Name",
"vis" : "1", "dt" : "1", "predefined" : "Name" }, { "k" : "118", "id" : "ID", "n" : "Identifier", "vis" : "1", "dt" : "2",
"uniqueIndex" : "INDEX1", "predefined" : "Ident" }, { "k" : "119", "id" : "ORDER", "n" : "Order", "vis" : "1", "dt" : "2", "predefined" : "Order"
}, { "k" : "122", "id" : "PARENT", "n" : "Parent", "vis" : "1", "dt" : "2" }, { "k" : "177",
"id" : "CODE", "n" : "Code", "vis" : "1", "dt" : "1" } ] }, "levs" : { "it" :
[ { "k" : "150", "id" : "LEVEL1", "n" : "Level1", "vis" : "1" }, { "k" : "151", "id" : "LEVEL2",
"n" : "Level2", "vis" : "1" }, { "k" : "4294967295", "n" : "Level 2", "vis" : "0" } ] },
"selection" : { "selectedCount" : "-1", "compound" : { "k" : "4294967295" } } } } }
The specified GetDictInfo function returns information about dictionary structure. The dictionary instance moniker is sent as an input parameter. In the function body specify the pattern with the dictionary blocks, information on which needs to be obtained. The result of the function is the result of the operation.
public static GetDimMetadataResult GetDictInfo(DmId moniker) { var somClient = new SomPortTypeClient(); //Proxy object for operation execution //Operation execution parameters var tMeta = new GetDimMetadata() { tArg = new GetDimMetadataArg() { pattern = new DmMetadataPattern() { getAttrs = true, getCompound = true, getDescr = true, getLevs = true, obInst = false } }, tDim = moniker }; //Get information on dictionary structure var result = somClient.GetDimMetadata(tMeta); return result; }
See also: