MoveObject

Syntax

MoveObjectResult MoveObject(OdId tParent, MoveObjectArg tArg)

Parameters

tParent. Moved object moniker.

tArg. Operation execution parameters.

Description

The MoveObject operation moves a repository object.

Comments

To execute the operation, in the tParent parameter specify the moved object moniker. In the tArg parameter specify information on where the object is moved. This parameter may also contain parameters of updating the list of repository objects, that will be applied after the operation is executed.

The operation results in the description of the moved object, and also the updated list of repository objects, if respective operation execution parameters are specified.

Example

The example of moving an object. The object is moved to the repository folder with the Temp identifier.

The C# example uses the FindObjectById function, which code is given in the Getting Object Description by Its Identifier example.

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">
<MoveObject xmlns="http://www.fsight.ru/PP.SOM.Som">
<tParent xmlns="">
  <id>FNDKOLJACBNNFOAEDCEENEKPOGMMOOGEBLEIHFKEJOFOFMNJ!M!305000</id>
  </tParent>
<tArg xmlns="">
<info>
<parent isShortcut="false" isLink="false" hf="false">
  <i>TEMP</i>
  <n>Temp</n>
  <k>65</k>
  <c>0</c>
  <p>70</p>
  <h>false</h>
  <hasPrv>false</hasPrv>
  <ic>false</ic>
  </parent>
  </info>
<getObjects>
<parent>
  <id>FNDKOLJACBNNFOAEDCEENEKPOGMMOOGEBLEIHFKEJOFOFMNJ!M!65</id>
  </parent>
<filter>
  <hideEmptyFolders>true</hideEmptyFolders>
<classes>
<it>
  <k>1538</k>
  </it>
  </classes>
  </filter>
<arg>
<pattern>
  <n>false</n>
  <i>true</i>
  <ts>false</ts>
  <ds>false</ds>
  <isShortcut>false</isShortcut>
  </pattern>
  </arg>
  </getObjects>
  </tArg>
  </MoveObject>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<MoveObjectResult 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">
<object xmlns="" ds="" isShortcut="0" isLink="0" ver="1" hf="0">
  <i>NEWFORM1</i>
  <n>NewForm1</n>
  <k>305000</k>
  <c>1538</c>
  <p>65</p>
  <h>0</h>
  <hasPrv>0</hasPrv>
  <ic>0</ic>
  <trackElementDependents>0</trackElementDependents>
  </object>
<objects xmlns="">
<id>
  <id>FNDKOLJACBNNFOAEDCEENEKPOGMMOOGEBLEIHFKEJOFOFMNJ!M!305000</id>
  </id>
<objects>
<its>
<d isShortcut="0" isLink="0" hf="0">
  <i>OBJ90</i>
  <n />
  <k>90</k>
  <c>1538</c>
  <p>65</p>
  <h>0</h>
  <hasPrv>0</hasPrv>
  <ic>0</ic>
  </d>
<d isShortcut="0" isLink="0" hf="0">
  <i>NEWFORM1</i>
  <n />
  <k>305000</k>
  <c>1538</c>
  <p>65</p>
  <h>0</h>
  <hasPrv>0</hasPrv>
  <ic>0</ic>
  </d>
  </its>
  </objects>
  </objects>
  </MoveObjectResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"MoveObject" :
{
"tParent" :
{
"id" : "FNDKOLJACBNNFOAEDCEENEKPOGMMOOGEBLEIHFKEJOFOFMNJ!M!305000"
},
"tArg" :
{
"info" :
{
"parent" :
{
"@isShortcut" : "false",
"@isLink" : "false",
"@hf" : "false",
"i" : "TEMP",
"n" : "Temp",
"k" : "65",
"c" : "0",
"p" : "70",
"h" : "false",
"hasPrv" : "false",
"ic" : "false"
}
},
"getObjects" :
{
"parent" :
{
"id" : "FNDKOLJACBNNFOAEDCEENEKPOGMMOOGEBLEIHFKEJOFOFMNJ!M!65"
},
"filter" :
{
"hideEmptyFolders" : "true",
"classes" :
{
"it" :
{
"k" : "1538"
}
}
},
"arg" :
{
"pattern" :
{
"n" : "false",
"i" : "true",
"ts" : "false",
"ds" : "false",
"isShortcut" : "false"
}
}
}
}
}
}

JSON response:

{
"MoveObjectResult" :
{
"object" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "1",
"@hf" : "0",
"i" : "NEWFORM1",
"n" : "NewForm1",
"k" : "305000",
"c" : "1538",
"p" : "65",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0"
},
"objects" :
{
"id" :
{
"id" : "FNDKOLJACBNNFOAEDCEENEKPOGMMOOGEBLEIHFKEJOFOFMNJ!M!305000"
},
"objects" :
{
"its" :
{
"d" :
[
{
"@isShortcut" : "0",
"@isLink" : "0",
"@hf" : "0",
"i" : "OBJ90",
"n" : "",
"k" : "90",
"c" : "1538",
"p" : "65",
"h" : "0",
"hasPrv" : "0",
"ic" : "0"
},
{
"@isShortcut" : "0",
"@isLink" : "0",
"@hf" : "0",
"i" : "NEWFORM1",
"n" : "",
"k" : "305000",
"c" : "1538",
"p" : "65",
"h" : "0",
"hasPrv" : "0",
"ic" : "0"
}
]
}
}
}
}
}
public static MoveObjectResult MoveObject(MbId mb, string moveableObj, string newParentId)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
var tObject = FindObjectById(mb, moveableObj);
var tParent = FindObjectById(mb, newParentId);
//Operation execution parameters
var tMove = new MoveObject()
{
tArg = new MoveObjectArg()
{
//Parameters of refreshing objects list after moving
getObjects = new GetObjectsOpArg()
{
arg = new GetObjectsArg()
{
pattern = new OdsPattern()
{
ds = false,
i = true,
isShortcut = false,
n = false,
ts = false
}
},
filter = new OdsFilt()
{
classes = new OdClass[1]
{
//Refresh list of objects with the same class, which the moved object has
new OdClass(){k = tObject.c},
},
hideEmptyFolders = true
},
parent = new OdId() { id = mb.id + "!" + tParent.k }
},
info = new ObjectMoveInfo()
{
parent = tParent
}
},
tParent = new OdId()
{
id = mb.id + "!" + tObject.k
}
};
//Move object
var result = somClient.MoveObject(tMove);
return result;
}

See also:

Common Operations