Migrate to MapFish Server 1.0
MapFish Server 1.0 comes with a great deal of changes. Application code based on MapFish Server 0.2 must be changed.
Generated Python code [867]
The code generated by paster mf-layer is different. And the old generated code isn't compatible with the new MapFish code. For example the Search class does no longer exist in the new MapFish code.
If you didn't modify the code generated by paster mf-layer then your best luck is to remove the generated files corresponding to your layers and regenerate it with paster mf-layer. For example, if your layer is named points you would do:
- rm yourproject/controller/points.py yourproject/model/points.py yourproject/tests/functional/test_points.py
- paster mf-layer points
If you did modify the generated code, write a fake layer in layers.ini and generate its code with paster mf-layer. Look at the generated code and adapt the code of your layers based on that code. If you have application-specific filters you'll need to migrate this code to the new filtering framework. See this code for an example.
In either case you'll also need to modify your layers' routing configuration in yourproject/config/routing.py. Remove your layers' routing configuration and replace it with something like this:
map.resource('layer_1_singular_name', 'layer_1_plural_name')
map.resource('layer_2_singular_name', 'layer_2_plural_name')
...
E.g. map.resource('country', 'countries')
If this doesn't suffice and you still have problem, contact the developers on users@….
GeoJSON Java library [206]
The GeoJSON Java library now has decoding support.
To add this, the library no longer uses net.sf.json.util, it now uses org.json. This changes the signature of the toJSON method of the MfFeature abstract class. Subclasses implementing toJSON must therefore be modified.
Old signature:
import net.sf.json.util.JSONBuilder; public abstract void toJSON(JSONBuilder builder);
New signature:
import org.json.JSONWriter; import org.json.JSONException; public abstract void toJSON(JSONWriter builder) throws JSONException;
Also, the MfGeoJSON class has been renamed MfGeoJSONWriter.
FeatureList changed namespace [1058] [1059] [1060]
mapfish.widgets.edition.FeatureList is replaced by mapfish.widgets.editing.FeatureList.
Searcher refactoring [1054] [1195] [1196] [1197]
The searcher has received many changes. Here they are:
- mapfish.Searcher.XY, mapfish.Searcher.Box and mapfish.Searcher.Extent have been merged into one single class, namely mapfish.Searcher.Map, see the corresponding API doc section
- mapfish.SearchMediator no longer exists, it is replaced by two protocol decorators, namely mapfish.Protocol.TriggerEventDecorator and mapfish.Protocol.MergeFilterDecorator, and a convenience function to decorate a protocol, namely mapfish.Protocol.decorateProtocol; the the corresponding API doc:
