2
* Copyright (C) 2007 Camptocamp
4
* This file is part of MapFish Client
6
* MapFish Client is free software: you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation, either version 3 of the License, or
9
* (at your option) any later version.
11
* MapFish Client is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with MapFish Client. If not, see <http://www.gnu.org/licenses/>.
21
* Namespace: mapfish.Protocol
22
* Contains convenience methods for protocol manipulation.
27
* APIFunction: decorateProtocol
28
* Decorate a protocol.
32
* var protocol = mapfish.Protocol.decorateProtocol({
34
* TriggerEventDecorator: {
36
* crudfinished: function() {
37
* alert("CRUD operation completed");
41
* MergeFilterDecorator: null
46
* config - {Object} Config object specifying how protocol must be
47
* decorated, see the above the example.
50
* {<OpenLayers.Protocol>} The resulting protocol.
52
decorateProtocol: function(config) {
53
var protocol = config.protocol;
54
for (var key in config) {
55
if (key != "protocol") {
56
if (!mapfish.Protocol[key]) {
57
OpenLayers.Console.error(
58
"mapfish.Protocol." + key + " does not exist");
60
protocol = new mapfish.Protocol[key](
61
OpenLayers.Util.extend(
62
{protocol: protocol}, config[key])