Monday, 27 September 2010

Using FDO Schema Overrides Redux

When I announced beta 2 of FDO Toolbox 1.0, I briefly mentioned that the new Unified Data Store editor doubles as a visual FDO Schema Override editor.

In this post I'll illustrate how we can create FDO XML configuration documents without needing to modify a single line of XML in a text editor, using our Unified Data Store editor.

We will use the same sample SQL Server database from our previous post

Creating a connection to this via FDO Toolbox gives us the following logical schema view:

Notice once again, how the FeatId property is not identity. Now where the previous post used a text editor to tweak the logical schema, we will do the whole process visually using the unified data store editor.

We'll right click the connection and use the new Edit Data Store option

This brings up the Unified Data Store editor.

Now what we simply do, is modify the logical schema so that it matches what we want it to be. In this case, we want FeatId to be an Identity Property of VParcels. So we select the VParcels feature class, this will bring up the class definition editor. We check the FeatId property under the Identity Properties to make FeatId an Identity Property

Now comes the important bit: Do not apply the changes!

Instead we export this current state out to an XML configuration document via Export - XML Configuration Document

Now let's create another connection to the same database, but this time we'll use the XML configuration document we have just saved.

If we look at the VParcels feature class in this configured connection, you'll notice it takes on our overridden logical schema.

From here, the process is just like the previous post. In Maestro's feature source editor, you would edit the configuration document of that feature source, paste in the contents of this XML file and save it. Layers based off of the VParcels feature class will then be selectable.

As I mentioned in the beta 2 announcement this editor is not fully complete. For one thing, there is no user interface to edit the physical configuration of any Class Definitions and Property Definitions. Whatever mappings gets exported out to XML are the default mappings generated by the provider.

But for overriding the default logical schema (which I'd guess is the common scenario), the unified data store editor makes this process much simpler than the older method of editing XML files by hand.


Ivan Milicevic said...

WOW! This is AWSOME! Excellent time saver. Thank you!

Yash said...

I have one question...I can create XML file through follow this stapes now I can't gate it where actually XML file Paste. In layer XML or Future sources XML.
Simple question is where to paste XML file in Mapguide Maestro.

Jackie Ng said...

For Maestro 3.0 and newer:

Open the Feature Source in question.

At the bottom of the editor click "Edit Configuration Document" to bring up the XML editor for that configuration document.

Paste your XML content in there.

Yash said...

Hi Jacki..thankx for replay

"Edit Configuration Document button" is disabled in mapguide maestro 3.0 How to enable that button ?


Jackie Ng said...

If it's disabled, that particular FDO provider doesn't support this Schema Overrides feature

Yash said...

which FDO provider supported this Schema Overrides feature ???
we have use 3.3 FDO Provider and Maestro 3.0


Jackie Ng said...

For SQL Server, use the latest version. 3.3 is too old.

Yash said...

hi.. now i get error when i past xml file into edit configure documents. error is "Object reference not set to an instance of an object" that's why i can not save edit configure documents.