ALKMaps.Protocol

Abstract vector layer protocol class.  Not to be instantiated directly.  Use one of the protocol subclasses instead.

Summary
ALKMaps.ProtocolAbstract vector layer protocol class.
Properties
format{ALKMaps.Format} The format used by this protocol.
options{Object} Any options sent to the constructor.
autoDestroy{Boolean} The creator of the protocol can set autoDestroy to false to fully control when the protocol is destroyed.
defaultFilter{ALKMaps.Filter} Optional default filter to read requests
Constructor
ALKMaps.ProtocolAbstract class for vector protocols.
Functions
mergeWithDefaultFilterMerge filter passed to the read method with the default one
destroyClean up the protocol.
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.
abortAbort an ongoing request.
createCallbackReturns a function that applies the given public method with resp and options arguments.
ALKMaps.Protocol.ResponseProtocols return Response objects to their users.
Properties
code
requestType{String} The type of request this response corresponds to.
last
features{Array({ALKMaps.Feature.Vector})} or {ALKMaps.Feature.Vector} The features returned in the response by the server.
data{Object} The data returned in the response by the server.
reqFeatures{Array({ALKMaps.Feature.Vector})} or {ALKMaps.Feature.Vector} The features provided by the user and placed in the request by the protocol.
priv
error{Object} The error object in case a service exception was encountered.
Constructor
ALKMaps.Protocol.Response
Functions
success

Properties

format

{ALKMaps.Format} The format used by this protocol.

options

{Object} Any options sent to the constructor.

autoDestroy

{Boolean} The creator of the protocol can set autoDestroy to false to fully control when the protocol is destroyed.  Defaults to true.

defaultFilter

{ALKMaps.Filter} Optional default filter to read requests

Constructor

ALKMaps.Protocol

Abstract class for vector protocols.  Create instances of a subclass.

Parameters

options{Object} Optional object whose properties will be set on the instance.

Functions

mergeWithDefaultFilter

mergeWithDefaultFilter: function(filter)

Merge filter passed to the read method with the default one

Parameters

filter{ALKMaps.Filter}

destroy

destroy: function()

Clean up the protocol.

read

read: function(options)

Construct a request for reading new features.

Parameters

options{Object} Optional object for configuring the request.

Returns

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

create

create: function()

Construct a request for writing newly created features.

Parameters

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

Returns

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

update

update: function()

Construct a request updating modified features.

Parameters

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

Returns

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

delete

"delete": function()

Construct a request deleting a removed feature.

Parameters

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

Returns

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

commit

commit: function()

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

Parameters

features{Array({ALKMaps.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({ALKMaps.Protocol.Response})} An array of ALKMaps.Protocol.Response objects.

abort

abort: function(response)

Abort an ongoing request.

Parameters

response{ALKMaps.Protocol.Response}

createCallback

createCallback: function(method,
response,
options)

Returns a function that applies the given public method with resp and options arguments.

Parameters

method{Function} The method to be applied by the callback.
response{ALKMaps.Protocol.Response} The protocol response object.
options{Object} Options sent to the protocol method

ALKMaps.Protocol.Response

Protocols return Response objects to their users.

Summary
Properties
code
requestType{String} The type of request this response corresponds to.
last
features{Array({ALKMaps.Feature.Vector})} or {ALKMaps.Feature.Vector} The features returned in the response by the server.
data{Object} The data returned in the response by the server.
reqFeatures{Array({ALKMaps.Feature.Vector})} or {ALKMaps.Feature.Vector} The features provided by the user and placed in the request by the protocol.
priv
error{Object} The error object in case a service exception was encountered.
Constructor
ALKMaps.Protocol.Response
Functions
success

Properties

code

{Number}ALKMaps.Protocol.Response.SUCCESS or ALKMaps.Protocol.Response.FAILURE

requestType

{String} The type of request this response corresponds to.  Either “create”, “read”, “update” or “delete”.

last

{Boolean}true if this is the last response expected in a commit, false otherwise, defaults to true.

features

{Array({ALKMaps.Feature.Vector})} or {ALKMaps.Feature.Vector} The features returned in the response by the server.  Depending on the protocol’s read payload, either features or data will be populated.

data

{Object} The data returned in the response by the server.  Depending on the protocol’s read payload, either features or data will be populated.

reqFeatures

{Array({ALKMaps.Feature.Vector})} or {ALKMaps.Feature.Vector} The features provided by the user and placed in the request by the protocol.

priv

error

{Object} The error object in case a service exception was encountered.

Constructor

ALKMaps.Protocol.Response

Parameters

options{Object} Optional object whose properties will be set on the instance.

Functions

success

success: function()

Returns

{Boolean}true on success, false otherwise
Base class for format reading/writing a variety of formats.
This class represents an OGC Filter.
mergeWithDefaultFilter: function(filter)
Merge filter passed to the read method with the default one
destroy: function()
Clean up the protocol.
read: function(options)
Construct a request for reading new features.
create: function()
Construct a request for writing newly created features.
update: function()
Construct a request updating modified features.
"delete": function()
Construct a request deleting a removed feature.
commit: function()
Go over the features and for each take action based on the feature state.
abort: function(response)
Abort an ongoing request.
createCallback: function(method,
response,
options)
Returns a function that applies the given public method with resp and options arguments.
Vector features use the ALKMaps.Geometry classes as geometry description.
success: function()
Protocols return Response objects to their users.
Close