Moves an existing resource to another location.
.NET Syntax
Java Syntax
PHP Syntax
Example (PHP)
This example moves the file Library://Geography/World.MapDefinition to Library://Atlas/Oceans.MapDefinition:
// Assuming $resourceService has already been initialized $oldPath = new MgResourceIdentifier("Library://Geography/World.MapDefinition"); $newPath = new MgResourceIdentifier("Library://Atlas/Oceans.MapDefinition"); $resourceService->MoveResource($oldPath, $newPath, true); This example moves the folder Library://Geography/ to Library://World Geography/: $oldPath = new MgResourceIdentifier("Library://Geography/"); $newPath = new MgResourceIdentifier("Library://World Geography/"); $resourceService->MoveResource($oldPath, $newPath, true); This example renames Oceans.MapDefinition to Pacific Ocean.MapDefinition: /**************************************************************************/ $oldPath = new MgResourceIdentifier("Library://Atlas/Oceans.MapDefinition"); $newPath = new MgResourceIdentifier("Library://Atlas/Pacific Ocean.MapDefinition"); $resourceService->MoveResource($oldPath, $newPath, true);
|