Thursday, 8 July 2010

MapGuide Maestro 2.1

After 2 preview releases, I am proud to announce the general availability of MapGuide Maestro 2.1

New features include:
  • Ability to preview feature sources locally (note that this is only enabled for releases newer than MapGuide Open Source 2.2 Beta 1)
  • Support for connecting via the official MapGuide API (a.k.a. Web-less editing)
  • Basic support for SDF and SHP Load Procedures
  • Site Explorer context menu enhancements (provided by Crispin from 1spatial)
  • XML editor find and replace (provided by Crispin from 1spatial)
  • Support for applying overrides to multiple coordinate systems (provided by Crispin from 1spatial)
  • Many bug fixes for LocalNativeConnection
  • Support for adding layers to a map by dragging and dropping them from the Site Explorer.
  • Open layer in Layer Editor when double clicked from the Map Editor.
  • Support for selecting DSNs in the ODBC feature source editor.
  • Updated french translation provided by Pierre Cardinal
  • New Croatian translation provided by Ivan Miličević
A comprehensive list of changes since the 2.0 release can be found here

2.1 represents the last release in the 2.x line that will have new features. Future releases in the 2.x line will be strictly bug fixes only.

New features and/or enhancement requests will all be moved for the 3.0 release

Download (msi)


Download (zip)

Tuesday, 6 July 2010

Connecting to MS Access databases with the 64-bit FDO ODBC provider

One of the (many) joys of going 64-bit is the astronomically huge amount of memory (2^64 bytes) you can throw at any application.

However, one of the pains thus far (on Windows at least) is the lack of connectivity to MS Access databases due to a lack of a fully native 64-bit ODBC driver.

Well it seems Microsoft have finally listened to its 64-bit userbase and finally released 64-bit drivers for Microsoft Access Databases last month.

Now how can we use these drivers in the just released 64-bit FDO Toolbox? If you thought the Connect to ODBC command choosing MsAccess as the data source type (like I first did), then you thought wrong.

It turns out the Office 2010 ODBC drivers have slightly tweaked the required connection string.

Here's what a current MS Access ODBC connection string would look like:

Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\parcels.mdb

If you used that same connection string in a 64-bit FDO Toolbox, that will not work (you'll get an error message similar to: RDBMS: No open database). You have to tweak that string so it looks like this:

Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=C:\parcels.mdb

That will load the correct 64-bit driver.

Now I had just made this discovery after releasing the first ever 64-bit FDO Toolbox, so in the meantime to connect to MS Access databases using the 64-bit FDO Provider, choose Connect to ODBC command using the Generic data source type.

This will present a simple UI which will allow you to enter the raw ODBC connection string.

And remember that FDO Toolbox is just another FDO client application, so this method should work for any other application that uses 64-bit FDO, like: AutoCAD Map 2011 and MapGuide Enterprise 2011

Monday, 5 July 2010

FDO Toolbox v0.9.4

Here's a small point release with one big significant change: now available in 64-bit

Also included is:
  • Better default settings that play nice with Windows UAC in Vista, Windows 7 and Windows Server 2008
  • User Coordinate System management is now done exclusively through the SQLite FDO provider (instead of a separate SQLite assembly), and some fixes made for the management UI.

Download

Bugs / Feature requests

Wednesday, 30 June 2010

The toolbox goes 64-bit

So far, so good.





















The build system still needs some work though, the documentation builders are choking in 64-bit (then again, NDoc should probably be replaced anyway) and the NSIS installer is still yet untested.

Thursday, 3 June 2010

Maestro package loading problems in IIS7 and above

Ever get this when loading a package?


The error message in question is quite deceptive. The true problem is that in IIS7 and above, a file upload limit has been imposed by IIS, causing this mysterious "404" error.

The solution is to simply raise this limit in IIS manager to a level that is more sensible. On the command prompt, issue the following command:

%windir%\system32\inetsrv\appcmd set config "Default Web Site/YOUR_APP_NAME" -section:requestFiltering -requestLimits.maxAllowedContentLength:MAX_UPLOAD_SIZE_IN_BYTES

A default IIS7 configuration limits the file upload to a number shy under 30mb.

Where YOUR_APP_NAME is mapguide for a default MapGuide Open Source installation and mapguide2010 for a default installation of MapGuide Enterprise 2010

Given the more locked down nature of windows with IIS7 or newer, you would need to execute this command with administrator privileges

Thursday, 6 May 2010

Xsd2Code

If you have used xsd.exe before to generate C# code from XSD schema files you may have bore witness to some of the most horrendous looking serialization code that's ever been generated:
  • A repeating element becomes an array property with full get and set. (How are you supposed to add elements?)
  • Child object properties of generated classes must explicitly be created and assigned when creating a new instance of said class. (A recipe for NullReferenceException hell)
Just to name a few.

I was scouring the web hoping that there would be a better way to do this. I was on the verge of giving up until I encountered this link from stackoverflow:


In the short time I've played with this tool, I am already impressed at the quality of code that it generates. Just to illustrate how good this is:

Here's the Parameter property for the MaestroAPI FeatureSource class as it currently stands (generated by xsd.exe):

[System.Xml.Serialization.XmlElementAttribute("Parameter")]
public NameValuePairTypeCollection Parameter {
get {
return this.m_parameter;
}
set {
this.m_parameter = value;
}
}

If we created a new instance of FeatureSource and tried to access this property a NullReferenceException is thrown because you have to manually new the NameValuePairTypeCollection and assign it to this property yourself!

Here's the same snippet as generated by Xsd2Code

[System.Xml.Serialization.XmlElementAttribute("Parameter")]
public List<NameValuePairType> Parameter
{
get
{
if ((this.parameterField == null))
{
this.parameterField = new List<NameValuePairType>();
}
return this.parameterField;
}
set
{
if ((this.parameterField != null))
{
if ((parameterField.Equals(value) != true))
{
this.parameterField = value;
this.OnPropertyChanged("Parameter");
}
}
else
{
this.parameterField = value;
this.OnPropertyChanged("Parameter");
}
}
}
Creating a new instance of this FeatureSource, we can safely access this property because it has lazy generation logic built in! Xsd2Code does other things as well, such as providing built-in serialization/deserialization logic, object cloning, and much more!

I'm a bit disappointed that the property still has a setter (collection properties should almost never be assignable!), but already this code is much cleaner and easier to work with than the one generated by xsd.exe

Just seeing some of the code that's generated with some of the mapguide xsds, I knew that I have found my saviour. So long xsd.exe!

I will definitely be using this tool for the next (post-2.1) version of the Maestro API and any other projects that involve working with xsd files.

Tuesday, 4 May 2010

WebTier-less editing with Maestro

Just landed in trunk, is experimental support for using Maestro using the offical MapGuide API (known as LocalNativeConnection in Maestro). What this means is that when Maestro starts up you are now greeted with a slightly different login dialog.


Notice the two radio buttons Connect via HTTP and Connect via TCP/IP, when the Connect via TCP/IP button is clicked, you get a different user interface


If you ever used the offical MapGuide API, you should know how this works. Give your login details, supply the path to the webconfig.ini and away we go.


Where is the value in having offical MapGuide API support? It means it is now possible to edit resources in a MapGuide server without the need for a web server and web extensions installed on your machine!

For people (like me) who test bleeding edge versions of MapGuide built from source this is a very useful feature to have. This doesn't work perfectly yet. It bombed out on me when opening feature sources (some xml serialization bug), but it's a promising start.