<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Geospecialling &#187; Mapguide</title>
	<atom:link href="http://www.geospecialling.com/index.php/category/mapguide/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.geospecialling.com</link>
	<description>Being a (G)IS Developer...</description>
	<lastBuildDate>Sun, 25 Jul 2010 05:15:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Creating .NET objects for Mapguide Enterprise 2011</title>
		<link>http://www.geospecialling.com/index.php/2010/07/creating-net-objects-for-mapguide-enterprise-2011/</link>
		<comments>http://www.geospecialling.com/index.php/2010/07/creating-net-objects-for-mapguide-enterprise-2011/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 05:15:41 +0000</pubDate>
		<dc:creator>Darrin Maidlow</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Mapguide]]></category>
		<category><![CDATA[RADE]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Mapguide Enterprise]]></category>

		<guid isPermaLink="false">http://www.geospecialling.com/index.php/2010/07/creating-net-objects-for-mapguide-enterprise-2011/</guid>
		<description><![CDATA[Better late than never…&#160; I’ve updated my Mapguide Enterprise .NET objects to work with 2011.&#160; The steps in my previous post for creating .NET objects for Mapguide Enterprise 2009&#160; have been modernized and simplified significantly.&#160;&#160; This post will show you how to create (or re-create) these objects for the 2011 release of Mapguide.&#160; Sorry for [...]]]></description>
			<content:encoded><![CDATA[<p>Better late than never…&#160; I’ve updated my <a title="Autodesk Mapguide" href="http://www.mapguide.com" target="_blank"></a><a title="Autodesk Mapguide Enterprise" href="http://www.mapguide.com" target="_blank">Mapguide Enterprise</a> .NET</a> objects to work with 2011.&#160; The steps in my <a title="Creating .NET objects for Mapguide XML schema definitions" href="http://www.webrade.com/blogs/darrin/2008/05/16/CreatingNETObjectsForMapguideXMLSchemaDefinitionsXSDUsingLINQ.aspx" target="_blank" rel="tag">previous post for creating .NET objects for Mapguide Enterprise 2009</a>&#160; have been modernized and simplified significantly.&#160;&#160; This post will show you how to create (or re-create) these objects for the 2011 release of Mapguide.&#160; Sorry for skipping 2010 =)</p>
<p>First, download the actual non-aplha release of <a title="LINQ to XSD" href="http://linqtoxsd.codeplex.com/releases/view/41258" target="_blank" rel="tag">LINQ to XSD</a> and extract it.&#160; You will need to have <a href="http://www.webrade.com/blogs/darrin/ct.ashx?id=f6d81338-14fd-4465-a8bd-8eeee747cdd4&amp;url=http%3a%2f%2fwww.microsoft.com%2fdownloads%2fdetails.aspx%3fFamilyID%3da45f58cd-fcfc-439e-b735-8182775560af%26displaylang%3den">.NET 3.5</a> installed to run LINQ to XSD.&#160; The project itself is a Visual Studio 2010, .NET 4.0 project.&#160; You should be able to change it to .NET 3.5 with no problems.&#160; I’m not sure about using .NET 2.0.&#160;&#160; I still assume these steps should work with <a title="Mapguide Open Source" href="http://mapguide.osgeo.org" target="_blank">Mapguide Open Source</a> 2.2 given its pretty much the same thing as MGE 2011.&#160; Please let me know if you try it and that is not the case.</p>
<h3>Building the classes</h3>
<p>Last time around we had to mess around with Visual Studio projects, building temporary code, finding and extracting that code from temporary files.&#160; This time around, we’re given a nice little executable that can be run in a batch file.&#160;&#160; I’ve posted a copy of my batch file below but it was simply made using a dir /b &gt; CreateMapguideNetObjects.cmd in the <a title="Autodesk Mapguide" href="http://www.mapguide.com" target="_blank">Mapguide</a> server schema folder (which by default is to c:\Program Files\Autodesk\MapGuideEnterprise2011\Server\Schema) .&#160; I then edited that file with a text editor that support macros and removed the following schema files:</p>
<ul>
<li>FdoProviderCapabilities-1.0.0.xsd </li>
<li>LoadProcedure-1.0.0.xsd </li>
<li>LoadProcedure-1.1.0.xsd </li>
<li>LayerDefinition-1.0.0.xsd </li>
<li>LayerDefinition-1.1.0.xsd </li>
<li>LayerDefinition-1.2.0.xsd </li>
<li>SiteInformation-1.0.0.xsd </li>
<li>SiteVersion-1.0.0.xsd </li>
<li>SymbolDefinition-1.0.0.xsd </li>
<li>WebLayout-1.0.0.xsd </li>
</ul>
<p>These files are deprecated object definitions from previous Mapguide releases.&#160; In the end each line in the batch file looks a little like this:</p>
<blockquote><p>LinqToXsd ApplicationDefinition-1.0.0.xsd /filename:ApplicationDefinition.cs</p>
</blockquote>
<p>Executing the batch file will create a number of C# files containing appropriately named classes.</p>
<h3>Setting up your project</h3>
<p>At this point you should be able to fire up Visual Studio and create a new C# project.&#160;&#160; If you have an existing project from a previous version of Mapguide its good to start fresh.&#160; Also, don’t try this in an existing solution that is dependant on the project that contains the Mapguide objects.&#160; This will just result in a bunch of extra screwing around to avoid compiler errors from missing code during the process.&#160;&#160;&#160; This time around its a lot easier.&#160; Create a new DLL project.&#160; Add a reference to the Xml.Schema.Linq.dll file that was included with LinqToXsd.exe.&#160;&#160; Add a reference to the following Mapguide dlls:</p>
<ul>
<li>OSGeo.Mapguide.Foundation</li>
<li>OSGeo.Mapguide.Geometry</li>
<li>OSGeo.Mapguide.MapguideCommon</li>
<li>OSGeo.Mapguide.PlatformBase</li>
<li>OSGeo.Mapguide.Web</li>
</ul>
<p>You’ll also need to ensure that the appropriate unmanaged assemblies are available in the calling applications bin folder when you go to run this stuff.&#160; </p>
<p>Next place all of the generated C# files in the new project.&#160; Once you build you’re going to see a ton of errors.&#160; We’ll clean those up.</p>
<p>To resolve a lot of these errors I did a global search and replace on “global::” and replaced it with nothing.&#160; Also, I wrapped each class in a unique wrapper classes to prevent duplicate type errors.&#160; Finally, the case issue with DataType was still an issue – and I resolved it by changing the case on DataType to be Datatype:</p>
<div>
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   1:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">string</span> DataType {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   2:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">string</span> Datatype {</pre>
</p></div>
</div>
<p>For a complete view of the changes I made do a file compare between the code in the attached zip file and your newly generated code.</p>
<p>&lt;insert 3 week gap here, wherein I had <a title="Mapguide Enterprise 2011 installation and licensing fun" href="http://www.geospecialling.com/index.php/2010/07/mapguide-2011-javascript-error-openlayers-lang-is-null-or-not-an-object/" target="_blank" rel="tag">a hell of a time getting MGE 2011 installed and properly licensed</a> so that I could actually test this newly created code, oh and I also went on vacation for a few days too =)/&gt;</p>
<p>And back.&#160; The best part about this is that it seems ALL my old <a title="RADE" href="http://www.geospecialling.com/index.php/2008/06/rade-build-custom-web-applications-without-writing-custom-code/" target="_blank" rel="tag">RADE</a> code just worked with upgraded basic layouts after changing it to look for the object definitions within the new wrapper classes.&#160;&#160; Now I just need to add support for flexible layouts and we’ll be laughing.</p>
<h3>The Code</h3>
<p>Please note – I didn’t rebase the code.&#160; It’s all in the RADE.MGE namespace.&#160; If you would like to use it, feel free to re-base it – or just leave it as is.&#160; Also, if you create any unit tests or enhancements and would like to share them – please feel free!&#160;&#160; </p>
<p>As I update the project myself, or receive updates I will update this file.</p>
<div class="wlWriterEditableSmartContent" id="scid:fb3a1972-4489-4e52-abe7-25a00bb07fdf:5b76b660-1647-415a-861e-ec611af03c8f" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<p>Download the <a href="http://www.geospecialling.com/wp-content/uploads/2010/07/RADE.MGE_.2011.zip" target="_blank">Mapguide .NET Objects Visual Studio 2010 solution</a></p>
</div>
<p>.&#160;
<p>Finally, the <a title="Examples of using the Mapguide .NET objects" href="http://www.webrade.com/blogs/darrin/2008/05/21/DynamicAuthoringInMapguideEnterpriseBeforeTheViewerHasLoaded.aspx" target="_blank" rel="tag">example code I posted long ago</a> will still work with this new project.&#160; Perhaps one day, I’ll post some fancy new code in C# =) </p>
<p>Hope this comes in handy, I welcome your comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geospecialling.com/index.php/2010/07/creating-net-objects-for-mapguide-enterprise-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mapguide 2011 Javascript error &#8216;OpenLayers.Lang&#8217; is null or not an object</title>
		<link>http://www.geospecialling.com/index.php/2010/07/mapguide-2011-javascript-error-openlayers-lang-is-null-or-not-an-object/</link>
		<comments>http://www.geospecialling.com/index.php/2010/07/mapguide-2011-javascript-error-openlayers-lang-is-null-or-not-an-object/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 04:33:47 +0000</pubDate>
		<dc:creator>Darrin Maidlow</dc:creator>
				<category><![CDATA[Mapguide]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Mapguide Enterprise]]></category>

		<guid isPermaLink="false">http://www.geospecialling.com/index.php/2010/07/mapguide-2011-javascript-error-openlayers-lang-is-null-or-not-an-object/</guid>
		<description><![CDATA[We’ve finally moved Mapguide Enterprise support back up the list of priorities for RADE =)&#160; The ability to add Google, Yahoo, and Bing data into the map with OpenLayers is very compelling.&#160; So I’ve spent a little time (actually kind of a lot of time)&#160; in the past little bit trying to get my Mapguide [...]]]></description>
			<content:encoded><![CDATA[<p>We’ve finally moved <a title="Autodesk Mapguide" href="http://www.mapguide.com" target="_blank"><a title="Autodesk Mapguide Enterprise" href="http://www.mapguide.com" target="_blank">Mapguide Enterprise</a> support</a> back up the list of priorities for <a title="RADE" href="http://www.geospecialling.com/index.php/2008/06/rade-build-custom-web-applications-without-writing-custom-code/" target="_blank" rel="tag">RADE</a> =)&#160; The ability to add Google, Yahoo, and Bing data into the map with OpenLayers is very compelling.&#160; So I’ve spent a little time (actually kind of a lot of time)&#160; in the past little bit trying to get my <a title="Autodesk Mapguide" href="http://www.mapguide.com" target="_blank">Mapguide</a> development environment setup.&#160;&#160; To avoid cross site scripting (xss) errors when developing on my workstation I needed to install the web tier locally.&#160;&#160; After muchos problems with license servers and the likes I came across an annoying javascript error whenever I would load a <a title="flexible web layout" href="http://docs.autodesk.com/TOPOBSADM/2011/ENU/Autodesk%20Topobase%202011%20Help/filesAdministrator/WS73099cc142f487557bfaa8da122ec01152fbe5-procedure1.htm" target="_blank" rel="tag">Flexible Web Layout</a> using&#160; the local web tier:</p>
<div>
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   1:</span> Line: 2</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   2:</span> Char: 2498</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   3:</span> Error: <span style="color: #006080">'OpenLayers.Lang'</span> <span style="color: #0000ff">is</span> <span style="color: #0000ff">null</span> or not an <span style="color: #0000ff">object</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   4:</span> Code: 0</pre>
</p></div>
</div>
<p>Loading the web tier on the Mapguide server worked fine.&#160; Very odd.&#160; I ended up doing a file comparison between the two web tiers and noticed the only significant difference was this in the web.config:</p>
<div>
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">staticContent</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   2:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">mimeMap</span> <span style="color: #ff0000">fileExtension</span><span style="color: #0000ff">=&quot;.json&quot;</span> <span style="color: #ff0000">mimeType</span><span style="color: #0000ff">=&quot;application/json&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   3:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">staticContent</span><span style="color: #0000ff">&gt;</span></pre>
</p></div>
</div>
<p>Adding this tag to IIS 7 on Vista resulted in an error, the tag must be something new in IIS 7.5.&#160; However, after manually adding the mime type mapping to the server – my flexible layout now loads perfectly on the local Vista web tier.<a href="http://www.geospecialling.com/wp-content/uploads/2010/07/SNAGHTML15f08bbe.png"><img title="SNAGHTML15f08bbe" style="border-right: 0px; border-top: 0px; display: inline; margin-left: 0px; border-left: 0px; margin-right: 0px; border-bottom: 0px" height="179" alt="SNAGHTML15f08bbe" src="http://www.geospecialling.com/wp-content/uploads/2010/07/SNAGHTML15f08bbe_thumb.png" width="244" align="right" border="0" /></a></p>
<p>This mime type mapping can be added on either the virtual directory, or the server level.&#160; I chos to add it to the server.&#160; Either way, to add it select the appropriate level in IIS manager.&#160; In the right hand window double click “Mime Types”.&#160; Click Add and you can enter the .json extension and the mime type.&#160; Once this is added, Vista/IIS7 was now properly serving out flexible layers</p>
<p><a href="http://www.geospecialling.com/wp-content/uploads/2010/07/SNAGHTML15eec92b.png">&#160;</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.geospecialling.com/index.php/2010/07/mapguide-2011-javascript-error-openlayers-lang-is-null-or-not-an-object/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring Mapguide Enterprise 2009 and 2010 on the same machine</title>
		<link>http://www.geospecialling.com/index.php/2009/08/configuring-mapguide-enterprise-2009-and-2010-on-the-same-machine/</link>
		<comments>http://www.geospecialling.com/index.php/2009/08/configuring-mapguide-enterprise-2009-and-2010-on-the-same-machine/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 19:57:27 +0000</pubDate>
		<dc:creator>Darrin Maidlow</dc:creator>
				<category><![CDATA[Mapguide]]></category>
		<category><![CDATA[Mapguide Enterprise]]></category>

		<guid isPermaLink="false">http://www.landoris.com/blogs/darrin/index.php/2009/08/configuring-mapguide-enterprise-2009-and-2010-on-the-same-machine/</guid>
		<description><![CDATA[So I’m a little behind on the times.&#160; Yes I’ve finally started making the switch from Mapguide Enterprise 2009 to MGE 2010.&#160;&#160; However, I need to keep 2009 around a little bit longer.&#160; This resulted in wanting to configure both 2009 and 2010 on the same server.&#160; Configuring Mapguide enterprise 2009 and 2010 on the [...]]]></description>
			<content:encoded><![CDATA[<p>So I’m a little behind on the times.&#160; Yes I’ve finally started making the switch from Mapguide Enterprise 2009 to MGE 2010.&#160;&#160; However, I need to keep 2009 around a little bit longer.&#160; This resulted in wanting to configure both 2009 and 2010 on the same server.&#160; Configuring <a title="Autodesk Mapguide Enterprise" href="http://www.mapguide.com" target="_blank">Mapguide enterprise</a> 2009 and 2010 on the same machine is possible, and even beneficial in a development environment.&#160; Less VMs or servers can be a good thing in these days of crazy <a title="Virtual Machines - Too much of a good thing" href="http://www.enterprisestorageforum.com/management/article.php/3772841" target="_blank" rel="tag">virtual machine sprawl</a>.&#160; Autodesk however, recommends against doing this in a production environment.&#160;&#160; You should probably heed this advice if this Mapguide installation is important – even from a workgroup development point of view.&#160;&#160; Note, these steps should be relevant for the <a title="Mapguide Open Source" href="http://mapguide.osgeo.org" target="_blank">Mapguide Open Source</a> equivalents – though I have not tried it.</p>
<p>After installing <a title="Autodesk Mapguide" href="http://www.mapguide.com" target="_blank">Mapguide</a> 2010 (both server and web tier) on a server running 2009 and updating the license manager appropriately, you’ll notice that the service is not running.&#160; Attempts to start the service will result in an error message logged in the Windows Application Log that looks a little bit like this:</p>
<blockquote><p>The description for Event ID ( 0 ) in Source ( MapGuide Enterprise 2010 Server ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: Port 2801 is not available, please try using a different port.</p>
</blockquote>
<p>So we need to setup one of the Mapguide installations to use a different set of ports.&#160; I’ve chosen to modify the behavior of Mapguide 2010, though these changes could be made for Mapguide 2009 instead.&#160;&#160; For this process we’ll need three free ports.&#160; For simplicity its nice to keep these ports sequential.&#160; You will need to ensure that the ports you choose are available on your system.</p>
<p>First we need to edit the serverconfig.ini in the C:\Program Files\Autodesk\MapGuideEnterprise2010\Server\Bin folder.&#160;&#160; First lets change the Port in the AdministrativeConnectionProperties section from 2800 to lets say 3800.&#160;&#160; Next in the ClientConnectionProperties section change the port to 3801.&#160; Finally change the port in SiteConnectionProperties to 3802.</p>
<p>Next we need to edit the webconfig.ini in the C:\Program Files\Autodesk\MapGuideEnterprise2010\WebServerExtensions folder.&#160; We need to update the port numbers in this config to match the numbers in the server config.&#160; Remember the web config is the client that will usually be consuming the server service.&#160; Finally, as the configuration settings for the web tier may be cached you should restart IIS using iisreset.exe.&#160; This will clear the cached port configurations and Mapguide Studio / Mapguide Administration will now work properly.</p>
<p>Once that is done, the 2009 repository can be migrated to 2010 by following the steps included in the Help/MGE2010UpgradingWindows.htm file on your installation disc/folder.</p>
<h2>PHP Problems</h2>
<p>Once MGE 2010 has been installed I had a problem with PHP.&#160; Multiple PHPs can be bad news.&#160; I’ve found that running both MGE 2009 and 2010 using the PHP provided with 2010 seems to do the trick.&#160; First you will need to edit the Windows system path.&#160; Update the path variable there to point to the 2010 PHP installation.&#160; If a 2010 path variable exists already – remove the 2009 path.&#160; Next open the IIS manager and ensure that both the MGE 2009 and MGE 2010 virtual directory trees are pointing to the MGE 2010 php extension in the Application Extension Mappings.</p>
<p>Once these changes have been made, do a quick IISreset and you should now be able to login to both the Mapguide admins, as well as have Mapguide Studio connect to the appropriate servers.&#160; Again – this setup could have issues – so consider your environment and needs before configuring a server with both releases of Mapguide.</p>
<h2>Remote Web Tiers</h2>
<p>If you need to run a shared Mapguide server with web tiers installed on individual development machines don’t forget to set the ports on each development machine.&#160;&#160; The Mapguide installer will prompt for the Mapguide server IP address – but the webconfig.ini will need to be updated with the appropriate ports manually.&#160; Not doing do will result in your web tier talking to the 2009 server – and much confusion =)</p>
<p>Finally one note on IP addressees and remote web tiers.&#160; If you plan to use a remote web tier – make sure your Mapguide server is setup using the actual IP address of the server and not 127.0.0.1.&#160; If your Mapguide server is configured with 127.0.0.1, you will get a “Cannot establish connection.” error on the remote web tiers when attempting to create and use a session.&#160; Using real IP addresses (either internal or external) will prevent this error from occurring.</p>
<div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:4fe137b7-0f5b-42d7-bf1b-6a7879d3713f" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags: <a href="http://technorati.com/tags/Mapguide+Enterprise" rel="tag">Mapguide Enterprise</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.geospecialling.com/index.php/2009/08/configuring-mapguide-enterprise-2009-and-2010-on-the-same-machine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mapguide Enterprise 2009 Update 1 (For Windows)</title>
		<link>http://www.geospecialling.com/index.php/2008/10/mapguide-enterprise-2009-update-1-for-windows/</link>
		<comments>http://www.geospecialling.com/index.php/2008/10/mapguide-enterprise-2009-update-1-for-windows/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 18:09:00 +0000</pubDate>
		<dc:creator>Darrin Maidlow</dc:creator>
				<category><![CDATA[Mapguide]]></category>
		<category><![CDATA[Service Pack]]></category>

		<guid isPermaLink="false">http://www.geospecialling.com/index.php/2008/10/mapguide-enterprise-2009-update-1-for-windows/</guid>
		<description><![CDATA[Yay.&#160; Autodesk today released an update for both the Mapguide Enterprise Web Tier, Server and Studio.&#160; This release should catch Enterprise up a little more closely to the Open Source edition.&#160; A PDF with containing some of the changes can be found here.&#160; Check out the updates.&#160; Some of these updates are pretty critical (ie. [...]]]></description>
			<content:encoded><![CDATA[<p>Yay.&#160; Autodesk today released an update for both the <a title="Autodesk Mapguide Enterprise" href="http://www.mapguide.com" target="_blank">Mapguide Enterprise</a> Web Tier, Server and Studio.&#160; This release should catch Enterprise up a little more closely to the Open Source edition.&#160; A PDF with containing some of the changes can be found <a title="Mapguide Enterprise 2009 Update 1 Release Notes" href="http://images.autodesk.com/adsk/files/autodeskmapguideupdatereadme_enu.pdf" target="_blank" rel="tag">here</a>.&#160; <a title="Mapguide Enterprise 2009 Update 1" href="http://usa.autodesk.com/adsk/servlet/ps/dl/item?siteID=123112&amp;id=12004070&amp;linkID=9242179" target="_blank" rel="tag">Check out the updates.</a>&#160; Some of these updates are pretty critical (ie. the FireFox 3 takes out your Mapguide server).&#160; Looks like many performances updates have made it in also.</p>
<p>Thanks Autodesk! =)</p>
<div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:1ea7ceb5-a8fa-41c3-9964-0fb928ec85e2" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags: <a href="http://technorati.com/tags/Mapguide+Enterprise" rel="tag">Mapguide Enterprise</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.geospecialling.com/index.php/2008/10/mapguide-enterprise-2009-update-1-for-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Developing with Mapguide Enterprise / Open Source in a shared server environment</title>
		<link>http://www.geospecialling.com/index.php/2008/09/developing-with-mapguide-enterprise-open-source-in-a-shared-server-environment/</link>
		<comments>http://www.geospecialling.com/index.php/2008/09/developing-with-mapguide-enterprise-open-source-in-a-shared-server-environment/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 01:41:00 +0000</pubDate>
		<dc:creator>Darrin Maidlow</dc:creator>
				<category><![CDATA[Mapguide]]></category>

		<guid isPermaLink="false">http://www.geospecialling.com/index.php/2008/09/developing-with-mapguide-enterprise-open-source-in-a-shared-server-environment/</guid>
		<description><![CDATA[I have enough junk running on my development machine.&#160; In an effort to try and keep my workstation speedy &#8211; I don&#8217;t install any unnecessary services (Oracle server, Mapguide Server etc) on this machine.&#160; In a larger development environment, running multiple servers on local development machines has a few other less than desirable results.&#160; For [...]]]></description>
			<content:encoded><![CDATA[<p>I have enough junk running on my development machine.&#160; In an effort to try and keep my workstation speedy &#8211; I don&#8217;t install any unnecessary services (Oracle server, Mapguide Server etc) on this machine.&#160; In a larger development environment, running multiple servers on local development machines has a few other less than desirable results.&#160; For example licensing issues and costs could increase, data management can become more complex, and just managing the extra services on N machines could cause a lot more work for your already overworked IT guy.</p>
<p>So instead I have centralized my server resources into a nice VM setup running on my beefy Dell server.&#160; Now, regardless of which machine I use to develop I can still access the same data sets.&#160; This is especially nice when traveling.&#160; Specifically Mapguide Server and web tier are installed on my development web server.&#160; When coding, I will either use my local IIS or the built in Visual Studio web server.&#160; This poses one problem when working with Mapguide.&#160; Referencing the web tier on the shared server from another web server will result in <a title="Cross Site Scripting Explained" href="http://en.wikipedia.org/wiki/Cross-site_scripting" target="_blank" rel="tag">cross site scripting</a> (XSS) errors.&#160; Basically, javascript on one web server cannot access javascript code on another web server, which under most circumstances is a good thing.&#160; When trying to develop using the Mapguide Web API on a central Mapguide server this poses a problem as the web tier API is wholly contained within the virtual directory on another server.&#160; Gotta love when &#8217;security&#8217; jumps up bites us in the behind.</p>
<p>The simple solution to this problem is to install the Mapguide web tier on every development machine.&#160; This will require that each development machine have a web server installed, but chances are that is already the case.&#160; When installing the web tier be sure to have the IP address of the Mapguide server handy as it will needed during the install.&#160; Once the web tier is running locally, reference the local web tier in your URLs and the cross site scripting vulnerabilities go away!&#160; If you&#8217;re running the 64 Bit version of Vista on your development machine, check out my post installing the <a title="Installing Mapguide Web Tier on Vista x64" href="http://www.geospecialling.com/index.php/2008/05/manually-configure-mapguide-2009-web-tier-on-vista-x64-iis7/" target="_blank" rel="tag">web tier on Vista x64</a></p>
<div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:282fb14b-6c50-4bbe-8aeb-63d97f1c707d" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags: <a href="http://technorati.com/tags/Mapguide" rel="tag">Mapguide</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.geospecialling.com/index.php/2008/09/developing-with-mapguide-enterprise-open-source-in-a-shared-server-environment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Increase Mapguide Enterprise/Open Performance with Javascript Compression using the YUI Compressor</title>
		<link>http://www.geospecialling.com/index.php/2008/08/increase-mapguide-enterpriseopen-performance-with-javascript-compression-using-the-yui-compressor/</link>
		<comments>http://www.geospecialling.com/index.php/2008/08/increase-mapguide-enterpriseopen-performance-with-javascript-compression-using-the-yui-compressor/#comments</comments>
		<pubDate>Sat, 30 Aug 2008 13:18:00 +0000</pubDate>
		<dc:creator>Darrin Maidlow</dc:creator>
				<category><![CDATA[Mapguide]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[YUI Compressor]]></category>

		<guid isPermaLink="false">http://www.geospecialling.com/index.php/2008/08/increase-mapguide-enterpriseopen-performance-with-javascript-compression-using-the-yui-compressor/</guid>
		<description><![CDATA[Javascript compression is something I had on my list for the next major release of RADE.&#160; RADE is not quite ready for this step yet, so I thought I would give it a shot on Mapguide Enterprise and see what kind of results it would yield.&#160; For a small site or an internal site this [...]]]></description>
			<content:encoded><![CDATA[<p>Javascript compression is something I had on my list for the next major release of RADE.&#160; RADE is not quite ready for this step yet, so I thought I would give it a shot on Mapguide Enterprise and see what kind of results it would yield.&#160; For a small site or an internal site this will probably not yield significant benefits.&#160; However if you run a large public site javascript compression could squeeze out some more performance as well as save you on bandwidth costs.&#160; Yahoo has a good article on <a title="empty cache performance" href="http://yuiblog.com/blog/2007/01/04/performance-research-part-2/" target="_blank" rel="tag">performance and the &quot;empty cache&quot;</a>.</p>
<p>I did some brief looking around and word on the internets is that the <a title="YUI Javascript compressor" href="http://developer.yahoo.com/yui/compressor/" target="_blank" rel="tag">YUI compressor</a> is one of the better compressors out there.&#160; The YUI compressor is an open source java applet.&#160;&#160; This *should* work with Mapguide Open, heck this might even be done already in MGOS &#8211; but I am only using Enterprise so I cannot confirm, deny, or test this.&#160;&#160; </p>
<p>Some of the key things the compressor will do:</p>
<ol>
<li>remove all comments </li>
<li>remove all white space and line breaks </li>
<li>rename all local variables and parameters to single characters </li>
</ol>
<p>The YUI compressor should not alter variable values or your logic in any way.</p>
<p>To use the YUI compressor you will need to <a title="Download Java" href="http://www.java.com/en/" target="_blank" rel="tag">have Java installed</a>.&#160; Note that if you have the Oracle client installed, you probably have Java already&#160; Once you have Java, you can download a copy of the <a title="download the YUI compress" href="http://www.julienlecomte.net/yuicompressor/" target="_blank" rel="tag">YUI compressor</a> (I&#8217;m going to start referring to it as the YC now&#8230;).&#160; If you don&#8217;t feel like downloading Java and the YC &#8211; I&#8217;ve attached the processed files at the bottom of this post.</p>
<p>Lets first look at the javascript shipped with Mapguide Enterprise.&#160; If you browse to your web server extension viewer files (the default location is C:\Program Files\Autodesk\MapGuideEnterprise2009\WebServerExtensions\www\viewerfiles I believe) you will see ten javascript files.&#160; If you choose to process these files on your own please back them up first.&#160; Don&#8217;t blame me if you don&#8217;t backup your files and something goes wrong =).</p>
<p>Before YC:</p>
<p><a href="http://www.geospecialling.com/wp-content/uploads/2010/02/image9.png" target="_blank"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="242" alt="Mapgude Enterprise Javascript before YUI Compression" src="http://www.geospecialling.com/wp-content/uploads/2010/02/image_thumb9.png" width="499" border="0" /></a></p>
<p>Using the YC is simple:</p>
<div>
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   1:</span> c:\oracle\product\10.2.0\client_1\jdk\bin\java.exe -jar f:\utils\YUICompress\yuicompressor-2.3.6\build\yuicompressor-2.3.6.jar -o comp\browserdetect.js browserdetect.js</pre>
</p></div>
</div>
<p>&#160;</p>
<p>Update the paths to Java and the YC as per your environment.&#160; Using the handy dir /B *.js &gt; go.bat I created a batch file of all the javascript files in the viewerfiles folder.&#160; Be sure to run this from a dos window in the viewerfiles folder, or update the paths.&#160; You will also need to create the comp folder in viewerfiles.&#160;&#160; Quick cut and pasting created the following batch file:</p>
<div>
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   1:</span> c:\oracle\product\10.2.0\client_1\jdk\bin\java.exe -jar f:\utils\YUICompress\yuicompressor-2.3.6\build\yuicompressor-2.3.6.jar -o comp\browserdetect.js browserdetect.js</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   2:</span> c:\oracle\product\10.2.0\client_1\jdk\bin\java.exe -jar f:\utils\YUICompress\yuicompressor-2.3.6\build\yuicompressor-2.3.6.jar -o comp\contextmenu.js contextmenu.js</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   3:</span> c:\oracle\product\10.2.0\client_1\jdk\bin\java.exe -jar f:\utils\YUICompress\yuicompressor-2.3.6\build\yuicompressor-2.3.6.jar -o comp\digitize.js digitize.js</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   4:</span> c:\oracle\product\10.2.0\client_1\jdk\bin\java.exe -jar f:\utils\YUICompress\yuicompressor-2.3.6\build\yuicompressor-2.3.6.jar -o comp\hashtable.js hashtable.js</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   5:</span> c:\oracle\product\10.2.0\client_1\jdk\bin\java.exe -jar f:\utils\YUICompress\yuicompressor-2.3.6\build\yuicompressor-2.3.6.jar -o comp\initdwfctrl.js initdwfctrl.js</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   6:</span> c:\oracle\product\10.2.0\client_1\jdk\bin\java.exe -jar f:\utils\YUICompress\yuicompressor-2.3.6\build\yuicompressor-2.3.6.jar -o comp\legend.js legend.js</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   7:</span> c:\oracle\product\10.2.0\client_1\jdk\bin\java.exe -jar f:\utils\YUICompress\yuicompressor-2.3.6\build\yuicompressor-2.3.6.jar -o comp\numfmt.js numfmt.js</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   8:</span> c:\oracle\product\10.2.0\client_1\jdk\bin\java.exe -jar f:\utils\YUICompress\yuicompressor-2.3.6\build\yuicompressor-2.3.6.jar -o comp\pngfix_map.js pngfix_map.js</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   9:</span> c:\oracle\product\10.2.0\client_1\jdk\bin\java.exe -jar f:\utils\YUICompress\yuicompressor-2.3.6\build\yuicompressor-2.3.6.jar -o comp\sarissa.js sarissa.js</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  10:</span> c:\oracle\product\10.2.0\client_1\jdk\bin\java.exe -jar f:\utils\YUICompress\yuicompressor-2.3.6\build\yuicompressor-2.3.6.jar -o comp\wz_jsgraphics.js wz_jsgraphics.js</pre>
</p></div>
</div>
<p>&#160;</p>
<p>(*Sorry about the overlap.&#160; I&#8217;m working on a new layout and am addressing that in there)</p>
<p>Running that output all of the compressed of the files down somewhat, to pretty significantly. </p>
<p align="left"><a href="http://www.geospecialling.com/wp-content/uploads/2010/02/image10.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="223" alt="Mapgude Enterprise Javascript After YUI Compression" src="http://www.geospecialling.com/wp-content/uploads/2010/02/image_thumb10.png" width="569" border="0" /></a></p>
<p>A quick comparison of one of the function calls:</p>
<div>
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   1:</span> <span style="color: #0000ff">function</span> MenuData(menuName, arrowHeight, scrollInc, scrollDelay, minSize, iconScrollUp, iconScrollUpDisabled, iconScrollDown, iconScrollDownDisabled, owner, withIFrame, bkColor)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   2:</span> <span style="color: #0000ff">function</span> MenuData(F,H,I,K,E,G,D,J,A,C,B,L)</pre>
</p></div>
</div>
<p>&#160;</p>
<p>As you can see &#8211; the savings can be significant.</p>
<p>I&#8217;m not using the <a title="fusion viewer" href="http://www.jasonbirch.com/nodes/2007/12/19/155/mapguide-open-source-more-fusion-less-confusion/" target="_blank" rel="tag">Fusion viewer</a> yet so I did not process those files, but I did check some of the JS in there and each script file had a huge header comment.&#160; It looks like Fusion could also benefit from some compression action.&#160; Please note, I&#8217;ve been running my web tier using this script for a day or two.&#160; I&#8217;ve not run any serious testing on this code &#8211; so try this at your own risk.&#160; You did make that backup I suggested, right?&#160; That said, I have not personally experienced any problems yet.&#160; Also, should you compress your viewerfiles and have problems be sure to try your backups.&#160; Especially before calling your dealer or Autodesk for help. (sorry product support and ADN guys.&#160; Please don&#8217;t hate me =] ).</p>
</p>
<div class="wlWriterEditableSmartContent" id="scid:fb3a1972-4489-4e52-abe7-25a00bb07fdf:e709df33-b7eb-4787-9e2d-dd73ac7bc3b0" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<p> <a href="http://www.geospecialling.com/wp-content/uploads/2010/02/compressedJS.zip" target="_blank">Download some pre-compressed javascript files</a></p>
</div>
<p>if you would rather not run the YC yourself. </p>
<p>Enjoy!</p>
<div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:8cf6b803-e6e9-4c76-b59c-22402f72bde2" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags: <a href="http://technorati.com/tags/Javascript" rel="tag">Javascript</a>,<a href="http://technorati.com/tags/Mapguide+Enterprise" rel="tag">Mapguide Enterprise</a>,<a href="http://technorati.com/tags/Mapguide+Open+Source" rel="tag">Mapguide Open Source</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.geospecialling.com/index.php/2008/08/increase-mapguide-enterpriseopen-performance-with-javascript-compression-using-the-yui-compressor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Passing a Large Mapguide Selection XML to a New Window Using Dynamic Forms and Javascript</title>
		<link>http://www.geospecialling.com/index.php/2008/07/passing-a-large-mapguide-selection-xml-to-a-new-window-using-dynamic-forms-and-javascript/</link>
		<comments>http://www.geospecialling.com/index.php/2008/07/passing-a-large-mapguide-selection-xml-to-a-new-window-using-dynamic-forms-and-javascript/#comments</comments>
		<pubDate>Thu, 31 Jul 2008 05:22:00 +0000</pubDate>
		<dc:creator>Darrin Maidlow</dc:creator>
				<category><![CDATA[Mapguide]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.geospecialling.com/index.php/2008/07/passing-a-large-mapguide-selection-xml-to-a-new-window-using-dynamic-forms-and-javascript/</guid>
		<description><![CDATA[Everyone knows there is a limit to the size of the query string, right?&#160; Well ok, maybe you didn&#8217;t &#8211; but there is.&#160; What that limit is depends on the browser.&#160; There is a lot of conflicting information out there on the magical Google.&#160; An RFC defines it, but no one really seems to pay [...]]]></description>
			<content:encoded><![CDATA[<p>Everyone knows there is a <a title="query string has a size limit!" href="http://www.asp101.com/tips/index.asp?id=102" target="_blank" rel="tag">limit to the size of the query string</a>, right?&#160; Well ok, maybe you didn&#8217;t &#8211; but there is.&#160; What that limit is depends on the browser.&#160; There is a lot of conflicting information out there on the magical <a title="the magical Google!" href="http://www.google.com" target="_blank" rel="tag">Google</a>.&#160; An RFC defines it, but no one really seems to pay attention to those anyhow.&#160; (Are you listening Microsoft, of course you are! =]).&#160; Anyhow, for IE, the query string length is usually around 2000 characters.</p>
<p>However, in most cases you&#8217;re better off using a form and posting your data up to the server side that way, as the limitations on data are so large you will likely not need to worry about them.&#160; Sometimes, query strings can also show your users just a little too much information &#8211; though I&#8217;m by no means a proponent of &quot;security through obscurity&quot; hiding a little bit more from your users will keep the curious ones a little more in check =).</p>
<p>When working with <a title="Autodesk Mapguide Enterprise" href="http://www.mapguide.com" target="_blank" rel="tag">Mapguide Enterprise</a>/<a title="Mapguide Open Source" href="http://mapguide.osgeo.org" target="_blank" rel="tag">Mapguide Open Source</a> we need to grab some potentially massive XML strings from the MgMap object and pass these along to the server side for processing.&#160; Take the selection XML from the MgMap object, even a single entity selection can use a significant portion of the characters available in the query string.&#160; On top of that, passing this data via query string requires that the data be URL encoded, using even more of our precious query string characters. </p>
<p>Depending on the design of your application it may not always be feasible to define a hard coded form, or even a form defined server side using ASP.NET.&#160; In some cases (you guessed it &#8211; my case) you may want to use javascript and do all the work on the client side to define a form and pass the data long that way.</p>
<p>Well you&#8217;re in luck, I found a pretty nice solution (WELL, at least I&#8217;m liking it&#160; =]).&#160;&#160; I&#8217;m kicking myself for not realizing this long ago, but oh well.&#160; So the following javascript function demonstrates how to build, add, populate, and submit a form on the fly using some information from the MgMap object. </p>
<div>
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   1:</span> <span style="color: #0000ff">function</span> postData()   </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   2:</span> {   3: <span style="color: #008000">//get the map   </span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   3:</span> mapObj = GetMap();   </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   4:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   5:</span> <span style="color: #008000">//define the new form   </span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   6:</span> <span style="color: #0000ff">var</span> newForm = document.createElement(<span style="color: #006080">&quot;form&quot;</span>);   </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   7:</span> <span style="color: #008000">//set the method to POST - the opposite of query strings..   </span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   8:</span> newForm.method=<span style="color: #006080">&quot;POST&quot;</span>;  </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   9:</span>  <span style="color: #008000">//add the new form to the current document  </span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  10:</span>  document.body.appendChild(newForm);  </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  11:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  12:</span>  <span style="color: #008000">//lets get some data and add it to the form  </span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  13:</span>  AddFormElement(newForm, <span style="color: #006080">&quot;MapName&quot;</span>, oMap.GetMapName());  </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  14:</span>  AddFormElement(newForm, <span style="color: #006080">&quot;SID&quot;</span>, oMap.GetSessionId());  </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  15:</span>  <span style="color: #008000">//be sure you escape the selection XML - or you will get an error on post about a   </span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  16:</span>  <span style="color: #008000">//&quot;potentially dangerous form value&quot;.  Remember on the server side to Server.UrlDecode() it  </span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  17:</span>  AddFormElement(newForm, <span style="color: #006080">&quot;sel&quot;</span>, escape(oMap.GetSelectionXML()));  </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  18:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  19:</span>  <span style="color: #008000">//lets create our new window  </span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  20:</span>  <span style="color: #0000ff">var</span> szTarget = <span style="color: #006080">&quot;targetWin&quot;</span>  </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  21:</span>  newForm.target = szTarget;  </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  22:</span>  <span style="color: #008000">//set the name/path of the ASPX file you want to process your form with  </span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  23:</span>  newForm.action = <span style="color: #006080">&quot;/url_to_open/file.aspx&quot;</span>  </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  24:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  25:</span>  <span style="color: #008000">//open a new window to submit the form to.  Its a good idea to have a blank.htm so you don't get a file not found error  </span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  26:</span>  <span style="color: #0000ff">var</span> oWin = window.open(<span style="color: #006080">&quot;blank.htm&quot;</span>,szTarget,<span style="color: #006080">'menubar=yes, resizable=yes,scrollbars=yes, status=no,toolbar=no,width=300, height=300'</span>);  </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  27:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  28:</span>  <span style="color: #008000">//give the window focus.  Users like this  </span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  29:</span>  oWin.focus();  </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  30:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  31:</span>  <span style="color: #008000">//submit the form - it will now open in the new window  </span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  32:</span>  newForm.submit();  </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  33:</span>  <span style="color: #008000">//remove the form from the document, we're done with it  </span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  34:</span>  document.body.removeChild(newForm);  </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  35:</span>  }  </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  36:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  37:</span>  <span style="color: #0000ff">function</span> AddFormElement(form, elementName, elementVal)  </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  38:</span>  {  </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  39:</span>      <span style="color: #0000ff">var</span> newElement = document.createElement(<span style="color: #006080">&quot;&lt;input name='&quot;</span> + elementName + <span style="color: #006080">&quot;' type='hidden'/&gt;&quot;</span>);  </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  40:</span>      newElement.value = elementVal;  </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  41:</span>      form.appendChild(newElement);  </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  42:</span>      <span style="color: #0000ff">return</span> form;  </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  43:</span>  }</pre>
</p></div>
</div>
<p>&#160;</p>
<p>On the server side, you can now access this data from ASP.NET using Request.Form, for example Request.Form(&quot;MapName&quot;) would give you the map name.&#160; Don&#8217;t forget when retrieving the selection XML to run that through Server.UrlDecode, or HttpUtility.UrlDecode.</p>
<p>As usual, any comments, bugs, or rotten fruit &#8211; send em my way.&#160; Enjoy!</p>
<div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:09bdc2e1-fce5-42ef-972d-5d2186dd47d2" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags: <a href="http://technorati.com/tags/ASP.NET" rel="tag">ASP.NET</a>,<a href="http://technorati.com/tags/Javascript" rel="tag">Javascript</a>,<a href="http://technorati.com/tags/Mapguide+Enterprise" rel="tag">Mapguide Enterprise</a>,<a href="http://technorati.com/tags/Mapguide+Open+Source" rel="tag">Mapguide Open Source</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.geospecialling.com/index.php/2008/07/passing-a-large-mapguide-selection-xml-to-a-new-window-using-dynamic-forms-and-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mapguide 2009 / OS 2.0 Get Selected Key Values VB.NET Example and the dreaded MgSelection.GenerateFilter Issue</title>
		<link>http://www.geospecialling.com/index.php/2008/07/mapguide-2009-os-2-0-get-selected-key-values-vb-net-example-and-the-dreaded-mgselection-generatefilter-issue/</link>
		<comments>http://www.geospecialling.com/index.php/2008/07/mapguide-2009-os-2-0-get-selected-key-values-vb-net-example-and-the-dreaded-mgselection-generatefilter-issue/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 08:12:00 +0000</pubDate>
		<dc:creator>Darrin Maidlow</dc:creator>
				<category><![CDATA[Mapguide]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Dynamic Authoring]]></category>

		<guid isPermaLink="false">http://www.geospecialling.com/index.php/2008/07/mapguide-2009-os-2-0-get-selected-key-values-vb-net-example-and-the-dreaded-mgselection-generatefilter-issue/</guid>
		<description><![CDATA[Tonight I came across the MgSelection.GenerateFilter bug.&#160; I had read about it, and made a mental note that one day it would be an issue.&#160; That note wasn&#8217;t very good, and I completely forgot about it.&#160;&#160; I was wrapping up the RADE updates around the report this eve and fortunately I bothered to select the [...]]]></description>
			<content:encoded><![CDATA[<p>Tonight I came across the <a title="MgSelection.GenerateFilter cannot deal with more than twenty objects" href="http://trac.osgeo.org/mapguide/ticket/501" target="_blank" rel="tag">MgSelection.GenerateFilter bug</a>.&#160; I had read about it, and made a mental note that one day it would be an issue.&#160; That note wasn&#8217;t very good, and I completely forgot about it.&#160;&#160; I was wrapping up the <a title="RADE framework - building custom applications without writing code" href="http://www.webrade.com/blogs/darrin/2008/06/29/RADEBuildCustomWebApplicationsWithoutWritingCustomCode.aspx" target="_blank" rel="tag">RADE</a> updates around the report this eve and fortunately I bothered to select the entire map and run through a report.</p>
<p align="center"><a href="http://www.geospecialling.com/wp-content/uploads/2010/02/image13.png" target="_blank"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="208" alt="RADE Report - but what, only 20 records returned?" src="http://www.geospecialling.com/wp-content/uploads/2010/02/image_thumb13.png" width="244" border="0" /></a> </p>
<p>Report looked good.&#160; The results were sorting, checkboxes working.&#160;&#160; Wait a minute, I selected the entire map.&#160; There should be more than twenty items returned.&#160; So a quick search of my twelve thousand saved e-mails from the <a title="Mapguide Users Mailing List" href="http://lists.osgeo.org/mailman/listinfo/mapguide-users" target="_blank" rel="tag">Mapguide Users mailing list</a> turned up what needed to be done.&#160; Fortunately Autodesk added a GenerateFilters call to MgSelection.&#160; This call returns an MgStringCollection of filters.</p>
<p>Basically the solution to this problem is to use GenerateFilters instead of GenerateFilter, and loop through the results.&#160; Each time, appending the returned keys to the complete list.&#160; For example:</p>
<div>
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   1:</span> Public Shared Function GetSelectedKeysString(ByRef siteConn As MgSiteConnection, _</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   2:</span>     ByRef resSvc As MgResourceService, ByVal oMap As MgMap, ByVal SessionId As String, _</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   3:</span>     ByVal SelectionXML As String, ByVal layerResID As MgResourceIdentifier, _</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   4:</span>     ByVal keyFieldName As String) As String</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   5:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   6:</span>     Dim szKeys As String = &quot;&quot;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   7:</span>     Dim oSel As New MgSelection(oMap)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   8:</span>     oSel.FromXml(SelectionXML)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   9:</span>     Dim curLay As MgLayerBase</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  10:</span>     'isolate the layer</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  11:</span>     For Each layerItem As MgLayerBase In oSel.GetLayers</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  12:</span>         If layerItem.Name = layerResID.Name Then</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  13:</span>             curLay = layerItem</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  14:</span>         End If</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  15:</span>     Next</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  16:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  17:</span>     Dim featSvc As MgFeatureService = siteConn.CreateService(MgServiceType.FeatureService)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  18:</span>     Dim queryOptions As New MgFeatureQueryOptions</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  19:</span>     Dim featureClassName As String = curLay.GetFeatureClassName</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  20:</span>     'workaround using GenerateFilters and looping through the results as needed</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  21:</span>     Dim featureReader As MgFeatureReader</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  22:</span>     Dim filters As MgStringCollection = oSel.GenerateFilters(curLay, featureClassName, 20)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  23:</span>     Dim filterCnt As Integer = 0</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  24:</span>     While filterCnt <span style="color: #0000ff">&lt;</span> filters.GetCount</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  25:</span>         queryOptions.SetFilter(filters.GetItem(filterCnt))</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  26:</span>         featureReader = featSvc.SelectFeatures(New MgResourceIdentifier(curLay.GetFeatureSourceId), featureClassName, queryOptions)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  27:</span>         While featureReader.ReadNext</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  28:</span>             If szKeys = &quot;&quot; Then</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  29:</span>                 szKeys = ConvertPropertyToString(featureReader, keyFieldName)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  30:</span>             Else</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  31:</span>                 szKeys &amp;= &quot;,&quot; &amp; ConvertPropertyToString(featureReader, keyFieldName)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  32:</span>             End If</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  33:</span>         End While</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  34:</span>         featureReader.Close()</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  35:</span>         featureReader.Dispose()</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  36:</span>         filterCnt += 1</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  37:</span>     End While</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  38:</span>     Return szKeys</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  39:</span> End Function</pre>
</p></div>
</div>
<p>&#160;</p>
<p>In this code, we get the selection from the MgMap object and then isolate the layer in question.&#160; Then we generate the collection of filters and loop through them.&#160; Each time, adding the appropriate value to the list of keys.&#160; Note the use of ConverPropertyToString, this needs to be used to ensure that the various data types are converted over to string. </p>
</p>
<div class="wlWriterEditableSmartContent" id="scid:fb3a1972-4489-4e52-abe7-25a00bb07fdf:014f4cac-ecec-4ce7-ab9c-535012915177" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<p>I&#8217;ve included this function as well as a couple other handy related ones in the <a href="http://www.geospecialling.com/wp-content/uploads/2010/02/feature.zip" target="_blank">attached zip file</a></p>
</div>
<p>.&#160; If you&#8217;re looking for a C# example of how to use GenerateFilters one is provided in the <a title="C# example of GenerateFilters" href="http://svn.osgeo.org/mapguide/branches/2.0.x/MgDev/Web/src/mapviewernet/buffer.aspx" target="_blank" rel="tag">source for buffers.aspx</a>. </p>
<p>After making these changes my reports now look all proper! hurray.&#160; Maybe I can hit the sack now?&#160; nahh.</p>
<p align="center"><a href="http://www.geospecialling.com/wp-content/uploads/2010/02/image14.png" target="_blank"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="208" alt="RADE report - but this time everything looks ok" src="http://www.geospecialling.com/wp-content/uploads/2010/02/image_thumb14.png" width="244" border="0" /></a>&#160;</p>
<div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:5dbcf6eb-786b-405c-8a73-dbb348080503" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags: <a href="http://technorati.com/tags/ASP.NET" rel="tag">ASP.NET</a>,<a href="http://technorati.com/tags/Mapguide+Enterprise" rel="tag">Mapguide Enterprise</a>,<a href="http://technorati.com/tags/Mapguide+Open+Source" rel="tag">Mapguide Open Source</a>,<a href="http://technorati.com/tags/VB.NET" rel="tag">VB.NET</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.geospecialling.com/index.php/2008/07/mapguide-2009-os-2-0-get-selected-key-values-vb-net-example-and-the-dreaded-mgselection-generatefilter-issue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mapguide Enterprise &#8211; Cannot Select Items in DWF and AJAX viewer &#8211; Again</title>
		<link>http://www.geospecialling.com/index.php/2008/07/mapguide-enterprise-cannot-select-items-in-dwf-and-ajax-viewer-again/</link>
		<comments>http://www.geospecialling.com/index.php/2008/07/mapguide-enterprise-cannot-select-items-in-dwf-and-ajax-viewer-again/#comments</comments>
		<pubDate>Tue, 08 Jul 2008 04:41:00 +0000</pubDate>
		<dc:creator>Darrin Maidlow</dc:creator>
				<category><![CDATA[Mapguide]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Dynamic Authoring]]></category>
		<category><![CDATA[FDO]]></category>

		<guid isPermaLink="false">http://www.geospecialling.com/index.php/2008/07/mapguide-enterprise-cannot-select-items-in-dwf-and-ajax-viewer-again/</guid>
		<description><![CDATA[I had another problem with Mapguide Enterprise 2009 recently pertaining to objects not being selectable.&#160; Unlike my previous post on errors caused by invalid FDO filter conditions while dynamically authoring layers, no errors were logged to the Mapguide server logs.&#160; This problem is very likely specific to the enterprise version, as I was using the [...]]]></description>
			<content:encoded><![CDATA[<p>I had another problem with Mapguide Enterprise 2009 recently pertaining to objects not being selectable.&#160; Unlike my previous post on errors caused by <a title="cannot select items with an invalid FDO where condition" href="http://www.webrade.com/blogs/darrin/Trackback.aspx?guid=70cd1029-9f82-408f-b738-f25fe743e7dd" target="_blank" rel="tag">invalid FDO filter conditions while dynamically authoring</a> layers, no errors were logged to the Mapguide server logs.&#160; This problem is very likely specific to the enterprise version, as I was using the Autodesk FDO Provider for Oracle.</p>
<p>So a data connection was created pointing to the Oracle 10g schema.&#160; This database contained a number of tables containing Lat/Long point geometry entities.&#160; I created a layer pointing to the table in question.&#160; I created a layer pointing to that data connection.&#160; At this point the entities showed up as expected in the both the DWF and the AJAX viewers.&#160; Once again, I could not select any of the entities.&#160; I checked the server logs, no errors were reported.</p>
<p>In troubleshoot mode, I tried just about everything I could think of but nothing would work.&#160; I simplified the theme, created new layers, removed all other layers from them map.&#160; Eventually I created a new layer from another table.&#160; Luckily, the entities on this layer could be selected.&#160; It must be a problem with the underlying data.&#160; On a hunch, I checked the table definitions &#8211; specifically looking at primary keys.&#160; The selectable layer had a primary key defined, the problem layer did not.&#160; (Good thing I cannot take credit for creating this source data =))</p>
<p>So, I created a primary key on the problem table, did a touch on the layer definition (opening the definition in Studio and saving it without any changes) and then left for twenty minutes.&#160; I&#8217;m thinking there is some sort of caching going within the server, and I&#8217;m not sure how it works.&#160; Immediately reloading the map after adding the primary key did not work &#8211; the entities were still not selectable.&#160; When I came back &#8211; the items in the viewers were now selectable.</p>
<p>So long story short, if again you cannot select map entities using the Autodesk FDO Provider for Oracle ensure that the source table has a primary key defined.&#160; Hopefully this saves someone some grief =)</p>
<div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:529a75cc-4fc2-418c-ade5-92e424b5f309" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags: <a href="http://technorati.com/tags/FDO" rel="tag">FDO</a>,<a href="http://technorati.com/tags/Mapguide+Enterprise" rel="tag">Mapguide Enterprise</a>,<a href="http://technorati.com/tags/Mapguide+Authoring" rel="tag">Mapguide Authoring</a>,<a href="http://technorati.com/tags/Oracle+Spatial" rel="tag">Oracle Spatial</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.geospecialling.com/index.php/2008/07/mapguide-enterprise-cannot-select-items-in-dwf-and-ajax-viewer-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy color ranges for developers in Mapguide Studio 2009</title>
		<link>http://www.geospecialling.com/index.php/2008/06/easy-color-ranges-for-developers-in-mapguide-studio-2009/</link>
		<comments>http://www.geospecialling.com/index.php/2008/06/easy-color-ranges-for-developers-in-mapguide-studio-2009/#comments</comments>
		<pubDate>Thu, 26 Jun 2008 00:30:00 +0000</pubDate>
		<dc:creator>Darrin Maidlow</dc:creator>
				<category><![CDATA[Mapguide]]></category>
		<category><![CDATA[Colors]]></category>

		<guid isPermaLink="false">http://www.geospecialling.com/index.php/2008/06/easy-color-ranges-for-developers-in-mapguide-studio-2009/</guid>
		<description><![CDATA[Typically developers are color stupid (myself included).&#160; I&#8217;ve seen some really really ugly maps.&#160; I&#8217;ve created some really really ugly maps.&#160; With Mapguide 6.5 in particular &#8211; I gave up on trying to create visually appealing maps.&#160; The 255 colors, in the ranges defined I just could not do it.
With Mapguide Enterprise &#8211; I may [...]]]></description>
			<content:encoded><![CDATA[<p>Typically developers are color stupid (myself included).&#160; I&#8217;ve seen some really really ugly maps.&#160; I&#8217;ve created some really really ugly maps.&#160; With Mapguide 6.5 in particular &#8211; I gave up on trying to create visually appealing maps.&#160; The 255 colors, in the ranges defined I just could not do it.</p>
<p>With Mapguide Enterprise &#8211; I may have found a solution.&#160; Recently I created a themed layer for municipalities.&#160; There were twenty five municipalities in a single spatial table.&#160; Each municipality had a unique code.&#160;&#160; In an effort to bang these off quickly I added the twenty five municipalities and the filter condition.&#160;&#160; Next I entered the twenty five legend labels.</p>
<p>Here is the developer friendly method I came up with creating a somewhat visually appealing color range.&#160; In the first condition I set first set the transparency to 50%.&#160; The transparency affects the resulting color.&#160; Select the color combo and choose &quot;More Colors&quot;.&#160; This should bring up the custom color dialog.&#160; First, select one of the &quot;Custom Color&quot; boxes and set the Hue to 0. Next I created a color I wanted to use as my starting shade.</p>
<p>At this point, I saved the color using the &quot;Add to Custom Colors&quot; button.&#160; Your form should look something like this:</p>
<p align="center"><a href="http://www.geospecialling.com/wp-content/uploads/2010/02/image4.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="203" alt="Mapguide Color Dialog" src="http://www.geospecialling.com/wp-content/uploads/2010/02/image_thumb4.png" width="244" border="0" /></a> </p>
<p align="left">Click OK a couple of times and your first condition should be set.&#160; Next I selected my next condition, and clicked the color combo again choosing &quot;More Colors&quot; once again.&#160; This time, select the saved custom color and it should reset the form with the previously saved shade.&#160; At this point I incremented the Hue by 20 to 20.&#160; Click ok a couple of times and repeat.&#160; I was not re-saving my shade, though I suppose that might have made sense.&#160; Each time you repeat this process increase the hue by 20 until you hit the max of 239.</p>
<p align="left">If needed, and you do hit the max hue start the process over starting with another complimentary base shade with a hue of 0. Using a hue increment of 40 might have resulted in more distinct colorations and may be a good idea.</p>
<p align="left">I think it turned out OK, but then again as I stated earlier &#8211; I&#8217;m color stupid.&#160; </p>
<p align="center"><a href="http://www.geospecialling.com/wp-content/uploads/2010/02/image5.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="175" alt="Resulting Color Range" src="http://www.geospecialling.com/wp-content/uploads/2010/02/image_thumb5.png" width="244" border="0" /></a> </p>
<div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:5e1c745d-30a3-4d92-acc7-1ab11240cbd0" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags: <a href="http://technorati.com/tags/Mapguide" rel="tag">Mapguide</a>,<a href="http://technorati.com/tags/Mapguide+Authoring" rel="tag">Mapguide Authoring</a>,<a href="http://technorati.com/tags/Mapguide+Studio" rel="tag">Mapguide Studio</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.geospecialling.com/index.php/2008/06/easy-color-ranges-for-developers-in-mapguide-studio-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert Mapguide 6.5 colors to Mapguide Enterprise/Open Source/AutoCAD RGB equivalents</title>
		<link>http://www.geospecialling.com/index.php/2008/06/convert-mapguide-6-5-colors-to-mapguide-enterpriseopen-sourceautocad-rgb-equivalents/</link>
		<comments>http://www.geospecialling.com/index.php/2008/06/convert-mapguide-6-5-colors-to-mapguide-enterpriseopen-sourceautocad-rgb-equivalents/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 05:59:00 +0000</pubDate>
		<dc:creator>Darrin Maidlow</dc:creator>
				<category><![CDATA[Mapguide]]></category>
		<category><![CDATA[6.5]]></category>

		<guid isPermaLink="false">http://www.geospecialling.com/index.php/2010/02/convert-mapguide-6-5-colors-to-mapguide-enterpriseopen-sourceautocad-rgb-equivalents/</guid>
		<description><![CDATA[I&#8217;ve been authoring some test data for my ongoing Mapguide Enterprise \ MGOS work.&#160; For consistency with my existing tabular test data, I need to migrate some Mapguide 6.5 maps over to Enterprise.&#160; This is quite the chore.&#160; I really wish Autodesk would have kept updating the Mapguide 6.5 Data Migration Tool and bring that [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been authoring some test data for my ongoing Mapguide Enterprise \ MGOS work.&#160; For consistency with my existing tabular test data, I need to migrate some Mapguide 6.5 maps over to Enterprise.&#160; This is quite the chore.&#160; I <strong><em>really</em></strong> wish Autodesk would have kept updating the Mapguide 6.5 <a title="Mapguide 6.5 to 2007 Data Migration Tool" href="http://usa.autodesk.com/adsk/servlet/index?siteID=123112&amp;id=7429087&amp;linkID=9242099" target="_blank" rel="tag">Data Migration Tool</a> and bring that up to support a current release of Mapguide.&#160; Even with the tools flaws, it was still a good start on migration &#8211; but oh well, that&#8217;s another rant completely..and maybe another side project that I just don&#8217;t have time for =)</p>
<p>Anyhow, I wanted to share the <a title="Autodesk Mapguide 6.5 RGB color conversions" href="http://www.dot.co.pima.az.us/gis/mgdev/mgcolors/" target="_blank" rel="tag">Pima County Mapguide Color Chart</a>.&#160; I can&#8217;t believe I hadn&#8217;t found this page sooner.&#160; A fantastic, and crucial reference.&#160;&#160; Tons of useful settings for the chart generator.&#160; Show the hex codes for using the colors in HTML, Decimal RGB values for Mapguide Enterprise \ Autocad.&#160; The colors under the Decimal heading are the RGB values &#8211; ordered in Red, Green, Blue.&#160; I&#8217;ve been using the chart in <a title="Autodesk Mapguide 6.5 Hex and RGB colors" href="http://www.dot.co.pima.az.us/gis/mgdev/mgcolors/chart.cfm?hex=yes&amp;decimal=yes&amp;crossref=yes&amp;insert=yes&amp;collength=60" target="_blank" rel="tag">this config</a>.</p>
<p>Thanks Pima County.&#160; Hopefully, you guys were able to come up with a programmatic method of creating this chart.&#160; I&#8217;d hate to be the guy tasked with &#8216;eyedropping&#8217; all these colors using Photoshop or something.</p>
<p>The decimal values by the way should work with AutoCAD too.</p>
<p>&#160;</p>
<div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:6ff5e320-5388-400b-a832-82f2aaeeaebe" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags: <a href="http://technorati.com/tags/Mapguide+Colors" rel="tag">Mapguide Colors</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.geospecialling.com/index.php/2008/06/convert-mapguide-6-5-colors-to-mapguide-enterpriseopen-sourceautocad-rgb-equivalents/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamic Authoring in Mapguide Enterprise &#8211; Before the Viewer has Loaded</title>
		<link>http://www.geospecialling.com/index.php/2008/05/dynamic-authoring-in-mapguide-enterprise-before-the-viewer-has-loaded/</link>
		<comments>http://www.geospecialling.com/index.php/2008/05/dynamic-authoring-in-mapguide-enterprise-before-the-viewer-has-loaded/#comments</comments>
		<pubDate>Thu, 22 May 2008 05:38:00 +0000</pubDate>
		<dc:creator>Darrin Maidlow</dc:creator>
				<category><![CDATA[Mapguide]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Dynamic Authoring]]></category>

		<guid isPermaLink="false">http://www.geospecialling.com/index.php/2008/05/dynamic-authoring-in-mapguide-enterprise-before-the-viewer-has-loaded/</guid>
		<description><![CDATA[As a follow up to my previous post on Creating .Net objects for Mapguide XML Schema Definitions, I wanted to share some examples of using these new objects, so I created this example of doing some dynamic authoring before the map viewer has loaded.&#160; Currently, all of my work is done using Mapguide Enterprise 2009, [...]]]></description>
			<content:encoded><![CDATA[<p>As a follow up to my previous post on <a title="Creating .Net objects for Mapguide XML Schema Definitions" href="http://www.geospecialling.com/index.php/2008/05/creating-net-objects-for-mapguide-xml-schema-definitions-xsd-using-linq/" target="_blank" rel="tag">Creating .Net objects for Mapguide XML Schema Definitions</a>, I wanted to share some examples of using these new objects, so I created this example of doing some dynamic authoring before the map viewer has loaded.&#160; Currently, all of my work is done using Mapguide Enterprise 2009, however this code should work using Mapguide Open 2.0 as well.&#160; I believe I had this code working using Mapguide 2008 initially, and then migrated it over to the 2009 platform.&#160; Feel free to give that shot if you are still using Mapguide 2008.&#160; Some changes would be needed in the .Net objects project &#8211; to remove 2009 specific XSD files and possibly reference some of the older XSDs for things like layers.</p>
<p>One of my first tasks with Mapguide Enterprise was to build a map on the fly.&#160; There were examples for adding layers to the map programmatically after the viewer had loaded, but this didn&#8217;t match the desired flow of my application.&#160; Also, having come from years of Mapguide 6.5 and lower -&#160; I was trying to avoid as much client side automation as possible.&#160; The new <a title="Mapguide Open Source Web Tier API" href="http://mapguide.osgeo.org/files/mapguide/docs/webapi/index.htm" target="_blank" rel="tag">Web Tier API</a> was one of the things that excited me the most about Mapguide Enterprise / Mapguide Open Source</p>
<p>I&#8217;ve pasted the full, commented code here, as well as attached a solution containing the two projects needed.&#160; Note these projects are Visual Studio 2008 projects.&#160; Please feel free to use this code for learning purposes.&#160; If it helps you out, link back to this article =)</p>
<p>If you choose instead to create a new project, be sure to add a project or DLL reference to the OSGeo.Mapguide.Objects.dll file we created previously .&#160; The project I&#8217;ve included here contains both the sample Web Application project, as well as a copy of the .NET objects for Mapguide project.&#160; It should be almost ready for the running.&#160; Also ensure there is a reference to the Microsoft.XML.Schema.Linq namespace added to the project.&#160; Also copy the required .DLL files from the Autodesk provided .NET viewer\bin folder to the web projects bin folder.&#160; I did not include these here as I was not sure of the legality of doing so.</p>
<p>First load up the <a title="Sheboyban Mapguide Sample Data" href="http://download.osgeo.org/mapguide/releases/2.0.0/samples/Sheboygan.mgp" target="_blank" rel="tag">Sheboygan package</a> into your Mapguide repository.&#160; For the purposes of this example, open the Map definition in Mapguide Studio (or equivalent) and remove all the layers and layer groups from the map.&#160; If you forget to do this you will get a Duplicate Object error when you load up the map.&#160; Once that is done, you are ready to try out the code.</p>
<div class="wlWriterEditableSmartContent" id="scid:fb3a1972-4489-4e52-abe7-25a00bb07fdf:7bb82de1-2f5f-472e-a241-e5709454be7c" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<p> <a href="http://www.geospecialling.com/wp-content/uploads/2010/02/MGEDynamicAuthoringSample.zip" target="_blank">Full Project and Solution with source</a></p>
</div>
<p>You should be able top unzip the zip and open the MGEDynamicAuthoringSample.sln file with Visual Studio.&#160; Pretty much the only thing you may need to change are the constants to match your machine specific items:</p>
<p>&#160;</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4">
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   1:</span> <span style="color: #006080">'set some contants up - webconfig.ini, map viewer url, Map, Layout and Layer locatinos</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   2:</span> Private Const gszWebConfig As String = &quot;C:\inetpub\MapGuideEnterprise2009\WebServerExtensions\www\webconfig.ini&quot;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   3:</span> Private Const gszViewerUrl As String = &quot;http://localhost/mapguide2009/mapviewerdwf&quot;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   4:</span> Private Const gszMapResID As String = &quot;Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition&quot;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   5:</span> Private Const gszLayerFolderResID As String = &quot;Library://Samples/Sheboygan/Layers.Folder&quot;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   6:</span> Private Const gszLayoutResID As String = &quot;Library://Samples/Sheboygan/Layouts/SheboyganAsp.WebLayout&quot;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   7:</span> '</span>lets run with Administrator <span style="color: #0000ff">for</span> noew to eliminate permission problems.  Update your password <span style="color: #0000ff">as</span> needed, or specify your</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   8:</span> 'own credentials <span style="color: #0000ff">if</span> you are comfortable with setting up repository permissions.</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   9:</span> Private Const gszMGUser As String = <span style="color: #006080">&quot;Administrator&quot;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  10:</span> Private Const gszMGPass As String = <span style="color: #006080">&quot;admin&quot;</span></pre>
</p></div>
</div>
<p>
  <br />Once you&#8217;ve changed all the needed settings, you should be good to go.&#160; Run the code in Visual Studio and you should now see a map similar to the default Sheboygan map.&#160; The key difference is that all of the layers will exist within the layer group we created programmatically.</p>
<p><strong>Commented Codebehind:</strong></p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; height: 236px; background-color: #f4f4f4">
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   1:</span> Imports OSGeo.MapGuide</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   2:</span> <span style="color: #006080">'we still need to import and use system.xml, but don'</span>t really need to use many parts of the XML</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   3:</span> <span style="color: #006080">'functionality =)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   4:</span> Imports System.Xml</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   5:</span> Partial Public Class _Default</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   6:</span>     '</span><span style="color: #006080">' '</span>So <span style="color: #0000ff">for</span> <span style="color: #0000ff">this</span> example, we<span style="color: #006080">'re going to use the sheboygan sample package available from </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   7:</span>     '</span><span style="color: #006080">' '</span> http:<span style="color: #008000">//mapguide.osgeo.org/download/releases/2.0.x-samples.  Be sure to grab both the </span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   8:</span>     <span style="color: #006080">''</span> <span style="color: #006080">' dotnetviewstample.zip as well as the sheboygan.mgp.  Import the package using</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   9:</span>     '</span><span style="color: #006080">' '</span> the mapguide site administrator.  I<span style="color: #006080">'ve tried to use the default resource paths</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  10:</span>     '</span><span style="color: #006080">' '</span> but some tweaking of map will be needed</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  11:</span>     <span style="color: #006080">''</span> <span style="color: #006080">' </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  12:</span>     '</span><span style="color: #006080">' '</span> Open the map definition <span style="color: #0000ff">in</span> Studio, and remove all the layers from Samples/Sheboygan/Maps/Sheboygan.MapDefinition </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  13:</span>     <span style="color: #006080">''</span> <span style="color: #006080">' we'</span>re going to add them dynamically    </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  14:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  15:</span>     Inherits System.Web.UI.Page</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  16:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  17:</span>     <span style="color: #006080">'set some contants up - webconfig.ini, map viewer url, Map, Layout and Layer locatinos</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  18:</span>     Private Const gszWebConfig As String = &quot;C:\inetpub\MapGuideEnterprise2009\WebServerExtensions\www\webconfig.ini&quot;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  19:</span>     Private Const gszViewerUrl As String = &quot;http://localhost/mapguide2009/mapviewerdwf&quot;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  20:</span>     Private Const gszMapResID As String = &quot;Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition&quot;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  21:</span>     Private Const gszLayerFolderResID As String = &quot;Library://Samples/Sheboygan/Layers.Folder&quot;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  22:</span>     Private Const gszLayoutResID As String = &quot;Library://Samples/Sheboygan/Layouts/SheboyganAsp.WebLayout&quot;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  23:</span>     Private Const gszMGUser As String = &quot;Administrator&quot;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  24:</span>     Private Const gszMGPass As String = &quot;admin&quot;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  25:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  26:</span>     '</span><span style="color: #006080">''</span> &lt;summary&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  27:</span>     <span style="color: #006080">''</span><span style="color: #006080">' Page_Load does everything =)  Be sure to copy the dll files from your mapviewernet\bin folder to this projects bin folder.</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  28:</span>     '</span><span style="color: #006080">''</span> I did not include them <span style="color: #0000ff">as</span> that might have violated some autodesk license.    </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  29:</span>     <span style="color: #006080">''</span><span style="color: #006080">' &lt;/summary&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  30:</span>     '</span><span style="color: #006080">''</span> &lt;param name=<span style="color: #006080">&quot;sender&quot;</span>&gt;&lt;/param&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  31:</span>     <span style="color: #006080">''</span><span style="color: #006080">' &lt;param name=&quot;e&quot;&gt;&lt;/param&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  32:</span>     '</span><span style="color: #006080">''</span> &lt;remarks&gt;&lt;/remarks&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  33:</span>     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  34:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  35:</span>         <span style="color: #006080">'setup our siteconnection</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  36:</span>         Dim siteConnection As New MgSiteConnection</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  37:</span>         siteConnection = CreateMGSession(gszMGUser, gszMGPass, gszWebConfig)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  38:</span>         Dim szSessionId As String = siteConnection.GetSite.CreateSession()</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  39:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  40:</span>         '</span>create our connection to the resource service</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  41:</span>         Dim resSvc As MgResourceService</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  42:</span>         resSvc = siteConnection.CreateService(MgServiceType.ResourceService)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  43:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  44:</span>         <span style="color: #006080">'get or set the resourceid of the map to load - in this case i'</span>m just going to hard code it</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  45:</span>         Dim mapResourceID As New MgResourceIdentifier(gszMapResID)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  46:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  47:</span>         <span style="color: #006080">'load the existing map from the libary into an XML document</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  48:</span>         Dim mapXML As XmlDocument = GetResourceXML(resSvc, mapResourceID)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  49:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  50:</span>         '</span>so at <span style="color: #0000ff">this</span> point we have an XML document.  Let<span style="color: #006080">'s try using our new OSGeo.Mapguide.Object classes</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  51:</span>         Dim newMapDefinition As New OSGeo.MapGuide.Objects.MapDefinition</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  52:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  53:</span>         '</span>to load the xml - call the shared/<span style="color: #0000ff">static</span> method of MapDefinition.Parse on the OuterXML of the XMLDocument</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  54:</span>         newMapDefinition = OSGeo.MapGuide.Objects.MapDefinition.Parse(mapXML.OuterXml)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  55:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  56:</span>         <span style="color: #006080">'at this point we have a loaded .NET Object containing the map.  Try using Intellisense to see the different methods</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  57:</span>         '</span>Lets add a layer group now</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  58:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  59:</span>         <span style="color: #006080">'add any needed layer groups to the map.  In this example we'</span>re only going to add one.</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  60:</span>         Dim szLayerGroupName As String = <span style="color: #006080">&quot;NewLayerGroup&quot;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  61:</span>         Dim szLayerGroupAlias As String = <span style="color: #006080">&quot;My Layer Group Alias&quot;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  62:</span>         newMapDefinition = AddMapLayerGroup(newMapDefinition, szLayerGroupName, szLayerGroupAlias)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  63:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  64:</span>         <span style="color: #006080">'get or set the resourceid of the folder that contains our layers to add</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  65:</span>         Dim layerPath As New MgResourceIdentifier(gszLayerFolderResID)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  66:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  67:</span>         '</span>so we now have a layer group <span style="color: #0000ff">in</span> our map.  Lets add the layers</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  68:</span>         AddFolderOfLayers(resSvc, newMapDefinition, layerPath, szLayerGroupName)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  69:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  70:</span>         <span style="color: #006080">'at this point our map definition is loaded.  Lets convert it back to XML and save it to the session</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  71:</span>         Dim newMapDoc As New XmlDocument</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  72:</span>         newMapDoc.PreserveWhitespace = True</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  73:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  74:</span>         Dim szXML As String = newMapDefinition.Untyped.ToString</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  75:</span>         newMapDoc.LoadXml(szXML)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  76:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  77:</span>         '</span>create our <span style="color: #006080">'new'</span> resourceID <span style="color: #0000ff">in</span> the session repository</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  78:</span>         Dim newMapResourceID As New MgResourceIdentifier(<span style="color: #006080">&quot;Session:&quot;</span> &amp; szSessionId &amp; <span style="color: #006080">&quot;//&quot;</span> &amp; mapResourceID.GetName() &amp; <span style="color: #006080">&quot;.&quot;</span> &amp; MgResourceType.MapDefinition)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  79:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  80:</span>         <span style="color: #006080">'save the newly created map in the session repository</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  81:</span>         CreateSessionResource(resSvc, newMapDoc, szSessionId, newMapResourceID.GetName, MgResourceType.MapDefinition)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  82:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  83:</span>         '</span>now lets deal with the layout - we need to load up the library layout, update the map definition, and save it to the repository</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  84:</span>         Dim layoutResourceID As New MgResourceIdentifier(gszLayoutResID)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  85:</span>         Dim newLayoutResourceID As New MgResourceIdentifier(<span style="color: #006080">&quot;Session:&quot;</span> &amp; szSessionId &amp; <span style="color: #006080">&quot;//&quot;</span> &amp; layoutResourceID.GetName() &amp; <span style="color: #006080">&quot;.&quot;</span> &amp; MgResourceType.WebLayout)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  86:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  87:</span>         <span style="color: #006080">'same process here, load the XML, parse the XML into the new .net Object</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  88:</span>         Dim layoutXML As XmlDocument = GetResourceXML(resSvc, layoutResourceID)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  89:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  90:</span>         Dim newLayout As New OSGeo.MapGuide.Objects.WebLayout</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  91:</span>         newLayout = OSGeo.MapGuide.Objects.WebLayout.Parse(layoutXML.OuterXml)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  92:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  93:</span>         '</span>update the map resource ID <span style="color: #0000ff">in</span> the layout to point to our newly created map <span style="color: #0000ff">in</span> the session</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  94:</span>         newLayout.Map.ResourceId = newMapResourceID.ToString</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  95:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  96:</span>         <span style="color: #006080">'finally go through the motinos to save the layout to the session</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  97:</span>         Dim newLayoutXML As New XmlDocument</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  98:</span>         newLayoutXML.PreserveWhitespace = True</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  99:</span>         newLayoutXML.LoadXml(newLayout.Untyped.ToString())</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 100:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 101:</span>         CreateSessionResource(resSvc, newLayoutXML, szSessionId, newLayoutResourceID.GetName, MgResourceType.WebLayout)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 102:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 103:</span>         '</span>our last step <span style="color: #0000ff">is</span> to update the src attribute of the iframe with the information needed to load the newly created layout</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 104:</span>         SetupIFrame(newLayoutResourceID, szSessionId)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 105:</span>     End Sub</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 106:</span>     Private Sub SetupIFrame(ByVal layoutResId As MgResourceIdentifier, ByVal szSessionID As String)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 107:</span>         <span style="color: #006080">'build the URL based on our constants, and the layout + session info</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 108:</span>         Dim szUrl As String = gszViewerUrl &amp; &quot;?WEBLAYOUT=&quot; &amp; layoutResId.ToString &amp; &quot;&amp;SESSION=&quot; &amp; szSessionID</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 109:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 110:</span>         '</span>update the iframe</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 111:</span>         ifrmViewer.Attributes.Add(<span style="color: #006080">&quot;src&quot;</span>, szUrl)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 112:</span>     End Sub</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 113:</span>     <span style="color: #006080">''</span><span style="color: #006080">' &lt;summary&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 114:</span>     '</span><span style="color: #006080">''</span> Adds a layer group to the passed MapDefinition, and returns the updated MapDefinition Object.</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 115:</span>     <span style="color: #006080">''</span><span style="color: #006080">' If desired, additional parameters could be added to this to customize the various other properties</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 116:</span>     '</span><span style="color: #006080">''</span> like ShowInLegend etc        </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 117:</span>     <span style="color: #006080">''</span><span style="color: #006080">' &lt;/summary&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 118:</span>     '</span><span style="color: #006080">''</span> &lt;param name=<span style="color: #006080">&quot;mapDef&quot;</span>&gt;The loaded MapDefinition obect&lt;/param&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 119:</span>     <span style="color: #006080">''</span><span style="color: #006080">' &lt;param name=&quot;szLayerGroupName&quot;&gt;The Layer Name of the new layer group&lt;/param&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 120:</span>     '</span><span style="color: #006080">''</span> &lt;param name=<span style="color: #006080">&quot;szLayerGroupAlias&quot;</span>&gt;The Layer Alias of the <span style="color: #0000ff">new</span> layer group&lt;/param&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 121:</span>     <span style="color: #006080">''</span><span style="color: #006080">' &lt;returns&gt;the passed MapDefinition, with the new layer group added&lt;/returns&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 122:</span>     '</span><span style="color: #006080">''</span> &lt;remarks&gt;&lt;/remarks&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 123:</span>     Public Shared Function AddMapLayerGroup(ByVal mapDef As OSGeo.MapGuide.Objects.MapDefinition, ByVal szLayerGroupName As String, ByVal szLayerGroupAlias As String) As OSGeo.MapGuide.Objects.MapDefinition</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 124:</span>         Dim newLayGRoup As New OSGeo.MapGuide.Objects.MapLayerGroupType</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 125:</span>         newLayGRoup.Name = szLayerGroupName</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 126:</span>         newLayGRoup.LegendLabel = szLayerGroupAlias</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 127:</span>         newLayGRoup.ShowInLegend = <span style="color: #006080">&quot;True&quot;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 128:</span>         newLayGRoup.ExpandInLegend = <span style="color: #006080">&quot;True&quot;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 129:</span>         newLayGRoup.Visible = <span style="color: #006080">&quot;True&quot;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 130:</span>         newLayGRoup.Group = <span style="color: #006080">&quot;&quot;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 131:</span>         mapDef.MapLayerGroup.Add(newLayGRoup)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 132:</span>         Return mapDef</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 133:</span>     End Function</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 134:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 135:</span>     <span style="color: #006080">''</span><span style="color: #006080">' &lt;summary&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 136:</span>     '</span><span style="color: #006080">''</span> Adds all layer definitions within the specified repository folder to the specified map</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 137:</span>     <span style="color: #006080">''</span><span style="color: #006080">' &lt;/summary&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 138:</span>     '</span><span style="color: #006080">''</span> &lt;param name=<span style="color: #006080">&quot;resSvc&quot;</span>&gt;An open resource service connection&lt;/param&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 139:</span>     <span style="color: #006080">''</span><span style="color: #006080">' &lt;param name=&quot;newMap&quot;&gt;the MapDefinition object to modify&lt;/param&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 140:</span>     '</span><span style="color: #006080">''</span> &lt;param name=<span style="color: #006080">&quot;resLocation&quot;</span>&gt;The folder <span style="color: #0000ff">in</span> the repository to search <span style="color: #0000ff">for</span> layer objects&lt;/param&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 141:</span>     <span style="color: #006080">''</span><span style="color: #006080">' &lt;returns&gt;Update MapDefinition object&lt;/returns&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 142:</span>     '</span><span style="color: #006080">''</span> &lt;remarks&gt;&lt;/remarks&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 143:</span>     Public Shared Function AddFolderOfLayers(ByRef resSvc As MgResourceService, ByVal newMap As OSGeo.MapGuide.Objects.MapDefinition, ByVal resLocation As MgResourceIdentifier, ByVal szLayerGroupName As String) As OSGeo.MapGuide.Objects.MapDefinition</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 144:</span>         <span style="color: #006080">'get the list of layers in the folder</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 145:</span>         Dim resList As OSGeo.MapGuide.Objects.ResourceList</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 146:</span>         '</span>use GetAllResources to get a <span style="color: #0000ff">new</span> resList</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 147:</span>         resList = GetAllResources(resSvc, resLocation, 1, MgResourceType.LayerDefinition)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 148:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 149:</span>         <span style="color: #006080">'resList items are pretty much a collection of resrouceDocumentLocalTypes so define one of these to use in the for loop</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 150:</span>         Dim resItem As OSGeo.MapGuide.Objects.ResourceList.ResourceDocumentLocalType</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 151:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 152:</span>         '</span>define a <span style="color: #0000ff">new</span> layerResID to use <span style="color: #0000ff">in</span> the loop</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 153:</span>         Dim layerResID As MgResourceIdentifier</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 154:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 155:</span>         <span style="color: #006080">'for each layer - process it and add it to the map</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 156:</span>         Dim newLayerType As New OSGeo.MapGuide.Objects.MapLayerType</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 157:</span>         For Each resItem In resList.ResourceDocument</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 158:</span>             layerResID = New MgResourceIdentifier(resItem.ResourceId)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 159:</span>             '</span><span style="color: #0000ff">for</span> adding a layer to the map - we must use the MapLayerType <span style="color: #0000ff">object</span> </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 160:</span>             newLayerType = New OSGeo.MapGuide.Objects.MapLayerType</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 161:</span>             newLayerType.ResourceId = layerResID.ToString</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 162:</span>             <span style="color: #006080">'Be sure to specify the name of the </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 163:</span>             newLayerType.Group = szLayerGroupName</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 164:</span>             newLayerType.Name = layerResID.GetName</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 165:</span>             newLayerType.Selectable = &quot;false&quot;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 166:</span>             newLayerType.ShowInLegend = &quot;true&quot;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 167:</span>             newLayerType.LegendLabel = layerResID.GetName</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 168:</span>             newLayerType.ExpandInLegend = &quot;true&quot;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 169:</span>             newLayerType.Visible = &quot;true&quot;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 170:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 171:</span>             newMap.MapLayer.Insert(0, newLayerType)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 172:</span>         Next</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 173:</span>         '</span><span style="color: #0000ff">return</span> the updated MapDefinition</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 174:</span>         Return newMap</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 175:</span>     End Function</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 176:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 177:</span>     <span style="color: #006080">'Some handy functions</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 178:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 179:</span>     '</span><span style="color: #006080">''</span> &lt;summary&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 180:</span>     <span style="color: #006080">''</span><span style="color: #006080">' Saves the specified XMLDocument to the session respository</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 181:</span>     '</span><span style="color: #006080">''</span> &lt;/summary&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 182:</span>     <span style="color: #006080">''</span><span style="color: #006080">' &lt;param name=&quot;resSvc&quot;&gt;The open resource service connection&lt;/param&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 183:</span>     '</span><span style="color: #006080">''</span> &lt;param name=<span style="color: #006080">&quot;xmlDoc&quot;</span>&gt;the XMLDocument to save to the session repository&lt;/param&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 184:</span>     <span style="color: #006080">''</span><span style="color: #006080">' &lt;param name=&quot;szSessionId&quot;&gt;String containing the session ID&lt;/param&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 185:</span>     '</span><span style="color: #006080">''</span> &lt;param name=<span style="color: #006080">&quot;szName&quot;</span>&gt;The name of the newly created <span style="color: #0000ff">object</span> <span style="color: #0000ff">in</span> the repository&lt;/param&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 186:</span>     <span style="color: #006080">''</span><span style="color: #006080">' &lt;param name=&quot;szResourceType&quot;&gt;the object type&lt;/param&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 187:</span>     '</span><span style="color: #006080">''</span> &lt;returns&gt;&lt;/returns&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 188:</span>     <span style="color: #006080">''</span><span style="color: #006080">' &lt;remarks&gt;&lt;/remarks&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 189:</span>     Public Shared Function CreateSessionResource(ByRef resSvc As MgResourceService, ByVal xmlDoc As XmlDocument, ByVal szSessionId As String, ByVal szName As String, ByVal szResourceType As String) As MgResourceIdentifier</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 190:</span>         Dim byteSource As MgByteSource = getByteSource(xmlDoc)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 191:</span>         Dim resID As New MgResourceIdentifier(&quot;Session:&quot; &amp; szSessionId &amp; &quot;//&quot; &amp; szName &amp; &quot;.&quot; &amp; szResourceType)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 192:</span>         resSvc.SetResource(resID, byteSource.GetReader, Nothing)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 193:</span>         Return resID</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 194:</span>     End Function</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 195:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 196:</span>     '</span><span style="color: #006080">''</span> &lt;summary&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 197:</span>     <span style="color: #006080">''</span><span style="color: #006080">' Returns an MgByteSource for the passed XMLDocument</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 198:</span>     '</span><span style="color: #006080">''</span> &lt;/summary&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 199:</span>     <span style="color: #006080">''</span><span style="color: #006080">' &lt;param name=&quot;xmlDoc&quot;&gt;The XMLDocument to convert&lt;/param&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 200:</span>     '</span><span style="color: #006080">''</span> &lt;returns&gt;MgByteSource of the XMLDocumnet&lt;/returns&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 201:</span>     <span style="color: #006080">''</span><span style="color: #006080">' &lt;remarks&gt;&lt;/remarks&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 202:</span>     Public Shared Function getByteSource(ByVal xmlDoc As XmlDocument) As MgByteSource</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 203:</span>         Dim xmlStream As New IO.MemoryStream</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 204:</span>         xmlDoc.Save(xmlStream)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 205:</span>         Dim arrBytes() As Byte = xmlStream.ToArray()</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 206:</span>         Dim Enc As Encoding = Encoding.UTF8</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 207:</span>         Dim docString As String = New String(Enc.GetChars(arrBytes))</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 208:</span>         arrBytes = Nothing</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 209:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 210:</span>         Dim arrOutput(docString.Length - 1) As Byte</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 211:</span>         Dim nByteCount As Integer = Enc.GetBytes(docString, 0, docString.Length, arrOutput, 0)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 212:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 213:</span>         Dim byteSource As New MgByteSource(arrOutput, arrOutput.Length)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 214:</span>         byteSource.SetMimeType(MgMimeType.Xml)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 215:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 216:</span>         Return byteSource</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 217:</span>     End Function</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 218:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 219:</span>     '</span><span style="color: #006080">''</span> &lt;summary&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 220:</span>     <span style="color: #006080">''</span><span style="color: #006080">' returns a loaded XML document of the specified resourceID</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 221:</span>     '</span><span style="color: #006080">''</span> &lt;/summary&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 222:</span>     <span style="color: #006080">''</span><span style="color: #006080">' &lt;param name=&quot;resSvc&quot;&gt;An open connection to the Mapguide Resource Service&lt;/param&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 223:</span>     '</span><span style="color: #006080">''</span> &lt;param name=<span style="color: #006080">&quot;resId&quot;</span>&gt;The MgResourceID of the entity <span style="color: #0000ff">in</span> question&lt;/param&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 224:</span>     <span style="color: #006080">''</span><span style="color: #006080">' &lt;returns&gt;A loaded XMLDocument of the specified resource&lt;/returns&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 225:</span>     '</span><span style="color: #006080">''</span> &lt;remarks&gt;&lt;/remarks&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 226:</span>     Public Shared Function GetResourceXML(ByRef resSvc As MgResourceService, ByVal resId As MgResourceIdentifier) As XmlDocument</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 227:</span>         Dim retDoc As New XmlDocument</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 228:</span>         retDoc.PreserveWhitespace = True</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 229:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 230:</span>         Dim szXML As String = resSvc.GetResourceContent(resId).ToString()</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 231:</span>         Dim nByteCount As Integer</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 232:</span>         Dim arrByte(szXML.Length) As Byte</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 233:</span>         nByteCount = Encoding.UTF8.GetBytes(szXML, 0, szXML.Length, arrByte, 0)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 234:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 235:</span>         Dim memStream As New IO.MemoryStream(arrByte)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 236:</span>         retDoc.Load(memStream)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 237:</span>         Return retDoc</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 238:</span>     End Function</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 239:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 240:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 241:</span>     <span style="color: #006080">''</span><span style="color: #006080">' &lt;summary&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 242:</span>     '</span><span style="color: #006080">''</span> Create a <span style="color: #0000ff">new</span> mapguide session and <span style="color: #0000ff">return</span> the resulting session ID</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 243:</span>     <span style="color: #006080">''</span><span style="color: #006080">' &lt;/summary&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 244:</span>     '</span><span style="color: #006080">''</span> &lt;param name=<span style="color: #006080">&quot;szMGUser&quot;</span>&gt;Valid mapguide user name&lt;/param&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 245:</span>     <span style="color: #006080">''</span><span style="color: #006080">' &lt;param name=&quot;szMGPass&quot;&gt;Valid password for the specified mapguide user name&lt;/param&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 246:</span>     '</span><span style="color: #006080">''</span> &lt;param name=<span style="color: #006080">&quot;szMGWebTier&quot;</span>&gt;The path to the Mapguide web tier (valid on the mapguide web server&lt;/param&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 247:</span>     <span style="color: #006080">''</span><span style="color: #006080">' &lt;returns&gt;MgSiteConnection - the newly created mapguide site connection&lt;/returns&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 248:</span>     '</span><span style="color: #006080">''</span> &lt;remarks&gt;&lt;/remarks&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 249:</span>     Public Shared Function CreateMGSession(ByVal szMGUser As String, ByVal szMGPass As String, ByVal szMGWebTier As String) As MgSiteConnection</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 250:</span>         MapGuideApi.MgInitializeWebTier(szMGWebTier)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 251:</span>         Dim siteConnection As New MgSiteConnection()</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 252:</span>         siteConnection.Open(New MgUserInformation(szMGUser, szMGPass))</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 253:</span>         Return siteConnection</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 254:</span>     End Function</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 255:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 256:</span>     <span style="color: #006080">''</span><span style="color: #006080">' &lt;summary&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 257:</span>     '</span><span style="color: #006080">''</span> Converts MgReader to XMLDocument</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 258:</span>     <span style="color: #006080">''</span><span style="color: #006080">' &lt;/summary&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 259:</span>     '</span><span style="color: #006080">''</span> &lt;param name=<span style="color: #006080">&quot;byteReader&quot;</span>&gt;Loaded MgByteReader&lt;/param&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 260:</span>     <span style="color: #006080">''</span><span style="color: #006080">' &lt;returns&gt;Loaded XMLDocument&lt;/returns&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 261:</span>     '</span><span style="color: #006080">''</span> &lt;remarks&gt;&lt;/remarks&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 262:</span>     Public Shared Function ConvertMgReaderXml(ByVal byteReader As MgByteReader) As XmlDocument</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 263:</span>         Dim szXML As String</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 264:</span>         Try</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 265:</span>             szXML = byteReader.ToString</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 266:</span>         Catch ex As Exception</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 267:</span>             Throw ex</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 268:</span>         End Try</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 269:</span>         Dim nByteCount As Integer</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 270:</span>         Dim arrByte(szXML.Length) As Byte</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 271:</span>         Try</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 272:</span>             nByteCount = Encoding.UTF8.GetBytes(szXML, 0, szXML.Length, arrByte, 0)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 273:</span>         Catch ex As Exception</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 274:</span>             Throw ex</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 275:</span>         End Try</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 276:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 277:</span>         Dim memStream As New IO.MemoryStream(arrByte)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 278:</span>         Dim retDoc As New XmlDocument</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 279:</span>         retDoc.PreserveWhitespace = True</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 280:</span>         Try</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 281:</span>             retDoc.Load(memStream)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 282:</span>         Catch ex As Exception</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 283:</span>             memStream.Close()</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 284:</span>             memStream.Dispose()</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 285:</span>             Throw ex</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 286:</span>         End Try</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 287:</span>         memStream.Close()</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 288:</span>         memStream.Dispose()</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 289:</span>         Return retDoc</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 290:</span>     End Function</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 291:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 292:</span>     <span style="color: #006080">''</span><span style="color: #006080">' &lt;summary&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 293:</span>     '</span><span style="color: #006080">''</span> Gets a ResourceList <span style="color: #0000ff">for</span> each item <span style="color: #0000ff">in</span> the specified repository folder.</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 294:</span>     <span style="color: #006080">''</span><span style="color: #006080">' &lt;/summary&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 295:</span>     '</span><span style="color: #006080">''</span> &lt;param name=<span style="color: #006080">&quot;resSvc&quot;</span>&gt;The opened resource server connection&lt;/param&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 296:</span>     <span style="color: #006080">''</span><span style="color: #006080">' &lt;param name=&quot;resId&quot;&gt;The MgResourceId of the folder we want to enumerate&lt;/param&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 297:</span>     '</span><span style="color: #006080">''</span> &lt;param name=<span style="color: #006080">&quot;nDepth&quot;</span>&gt;The folder depth to enumerate.  From the Mapguide Web API Reference:</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 298:</span>     <span style="color: #006080">''</span><span style="color: #006080">' (int) Recursion depth, relative to the specified resource.</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 299:</span>     '</span><span style="color: #006080">''</span>* If the resource <span style="color: #0000ff">is</span> a document, depth must be set to 0.</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 300:</span>     <span style="color: #006080">''</span><span style="color: #006080">'* If the resource is a folder:</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 301:</span>     '</span><span style="color: #006080">''</span>      o If the depth <span style="color: #0000ff">is</span> equal to 0, only information about the specified folder <span style="color: #0000ff">is</span> returned.</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 302:</span>     <span style="color: #006080">''</span><span style="color: #006080">'      o If the depth is greater than 0, information about the folder and its descendants up to the specified depth are returned.</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 303:</span>     '</span><span style="color: #006080">''</span>* If the depth <span style="color: #0000ff">is</span> -1, information about the folder and all its descendants <span style="color: #0000ff">is</span> returned.</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 304:</span>     <span style="color: #006080">''</span><span style="color: #006080">' &lt;/param&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 305:</span>     '</span><span style="color: #006080">''</span> &lt;param name=<span style="color: #006080">&quot;szType&quot;</span>&gt;Again from the Mapguide Web API Reference:</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 306:</span>     <span style="color: #006080">''</span><span style="color: #006080">'     (String/string) Type of the resource to be enumerated. (Case sensitive.) See MgResourceType  for valid types. If the type is a folder, </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 307:</span>     '</span><span style="color: #006080">''</span>     you must include the trailing slash.</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 308:</span>     <span style="color: #006080">''</span><span style="color: #006080">'     Or, this can be set to null, in which case information about all resource types is returned</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 309:</span>     '</span><span style="color: #006080">''</span> &lt;/param&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 310:</span>     <span style="color: #006080">''</span><span style="color: #006080">' &lt;returns&gt;OSGeo.Mapguide.Objects.ResourceList of resource entities&lt;/returns&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 311:</span>     '</span><span style="color: #006080">''</span> &lt;remarks&gt;&lt;/remarks&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 312:</span>     Public Shared Function GetAllResources(ByRef resSvc As MgResourceService, ByVal resId As MgResourceIdentifier, ByVal nDepth As Integer, ByVal szType As String) As OSGeo.MapGuide.Objects.ResourceList</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 313:</span>         Dim retDoc As XmlDocument</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 314:</span>         retDoc = ConvertMgReaderXml(resSvc.EnumerateResources(resId, nDepth, szType))</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 315:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 316:</span>         Dim resourceList As New OSGeo.MapGuide.Objects.ResourceList</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 317:</span>         resourceList = OSGeo.MapGuide.Objects.ResourceList.Parse(retDoc.OuterXml)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 318:</span>         Return resourceList</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060"> 319:</span>     End Function</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060"> 320:</span> End Class</pre>
</p></div>
</div>
<p>If you have any questions or comments &#8211; feel free to let me know.</p>
<div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:8bbf493c-f424-47b7-bed5-b62ee2ab5c29" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags: <a href="http://technorati.com/tags/ASP.NET" rel="tag">ASP.NET</a>,<a href="http://technorati.com/tags/Mapguide" rel="tag">Mapguide</a>,<a href="http://technorati.com/tags/Dynamic+Authoring" rel="tag">Dynamic Authoring</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.geospecialling.com/index.php/2008/05/dynamic-authoring-in-mapguide-enterprise-before-the-viewer-has-loaded/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating .NET objects for Mapguide XML schema Definitions (XSD) using LINQ</title>
		<link>http://www.geospecialling.com/index.php/2008/05/creating-net-objects-for-mapguide-xml-schema-definitions-xsd-using-linq/</link>
		<comments>http://www.geospecialling.com/index.php/2008/05/creating-net-objects-for-mapguide-xml-schema-definitions-xsd-using-linq/#comments</comments>
		<pubDate>Fri, 16 May 2008 10:18:00 +0000</pubDate>
		<dc:creator>Darrin Maidlow</dc:creator>
				<category><![CDATA[Mapguide]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Dynamic Authoring]]></category>

		<guid isPermaLink="false">http://www.geospecialling.com/index.php/2008/05/creating-net-objects-for-mapguide-xml-schema-definitions-xsd-using-linq/</guid>
		<description><![CDATA[With the release of Mapguide 2007 I was really excited about the new API and the significant power that it would give us developer types.&#160; Though I now appreciate the work involved with creating a full object API for all the supported development platforms, I was a little sad to see that only a handful [...]]]></description>
			<content:encoded><![CDATA[<p>With the release of Mapguide 2007 I was really excited about the new API and the significant power that it would give us developer types.&#160; Though I now appreciate the work involved with creating a full object API for all the supported development platforms, I was a little sad to see that only a handful of objects had been created for working with the various entity types available in Mapguide.</p>
<p>One of my first tasks with Mapguide was to add some layers to the map, before the viewer had loaded up, save that map in the session repository and then build a layout for the map &#8211; again in the session repository.&#160; I tried various ways of working with the XML provided by the resource&#160; service, and read through many of the e-mails on the topic from the Osgeo list, but I just couldn&#8217;t get it to work.&#160; So I set out on my mission to get an object based method of getting things done.&#160; First, as per the developer documentation I tried out xsd.exe.&#160; XSD allowed me to get a class skeleton created, but there was a lot of work needed to a rounded API running.&#160;&#160; I had been recently investigating the new functionality Microsoft was exposing with LINQ &#8211; and I came across LINQ to XSD.&#160; For more information on Linq to XSD the <a title="Microsoft XML Team Weblog" href="http://blogs.msdn.com/xmlteam/archive/2008/02/21/linq-to-xsd-alpha-0-2.aspx" target="_blank" rel="tag">Microsoft XML team blog</a> is a good place to start.&#160; </p>
<p>So download <a title="LINQ to XSD Alpha 0.2" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=a45f58cd-fcfc-439e-b735-8182775560af&amp;displaylang=en" target="_blank" rel="tag">LINQ to XSD Alpha 0.2</a> and install it.&#160; You will need to have <a title=".NET 3.5 Framework" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=a45f58cd-fcfc-439e-b735-8182775560af&amp;displaylang=en" target="_blank" rel="tag">.NET 3.5</a> installed first.&#160; In addition to that I&#8217;m using Visual Studio 2008 Pro.&#160; I have tried these steps with both Mapguide Enterprise 2008 and&#160; 2009.&#160; I have to assume the resulting code will work with Mapguide Open Source as well.</p>
<p><strong>Setting up your project</strong></p>
<p>At this point you should be able to fire up Visual Studio and create a new project.&#160; If you are a VB developer, I&#8217;m afraid you&#8217;re going to have to dive into a bit of C#, as its the only support language right now.&#160; It&#8217;s not that bad.</p>
<p>The new project window should look a little like this:</p>
<p align="center"><a href="http://www.geospecialling.com/wp-content/uploads/2010/02/image1.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="167" alt="image" src="http://www.geospecialling.com/wp-content/uploads/2010/02/image_thumb1.png" width="277" border="0" /></a> </p>
<p align="left">Choose LINQ to XSD Library and give the project a name.&#160; Once the new project is loaded, create a new folder called XSD.&#160; Browse to your Mapguide 2009/OS 2.0 server Schema folder (on a default installation its c:\Program Files\Autodesk\MapGuideEnterprise2009\Server\Schema).&#160; Take a these files and drag them into the new XSD folder.</p>
<p align="left">Back in Visual Studio, select all of the XSD files.&#160; Look in the property window and change the &quot;Build Action&quot; to be &quot;LinqToXsdSchema&quot;.</p>
<p align="left"><strong>Building the project</strong></p>
<p align="left">At this point, right click on the project in Visual Studio, and choose build.&#160; You should have 173 errors.&#160; This is caused by having multiple, similar versions of some of the XSDs.&#160; Let&#8217;s exclude the following files:</p>
<ul>
<li>
<div align="left">FdoProviderCapabilities-1.0.0.xsd</div>
</li>
<li>
<div align="left">LayerDefinition-1.0.0.xsd</div>
</li>
<li>
<div align="left">LayerDefinition-1.1.0.xsd</div>
</li>
<li>
<div align="left">LoadProcedure-1.0.0.xsd</div>
</li>
<li>
<div align="left">SymbolDefinition-1.0.0.xsd</div>
</li>
</ul>
<p align="left">Rebuild the project and we should be down to five errors.&#160; I have found that by excluding the following files I was able to get the code to generate:</p>
<ul>
<li>
<div align="left">ApplicationDefinition-1.0.0.xsd</div>
</li>
<li>ApplicationDefinitionInfo-1.0.0.xsd </li>
<li>SymbolLibrary-1.0.0.xsd </li>
</ul>
<p align="left">&#160;</p>
<p>For my purposes, I was not too concerned about being able to work with these entity types programmatically (at least at this time).&#160; If anyone is able to work around and would like to share it, please let me know.</p>
<p>Build the project again, and we will see three new errors.&#160; This time we will need to dig into the generated code to correct them.&#160; For each of the three errors we will want to change the public string name.&#160; For example:</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas,&#39;Courier New&#39;,courier,monospace; background-color: rgb(244,244,244)">
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas,&#39;Courier New&#39;,courier,monospace; border-right-style: none; border-left-style: none; background-color: rgb(244,244,244); border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas,&#39;Courier New&#39;,courier,monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: rgb(96,96,96)">   1:</span> <span style="color: rgb(0,0,255)">public</span> <span style="color: rgb(0,0,255)">string</span> DataType {</pre>
</p></div>
</div>
<p>&#160;</p>
<p>We would change to:</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas,&#39;Courier New&#39;,courier,monospace; background-color: rgb(244,244,244)">
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas,&#39;Courier New&#39;,courier,monospace; border-right-style: none; border-left-style: none; background-color: rgb(244,244,244); border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas,&#39;Courier New&#39;,courier,monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: rgb(96,96,96)">   1:</span> <span style="color: rgb(0,0,255)">public</span> <span style="color: rgb(0,0,255)">string</span> Datatype {</pre>
</p></div>
</div>
<p>&#160;</p>
<p>Change the case of the property name in each of the three errors and we are just about there.&#160; At this point you should have around 42904 lines of code in this file.&#160; Good thing I didn&#8217;t try to do this manually.&#160;&#160; Take a copy of all these wonderful lines o&#8217; code, and we&#8217;re going to paste them into a new class. For the sake of this example, I renamed class1.cs to be OSGeo.Mapguide.Objects.cs and pasted the code in there.&#160; I also wrapped all the code in a namespace to match the file name.</p>
<p>If you need to find the generated code, take a look in the obj folder within your project.&#160; You should find a file named LinqToXsdSource.cs in the appropriate build folder.</p>
<p>Next we need to prevent the XSDs from rebuilding each time.&#160; Select all of your XSD files again, and change the &quot;Build Action&quot; to &quot;None&quot;.&#160;&#160;&#160; Building the project at this point will generate fifty some odd errors.&#160; We can eliminate these by doing a search and replace on global:: and replacing it with an empty string.&#160; Build the project again, and you will find one error.&#160; Simply remove the &quot;global.&quot; from the line in question and the project will now build.</p>
<p>At this point, you should have a nice .dll file which you can reference from your projects and access many of the Mapguide entity types using objects.&#160; Be sure to grab a copy of Microsoft.XmlSchema.Linq.dll and distribute that with your new DLL.</p>
</p>
<div class="wlWriterEditableSmartContent" id="scid:fb3a1972-4489-4e52-abe7-25a00bb07fdf:c7128993-8018-4abc-98b5-f699b6434c0d" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<p>For your convenience, I&#8217;ve posted the <a href="http://www.geospecialling.com/wp-content/uploads/2010/02/OSGeo.Mapguide.Objects.zip" target="_blank">Project, source and binaries</a></p>
</div>
<p>This project maybe have some issues.&#160; I have worked with LayerDefinitions, MapDefinitions, and WebLayouts &#8211; but not tested many of the classes here yet.&#160; If you have any feedback or enhancements you want to share &#8211; please let me know!</p>
<p>In the next week I will post some examples on how to build maps and layouts &#8211; before the viewer has loaded.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geospecialling.com/index.php/2008/05/creating-net-objects-for-mapguide-xml-schema-definitions-xsd-using-linq/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cannot Select Entities in Mapguide Enterprise 2009 Viewer</title>
		<link>http://www.geospecialling.com/index.php/2008/05/cannot-select-entities-in-mapguide-enterprise-2009-viewer/</link>
		<comments>http://www.geospecialling.com/index.php/2008/05/cannot-select-entities-in-mapguide-enterprise-2009-viewer/#comments</comments>
		<pubDate>Thu, 08 May 2008 09:27:00 +0000</pubDate>
		<dc:creator>Darrin Maidlow</dc:creator>
				<category><![CDATA[Mapguide]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[FDO]]></category>

		<guid isPermaLink="false">http://www.geospecialling.com/index.php/2010/05/cannot-select-entities-in-mapguide-enterprise-2009-viewer/</guid>
		<description><![CDATA[I recently encountered a frustrating problem in my Mapguide travels.&#160; When the map in my application came up, I could not select any entities.&#160; Both window and single selections just did nothing.&#160; I had recently setup my map tier on my Vista x64 box so I was not sure if I had missed something in [...]]]></description>
			<content:encoded><![CDATA[<p>I recently encountered a frustrating problem in my <a title="Autodesk Mapguide" href="http://www.mapguide.com" target="_blank" rel="tag">Mapguide</a> travels.&#160; When the map in my application came up, I could not select any entities.&#160; Both window and single selections just did nothing.&#160; I had recently setup my <a title="Manually configure Mapguide 2009 Web Tier on Vista x64 IIS7" href="http://www.geospecialling.com/index.php/2008/05/manually-configure-mapguide-2009-web-tier-on-vista-x64-iis7/" target="_blank" rel="tag">map tier on my Vista x64 box</a> so I was not sure if I had missed something in the configuration there.&#160; In addition to this, my application is doing some dynamic authoring and adding a bunch of layers to the map before the viewer loads it up.</p>
<p>I saved a copy of the dynamically generated maps and layers to the library repository.&#160; Everything checked out.&#160; The layers were marked as selectable.</p>
<p>Next step was to check out the server logs on my Mapguide server.&#160;&#160;&#160; We have a nice error occurring a lot: Error: An exception occurred in FDO component. String does not represent a valid filter. </p>
<p>So into the code I go.&#160; I ripped out all my dynamic authoring calls, and the map loads and selects no problem.&#160; As I was starting to suspect, my code was to blame &#8211; and there is something specific to my filters on the layers:</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4">
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   1:</span> newLayer.VectorLayerDefinition.Filter = <span style="color: #006080">&quot;BLDG_ID = &quot;</span><span style="color: #006080">&quot;&quot;</span> &amp; szBldgID &amp; <span style="color: #006080">&quot;&quot;</span><span style="color: #006080">&quot; AND BLDG_FLOOR &quot;</span><span style="color: #006080">&quot; IN(0,&quot;</span> &amp; nFloorNumber.ToString &amp; <span style="color: #006080">&quot;)&quot;</span><span style="color: #006080">&quot;&quot;</span></pre>
</p></div>
</div>
<p>&#160;</p>
<p>I had assumed that FDO had an IN clause, did a quick check in Mapguide Studio&#8217;s condition builder and didn&#8217;t see one.&#160; Fair enough, in this case I can get by with two equals conditions in my select as the list of conditions will only ever consist of two values.</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4">
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   1:</span> newLayer.VectorLayerDefinition.Filter = <span style="color: #006080">&quot;BLDG_ID = &quot;</span> &amp; szBldgID &amp; <span style="color: #006080">&quot; AND (BLDG_FLOOR = 0 OR BLDG_FLOOR = &quot;</span> &amp; nFloorNumber.ToString &amp; <span style="color: #006080">&quot;)&quot;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   2:</span> 'newLayer.VectorLayerDefinition.Filter = <span style="color: #006080">&quot;BLDG_ID = &quot;</span> &amp; szBldgID &amp; <span style="color: #006080">&quot; AND BLDG_FLOOR  IN(0,&quot;</span> &amp; nFloorNumber.ToString &amp; <span style="color: #006080">&quot;)&quot;</span><span style="color: #006080">&quot;&quot;</span></pre>
</p></div>
</div>
<p>
  <br />Long story short, if you are selecting items in the map viewer that are supposed to be selectable, check your server logs.</p>
<div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:7bbff4f2-31de-4ffd-bbef-2315558181c6" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags: <a href="http://technorati.com/tags/Mapguide" rel="tag">Mapguide</a>,<a href="http://technorati.com/tags/ASP.NET" rel="tag">ASP.NET</a>,<a href="http://technorati.com/tags/FDO" rel="tag">FDO</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.geospecialling.com/index.php/2008/05/cannot-select-entities-in-mapguide-enterprise-2009-viewer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mapguide Enterprise and Not Null Constraints</title>
		<link>http://www.geospecialling.com/index.php/2008/04/mapguide-enterprise-and-not-null-constraints/</link>
		<comments>http://www.geospecialling.com/index.php/2008/04/mapguide-enterprise-and-not-null-constraints/#comments</comments>
		<pubDate>Sat, 26 Apr 2008 21:34:00 +0000</pubDate>
		<dc:creator>Darrin Maidlow</dc:creator>
				<category><![CDATA[Mapguide]]></category>
		<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://www.geospecialling.com/index.php/2008/04/mapguide-enterprise-and-not-null-constraints/</guid>
		<description><![CDATA[There is a problem with not null constraints and Mapguide Enterprise.&#160; This problem exists in both 2008, and the 2009 versions.&#160; If any columns within your table or view are defined as not allowing null Mapguide will pick these up as key fields.
I found this problem when trying to programmatically retrieve a feature set of&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>There is a problem with not null constraints and Mapguide Enterprise.&#160; This problem exists in both 2008, and the 2009 versions.&#160; If any columns within your table or view are defined as not allowing null Mapguide will pick these up as key fields.</p>
<p>I found this problem when trying to programmatically retrieve a feature set of&#160; the current selection.&#160; When the SetFilter method on the MgFeatureQueryOptions call was issued I was receiving a&#160; &quot;Not Implemented&quot; error.&#160; After a bit of back and forth with Steve Dang at Autodesk he gave me a list of valid&#160; database property types for the SetFilter call:</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4">
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   1:</span> <span style="color: #008000">//The problem is from the web tier.  Note that the  MgSelectionBase::GenerateFilter method</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   2:</span> <span style="color: #008000">//will throw an  MgNotImplementedException if the property type of the filtered data</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   3:</span> <span style="color: #008000">//is not one of the following types: </span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   4:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   5:</span> MgPropertyType::Int16</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   6:</span> MgPropertyType::Int32</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   7:</span> MgPropertyType::Int64</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   8:</span> MgPropertyType::String</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   9:</span> MgPropertyType::Single</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  10:</span> MgPropertyType::Double</pre>
</p></div>
</div>
<p>&#160;</p>
<p>This got me looking at my underlying fields, and eventually I noticed in the ODBC data connection the key fields for the table in question contained a&#160; number of columns that just should not have been there.&#160; The problem field was a date column &#8211; which would explain why the SetFilter call was throwing and error.&#160; Upon closer inspection I realized that these columns were constrained with &quot;Not Null&quot; constraints.&#160; </p>
<p>So I changed my source database and removed the not null constraints.&#160; Went back to studio to refresh the table &#8211; but the columns were still there.&#160; Long story short &#8211; there is possibly another defect somewhere in Mapguide around data connections.&#160; They seem to not fully update when you make changes to them.&#160; However, creating a new data connection and pointing to the same SQL server database now shows keys without the null columns.</p>
<p>Moving forward in my code now generated the selection filter and things were good.</p>
<p>I proposed to Autodesk that they auto populate the key fields but then allow the user to modify this list, in addition to correcting the not null constraint issue.&#160;&#160; It seems as though all primary and foreign keys are being found for the table/view and added to the list.&#160; Fair enough, however in the view I was working with I had something like 10+ keys (due to the joins of data tables, as well as the needed lookup tables).&#160;&#160; In reality &#8211; I only was interested in one of those fields.&#160; Filtering based on that one field was enough to uniquely identify the data in question.&#160; I&#8217;m not really familiar with the way FDO does things so this might not be possible.</p>
<div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:5c8c2644-2a65-47f3-bba3-e8a16ca1b0d8" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags: <a href="http://technorati.com/tags/Mapguide" rel="tag">Mapguide</a>,<a href="http://technorati.com/tags/.NET" rel="tag">.NET</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.geospecialling.com/index.php/2008/04/mapguide-enterprise-and-not-null-constraints/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
