[mapguide-commits] r8473 - in trunk/Tools/Maestro/SDK/SamplesWeb: . SamplesWeb SamplesWeb/Tasks
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Sat Dec 27 09:29:38 PST 2014
Author: jng
Date: 2014-12-27 09:29:38 -0800 (Sat, 27 Dec 2014)
New Revision: 8473
Modified:
trunk/Tools/Maestro/SDK/SamplesWeb/
trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/Default.aspx.cs
trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/Global.asax.cs
trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/SamplesWeb.csproj
trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/Tasks/AddThemedDistrictsLayer.aspx.cs
trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/Tasks/AddTracksLayer.aspx.cs
Log:
Fix SDK code samples in light of #2513
Property changes on: trunk/Tools/Maestro/SDK/SamplesWeb
___________________________________________________________________
Modified: svn:ignore
- SamplesWeb.suo
+ SamplesWeb.suo
*.suo
Modified: trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/Default.aspx.cs
===================================================================
--- trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/Default.aspx.cs 2014-12-27 17:24:11 UTC (rev 8472)
+++ trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/Default.aspx.cs 2014-12-27 17:29:38 UTC (rev 8473)
@@ -60,7 +60,8 @@
//the latest supported one on the mapguide server we've connected to. For example
//connecting to MGOS 2.2 will create a version 1.1.0 WebLayout. All the known
//resource versions have been registered on startup (see Global.asax.cs)
- IWebLayout wl = ObjectFactory.CreateWebLayout(conn, mdfId);
+ Version ver = conn.Capabilities.GetMaxSupportedResourceVersion(ResourceTypes.WebLayout.ToString());
+ IWebLayout wl = ObjectFactory.CreateWebLayout(ver, mdfId);
//What is IWebLayout2? It is an extension of IWebLayout that supports the ping server property.
//This is the interface equivalent of WebLayout 1.1.0 schema. Most schema revisions in MapGuide
Modified: trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/Global.asax.cs
===================================================================
--- trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/Global.asax.cs 2014-12-27 17:24:11 UTC (rev 8472)
+++ trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/Global.asax.cs 2014-12-27 17:29:38 UTC (rev 8473)
@@ -30,7 +30,6 @@
using OSGeo.MapGuide.MaestroAPI.Resource.Validation;
using OSGeo.MapGuide.MaestroAPI;
using OSGeo.MapGuide.MaestroAPI.Resource;
-using OSGeo.MapGuide.ExtendedObjectModels;
namespace SamplesWeb
{
@@ -39,16 +38,7 @@
protected void Application_Start(object sender, EventArgs e)
{
- //By default the ObjectFactory, ResourceTypeRegistry and ResourceValidatorSet only
- //support v1.0.0 of all resource types. To support additional types we need to inject
- //this information as part of the consuming application's init/startup process
- //
- //This is our application's entry point, so we do this here.
- //
- //The ModelSetup utility class can auto-magically do this for us
- //
- //This is only necessary if you want to create resources newer than version 1.0.0
- ModelSetup.Initialize();
+
}
protected void Session_Start(object sender, EventArgs e)
Modified: trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/SamplesWeb.csproj
===================================================================
--- trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/SamplesWeb.csproj 2014-12-27 17:24:11 UTC (rev 8472)
+++ trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/SamplesWeb.csproj 2014-12-27 17:29:38 UTC (rev 8473)
@@ -20,6 +20,10 @@
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkProfile />
<UseIISExpress>false</UseIISExpress>
+ <IISExpressSSLPort />
+ <IISExpressAnonymousAuthentication />
+ <IISExpressWindowsAuthentication />
+ <IISExpressUseClassicPipelineMode />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -39,13 +43,13 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="OSGeo.MapGuide.ExtendedObjectModels">
- <HintPath>..\..\bin\OSGeo.MapGuide.ExtendedObjectModels.dll</HintPath>
- </Reference>
<Reference Include="OSGeo.MapGuide.MaestroAPI, Version=3.0.0.5728, Culture=neutral, PublicKeyToken=f526c48929fda856, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\bin\OSGeo.MapGuide.MaestroAPI.dll</HintPath>
</Reference>
+ <Reference Include="OSGeo.MapGuide.ObjectModels">
+ <HintPath>..\..\bin\OSGeo.MapGuide.ObjectModels.dll</HintPath>
+ </Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Data.DataSetExtensions" />
Modified: trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/Tasks/AddThemedDistrictsLayer.aspx.cs
===================================================================
--- trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/Tasks/AddThemedDistrictsLayer.aspx.cs 2014-12-27 17:24:11 UTC (rev 8472)
+++ trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/Tasks/AddThemedDistrictsLayer.aspx.cs 2014-12-27 17:29:38 UTC (rev 8473)
@@ -103,8 +103,10 @@
private void CreateDistrictsLayer(IServerConnection conn, string resId, string layerId)
{
- //We use the ObjectFactory class to create our layer
- ILayerDefinition ldf = ObjectFactory.CreateDefaultLayer(conn, LayerType.Vector);
+ //We use the Utility class to create our layer. You can also use ObjectFactory, but
+ //that requires explicitly specifying the resource version. Using Utility will pick
+ //the latest supported version
+ ILayerDefinition ldf = Utility.CreateDefaultLayer(conn, LayerType.Vector);
IVectorLayerDefinition vldf = (IVectorLayerDefinition)ldf.SubLayer;
//Set feature source
Modified: trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/Tasks/AddTracksLayer.aspx.cs
===================================================================
--- trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/Tasks/AddTracksLayer.aspx.cs 2014-12-27 17:24:11 UTC (rev 8472)
+++ trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/Tasks/AddTracksLayer.aspx.cs 2014-12-27 17:29:38 UTC (rev 8473)
@@ -115,8 +115,10 @@
private static void CreateTracksLayer(IServerConnection conn, string resId, string layerId)
{
- //We use the ObjectFactory class to create our layer
- ILayerDefinition ldf = ObjectFactory.CreateDefaultLayer(conn, LayerType.Vector);
+ //We use the Utility class to create our layer. You can also use ObjectFactory, but
+ //that requires explicitly specifying the resource version. Using Utility will pick
+ //the latest supported version
+ ILayerDefinition ldf = Utility.CreateDefaultLayer(conn, LayerType.Vector);
IVectorLayerDefinition vldf = (IVectorLayerDefinition)ldf.SubLayer;
//Set feature source
More information about the mapguide-commits
mailing list