[Mapbender-dev] Mapbender Export

Karim Malhas karim at malhas.de
Fri May 7 07:35:52 EDT 2010

Dear Devs,

Since I started working with Mapbender I have been confused by the code
and the database. It is not readily apparent (or I am a little slow on
the uptake) what does what and how, and the interfaces are not defined

Not understanding what something I am interested in is about annoys me,
and I thought I could to better. So I started my endevavour to classify 
the things that we use in Mapbender and if possible put a consistant
interface on it - turns out the second part gave me a headache
and I thought that if my works leads me to the conclusion that I 
would want to change the datastructure I would just be doing
extra work for nothing - so I made it readonly. 

You get can get the code and take a look (see below). There is some
testing code, but after I decided I only wanted a serialization,
I stopped writing it. 

The interesting parts of each class are it's 'load' and 'toXML' methods.
The classes that are named in plural form, are just containers
which allow loading a set of objects, some with the possibility
to filter, e.g. all user in a group.

An example output can be found here:

The code is not complete, terrible in places, and for all I know might break
everything. Don't use it on an important data.

If someone has an idea where I can get a larger Mapbender database dump
to play with, please let me know. 


$ git clone http://karim.malhas.de/dev/mapbender_export.git
$ cd mapbender_export
$ git submodule init
$ git submodule update arcticjs

now adjust the database settings in test/data/mapender.conf
(or change the path in export.php)

$ make simple
(or just running export.php on the Commandline)
will create the XML file for you. 

There are some convenince functions, which depend on xsltproc and
xmlstarlt to be installed on your system:

$ make vim

will display the formatted file in vim 

$ make uzbl

will create output.html and attempt to open it in the uzbl browser (which
you probably don't have installed, but really, it's great)


P.S. What's the reason this list is called mapbender_dev, but is tagged 
[Mapbender-dev] (-  vs. _)  anyone else thinks this mismatch should be fixed?

More information about the Mapbender_dev mailing list