AutoCAD Map 3D 2009 Geospatial Platform Reference

AutoCAD Map 3D Geospatial Platform API

virtual void MgResourceService::ApplyResourcePackage ( MgByteReader resourcePackage  )  [pure virtual]

Applies a package of resource changes to the repository.

Note:
This is not valid with AutoCAD Map 3D. It works with MapGuide only.
Remarks:
This method only works on "Library" repository. Cross repository (Library:// and Session:a2c8e5ba//) changes in a single package are not supported.
.NET Syntax
virtual void ApplyResourcePackage(MgByteReader resourcePackage);
Java Syntax
virtual void ApplyResourcePackage(MgByteReader resourcePackage);
PHP Syntax
virtual void ApplyResourcePackage(MgByteReader resourcePackage);

Parameters:
resourcePackage (MgByteReader) The package containing resources to update.
Returns:
Returns nothing.
Example (PHP)
 // Assuming $resourceService is already initialized.
 $filepath = 'C:\Data\Packages\package.mgp';
 $byteSource = new MgByteSource($filepath);
 $byteReader = $byteSource->GetReader();
 $resourceService->ApplyResourcePackage($byteReader);

Exceptions:
MgNullArgumentException 
MgInvalidRepositoryTypeException 
MgInvalidRepositoryNameException 
MgInvalidResourcePathException 
MgInvalidResourceNameException 
MgInvalidResourceTypeException 
MgOutOfMemoryException 
Note:
  • ApplyResourcePackage is atomic. If a resource operation in the package fails to execute, then all operations up to that point are rolled back.
  • This method only affects the library repository.