[mapguide-commits] r6092 - in trunk/Tools/Maestro:
LocalConfigure/Resources Maestro.AddIn.Local
Maestro.AddIn.Local/Commands Maestro.Base/Commands
Maestro.Base/Editor Maestro.Base/UI
Maestro.Editors/MapDefinition Maestro.Login MaestroAPITests
OSGeo.MapGuide.MaestroAPI OSGeo.MapGuide.MaestroAPI/Capability
OSGeo.MapGuide.MaestroAPI/CoordinateSystem
OSGeo.MapGuide.MaestroAPI.Http OSGeo.MapGuide.MaestroAPI.Local
OSGeo.MapGuide.MaestroAPI.Native
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Tue Aug 23 13:10:08 EDT 2011
Author: jng
Date: 2011-08-23 10:10:08 -0700 (Tue, 23 Aug 2011)
New Revision: 6092
Added:
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeSimpleTransform.cs
Modified:
trunk/Tools/Maestro/LocalConfigure/Resources/Platform.ini
trunk/Tools/Maestro/Maestro.AddIn.Local/
trunk/Tools/Maestro/Maestro.AddIn.Local/Commands/StartupCommand.cs
trunk/Tools/Maestro/Maestro.AddIn.Local/Maestro.AddIn.Local.csproj
trunk/Tools/Maestro/Maestro.AddIn.Local/MapGuideDesktopUnmanagedApi.dll
trunk/Tools/Maestro/Maestro.AddIn.Local/MgDesktop.dll
trunk/Tools/Maestro/Maestro.AddIn.Local/OSGeo.MapGuide.Desktop.dll
trunk/Tools/Maestro/Maestro.Base/Commands/NewItemCommand.cs
trunk/Tools/Maestro/Maestro.Base/Editor/EditorContentBase.cs
trunk/Tools/Maestro/Maestro.Base/UI/NewResourceDialog.cs
trunk/Tools/Maestro/Maestro.Editors/MapDefinition/MapSettingsSectionCtrl.cs
trunk/Tools/Maestro/Maestro.Login/LoginDialog.cs
trunk/Tools/Maestro/MaestroAPITests/CapabilityTests.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpCapabilities.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalCapabilities.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/OSGeo.MapGuide.MaestroAPI.Local.csproj
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeCapabilities.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeCoordinateSystemCatalog.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/OSGeo.MapGuide.MaestroAPI.Native.csproj
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Capability/ConnectionCapabilities.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ConnectionProviderRegistry.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CoordinateSystem/CoordinateSystemCatalog.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CoordinateSystem/ICoordinateSystemCatalog.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CoordinateSystem/ISimpleTransform.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/IConnectionCapabilities.cs
Log:
- #1789: Refactor Maestro coordinate system transformation. Implementations of IServerConnection are responsible for determining what kind of transform to create
- Weed out unsupported resource types from available templates in New Resource Dialog
- Update MgDesktop dlls based on revision 79edffeaec74 (http://code.google.com/p/mg-desktop/source/detail?r=79edffeaec748145c5c1bc2a92565f44bd7b6a8a).
Modified: trunk/Tools/Maestro/LocalConfigure/Resources/Platform.ini
===================================================================
(Binary files differ)
Property changes on: trunk/Tools/Maestro/Maestro.AddIn.Local
___________________________________________________________________
Modified: svn:ignore
- bin
obj
+ bin
obj
*.user
Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/Commands/StartupCommand.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.Local/Commands/StartupCommand.cs 2011-08-23 15:42:25 UTC (rev 6091)
+++ trunk/Tools/Maestro/Maestro.AddIn.Local/Commands/StartupCommand.cs 2011-08-23 17:10:08 UTC (rev 6092)
@@ -31,9 +31,16 @@
{
public override void Run()
{
- ConnectionProviderRegistry.RegisterProvider(
- LocalConnection.PROVIDER_NAME,
- LocalConnection.Create);
+ if (!Platform.IsRunningOnMono)
+ {
+ ConnectionProviderRegistry.RegisterProvider(
+ LocalConnection.ProviderInfo,
+ LocalConnection.Create);
+ }
+ else
+ {
+ LoggingService.Info("Skipping local connection provider registration because I am guessing we're running Mono on Linux/Mac"); //LOCALIZEME
+ }
}
}
}
Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/Maestro.AddIn.Local.csproj
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.Local/Maestro.AddIn.Local.csproj 2011-08-23 15:42:25 UTC (rev 6091)
+++ trunk/Tools/Maestro/Maestro.AddIn.Local/Maestro.AddIn.Local.csproj 2011-08-23 17:10:08 UTC (rev 6092)
@@ -236,48 +236,213 @@
</Content>
</ItemGroup>
<ItemGroup>
- <None Include="Dictionaries\category.asc">
+ <None Include="Dictionaries\ADINDAN.MRT">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
+ <None Include="Dictionaries\ARC1950-01.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\ARC1950.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\ARC1960.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\ASTRLA66.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\ASTRLA84.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\AZORES-G.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\AZORES.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\BELLEVUE.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\BERMUDA.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\BOGOTA.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\CAMPO.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\CANAVRL.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\CAPE.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\CARTHAGE-MOD.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\CARTHAGE.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
<None Include="Dictionaries\Category.CSD">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
- <None Include="Dictionaries\coordsys.asc">
+ <None Include="Dictionaries\CHATHAM.MRT">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
+ <None Include="Dictionaries\CHUA.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
<None Include="Dictionaries\Coordsys.CSD">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
- <None Include="Dictionaries\datums.asc">
+ <None Include="Dictionaries\CORREGO.MRT">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Dictionaries\Datums.CSD">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
- <None Include="Dictionaries\elipsoid.asc">
+ <None Include="Dictionaries\DJAKRTA.MRT">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Dictionaries\Elipsoid.CSD">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
- <None Include="Dictionaries\GeodeticPath.asc">
+ <None Include="Dictionaries\ERP50-CY.MRT">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
+ <None Include="Dictionaries\ERP50-EG.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\ERP50-GB.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\ERP50-IR.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\ERP50-UK.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\ERP50-W.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\GD1949.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
<None Include="Dictionaries\GeodeticPath.CSD">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Dictionaries\GeodeticTransform.CSD">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
- <None Include="Dictionaries\GeodeticTransformation.asc">
+ <None Include="Dictionaries\GUAM63.MRT">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
- <None Include="Dictionaries\mreg.asc">
+ <None Include="Dictionaries\HJORSEY.MRT">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
+ <None Include="Dictionaries\IRAN.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\Ireland1965.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\IRELND65.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\IRELND75-MOD.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\IRELND75.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\KALIANP.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\KANDWALA.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\KERTAU48.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\LIBERIA.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\LUZON.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\MERCHICH-01.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\MERCHICH.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\MINNA.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\NAD27-48.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\NAD27-AK.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\NAD27-CB.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\NAD27-CN.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\NAD27-MX.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\NAD27.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
<None Include="Dictionaries\NameMapper.csv">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
+ <None Include="Dictionaries\NHRWN-O.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\OLDHI.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\OLD_EGYP.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\OMAN.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\OSGB-MOD.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\OSGB.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\PRVI.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\PSAD56.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\QATAR.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\QATAR48.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\SA1969.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\TIMBALAI.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\TOKYO.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="Dictionaries\ZANDERIJ.MRT">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
<None Include="FDO\com\fdosys_sys.sql">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/MapGuideDesktopUnmanagedApi.dll
===================================================================
(Binary files differ)
Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/MgDesktop.dll
===================================================================
(Binary files differ)
Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/OSGeo.MapGuide.Desktop.dll
===================================================================
(Binary files differ)
Modified: trunk/Tools/Maestro/Maestro.Base/Commands/NewItemCommand.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Commands/NewItemCommand.cs 2011-08-23 15:42:25 UTC (rev 6091)
+++ trunk/Tools/Maestro/Maestro.Base/Commands/NewItemCommand.cs 2011-08-23 17:10:08 UTC (rev 6092)
@@ -48,7 +48,7 @@
}
if (dlg == null)
- dlg = new NewResourceDialog(conn.ResourceService, conn.SiteVersion, nits);
+ dlg = new NewResourceDialog(conn, nits);
if (dlg.ShowDialog(wb) == System.Windows.Forms.DialogResult.OK)
{
Modified: trunk/Tools/Maestro/Maestro.Base/Editor/EditorContentBase.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/EditorContentBase.cs 2011-08-23 15:42:25 UTC (rev 6091)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/EditorContentBase.cs 2011-08-23 17:10:08 UTC (rev 6092)
@@ -221,7 +221,7 @@
if (res != null)
{
var rt = res.ResourceType;
- return ResourcePreviewEngine.IsPreviewableType(rt) && res.CurrentConnection.Capabilities.SupportsResourcePreviewUrls;
+ return ResourcePreviewEngine.IsPreviewableType(rt) && res.CurrentConnection.Capabilities.SupportsResourcePreviews;
}
return false;
}
Modified: trunk/Tools/Maestro/Maestro.Base/UI/NewResourceDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/UI/NewResourceDialog.cs 2011-08-23 15:42:25 UTC (rev 6091)
+++ trunk/Tools/Maestro/Maestro.Base/UI/NewResourceDialog.cs 2011-08-23 17:10:08 UTC (rev 6092)
@@ -45,15 +45,13 @@
InitializeComponent();
}
- private Version _siteVersion;
- private IResourceService _resSvc;
+ private IServerConnection _conn;
private NewItemTemplateService _nits;
- public NewResourceDialog(IResourceService resSvc, Version siteVersion, NewItemTemplateService nits)
+ public NewResourceDialog(IServerConnection conn, NewItemTemplateService nits)
: this()
{
- _siteVersion = siteVersion;
- _resSvc = resSvc;
+ _conn = conn;
_nits = nits;
}
@@ -119,7 +117,7 @@
if (lstCategories.SelectedItems.Count > 0)
{
string cat = lstCategories.SelectedItem.ToString();
- LoadTemplates(_nits.GetItemTemplates(GetSelectedCategories(), _siteVersion));
+ LoadTemplates(_nits.GetItemTemplates(GetSelectedCategories(), _conn.SiteVersion));
txtDescription.Text = string.Empty;
btnOK.Enabled = false;
@@ -159,6 +157,11 @@
tplImgList.Images.Add(Properties.Resources.document);
foreach (var tpl in templSet.GetTemplatesForCategory(cat))
{
+ //This is to weed out resource types not supported by the current connection
+ //we're working with
+ if (!_conn.Capabilities.IsSupportedResourceType(tpl.ResourceType))
+ continue;
+
var li = new ListViewItem();
li.Name = tpl.Name;
li.Text = tpl.Name;
Modified: trunk/Tools/Maestro/Maestro.Editors/MapDefinition/MapSettingsSectionCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/MapDefinition/MapSettingsSectionCtrl.cs 2011-08-23 15:42:25 UTC (rev 6091)
+++ trunk/Tools/Maestro/Maestro.Editors/MapDefinition/MapSettingsSectionCtrl.cs 2011-08-23 17:10:08 UTC (rev 6092)
@@ -187,16 +187,10 @@
txtCoordinateSystem.Text = cs;
if (_map.Extents != null && !string.IsNullOrEmpty(oldCs) && !string.IsNullOrEmpty(cs) && !oldCs.Equals(cs))
{
- //NOTE: We really should be using CS-Map (MgCoordinateSystem) here as its
- //transformation capabilities are more comprehensive, but we'd break mono
- //compatibility by doing so. Unless of course, Linux swig'd assemblies are
- //identical to the windows one, allowing for a clean swap of the DllImport'ed
- //native library
-
//Transform current extents
try
{
- var trans = new DefaultSimpleTransform(oldCs, cs);
+ var trans = _service.GetEditedResource().CurrentConnection.CoordinateSystemCatalog.CreateTransform(oldCs, cs);
var oldExt = _map.Extents;
Modified: trunk/Tools/Maestro/Maestro.Login/LoginDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Login/LoginDialog.cs 2011-08-23 15:42:25 UTC (rev 6091)
+++ trunk/Tools/Maestro/Maestro.Login/LoginDialog.cs 2011-08-23 17:10:08 UTC (rev 6092)
@@ -123,14 +123,20 @@
rdHttp.Checked = true;
var isNativeApiAvailable = false;
+ var isLocalApiAvailable = false;
var providers = ConnectionProviderRegistry.GetProviders();
foreach (var prv in providers)
{
- if (prv.Name.Equals("MAESTRO.LOCALNATIVE"))
+ if (prv.Name.ToUpper().Equals("MAESTRO.LOCALNATIVE"))
{
isNativeApiAvailable = true;
break;
}
+ else if (prv.Name.ToUpper().Equals("MAESTRO.LOCAL"))
+ {
+ isLocalApiAvailable = true;
+ break;
+ }
}
//Mono = No LocalNativeConnection for you (for now...)
if (Platform.IsRunningOnMono || !isNativeApiAvailable)
@@ -138,7 +144,7 @@
rdTcpIp.Enabled = false;
}
- if (Platform.IsRunningOnMono)
+ if (Platform.IsRunningOnMono || !isLocalApiAvailable)
{
rdLocal.Enabled = false;
}
Modified: trunk/Tools/Maestro/MaestroAPITests/CapabilityTests.cs
===================================================================
--- trunk/Tools/Maestro/MaestroAPITests/CapabilityTests.cs 2011-08-23 15:42:25 UTC (rev 6091)
+++ trunk/Tools/Maestro/MaestroAPITests/CapabilityTests.cs 2011-08-23 17:10:08 UTC (rev 6092)
@@ -123,7 +123,7 @@
break;
}
}
- Assert.IsTrue(caps.SupportsResourcePreviewUrls);
+ Assert.IsTrue(caps.SupportsResourcePreviews);
int[] services = caps.SupportedServices;
foreach (ServiceType st in Enum.GetValues(typeof(ServiceType)))
{
@@ -260,7 +260,7 @@
break;
}
}
- Assert.IsTrue(caps.SupportsResourcePreviewUrls);
+ Assert.IsTrue(caps.SupportsResourcePreviews);
int[] services = caps.SupportedServices;
foreach (ServiceType st in Enum.GetValues(typeof(ServiceType)))
{
@@ -390,7 +390,7 @@
break;
}
}
- Assert.IsTrue(caps.SupportsResourcePreviewUrls);
+ Assert.IsTrue(caps.SupportsResourcePreviews);
int[] services = caps.SupportedServices;
foreach (ServiceType st in Enum.GetValues(typeof(ServiceType)))
{
@@ -513,7 +513,7 @@
break;
}
}
- Assert.IsTrue(caps.SupportsResourcePreviewUrls);
+ Assert.IsTrue(caps.SupportsResourcePreviews);
int[] services = caps.SupportedServices;
foreach (ServiceType st in Enum.GetValues(typeof(ServiceType)))
{
@@ -633,7 +633,7 @@
break;
}
}
- Assert.IsTrue(caps.SupportsResourcePreviewUrls);
+ Assert.IsTrue(caps.SupportsResourcePreviews);
int[] services = caps.SupportedServices;
foreach (ServiceType st in Enum.GetValues(typeof(ServiceType)))
{
@@ -753,7 +753,7 @@
break;
}
}
- Assert.IsTrue(caps.SupportsResourcePreviewUrls);
+ Assert.IsTrue(caps.SupportsResourcePreviews);
int[] services = caps.SupportedServices;
foreach (ServiceType st in Enum.GetValues(typeof(ServiceType)))
{
@@ -879,7 +879,7 @@
break;
}
}
- Assert.IsTrue(caps.SupportsResourcePreviewUrls);
+ Assert.IsTrue(caps.SupportsResourcePreviews);
int[] services = caps.SupportedServices;
foreach (ServiceType st in Enum.GetValues(typeof(ServiceType)))
{
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Capability/ConnectionCapabilities.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Capability/ConnectionCapabilities.cs 2011-08-23 15:42:25 UTC (rev 6091)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Capability/ConnectionCapabilities.cs 2011-08-23 17:10:08 UTC (rev 6092)
@@ -225,7 +225,7 @@
/// Indicates whether web-based previewing capabilities are possible with this connection
/// </summary>
/// <value></value>
- public abstract bool SupportsResourcePreviewUrls
+ public abstract bool SupportsResourcePreviews
{
get;
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ConnectionProviderRegistry.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ConnectionProviderRegistry.cs 2011-08-23 15:42:25 UTC (rev 6091)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ConnectionProviderRegistry.cs 2011-08-23 17:10:08 UTC (rev 6092)
@@ -50,7 +50,7 @@
/// </value>
public bool IsMultiPlatform { get; private set; }
- internal ConnectionProviderEntry(string name, string desc, bool multiPlatform)
+ public ConnectionProviderEntry(string name, string desc, bool multiPlatform)
{
this.Name = name;
this.Description = desc;
@@ -192,13 +192,14 @@
/// </summary>
/// <param name="provider"></param>
/// <param name="method"></param>
- public static void RegisterProvider(string provider, ConnectionFactoryMethod method)
+ public static void RegisterProvider(ConnectionProviderEntry entry, ConnectionFactoryMethod method)
{
- string name = provider.ToUpper();
+ string name = entry.Name.ToUpper();
if (_ctors.ContainsKey(name))
- throw new ArgumentException("Provider already registered: " + provider);
+ throw new ArgumentException("Provider already registered: " + entry.Name);
_ctors[name] = method;
+ _providers.Add(entry);
}
/// <summary>
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CoordinateSystem/CoordinateSystemCatalog.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CoordinateSystem/CoordinateSystemCatalog.cs 2011-08-23 15:42:25 UTC (rev 6091)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CoordinateSystem/CoordinateSystemCatalog.cs 2011-08-23 17:10:08 UTC (rev 6092)
@@ -138,5 +138,10 @@
/// </summary>
/// <value></value>
public abstract bool IsLoaded { get; }
+
+ public virtual ISimpleTransform CreateTransform(string sourceWkt, string targetWkt)
+ {
+ return new DefaultSimpleTransform(sourceWkt, targetWkt);
+ }
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CoordinateSystem/ICoordinateSystemCatalog.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CoordinateSystem/ICoordinateSystemCatalog.cs 2011-08-23 15:42:25 UTC (rev 6091)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CoordinateSystem/ICoordinateSystemCatalog.cs 2011-08-23 17:10:08 UTC (rev 6092)
@@ -99,5 +99,13 @@
/// Gets whether the coordinate system catalog has been loaded
/// </summary>
bool IsLoaded { get; }
+
+ /// <summary>
+ /// Creates a simple coordinate system transformation from the source and target WKT strings
+ /// </summary>
+ /// <param name="sourceWkt"></param>
+ /// <param name="targetWkt"></param>
+ /// <returns></returns>
+ ISimpleTransform CreateTransform(string sourceWkt, string targetWkt);
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CoordinateSystem/ISimpleTransform.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CoordinateSystem/ISimpleTransform.cs 2011-08-23 15:42:25 UTC (rev 6091)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CoordinateSystem/ISimpleTransform.cs 2011-08-23 17:10:08 UTC (rev 6092)
@@ -30,7 +30,7 @@
/// <summary>
/// A simple coordinate transformation interface
/// </summary>
- public interface ISimpleTransform
+ public interface ISimpleTransform : IDisposable
{
/// <summary>
/// Transforms the specified point
@@ -82,7 +82,7 @@
/// </summary>
/// <param name="sourceCsWkt">The source cs WKT.</param>
/// <param name="targetCsWkt">The target cs WKT.</param>
- public DefaultSimpleTransform(string sourceCsWkt, string targetCsWkt)
+ internal DefaultSimpleTransform(string sourceCsWkt, string targetCsWkt)
{
//Check for and replace the WGS84.PseudoMercator WKT
string srcWkt = sourceCsWkt == CSMAP_WGS84_PSEUDO_MERCATOR ? POPULAR_VISUALISATION_CRS : sourceCsWkt;
@@ -110,5 +110,10 @@
tx = pts[0];
ty = pts[1];
}
+
+ public void Dispose()
+ {
+
+ }
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/IConnectionCapabilities.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/IConnectionCapabilities.cs 2011-08-23 15:42:25 UTC (rev 6091)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/IConnectionCapabilities.cs 2011-08-23 17:10:08 UTC (rev 6092)
@@ -54,7 +54,7 @@
/// <summary>
/// Indicates whether web-based previewing capabilities are possible with this connection
/// </summary>
- bool SupportsResourcePreviewUrls { get; }
+ bool SupportsResourcePreviews { get; }
/// <summary>
/// Indicates if this current connection supports the specified resource type
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpCapabilities.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpCapabilities.cs 2011-08-23 15:42:25 UTC (rev 6091)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpCapabilities.cs 2011-08-23 17:10:08 UTC (rev 6092)
@@ -44,7 +44,7 @@
}
}
- public override bool SupportsResourcePreviewUrls
+ public override bool SupportsResourcePreviews
{
get { return true; }
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalCapabilities.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalCapabilities.cs 2011-08-23 15:42:25 UTC (rev 6091)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalCapabilities.cs 2011-08-23 17:10:08 UTC (rev 6092)
@@ -52,8 +52,14 @@
}
}
- public override bool SupportsResourcePreviewUrls
+ public override bool IsSupportedResourceType(string resourceType)
{
+ return resourceType != ResourceTypes.ApplicationDefinition.ToString() &&
+ resourceType != ResourceTypes.WebLayout.ToString();
+ }
+
+ public override bool SupportsResourcePreviews
+ {
get { return true; }
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs 2011-08-23 15:42:25 UTC (rev 6091)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs 2011-08-23 17:10:08 UTC (rev 6092)
@@ -31,6 +31,7 @@
using OSGeo.MapGuide.MaestroAPI.Schema;
using System.IO;
using OSGeo.MapGuide.MaestroAPI.CoordinateSystem;
+using System.Diagnostics;
namespace OSGeo.MapGuide.MaestroAPI.Local
{
@@ -47,12 +48,19 @@
return new LocalConnection(initParams);
}
+ static bool _init = false;
+
protected LocalConnection(NameValueCollection initParams) : base()
{
_sessionId = Guid.NewGuid().ToString();
_configFile = initParams[PARAM_CONFIG];
+ var sw = new Stopwatch();
+ sw.Start();
MgPlatform.Initialize(_configFile);
+ _init = true;
+ sw.Stop();
+ Trace.TraceInformation("MapGuide Platform initialized in {0}ms", sw.ElapsedMilliseconds);
}
public const string PROVIDER_NAME = "Maestro.Local";
@@ -62,6 +70,17 @@
get { return PROVIDER_NAME; }
}
+ public static ConnectionProviderEntry ProviderInfo
+ {
+ get
+ {
+ return new ConnectionProviderEntry(
+ PROVIDER_NAME,
+ "Connection using the MapGuide Desktop API", //LOCALIZEME
+ false);
+ }
+ }
+
public override System.Collections.Specialized.NameValueCollection CloneParameters
{
get
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/OSGeo.MapGuide.MaestroAPI.Local.csproj
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/OSGeo.MapGuide.MaestroAPI.Local.csproj 2011-08-23 15:42:25 UTC (rev 6091)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/OSGeo.MapGuide.MaestroAPI.Local.csproj 2011-08-23 17:10:08 UTC (rev 6092)
@@ -66,6 +66,9 @@
<Compile Include="..\OSGeo.MapGuide.MaestroAPI.Native\LocalNativeRecord.cs">
<Link>LocalNativeRecord.cs</Link>
</Compile>
+ <Compile Include="..\OSGeo.MapGuide.MaestroAPI.Native\LocalNativeSimpleTransform.cs">
+ <Link>LocalNativeSimpleTransform.cs</Link>
+ </Compile>
<Compile Include="..\OSGeo.MapGuide.MaestroAPI.Native\LocalNativeSqlReader.cs">
<Link>LocalNativeSqlReader.cs</Link>
</Compile>
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeCapabilities.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeCapabilities.cs 2011-08-23 15:42:25 UTC (rev 6091)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeCapabilities.cs 2011-08-23 17:10:08 UTC (rev 6092)
@@ -52,7 +52,7 @@
}
}
- public override bool SupportsResourcePreviewUrls
+ public override bool SupportsResourcePreviews
{
get { return true; }
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeCoordinateSystemCatalog.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeCoordinateSystemCatalog.cs 2011-08-23 15:42:25 UTC (rev 6091)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeCoordinateSystemCatalog.cs 2011-08-23 17:10:08 UTC (rev 6092)
@@ -117,5 +117,10 @@
{
return new LocalNativeCoordinateSystemDefinition();
}
+
+ public override ISimpleTransform CreateTransform(string sourceWkt, string targetWkt)
+ {
+ return new LocalNativeSimpleTransform(sourceWkt, targetWkt);
+ }
}
}
Added: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeSimpleTransform.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeSimpleTransform.cs (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeSimpleTransform.cs 2011-08-23 17:10:08 UTC (rev 6092)
@@ -0,0 +1,61 @@
+#region Disclaimer / License
+// Copyright (C) 2011, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+//
+#endregion
+using System;
+using System.Collections.Generic;
+using System.Text;
+using OSGeo.MapGuide;
+using OSGeo.MapGuide.MaestroAPI.CoordinateSystem;
+
+namespace OSGeo.MapGuide.MaestroAPI.Native
+{
+ public class LocalNativeSimpleTransform : ISimpleTransform
+ {
+ private MgCoordinateSystemTransform _trans;
+
+ internal LocalNativeSimpleTransform(string sourceWkt, string targetWkt)
+ {
+ var fact = new MgCoordinateSystemFactory();
+ var source = fact.Create(sourceWkt);
+ var target = fact.Create(targetWkt);
+
+ _trans = fact.GetTransform(source, target);
+ }
+
+ public void Transform(double x, double y, out double tx, out double ty)
+ {
+ tx = Double.NaN;
+ ty = Double.NaN;
+
+ var coord = _trans.Transform(x, y);
+
+ tx = coord.X;
+ ty = coord.Y;
+ }
+
+ public void Dispose()
+ {
+ if (_trans != null)
+ {
+ _trans.Dispose();
+ _trans = null;
+ }
+ }
+ }
+}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/OSGeo.MapGuide.MaestroAPI.Native.csproj
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/OSGeo.MapGuide.MaestroAPI.Native.csproj 2011-08-23 15:42:25 UTC (rev 6091)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/OSGeo.MapGuide.MaestroAPI.Native.csproj 2011-08-23 17:10:08 UTC (rev 6092)
@@ -58,6 +58,7 @@
<Compile Include="LocalNativeDataReader.cs" />
<Compile Include="LocalNativeFeature.cs" />
<Compile Include="LocalNativeRecord.cs" />
+ <Compile Include="LocalNativeSimpleTransform.cs" />
<Compile Include="LocalNativeSqlReader.cs" />
<Compile Include="MgReadOnlyStream.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
More information about the mapguide-commits
mailing list