GetObjectResult GetObjectByOdId(OdId tObject, GetObjectArg tArg)
tObject. Moniker of the object, which information should be obtained.
tArg. Operation execution parameters.
The GetObjectByOdId operation gets basic properties of repository object.
The operation gets various basic properties of object (name, identifier, parameter values, shortcut settings, and so on). To execute the operation, in the tObject field specify object moniker, and in the tArg.metaGet field specify the pattern that will be used to get information.
The operation results in the obtained information about object.
Below is the example of getting shortcut properties. The request contains shortcut moniker. The response contains basic properties and information about the object, to which the shortcut refers.
{
"GetObjectByOdId" :
{
"tObject" :
{
"id" : "S1!M!SHORTCUT_TO_REPORT"
},
"tArg" :
{
"metaGet" :
{
"obInst" : "true",
"shortcutSource" : "true"
}
}
}
}
{
"GetObjectByOdIdResult" :
{
"id" :
{
"id" : "S1!M!SHORTCUT_TO_REPORT"
},
"metaGet" :
{
"obInst" :
{
"obDesc" :
{
"@ds" : "",
"@isShortcut" : "1",
"@isLink" : "0",
"@ver" : "11",
"@hf" : "0",
"i" : "SHORTCUT_TO_REPORT",
"n" : "Regular report (2)",
"k" : "176020",
"c" : "2562",
"p" : "61",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0",
"isPermanent" : "1",
"isTemp" : "0"
}
},
"shortcutSource" :
{
"obDesc" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "11",
"@hf" : "0",
"i" : "REPORT",
"n" : "Regular report",
"k" : "176019",
"c" : "2562",
"p" : "61",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0",
"isPermanent" : "1",
"isTemp" : "0"
}
}
}
}
}
public static GetObjectResult GetShortcutMeta(MbId mb, string shortcutId)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tObject = new GetObjectByOdId()
{
//Operation execution parameters
tArg = new GetObjectArg()
{
metaGet = new MbObjectPattern()
{
shortcutSource = true
}
},
tObject = new OdId()
{
id = mb.id + '!' + shortcutId
}
};
//Get shortcut metadata
var result = somClient.GetObjectByOdId(tObject);
return result;
}
See also: