MoveObjectResult MoveObject(OdId tParent, MoveObjectArg tArg)
tParent. Moved object moniker.
tArg. Operation execution parameters.
The MoveObject operation moves a repository object.
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.
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.
{
"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"
}
}
}
}
}
}
{
"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: