<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Yes. I have moved the entire site over on the MapGuide wiki.<br>
Documentation can now be found here:<br>
<a class="moz-txt-link-freetext" href="http://trac.osgeo.org/mapguide/wiki/maestro">http://trac.osgeo.org/mapguide/wiki/maestro</a><br>
And for the API:<br>
<a class="moz-txt-link-freetext" href="http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI">http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI</a><br>
<br>
Too bad about the LinQ dependancy, it would be a lot cleaner to do it
that way.<br>
<br>
I have not exposed functionality in the way you ask, but it is there.<br>
You can do it with code like this:<br>
<tt>Stream s = ... stream with Xml data ...<br>
LayerDefinition layer =
(LayerDefinition)con.DeserializeObject(typeof(LayerDefinition), s);<br>
layer.BackgroundColor = Color.White;<br>
s = con.SerializeObject(s);</tt><br>
<br>
The methods could actually be static, but they are not because they use
the server version to restrict/convert the version's of the documents.<br>
<br>
It is possible to serialize/deserialise the objects manually, using the
XmlSerializer from .Net:<br>
<tt>XmlSerializer ser = new XmlSerializer(typeof(LayerDefinition));<br>
layer = (LayerDefinition)con.Deserialize(s);<br>
</tt><tt>layer.BackgroundColor = Color.Green;<br>
</tt><tt>ser.Serialize(s, layer);</tt><br>
<br>
There is a function in the Utility class that strips the UTF-8 BOM:<br>
<tt>s = Utility.RemoveUTF8BOM(s);</tt><br>
<br>
<br>
<pre class="moz-signature" cols="72">Regards, Kenneth Skovhede, GEOGRAF A/S
</pre>
<br>
<br>
Darrin Maidlow skrev:
<blockquote cite="mid:004701c8bddf$4af50f30$e0df2d90$@com" type="cite">
  <meta http-equiv="Content-Type" content="text/html; ">
  <meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
  <style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
  </style><!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
  <div class="Section1">
  <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Hi
Kenneth,<o:p></o:p></span></p>
  <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p>&nbsp;</o:p></span></p>
  <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Thanks
for the feedback.&nbsp;
You are very right in that dual development streams would be a bad
thing and a
waste of a lot of time.&nbsp; &nbsp;What I was hoping to accomplish with that
XSD codegen was to create a set of relatively light weight objects to
roundtrip
the xml. &nbsp;Eliminate the use of XML tools for working with the mapguide
entities, then return the entities back to XML for use with the
Mapguide API.&nbsp;
&nbsp;&nbsp;I was not planning a full API project.&nbsp; Again, you are right
in that there is still some messing around needed to be done with the
linq code
&#8211; I had problems with nulls just as you mentioned =)<o:p></o:p></span></p>
  <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p>&nbsp;</o:p></span></p>
  <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">To answer
your question, as far
as I can see, the linq dll is required for the generated code to
function.&nbsp; A lot of the generated functionality requires methods that
exist
within the linq to XSD dll file.<o:p></o:p></span></p>
  <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p>&nbsp;</o:p></span></p>
  <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">I spent
some time trying to find
more info on the MeastroAPI today, but was not able to find much.&nbsp;
Likely
because of the move over to osgeo.&nbsp; I have not had a chance to actually
work with the API again yet, but perhaps you could answer a couple
questions
for me.<o:p></o:p></span></p>
  <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p>&nbsp;</o:p></span></p>
  <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Does
Meastro API come with the
abovementioned objects I was looking for?&nbsp; Can I shove some XML from
the
repository into a new object, do some work, and then spit the new XML
back
out?&nbsp; If so, I&#8217;m assuming that I could continue to work with the web
tier API from Mapguide?<o:p></o:p></span></p>
  <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p>&nbsp;</o:p></span></p>
  <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">thx<o:p></o:p></span></p>
  <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">darrin<o:p></o:p></span></p>
  <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p>&nbsp;</o:p></span></p>
  <div>
  <div
 style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0in 0in;">
  <p class="MsoNormal"><b><span
 style="font-size: 10pt; font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; color: windowtext;">From:</span></b><span
 style="font-size: 10pt; font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;; color: windowtext;">
<a class="moz-txt-link-abbreviated" href="mailto:mapguide-users-bounces@lists.osgeo.org">mapguide-users-bounces@lists.osgeo.org</a>
[<a class="moz-txt-link-freetext" href="mailto:mapguide-users-bounces@lists.osgeo.org">mailto:mapguide-users-bounces@lists.osgeo.org</a>] <b>On Behalf Of </b>Kenneth
Skovhede, GEOGRAF A/S<br>
  <b>Sent:</b> Thursday, May 22, 2008 12:04 PM<br>
  <b>To:</b> MapGuide Users Mail List<br>
  <b>Subject:</b> Re: [mapguide-users] .NET Objects for working with
Mapguide
Resources<o:p></o:p></span></p>
  </div>
  </div>
  <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
  <p class="MsoNormal">That is a smart way to convert Xsd to classes.
Is it
possible to extract the generated code and use it without LinQ for .Net
2.0?<br>
  <br>
I'm not sure what you mean by "wanted to stay closer to the core
API". Your generated classes expose the MapGuide Xml as .Net classes.<br>
You can then use .Net objects "directly" instead of handling Xml.
That is exactly what the MaestroAPI does.<br>
  <br>
I have implemented a connection interface that enables you to
communicate with
MapGuide either via the MapGuide API, or through Http.<br>
If you use the LocalNativeConnection exclusively, MaestroAPI is doing
the exact
same thing your code does.<br>
  <br>
If you (or someone else) has questions about MaestroAPI usage, please
ask away.<br>
If you (or someone else) find missing functionality, or has
improvements for
MaestroAPI, let me know.<br>
I have a short introduction to MaestroAPI usage here:<br>
  <a moz-do-not-send="true"
 href="http://code.google.com/p/mapstudioos/wiki/HowToUseMapGuideAPI">http://code.google.com/p/mapstudioos/wiki/HowToUseMapGuideAPI</a><br>
(The site is being migrated to here: <a moz-do-not-send="true"
 href="http://trac.osgeo.org/mapguide/wiki/maestro">http://trac.osgeo.org/mapguide/wiki/maestro</a>)<br>
  <br>
I like your code, and if you are up for it, I think we both could
benefit from
one great API extension, rather than two good ones.<br>
I have learned that after you have the serialization in place there are
many
places where you must handle trivial stuff like <br>
converting null string to empty string, empty collections to null
collections,
etc. MaestroAPI handles much of this already,<br>
and I would be sad to see you spend your time implementing that for
another
project.<br>
  <br>
  <o:p></o:p></p>
  <pre>Regards, Kenneth Skovhede, GEOGRAF A/S<o:p></o:p></pre>
  <p class="MsoNormal"><br>
  <br>
Darrin Maidlow skrev: <o:p></o:p></p>
  <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Hi Maksim,</span><o:p></o:p></p>
  <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">I looked
at early on in my learnage,
but wanted to stay closer to the core API provided by Mapguide Project
/
Autodesk. &nbsp;&nbsp;ADN support could offer some help with the built in API,
and if needed escalate off to the devs.&nbsp; I did also have some problems
getting the Maestro API running &#8211; but that was right around the
transition between 1.1 and 2.0 &#8211; and working all night with too much
redbull probably didn&#8217;t help either =)</span><o:p></o:p></p>
  <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">&nbsp;</span><o:p></o:p></p>
  <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">darrin</span><o:p></o:p></p>
  <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">&nbsp;</span><o:p></o:p></p>
  <div>
  <div
 style="border-style: solid none none; border-color: -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0in 0in;">
  <p class="MsoNormal"><b><span
 style="font-size: 10pt; font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;;">From:</span></b><span
 style="font-size: 10pt; font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;;"> <a
 moz-do-not-send="true"
 href="mailto:mapguide-users-bounces@lists.osgeo.org">mapguide-users-bounces@lists.osgeo.org</a>
[<a moz-do-not-send="true"
 href="mailto:mapguide-users-bounces@lists.osgeo.org">mailto:mapguide-users-bounces@lists.osgeo.org</a>]
  <b>On Behalf Of </b>Maksim Sestic<br>
  <b>Sent:</b> Thursday, May 22, 2008 7:40 AM<br>
  <b>To:</b> 'MapGuide Users Mail List'<br>
  <b>Subject:</b> RE: [mapguide-users] .NET Objects for working with
Mapguide
Resources</span><o:p></o:p></p>
  </div>
  </div>
  <p class="MsoNormal">&nbsp;<o:p></o:p></p>
  <p class="MsoNormal"><span
 style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; color: blue;">Hi
Darrin,</span><o:p></o:p></p>
  <p class="MsoNormal"><span
 style="font-size: 12pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;">&nbsp;</span><o:p></o:p></p>
  <p class="MsoNormal"><span
 style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; color: blue;">Thanks
for the tip. Please take a&nbsp;look at Kenneth's Meastro
API:</span><o:p></o:p></p>
  <p class="MsoNormal"><span
 style="font-size: 12pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;">&nbsp;</span><o:p></o:p></p>
  <p class="MsoNormal"><span
 style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; color: blue;"><a
 moz-do-not-send="true"
 href="http://trac.osgeo.org/mapguide/browser/trunk/Tools/Maestro/MaestroAPI">http://trac.osgeo.org/mapguide/browser/trunk/Tools/Maestro/MaestroAPI</a></span><o:p></o:p></p>
  <p class="MsoNormal"><span
 style="font-size: 12pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;">&nbsp;</span><o:p></o:p></p>
  <p class="MsoNormal"><span
 style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; color: blue;">It
relies on .NET 2.0 for MG types (de)serialization.</span><o:p></o:p></p>
  <p class="MsoNormal"><span
 style="font-size: 12pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;">&nbsp;</span><o:p></o:p></p>
  <p class="MsoNormal"><span
 style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; color: blue;">Regards,</span><o:p></o:p></p>
  <p class="MsoNormal"><span
 style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; color: blue;">Maksim
Sestic</span><o:p></o:p></p>
  <p class="MsoNormal"><span
 style="font-size: 12pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;">&nbsp;</span><o:p></o:p></p>
  <div class="MsoNormal" style="text-align: center;" align="center"><span
 style="font-size: 12pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;">
  <hr align="center" size="2" width="100%"></span></div>
  <p class="MsoNormal" style="margin-bottom: 12pt;"><b><span
 style="font-size: 10pt; font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;;">From:</span></b><span
 style="font-size: 10pt; font-family: &quot;Tahoma&quot;,&quot;sans-serif&quot;;"> <a
 moz-do-not-send="true"
 href="mailto:mapguide-users-bounces@lists.osgeo.org">mapguide-users-bounces@lists.osgeo.org</a>
[<a moz-do-not-send="true"
 href="mailto:mapguide-users-bounces@lists.osgeo.org">mailto:mapguide-users-bounces@lists.osgeo.org</a>]
  <b>On Behalf Of </b>Darrin Maidlow<br>
  <b>Sent:</b> Thursday, May 22, 2008 15:28<br>
  <b>To:</b> <a moz-do-not-send="true"
 href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a><br>
  <b>Subject:</b> [mapguide-users] .NET Objects for working with
Mapguide
Resources</span><o:p></o:p></p>
  <p class="MsoNormal">Hi List,<o:p></o:p></p>
  <p class="MsoNormal">&nbsp;<o:p></o:p></p>
  <p class="MsoNormal">I&#8217;ve written two posts I thought I would share
with
you on the topic of .NET based MG dev.&nbsp; The first describes a method
I&#8217;ve worked out to create relatively robust .NET based objects based on
the Xml Schema Definitions provided with the server.&nbsp;&nbsp; &nbsp;Please
note, I currently am only working with MGE 2009.&nbsp; I have not tried this
code on MGOS.&nbsp; If you do try them on MGOS, please let me know what
results
have.<o:p></o:p></p>
  <p class="MsoNormal">&nbsp;<o:p></o:p></p>
  <p class="MsoNormal">In a nutshell, one can get the resource XML from
the
resource service, load it into the object with the provided .parse
method,
manipulate the object (without having to use xml) e.g. add child
objects,
change properties etc, and finally spit it back out to XML for saving
back to
the repository.&nbsp; Yay no longer need to be jealous of the PHP guys and
their object factories =D<o:p></o:p></p>
  <p class="MsoNormal">&nbsp;<o:p></o:p></p>
  <p class="MsoNormal">The second is a dynamic authoring example using
these
objects, manipulating the MapDefinition before the viewer has loaded it.<o:p></o:p></p>
  <p class="MsoNormal">&nbsp;<o:p></o:p></p>
  <p class="MsoNormal">Both come with full source code, and Visual
Studio 2008
projects.&nbsp;&nbsp; I hope they are helpful to the other .NET devs out there.
  <o:p></o:p></p>
  <p class="MsoNormal">&nbsp;<o:p></o:p></p>
  <p class="MsoNormal"><a moz-do-not-send="true"
 href="http://www.webrade.com/blogs/darrin/2008/05/16/CreatingNETObjectsForMapguideXMLSchemaDefinitionsXSDUsingLINQ.aspx">http://www.webrade.com/blogs/darrin/2008/05/16/CreatingNETObjectsForMapguideXMLSchemaDefinitionsXSDUsingLINQ.aspx</a><o:p></o:p></p>
  <p class="MsoNormal"><a moz-do-not-send="true"
 href="http://www.webrade.com/blogs/darrin/2008/05/21/DynamicAuthoringInMapguideEnterpriseBeforeTheViewerHasLoaded.aspx">http://www.webrade.com/blogs/darrin/2008/05/21/DynamicAuthoringInMapguideEnterpriseBeforeTheViewerHasLoaded.aspx</a><o:p></o:p></p>
  <p class="MsoNormal">&nbsp;<o:p></o:p></p>
  <p class="MsoNormal">Enjoy.<o:p></o:p></p>
  <p class="MsoNormal">darrin<o:p></o:p></p>
  <p class="MsoNormal">&nbsp;<o:p></o:p></p>
  <p class="MsoNormal"><span
 style="font-size: 12pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;"><br>
  <br>
__________ NOD32 3118 (20080521) Information __________<br>
  <br>
This message was checked by NOD32 antivirus system.<br>
  <a moz-do-not-send="true" href="http://www.eset.com">http://www.eset.com</a></span><o:p></o:p></p>
  <pre><o:p>&nbsp;</o:p></pre>
  <pre style="text-align: center;">
<hr align="center" size="4" width="90%">

  </pre>
  <pre><o:p>&nbsp;</o:p></pre>
  <pre>_______________________________________________<o:p></o:p></pre>
  <pre>mapguide-users mailing list<o:p></o:p></pre>
  <pre><a moz-do-not-send="true"
 href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a><o:p></o:p></pre>
  <pre><a moz-do-not-send="true"
 href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a><o:p></o:p></pre>
  <pre>&nbsp; <o:p></o:p></pre>
  </div>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
mapguide-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a>
  </pre>
</blockquote>
</body>
</html>