Unformatted text preview:

ContentsResources and the Resource DatabaseResource IdentifiersResource Service API Layer Definition Resource XML SchemaUsing Templates to Make Dynamic Resource Creation EasyModifying Resource XML Documents with the DOMComputing Distributions with the MgFeatureService SelectAggregate APIPutting It Together in the Theme TaskResources Appendix A: Sample Layer Definition for the Parcel Layer in Figure 1Autodesk MapGuide® Enterprise Working with Resources Autodesk MapGuide® Enterprise software has a powerful API (application programming interface) for manipulating resources such as feature and drawing sources, maps, layers, and layouts. Using the Resource Service API, MapGuide-based applications can perform operations such as dynamic theming, data filtering, and layer creation among others, providing a rich, interactive experience for your users. This paper provides an in-depth look at resources and the resource service API in Autodesk MapGuide Enterprise. The information in this paper is applicable to both the MapGuide Open Source and Autodesk MapGuide Enterprise versions of the platform.AUTODESK MAPGUIDE TECHNIQUES: WORKING WITH RESOURCES www.autodesk.com/mapguideContents Introduction...................................................................................................................3 Resources and the Resource Database .....................................................................4 Resource Identifiers .....................................................................................................5 Resource Service API...................................................................................................5 Layer Definition Resource XML Schema....................................................................7 Using Templates to Make Dynamic Resource Creation Easy.................................11 Modifying Resource XML Documents with the DOM...............................................12 Computing Distributions with the MgFeatureService SelectAggregate API .........13 Putting It Together in the Theme Task......................................................................14 Resources ...................................................................................................................16 Appendix A: Sample Layer Definition for the Parcel Layer in Figure 1 .................17 2AUTODESK MAPGUIDE TECHNIQUES: WORKING WITH RESOURCES www.autodesk.com/mapguideIntroduction Resources are XML documents that define feature sources, drawing sources, layers, maps, and the user interface (layout) of the Autodesk MapGuide® Viewer. This paper introduces the concepts and demonstrates how to create and modify resources on a per-user basis in MapGuide applications. This can be useful if your application needs to dynamically add layers, change layer filters or stylization, or customize the map or web layout based on who the user is. The code samples in the paper were taken from a sample application that is available on the Autodesk MapGuide Technology Resource Center website (www.autodesk.com/ learnmapguide or data.mapguide.com/mapguide/gt/index.php for the direct link to the sample and source code download). The Theme task in the sample application allows the end user to theme or retheme a polygon layer (Figure 1). Figure 1: Sample Application Theme Task Users start by selecting a layer to theme and a property to use for the theme value. From there they can choose a statistical distribution from a drop-down menu that includes all the standard commands offered in Autodesk MapGuide® Studio (Individual, Equal, Standard Deviation, Quantile, and Jenks [Natural Breaks]) and the number of rules/categories to create. For the style ramp they can choose the starting and ending fill and border colors. Once they have made their choices, clicking Apply creates a new layer (using all the properties of the selected layer) and inserts it in the map just above the existing layer in the draw order. 3AUTODESK MAPGUIDE TECHNIQUES: WORKING WITH RESOURCES www.autodesk.com/mapguideThis paper covers all of the Autodesk MapGuide APIs and techniques used to create the theme application. Resources and the Resource Database Autodesk MapGuide Enterprise stores map definitions, layer definitions, data source connections, symbol definitions, and web and print layouts as XML documents in the Resource Database. These XML documents are referred to as resources. Resources are stored within the Resource Database in a directory-like hierarchy. Each stored resource has two fundamental parts: a header and content. The content is the XML document itself, such as the content of a file in the file system. The header is also an XML document that defines access permissions and metadata for the resource. Continuing the file system analogy, resources are also typed, that is, you can immediately distinguish between a map definition and a layer definition without reading and examining the content. All resource XML is defined by a W3C XML schema, and by default documents are validated against the schema when they are written to the resource database. Resource documents can refer to other resources and can have associated data, such as files, strings, or streams of bytes. Figure 2 shows the various resource types supported by Autodesk MapGuide Enterprise and which ones typically contain references to other resources, use resource data, or both. ResourcesWeb LayoutPrint LayoutMap DefinitionLayer DefinitionFeature Source Definition[1]Drawing Source DefinitionLoad ProcedureFolderSymbol LibraryMap[2]Feature SetResource DataFiles Streams StringsSymbolsData File(s)Configuration DocumentCredentialsDWF FileMapReferences another resource Uses resource data[1] The specific requirements for Data File, Configuration Document, and Credentials data for a given Feature Source depends on the FDO Provider.[2] Session based Map resources do not have XML document content, they are stored only as stream based resource data. Figure 2: Resource Types, References, and Data Usage The resource database is divided into two separate storage containers called repositories. The library repository is shared by all users and stores resource documents for an indefinite period of time. The Autodesk MapGuide Studio application allows you to create, edit, and manage resources in the library repository. The session repository stores 4AUTODESK MAPGUIDE TECHNIQUES: WORKING WITH RESOURCES


View Full Document

UNLV CEE 301 - Working with Resources

Documents in this Course
Surfaces

Surfaces

34 pages

Surfaces

Surfaces

39 pages

Tutorials

Tutorials

140 pages

Tutorials

Tutorials

76 pages

Queries

Queries

13 pages

Load more
Download Working with Resources
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Working with Resources and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Working with Resources 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?