[OpenLayers-Users] HTTP protocol with featureserver

Eric Lemoine eric.c2c at gmail.com
Wed Dec 10 16:01:53 EST 2008


On Wed, Dec 10, 2008 at 9:02 PM, Alexandre Dube <adube at mapgears.com> wrote:
> Eric Lemoine wrote:
>>
>> On Wed, Dec 10, 2008 at 8:42 PM, Andreas Hocevar <ahocevar at opengeo.org>
>> wrote:
>>
>> It seems to be that response.insertIds, and thus Strategy.Save, is
>> Protocol.WFS-specific, isn't it?
>>
>> If I'm correct Alexandre should not rely on the save strategy at this
>> point, and use protocol.commit directly instead.
>>
>> --
>> Eric
>>
>
> Yes, but Strategy.Save looks like it could be implemented as a standard for
> each protocols.  response.insertIds could be populated regarding of the
> protocol type, I think...
>
> Anyway, I'll try what you said and come back if I've more trouble.

It is to be noted that the save strategy register an "on commit"
callback which expects to be given a response object. The HTTP
protocol does not pass a response object to the "on commit" callback,
response objects are passed to "on create", "on update" and "on
delete" callbacks one can register using something like:

commit(features, {
    "update": {
        callback: onUpdate
    },
    "create": {
        callback: onCreate
    },
    "delete": {
        callback: onDelete
    }
});

Protocol.HTTP and Protocol.WFS are two different beasts at this time,
making Strategies' lives hard.
--
Eric



More information about the Users mailing list