Web API Reference | MapGuide Open Source

- Overview
- Modules
- Classes

# Resource Service

## Modules
| Resource Service Classes

## Detailed Description

The Resource Service enables you to manipulate repositories and resources.

A resource repository stores all the files and configuration information used by MapGuide. There are two types of repository. The library is used for persistent storage. There may also be session repositories. These hold data only for the user's current session, and are automatically deleted by the MapGuide server if they have not been used for a certain length of time. MapGuide creates session repositories automatically as required. You can also create your own session repositories by using MgSite::CreateSession().

A repository is structured like a directory, with documents, folders, and subfolders. Each resource, and any associated files required for that resource, is stored in one folder.

The root level of each repository, each folder in a repository, and each resource in a repository, has a header that specifies the permissions to access it. These permissions control whether users and groups can read and/or write to a resource or folder. Permissions can either be set explicitly for each folder or resource, or they can be set to inherit the permissions from the parent folder.

Resources may depend on other items:

- Some resources, such as print layouts, are self sufficient and do not refer to any other resources or files.
- Some resources reference other resources. For example, maps and layers are stored as separate resources, and the map refers to the layers that are included in the map.
- Some resources use associated resource data. For example, an ArcSDE feature source uses a file which holds the database credentials. Resource data can be stored as files, streams, or strings.
  - Files are used when the data is large, such as SHP files
  - Streams are used for faster access to smaller pieces of binary data, such as symbols.
  - Strings are used for small pieces of text data, such as database access credentials.

### Methods For Working With Repositories

- MgResourceService::GetRepositoryContent
- MgResourceService::GetRepositoryHeader
- MgResourceService::UpdateRepository

### Methods For Working With Resources

- MgResourceService::ChangeResourceOwner
- MgResourceService::CopyResource
- MgResourceService::DeleteResource
- MgResourceService::EnumerateReferences
- MgResourceService::EnumerateResources
- MgResourceService::EnumerateUnmanagedData
- MgResourceService::GetResourceContent
- MgResourceService::GetResourceHeader
- MgResourceService::GetResourceMetadata
- MgResourceService::InheritPermissionsFrom
- MgResourceService::MoveResource
- MgResourceService::ResourceExists
- MgResourceService::SetResource
- MgResourceService::SetResourceMetadata

### Methods For Working With Resource Data

- MgResourceService::DeleteResourceData
- MgResourceService::EnumerateResourceData
- MgResourceService::GetResourceData
- MgResourceService::RenameResourceData
- MgResourceService::SetResourceData

### Methods For Working With Resource Packages

- MgResourceService::ApplyResourcePackage

Comments or suggestions? Send us feedback.