MapGuide API Reference
|
MgByteReader* MgResourceService::EnumerateResources | ( | MgResourceIdentifier * | resource, |
INT32 | depth, | ||
CREFSTRING | type, | ||
bool | computeChildren | ||
) |
Enumerates the resources in the specified repository.
MgByteReader EnumerateResources(MgResourceIdentifier resource, int depth, string type, bool computeChildren); |
MgByteReader EnumerateResources(MgResourceIdentifier resource, int depth, String type, boolean computeChildren); |
MgByteReader EnumerateResources(MgResourceIdentifier resource, int depth, string type, bool computeChildren); |
resource | (MgResourceIdentifier) Resource identifier specifying the resource to enumerate. This can be a document or a folder. If it is a folder, you must include the trailing slash in the identifier. |
depth | (int) Recursion depth, relative to the specified resource.
|
type | (String/string) Type of the resource to be enumerated. (Case sensitive.) See MgResourceType for valid types. Or, this can be set to null, in which case information about all resource types is returned. |
computeChildren | (boolean/bool) Flag to determine whether or not the number of children of the leaf folder resource at the specified depth should be computed.
|
$resourceService
has already been initialized.
// Enumerates everything in the library $resourceID = new MgResourceIdentifier("Library://"); $byteReader = $resourceService->EnumerateResources($resourceID, -1, "", true); // Enumerates everything in Geography $resourceID = new MgResourceIdentifier("Library://Geography/"); $byteReader = $resourceService->EnumerateResources($resourceID, -1, "", true); // Enumerates all maps in the library $resourceID = new MgResourceIdentifier("Library://"); $byteReader = $resourceService->EnumerateResources($resourceID, -1, "MapDefinition", false); // Enumerates all folders in the library $resourceID = new MgResourceIdentifier("Library://"); $byteReader = $resourceService->EnumerateResources($resourceID, -1, "Folder", true); // Enumerates the folder Geography $resourceID = new MgResourceIdentifier("Library://Geography/"); $byteReader = $resourceService->EnumerateResources($resourceID, 0, "Folder", true); // Enumerates maps one level below Geography $resourceID = new MgResourceIdentifier("Library://Geography/"); $byteReader = $resourceService->EnumerateResources($resourceID, 1, "MapDefinition", false); // Enumerates a specific map // NOTE: In this case, depth must be set to 0 $resourceID = new MgResourceIdentifier("Library://Geography/World.MapDefinition"); $byteReader = $resourceService->EnumerateResources($resourceID, 0, "MapDefinition", false);
MgInvalidRepositoryTypeException | |
MgInvalidRepositoryNameException | |
MgInvalidResourcePathException | |
MgInvalidResourceNameException | |
MgInvalidResourceTypeException |