MapGuide API Reference
|
virtual void MgResourceService::CopyResource | ( | MgResourceIdentifier * | sourceResource, |
MgResourceIdentifier * | destResource, | ||
bool | overwrite | ||
) | [pure virtual] |
Copies an existing resource to another location.
virtual void CopyResource(MgResourceIdentifier sourceResource, MgResourceIdentifier destResource, bool overwrite); |
virtual void CopyResource(MgResourceIdentifier sourceResource, MgResourceIdentifier destResource, boolean overwrite); |
virtual void CopyResource(MgResourceIdentifier sourceResource, MgResourceIdentifier destResource, bool overwrite); |
sourceResource | (MgResourceIdentifier) Resource to be copied from. This can be a document or folder. If it is a folder, this method also copies the contents of the folder and all folders below it. You must include the trailing slash in the identifier. |
destResource | (MgResourceIdentifier) Where the resource should be copied to. |
overwrite | (boolean/bool) Flag to determine whether or not the destination resource should be overwritten if it exists. |
// Assuming $resourceService is already initialized. $source_resourceID= new MgResourceIdentifier("Library://Geography/World.MapDefinition"); $destination_resourceID= new MgResourceIdentifier("Library://Atlas/World Geography.MapDefinition"); $resourceService->CopyResource($source_resourceID, $destination_resourceID, true);
This example copies the folder Library://Geography/ to Library://World/Oceans/:
$source_resourceID= new MgResourceIdentifier("Library://Geography/"); $destination_resourceID= new MgResourceIdentifier("Library://World/Oceans/"); $resourceService->CopyResource($source_resourceID, $destination_resourceID, true);