Web API Reference | MapGuide Open Source

- Overview
- Modules
- Classes

ApplyResourcePackage
ChangeResourceOwner
CopyResource
DeleteResource
DeleteResourceData
EnumerateReferences
EnumerateResourceData
EnumerateResources
EnumerateResources
EnumerateUnmanagedData
GetRepositoryContent
GetRepositoryHeader
GetResourceContent
GetResourceData
GetResourceHeader
InheritPermissionsFrom
MoveResource
RenameResourceData
ResourceExists
SetResource
SetResourceData
UpdateRepository
virtual void MgResourceService::UpdateRepository | ( | MgResourceIdentifier * | resource,
|  | MgByteReader * | content,
|  | MgByteReader * | header |
| ) |  |  | `[pure virtual]`
Updates the header and content of the specified repository. Remarks: This method can only be used on a repository that already exists. .NET Syntax
`virtual void UpdateRepository(MgResourceIdentifier resource, MgByteReader content, MgByteReader header);`
Java Syntax
`virtual void UpdateRepository(MgResourceIdentifier resource, MgByteReader content, MgByteReader header);`
PHP Syntax
`virtual void UpdateRepository(MgResourceIdentifier resource, MgByteReader content, MgByteReader header);`
  Parameters:
  | resource | (MgResourceIdentifier) Repository to update.
  | content | (MgByteReader) Repository content in XML format using the RepositoryContent schema. Or, if the repository is the library, this can be set to null in which case the content is not changed.
  | header | (MgByteReader) If the repository is the library, this is the <repository header in XML format using the ResourceFolderHeader_schema schema. Or, this can be set to null in which case the header is not changed. If the repository is a session repository, this must be null.
Returns: Returns nothing. Example (PHP) This example updates the content and leaves the header unchanged:
     // Assuming $resourceService has already been initialized
     // Get a resource identifier for the library
     $resourceID = new MgResourceIdentifier('Library://');
     // Read the new content from a file
     $byteSource = new MgByteSource('C:\Data\Repository\Content.xml');
     // Put that MgByteSource into an MgByteReader
     $byteReader = $byteSource->GetReader();
     // Update the repository content
     $resourceService->UpdateRepository($resourceID, $byteReader, null);
  Exceptions:
  | MgOutOfMemoryException |
  | MgRepositoryNotFoundException | if repository does not exist
  | MgInvalidRepositoryTypeException |
  Note:
  If you are updating | Content | Header
  --- | --- | ---
  the library | Can be null as long as the header is not null. | Can be null as long as the content is not null.
  a session repository | Must not be null. | Must be null.

Comments or suggestions? Send us feedback.