Posts Tagged XML

Listing MapGuide Data File Locations

Over on the MapGuide Users mailing list, Zac said: "it would be nice to add a text file listing the unmanaged resources"

Happy to oblige! :)

OK, not quite, but I’ve created a simple command-line PHP script that talks to the MapGuide repository and outputs a CSV containing the ResourceID and File Path for all data sources that I’ve recognised as file-based. I’ll leave it as an exercise for the reader to filter this to only show unmanaged data sources.

Sample output:

C:\MgTest\listpaths>php cli_listfiles.php admin

“Library://Test/Data/MyImages.FeatureSource”,”C:\TestData\img_ecw”
“Library://Test/Data/MyImages2.FeatureSource”,”C:\TestData\img_ecw”
“Library://Test/Data/MyImages3.FeatureSource”,”C:\TestData\img_sid”
“Library://Test/Data/ABC123.FeatureSource”,”C:\TestData\img_ecw\”
“Library://Test/Data/MyImages4.FeatureSource”,”C:\TestData\img_sid\”
“Library://ImageTest/Data/ImageTest.FeatureSource”,”C:\ImageTest”
“Library://ImageTest/Data/Tiled.FeatureSource”,”C:\ImageTest\”
“Library://SdfTest/Data/bc_border.FeatureSource”,”%MG_DATA_FILE_PATH%”

I think this shows how easy it is to throw around the XML that MapGuide uses in its repositories.

-J

, , , ,

No Comments