After spending the last couple of weeks unsuccessfully trying to think of something interesting to blog about, today a colleague in the US responded to an email that I sent almost a year ago where I claimed to have prepared a script to remove un-needed files from a MapGuide Fusion production deployment. Great - an ideal blog post topic!
If you aren't already aware, a MapGuide Fusion installation includes both the individual source files (mostly Javascript files) and 'built' fusion files. The built versions combine all the individual files into a single file and this achieves a significant improvement in browser performance over the use of the individual files. Naturally, the fusion web page index.html defaults to using the 'built' version.
If you are interested in how to build the Fusion Javascript file yourself, see my other post on this topic.
To do the clean-up, create a batch file as follows.
set fusion_base=C:\Program Files\Autodesk\Autodesk MapGuide Enterprise 2011\MgeWebServerExtensions\www\fusion del %fusion_base%\lib\SingleFile.js del %fusion_base%\lib\fusion.js del %fusion_base%\lib\jxlib.uncompressed.js del %fusion_base%\lib\Error.js del %fusion_base%\lib\EventMgr.js del %fusion_base%\lib\ApplicationDefinition.js del %fusion_base%\lib\MGBroker.js del %fusion_base%\lib\Widget.js del %fusion_base%\lib\Search.js del %fusion_base%\lib\Map.js del %fusion_base%\layers\Layers.js del /Q %fusion_base%\text\*.json del /Q %fusion_base%\lib\OpenLayers\Lang\*.* rd %fusion_base%\lib\OpenLayers\Lang del %fusion_base%\configHeader.json del /Q %fusion_base%\widgets\*.js del %fusion_base%\layers\MapServer\MapServer.js del %fusion_base%\layers\MapGuide\MapGuide.js del %fusion_base%\layers\Generic\Generic.js del %fusion_base%\lib\jquery-1.4.2.min.js del %fusion_base%\lib\OpenLayers.js del %fusion_base%\lib\RectTool.js del /Q %fusion_base%\lib\excanvas\*.* rd %fusion_base%\lib\excanvas |
Edit the path for the 'fusion_base' setting in the above to suit your environment.
Your source files are backed up in some fashion, right? Excellent – go ahead and run the batch file.
The only thing now is to ensure your index.html file references the newly built fusionSF-compressed.fs file.
Please note that at present, this has only been tested with MapGuide 2011.
Comments