mapfish. Protocol. TriggerEventDecorator

Decorator class responsible to trigger events when requests are sent and received.

Inherits from

Summary
mapfish. Protocol. TriggerEventDecoratorDecorator class responsible to trigger events when requests are sent and received.
Properties
protocol{OpenLayers.Protocol} The decorated protocol.
Constants
EVENT_TYPES{Array(String)} Supported event types.
Constructor
mapfish. Protocol. TriggerEventDecorator
Functions
readConstruct a request for reading new features.
createConstruct a request for writing newly created features.
updateConstruct a request updating modified features.
deleteConstruct a request deleting a removed feature.
commitGo over the features and for each take action based on the feature state.
clearClear all the previous results.

Properties

protocol

{OpenLayers.Protocol} The decorated protocol.

Constants

EVENT_TYPES

{Array(String)} Supported event types.  Register a listener for a particular event with the following syntax:

protocol.events.register(type, obj, listener);

Listeners will be called with a reference to an event object.

Supported events

  • crudtriggered Triggered when either “create”, “read”, “update” or “delete” is called, listeners will receive an object with a type property referencing either the string “create”, “read”, “update”, or “delete” depending on what type of CRUD operation is actually triggered.
  • crudfinished Triggered when either “create”, “read”, “update” or “delete” is finished, listeners will receive an OpenLayers.Protocol.Response object.
  • committriggered Triggered when a commit operation is triggered.
  • commitfinished Triggered when a commit operation is finished.
  • clear Triggered when the clear API method is called.

Constructor

mapfish. Protocol. TriggerEventDecorator

Parameters

options{Object} Optional parameters to set in the protocol.

Returns

{mapfish.Protocol.TriggerEventDecorator}

Functions

read

read: function(options)

Construct a request for reading new features.

Parameters

options{Object} Optional object for configuring the request.

Returns

{OpenLayers.Protocol.Response} An OpenLayers.Protocol.Response object, the same object will be passed to the callback function passed if one exists in the options object.

create

create: function(features,
options)

Construct a request for writing newly created features.

Parameters

features{Array({OpenLayers.Feature.Vector})} or {OpenLayers.Feature.Vector}
options{Object} Optional object for configuring the request.

Returns

{OpenLayers.Protocol.Response} An OpenLayers.Protocol.Response object, the same object will be passed to the callback function passed if one exists in the options object.

update

update: function(features,
options)

Construct a request updating modified features.

Parameters

features{Array({OpenLayers.Feature.Vector})} or {OpenLayers.Feature.Vector}
options{Object} Optional object for configuring the request.

Returns

{OpenLayers.Protocol.Response} An OpenLayers.Protocol.Response object, the same object will be passed to the callback function passed if one exists in the options object.

delete

"delete": function(feature,
options)

Construct a request deleting a removed feature.

Parameters

feature{OpenLayers.Feature.Vector}
options{Object} Optional object for configuring the request.

Returns

{OpenLayers.Protocol.Response} An OpenLayers.Protocol.Response object, the same object will be passed to the callback function passed if one exists in the options object.

commit

commit: function(features,
options)

Go over the features and for each take action based on the feature state.  Possible actions are create, update and delete.

Parameters

features{Array({OpenLayers.Feature.Vector})}
options{Object} Object whose possible keys are “create”, “update”, “delete”, “callback” and “scope”, the values referenced by the first three are objects as passed to the “create”, “update”, and “delete” methods, the value referenced by the “callback” key is a function which is called when the commit operation is complete using the scope referenced by the “scope” key.

Returns

{Array({OpenLayers.Protocol.Response})} An array of OpenLayers.Protocol.Response objects.

clear

clear: function()

Clear all the previous results.

Abstract vector layer protocol class.
read: function(options)
Construct a request for reading new features.
create: function(features,
options)
Construct a request for writing newly created features.
update: function(features,
options)
Construct a request updating modified features.
"delete": function(feature,
options)
Construct a request deleting a removed feature.
commit: function(features,
options)
Go over the features and for each take action based on the feature state.
clear: function()
Clear all the previous results.
Protocols return Response objects to their users.
Vector features use the OpenLayers.Geometry classes as geometry description.
Close