MapGuide API Reference
|
virtual void MgResourceService::MoveResource | ( | MgResourceIdentifier * | sourceResource, |
MgResourceIdentifier * | destResource, | ||
bool | overwrite | ||
) | [virtual] |
Moves an existing resource to another location.
virtual void MoveResource(MgResourceIdentifier sourceResource, MgResourceIdentifier destResource, bool overwrite); |
virtual void MoveResource(MgResourceIdentifier sourceResource, MgResourceIdentifier destResource, boolean overwrite); |
virtual void MoveResource(MgResourceIdentifier sourceResource, MgResourceIdentifier destResource, bool overwrite); |
sourceResource | (MgResourceIdentifier) Resource to be moved. This can be a document or folder.
|
destResource | (MgResourceIdentifier) Where the resource should be moved to. |
overwrite | (boolean/bool) Flag to determine whether or not the destination resource should be overwritten if it exists. |
// 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);