Tuesday, 9 July 2013

A little note about mg-desktop and packages.

Suppose you have done the bulk of your map authoring work for your mg-desktop based application on an actual MapGuide Server and then proceeded to bring this data across to your mg-desktop application via packages. When you load this package into your mg-desktop application's repository (via ApplyResourcePackage), this error gets thrown back at your face.

What does this mean? Isn't packages supported and implemented in mg-desktop?

You are indeed correct. Packages is supported. So what is going on? You might want to take a look at the package itself. Take a look at the MgResourcePackageManifest.xml file in the root of the package.

Does it have an XML fragment like this?

If so, here's the actual problem. Our package implementation in mg-desktop assumes that a package will mainly consist of a series of SETRESOURCE and SETRESOURCEDATA calls. If you package from the root level of the repository, it will insert fragments to do an UPDATEREPOSITORY call, whose API we have not implemented in mg-desktop. This is the MgNotImplementedException that is thrown back.

So what is the fix for this? Simply remove the XML fragment in question, save the modified package and reload it. It should now load properly.

No comments: