SetObject

Syntax

SetObjectResult SetObject(OdId tObject, SetObjectArg tArg)

Parameters

tObject. Moniker of the object, which structure should be changed.

tArg. Operation execution parameters.

Description

The SetObject operation changes basic properties of repository object.

Comments

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.

Example

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.

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">
<SetObject xmlns="http://www.fsight.ru/PP.SOM.Som">
<tObject xmlns="">
  <id>S1!M!SHORTCUT_TO_REPORT</id>
  </tObject>
<tArg xmlns="">
<metaGet>
  <obInst>true</obInst>
  <shortcutSource>true</shortcutSource>
  </metaGet>
<pattern>
  <obInst>true</obInst>
  <shortcutSource>true</shortcutSource>
  </pattern>
<meta>
<shortcutSource>
<obDesc isShortcut="false" isLink="false" ds="" ver="5" hf="false">
  <i>REPORT_1</i>
  <n>Regular report</n>
  <k>6334</k>
  <c>2562</c>
  <p>6333</p>
  <h>false</h>
  <hasPrv>false</hasPrv>
  <ic>false</ic>
  <trackElementDependents>false</trackElementDependents>
  <isPermanent>true</isPermanent>
  <isTemp>false</isTemp>
  </obDesc>
  </shortcutSource>
  </meta>
  </tArg>
  </SetObject>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<SetObjectResult 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">
<id xmlns="">
  <id>S1!M!SHORTCUT_TO_REPORT</id>
  </id>
<metaGet xmlns="">
<obInst>
<obDesc ds="" isShortcut="1" isLink="0" ver="12" hf="0">
  <i>SHORTCUT_TO_REPORT</i>
  <n>Regular report (2)</n>
  <k>176020</k>
  <c>2562</c>
  <p>61</p>
  <h>0</h>
  <hasPrv>0</hasPrv>
  <ic>0</ic>
  <trackElementDependents>0</trackElementDependents>
  <isPermanent>1</isPermanent>
  <isTemp>0</isTemp>
  </obDesc>
  </obInst>
<shortcutSource>
<obDesc ds="" isShortcut="0" isLink="0" ver="4" hf="0">
  <i>REPORT_1</i>
  <n>Regular report</n>
  <k>6334</k>
  <c>2562</c>
  <p>6333</p>
  <h>0</h>
  <hasPrv>0</hasPrv>
  <ic>0</ic>
  <trackElementDependents>0</trackElementDependents>
  <isPermanent>1</isPermanent>
  <isTemp>0</isTemp>
  </obDesc>
  </shortcutSource>
  </metaGet>
  </SetObjectResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

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

JSON response:

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

Working with a Repository