[mapguide-commits] r7120 - in trunk/Tools/Maestro/SDK/SamplesWeb: . SamplesWeb SamplesWeb/Tasks

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Oct 16 04:27:11 PDT 2012


Author: jng
Date: 2012-10-16 04:27:09 -0700 (Tue, 16 Oct 2012)
New Revision: 7120

Modified:
   trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb.sln
   trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/Global.asax.cs
   trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/SamplesWeb.csproj
   trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/Tasks/AddTracksLayer.aspx.cs
   trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/Web.config
Log:
#2138: Update SDK web samples to VS2010. Also fix the "Add Tracks Layer" example

Modified: trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/Global.asax.cs
===================================================================
--- trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/Global.asax.cs	2012-10-16 11:09:52 UTC (rev 7119)
+++ trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/Global.asax.cs	2012-10-16 11:27:09 UTC (rev 7120)
@@ -26,20 +26,11 @@
 using System.Web.SessionState;
 using OSGeo.MapGuide.ObjectModels;
 
-using Ldf110 = OSGeo.MapGuide.ObjectModels.LayerDefinition_1_1_0;
-using Ldf120 = OSGeo.MapGuide.ObjectModels.LayerDefinition_1_2_0;
-using Ldf130 = OSGeo.MapGuide.ObjectModels.LayerDefinition_1_3_0;
-
-using Lp110 = OSGeo.MapGuide.ObjectModels.LoadProcedure_1_1_0;
-using Lp220 = OSGeo.MapGuide.ObjectModels.LoadProcedure_2_2_0;
-using WL110 = OSGeo.MapGuide.ObjectModels.WebLayout_1_1_0;
-
-using Sym110 = OSGeo.MapGuide.ObjectModels.SymbolDefinition_1_1_0;
-
 using OSGeo.MapGuide.ObjectModels.LoadProcedure;
 using OSGeo.MapGuide.MaestroAPI.Resource.Validation;
 using OSGeo.MapGuide.MaestroAPI;
 using OSGeo.MapGuide.MaestroAPI.Resource;
+using OSGeo.MapGuide.ExtendedObjectModels;
 
 namespace SamplesWeb
 {
@@ -54,65 +45,10 @@
             //
             //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
-
-            //Layer Definition 1.1.0
-            ResourceValidatorSet.RegisterValidator(new Ldf110.LayerDefinitionValidator());
-            ResourceTypeRegistry.RegisterResource(
-                new ResourceTypeDescriptor(ResourceTypes.LayerDefinition, "1.1.0"),
-                new ResourceSerializationCallback(Ldf110.LdfEntryPoint.Serialize),
-                new ResourceDeserializationCallback(Ldf110.LdfEntryPoint.Deserialize));
-            ObjectFactory.RegisterLayerFactoryMethod(new Version(1, 1, 0), new LayerCreatorFunc(Ldf110.LdfEntryPoint.CreateDefault));
-
-            //Layer Definition 1.2.0
-            ResourceValidatorSet.RegisterValidator(new Ldf120.LayerDefinitionValidator());
-            ResourceTypeRegistry.RegisterResource(
-                new ResourceTypeDescriptor(ResourceTypes.LayerDefinition, "1.2.0"),
-                new ResourceSerializationCallback(Ldf120.LdfEntryPoint.Serialize),
-                new ResourceDeserializationCallback(Ldf120.LdfEntryPoint.Deserialize));
-            ObjectFactory.RegisterLayerFactoryMethod(new Version(1, 2, 0), new LayerCreatorFunc(Ldf120.LdfEntryPoint.CreateDefault));
-
-            //Layer Definition 1.3.0
-            ResourceValidatorSet.RegisterValidator(new Ldf130.LayerDefinitionValidator());
-            ResourceTypeRegistry.RegisterResource(
-                new ResourceTypeDescriptor(ResourceTypes.LayerDefinition, "1.3.0"),
-                new ResourceSerializationCallback(Ldf130.LdfEntryPoint.Serialize),
-                new ResourceDeserializationCallback(Ldf130.LdfEntryPoint.Deserialize));
-            ObjectFactory.RegisterLayerFactoryMethod(new Version(1, 3, 0), new LayerCreatorFunc(Ldf130.LdfEntryPoint.CreateDefault));
-
-            //Load Procedure 1.1.0
-            ResourceValidatorSet.RegisterValidator(new Lp110.LoadProcedureValidator());
-            ResourceTypeRegistry.RegisterResource(
-                new ResourceTypeDescriptor(ResourceTypes.LoadProcedure, "1.1.0"),
-                new ResourceSerializationCallback(Lp110.LoadProcEntryPoint.Serialize),
-                new ResourceDeserializationCallback(Lp110.LoadProcEntryPoint.Deserialize));
-
-            //Load Procedure 1.1.0 schema offers nothing new for the ones we want to support, so nothing to register
-            //with the ObjectFactory
-
-            //Load Procedure 2.2.0
-            ResourceValidatorSet.RegisterValidator(new Lp220.LoadProcedureValidator());
-            ResourceTypeRegistry.RegisterResource(
-                new ResourceTypeDescriptor(ResourceTypes.LoadProcedure, "2.2.0"),
-                new ResourceSerializationCallback(Lp220.LoadProcEntryPoint.Serialize),
-                new ResourceDeserializationCallback(Lp220.LoadProcEntryPoint.Deserialize));
-            ObjectFactory.RegisterLoadProcedureFactoryMethod(LoadType.Sqlite, new LoadProcCreatorFunc(Lp220.LoadProcEntryPoint.CreateDefaultSqlite));
-
-            //Web Layout 1.1.0
-            ResourceValidatorSet.RegisterValidator(new WL110.WebLayoutValidator());
-            ResourceTypeRegistry.RegisterResource(
-                new ResourceTypeDescriptor(ResourceTypes.WebLayout, "1.1.0"),
-                new ResourceSerializationCallback(WL110.WebLayoutEntryPoint.Serialize),
-                new ResourceDeserializationCallback(WL110.WebLayoutEntryPoint.Deserialize));
-            ObjectFactory.RegisterWebLayoutFactoryMethod(new Version(1, 1, 0), new WebLayoutCreatorFunc(WL110.WebLayoutEntryPoint.CreateDefault));
-
-            //Symbol Definition 1.1.0
-            ResourceTypeRegistry.RegisterResource(
-                new ResourceTypeDescriptor(ResourceTypes.SymbolDefinition, "1.1.0"),
-                new ResourceSerializationCallback(Sym110.SymbolDefEntryPoint.Serialize),
-                new ResourceDeserializationCallback(Sym110.SymbolDefEntryPoint.Deserialize));
-            ObjectFactory.RegisterCompoundSymbolFactoryMethod(new Version(1, 1, 0), new CompoundSymbolDefCreatorFunc(Sym110.SymbolDefEntryPoint.CreateDefaultCompound));
-            ObjectFactory.RegisterSimpleSymbolFactoryMethod(new Version(1, 1, 0), new SimpleSymbolDefCreatorFunc(Sym110.SymbolDefEntryPoint.CreateDefaultSimple));
+            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	2012-10-16 11:09:52 UTC (rev 7119)
+++ trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/SamplesWeb.csproj	2012-10-16 11:27:09 UTC (rev 7120)
@@ -1,4 +1,6 @@
-<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
   <PropertyGroup>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -10,7 +12,14 @@
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>SamplesWeb</RootNamespace>
     <AssemblyName>SamplesWeb</AssemblyName>
-    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileUpgradeFlags>
+    </FileUpgradeFlags>
+    <UpgradeBackupLocation>
+    </UpgradeBackupLocation>
+    <OldToolsVersion>3.5</OldToolsVersion>
+    <TargetFrameworkProfile />
+    <UseIISExpress>false</UseIISExpress>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>
@@ -30,47 +39,28 @@
     <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.LayerDefinition-1.1.0, Version=3.0.0.5728, Culture=neutral, PublicKeyToken=f526c48929fda856, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\bin\OSGeo.MapGuide.ObjectModels.LayerDefinition-1.1.0.dll</HintPath>
-    </Reference>
-    <Reference Include="OSGeo.MapGuide.ObjectModels.LayerDefinition-1.2.0, Version=3.0.0.5728, Culture=neutral, PublicKeyToken=f526c48929fda856, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\bin\OSGeo.MapGuide.ObjectModels.LayerDefinition-1.2.0.dll</HintPath>
-    </Reference>
-    <Reference Include="OSGeo.MapGuide.ObjectModels.LayerDefinition-1.3.0, Version=3.0.0.5728, Culture=neutral, PublicKeyToken=f526c48929fda856, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\bin\OSGeo.MapGuide.ObjectModels.LayerDefinition-1.3.0.dll</HintPath>
-    </Reference>
-    <Reference Include="OSGeo.MapGuide.ObjectModels.LoadProcedure-1.1.0, Version=3.0.0.5728, Culture=neutral, PublicKeyToken=f526c48929fda856, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\bin\OSGeo.MapGuide.ObjectModels.LoadProcedure-1.1.0.dll</HintPath>
-    </Reference>
-    <Reference Include="OSGeo.MapGuide.ObjectModels.LoadProcedure-2.2.0, Version=3.0.0.5728, Culture=neutral, PublicKeyToken=f526c48929fda856, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\bin\OSGeo.MapGuide.ObjectModels.LoadProcedure-2.2.0.dll</HintPath>
-    </Reference>
-    <Reference Include="OSGeo.MapGuide.ObjectModels.SymbolDefinition-1.1.0, Version=3.0.0.5728, Culture=neutral, PublicKeyToken=f526c48929fda856, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\bin\OSGeo.MapGuide.ObjectModels.SymbolDefinition-1.1.0.dll</HintPath>
-    </Reference>
-    <Reference Include="OSGeo.MapGuide.ObjectModels.WebLayout-1.1.0, Version=3.0.0.5728, Culture=neutral, PublicKeyToken=f526c48929fda856, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\bin\OSGeo.MapGuide.ObjectModels.WebLayout-1.1.0.dll</HintPath>
-    </Reference>
     <Reference Include="System" />
     <Reference Include="System.Data" />
+    <Reference Include="System.Data.DataSetExtensions" />
     <Reference Include="System.Drawing" />
     <Reference Include="System.Web" />
+    <Reference Include="System.Web.ApplicationServices" />
+    <Reference Include="System.Web.DynamicData" />
+    <Reference Include="System.Web.Entity" />
+    <Reference Include="System.Web.Extensions" />
     <Reference Include="System.Xml" />
     <Reference Include="System.Configuration" />
     <Reference Include="System.Web.Services" />
     <Reference Include="System.EnterpriseServices" />
     <Reference Include="System.Web.Mobile" />
+    <Reference Include="System.Xml.Linq" />
   </ItemGroup>
   <ItemGroup>
     <Content Include="..\..\bin\ConnectionProviders.xml">
@@ -191,8 +181,13 @@
     <Folder Include="App_Data\" />
     <Folder Include="bin\" />
   </ItemGroup>
+  <PropertyGroup>
+    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
+    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
+  </PropertyGroup>
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" />
+  <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
+  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
        Other similar extension points exist, see Microsoft.Common.targets.
   <Target Name="BeforeBuild">

Modified: trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/Tasks/AddTracksLayer.aspx.cs
===================================================================
--- trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/Tasks/AddTracksLayer.aspx.cs	2012-10-16 11:09:52 UTC (rev 7119)
+++ trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/Tasks/AddTracksLayer.aspx.cs	2012-10-16 11:27:09 UTC (rev 7120)
@@ -84,6 +84,7 @@
                 RuntimeMapLayer layer = mpSvc.CreateMapLayer(rtMap, layerDef);
 
                 layer.Group = groupName;
+                layer.Name = "Tracks";
                 layer.LegendLabel = "Tracks";
                 layer.ShowInLegend = true;
                 layer.ExpandInLegend = true;

Modified: trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/Web.config
===================================================================
--- trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/Web.config	2012-10-16 11:09:52 UTC (rev 7119)
+++ trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb/Web.config	2012-10-16 11:27:09 UTC (rev 7120)
@@ -1,25 +1,24 @@
 <?xml version="1.0"?>
 <configuration>
-	<appSettings>
-		<add key="MapAgentUrl" value="http://localhost/mapguide/mapagent/mapagent.fcgi"/>
-	</appSettings>
-	<connectionStrings/>
-	<system.web>
-		<!-- 
+  <appSettings>
+    <add key="MapAgentUrl" value="http://localhost/mapguide/mapagent/mapagent.fcgi"/>
+  </appSettings>
+  <connectionStrings/>
+  <system.web>
+    <!-- 
             Set compilation debug="true" to insert debugging 
             symbols into the compiled page. Because this 
             affects performance, set this value to true only 
             during development.
         -->
-		<compilation debug="true">
-		</compilation>
-		<!--
+    <compilation debug="true" targetFramework="4.0"/>
+    <!--
             The <authentication> section enables configuration 
             of the security authentication mode used by 
             ASP.NET to identify an incoming user. 
         -->
-		<authentication mode="Windows"/>
-		<!--
+    <authentication mode="Windows"/>
+    <!--
             The <customErrors> section enables configuration 
             of what to do if/when an unhandled error occurs 
             during the execution of a request. Specifically, 
@@ -31,5 +30,6 @@
             <error statusCode="404" redirect="FileNotFound.htm" />
         </customErrors>
         -->
-	</system.web>
-</configuration>
+    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
+  </system.web>
+</configuration>
\ No newline at end of file

Modified: trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb.sln
===================================================================
--- trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb.sln	2012-10-16 11:09:52 UTC (rev 7119)
+++ trunk/Tools/Maestro/SDK/SamplesWeb/SamplesWeb.sln	2012-10-16 11:27:09 UTC (rev 7120)
@@ -1,6 +1,6 @@
 
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SamplesWeb", "SamplesWeb\SamplesWeb.csproj", "{28A017F3-28C9-4C0F-BD7F-160DC4D1EB44}"
 EndProject
 Global



More information about the mapguide-commits mailing list