MapGuide API Reference
 All Classes Functions Variables Enumerations Enumerator Friends
virtual void MgResourceService::ApplyResourcePackage ( MgByteReader resourcePackage) [pure virtual]

Applies a package of resource changes to the repository.

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.