SetObjectResult SetObject(OdId tObject, SetObjectArg tArg)
tObject. Moniker of the object, which structure should be changed.
tArg. Operation execution parameters.
The SetObject operation changes basic properties of repository object.
The operation changes names, identifiers and values of repository object parameters. It is also possible to set up shortcuts to other repository objects. To execute the operation, in the tObject field specify object moniker, and in the tArg field specify necessary conditions of changing object properties. All changes are saved automatically after finishing the operation.
If the tArg.metaGet field is defined, the operation results in the updated information about object.
Below is the example of changing shortcut properties. The request contains shortcut moniker and metadata of the new object, to which the shortcut refers. The response contains updated information about the shortcut.
{
"SetObject" :
{
"tObject" :
{
"id" : "S1!M!SHORTCUT_TO_REPORT"
},
"tArg" :
{
"metaGet" :
{
"obInst" : "true",
"shortcutSource" : "true"
},
"pattern" :
{
"obInst" : "true",
"shortcutSource" : "true"
},
"meta" :
{
"shortcutSource" :
{
"obDesc" :
{
"@ds" : "",
"@isShortcut" : "false",
"@isLink" : "false",
"@ver" : "5",
"@hf" : "false",
"i" : "REPORT_1",
"n" : "Regular report",
"k" : "6334",
"c" : "2562",
"p" : "6333",
"h" : "false",
"hasPrv" : "false",
"ic" : "false",
"trackElementDependents" : "false",
"isPermanent" : "true",
"isTemp" : "false"
}
}
}
}
}
}
{
"SetObjectResult" :
{
"id" :
{
"id" : "S1!M!SHORTCUT_TO_REPORT"
},
"metaGet" :
{
"obInst" :
{
"obDesc" :
{
"@ds" : "",
"@isShortcut" : "1",
"@isLink" : "0",
"@ver" : "12",
"@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" : "4",
"@hf" : "0",
"i" : "REPORT_1",
"n" : "Regular report",
"k" : "6334",
"c" : "2562",
"p" : "6333",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0",
"isPermanent" : "1",
"isTemp" : "0"
}
}
}
}
}
public static SetObjectResult SetShortcutObject(MbId mb, string shortcutId, PrxMd report)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tObject = new SetObject()
{
//Operation execution parameters
tArg = new SetObjectArg()
{
pattern = new MbObjectPattern()
{
shortcutSource = true
},
meta = new MbObjectMd()
{
shortcutSource = report.obInst
},
metaGet = new MbObjectPattern()
{
obInst = true,
shortcutSource = true
}
},
tObject = new OdId()
{
id = mb.id + '!' + shortcutId
}
};
//Change shortcut metadata
var result = somClient.SetObject(tObject);
return result;
}
See also: