In one of the AIMS applications I work on, we allow our customer to do most of the themeing in AIMS. They are more than happy to set up exactly how they want the data to look and how the users will view and interact with it. Because the customer does this themeing against a 'development' database and this themeing is later ported to the 'production' database that the application actually uses, sometimes the tables used for the development themeing may be named differently in the production database.
What these differences essentially mean is that you can't just export an AIMS .MGP package from the source environment and apply it to the ptroduction environment due to the differences in table names and schema names. If you open the Layer for editing within AIMS Studio and try to change the Data Resource or Feature Class, AIMS Studio will reset all your layer definitions…
There are two ways to get around this…
Editing the AIMS package
When you use the AIMS Site Administrator to create a package, the resulting file is <File Name>.mgp
This is in fact a ZIP file that contains all the Studio themeing in XML format. The steps I suggest for editing this file are:
- Take a backup copy first, in case you accidentally invalidate the package!
- Rename the file to a .zip (eg. before: My_Studio_Themeing.mgp After: My_Studio_Themeing.zip)
- Extract the zip file to a folder
- Drill down through the folder structures and locate the definition of the layer you wish to change. It should be something like this:
<Layer Name>.LayerDefinition_CONTENT.xml
<Layer Name>.LayerDefinition_HEADER.xml - Open the 'CONTENT' file with a text editor (such as Notepad++) and make the required changes
This is likely to be one or both of:
<ResourceId>XXX</ResourceId>
<FeatureName>YYY</FeatureName> - Save your changes and close the file
- Re-zip the entire folder
- Rename the .zip file back to a .mgp
You can then import the package using the AIMS Site Administrator to establish the new environment with the correct definitions.
TIP: When the package has been unzipped, you can do a 'Find' in Windows Explorer to locate all occurrences of layers with the definition you wish to alter. You can then select and open all of these files in Notepad++ and do a global search and replace, followed by a 'Save all...".
Editing Layer definitions with MapGuide Maestro
There is an Open Source alternative to AIMS Studio called MapGuide Maestro. You can find it here: http://trac.osgeo.org/mapguide/wiki/maestro
I don't profess to know much about Maestro, however I do use it to edit the XML definition of my Layers. You simply start up Maestro and point it at your AIMS server. Then go to your LayerDefinition and right-click to choose 'Edit resource with xml editor'…
You are then able to make the required changes, again likely to be one or both of:
<ResourceId>XXX</ResourceId>
<FeatureName>YYY</FeatureName>
Make sure you save your changes, then open in AIMS Studio again to make sure the definition is correct by previewing your Maps!
Hopefully these steps will make a potentially tedious task that much easier.