Beruflich Dokumente
Kultur Dokumente
exe
For .NET development, used with AutoCAD Map 3D and the ASP.NET API of
MapGuide, it is possible to use the tool xsd.exe, which is available with the
SDK that comes with Microsoft Visual Studio. xsd.exe reads an XML schema
and generates .NET classes for working with XML documents based on the
schema. xsd.exe can generate both VB.NET and C# classes.
To use xsd, a typical command is:
xsd.exe LayerDefinition-1.0.0.xsd /c /l:cs /n:OSGeo.Map
Guide.Schema.LayerDefinition
For an example of how to use these classes, see the Developer Samples Guide.
For more information on xsd, see http://msdn.microsoft.com.
layerdefinitionfactory.php
MapGuide includes layerdefinitionfactory.php, which contains PHP methods
for working with the LayerDefinition schema. These methods are designed to
handle most basic tasks with layer definitions, but do not provide complete
support for all possibilities. They create the XML by substituting strings into
external templates. It is relatively easy to adapt the techniques from
layerdefinitionfactory.php for use with a different schema or to translate them
into one of the other development languages.
// using System.Xml;
MgByteReader byteReader =
resourceService.GetResourceContent(resourceId);
XmlDocument doc = new XmlDocument();
doc.LoadXml(byteReader.ToString());
Modify the XML document using standard DOM methods, then convert it
back to a string and re-save the resource.
String xmlString = doc.DocumentElement.OuterXml;
resourceService.SetResource(resourceId,
new MgByteReader(xmlString, "text/xml"), null);
In AutoCAD Map 3D, the resources are stored inside the DWG drawing
file or a DWT template drawing, not in an external database. This means
that resources and their paths are specific to that drawing. In other words,
the same repository path in another drawing may not be defined, or may
refer to a different resource. If you need to share resources between
drawings, you must add them to each drawing.
Session repositories are not supported in AutoCAD Map 3D. All resources
must be stored in the Library repository.
AutoCAD Map 3D does not use resource headers. For any method that
allows them, for example SetResource(), enter null for that parameter.
ApplyResourcePackage()
ChangeResourceOwner()
10 | Chapter 2 Resources