move Protocol.SQL into deprecated.js

This commit is contained in:
Frederic Junod
2011-11-21 19:10:26 +01:00
parent 8360ddefe3
commit 7f2c06c5b7
5 changed files with 83 additions and 91 deletions

View File

@@ -239,7 +239,6 @@
"OpenLayers/Filter/Function.js",
"OpenLayers/Protocol.js",
"OpenLayers/Protocol/HTTP.js",
"OpenLayers/Protocol/SQL.js",
"OpenLayers/Protocol/WFS.js",
"OpenLayers/Protocol/WFS/v1.js",
"OpenLayers/Protocol/WFS/v1_0_0.js",

View File

@@ -1,88 +0,0 @@
/* Copyright (c) 2006-2011 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the Clear BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the
* full text of the license. */
/**
* @requires OpenLayers/Protocol.js
*/
/**
* Class: OpenLayers.Protocol.SQL
* Abstract SQL protocol class. Not to be instantiated directly. Use
* one of the SQL protocol subclasses instead.
*
* Inherits from:
* - <OpenLayers.Protocol>
*/
OpenLayers.Protocol.SQL = OpenLayers.Class(OpenLayers.Protocol, {
/**
* APIProperty: databaseName
* {String}
*/
databaseName: 'ol',
/**
* APIProperty: tableName
* Name of the database table into which Features should be saved.
*/
tableName: "ol_vector_features",
/**
* Property: postReadFiltering
* {Boolean} Whether the filter (if there's one) must be applied after
* the features have been read from the database; for example the
* BBOX strategy passes the read method a BBOX spatial filter, if
* postReadFiltering is true every feature read from the database
* will go through the BBOX spatial filter, which can be costly;
* defaults to true.
*/
postReadFiltering: true,
/**
* Constructor: OpenLayers.Protocol.SQL
*/
initialize: function(options) {
OpenLayers.Protocol.prototype.initialize.apply(this, [options]);
},
/**
* APIMethod: destroy
* Clean up the protocol.
*/
destroy: function() {
OpenLayers.Protocol.prototype.destroy.apply(this);
},
/**
* APIMethod: supported
* This should be overridden by specific subclasses
*
* Returns:
* {Boolean} Whether or not the browser supports the SQL backend
*/
supported: function() {
return false;
},
/**
* Method: evaluateFilter
* If postReadFiltering is true evaluate the filter against the feature
* and return the result of the evaluation, otherwise return true.
*
* Parameters:
* {<OpenLayers.Feature.Vector>} The feature.
* {<OpenLayers.Filter>} The filter.
*
* Returns:
* {Boolean} true if postReadFiltering if false, the result of the
* filter evaluation otherwise.
*/
evaluateFilter: function(feature, filter) {
return filter && this.postReadFiltering ?
filter.evaluate(feature) : true;
},
CLASS_NAME: "OpenLayers.Protocol.SQL"
});

View File

@@ -16,6 +16,7 @@
* @requires OpenLayers/Layer/EventPane.js
* @requires OpenLayers/Layer/FixedZoomLevels.js
* @requires OpenLayers/Layer/SphericalMercator.js
* @requires OpenLayers/Protocol.js
* @requires OpenLayers/Protocol/SQL.js
* @requires OpenLayers/Format/JSON.js
* @requires OpenLayers/Format/WKT.js
@@ -3725,6 +3726,85 @@ OpenLayers.Layer.VirtualEarth = OpenLayers.Class(
}
})();
/**
* Class: OpenLayers.Protocol.SQL
* Abstract SQL protocol class. Not to be instantiated directly. Use
* one of the SQL protocol subclasses instead.
*
* Inherits from:
* - <OpenLayers.Protocol>
*/
OpenLayers.Protocol.SQL = OpenLayers.Class(OpenLayers.Protocol, {
/**
* APIProperty: databaseName
* {String}
*/
databaseName: 'ol',
/**
* APIProperty: tableName
* Name of the database table into which Features should be saved.
*/
tableName: "ol_vector_features",
/**
* Property: postReadFiltering
* {Boolean} Whether the filter (if there's one) must be applied after
* the features have been read from the database; for example the
* BBOX strategy passes the read method a BBOX spatial filter, if
* postReadFiltering is true every feature read from the database
* will go through the BBOX spatial filter, which can be costly;
* defaults to true.
*/
postReadFiltering: true,
/**
* Constructor: OpenLayers.Protocol.SQL
*/
initialize: function(options) {
OpenLayers.Protocol.prototype.initialize.apply(this, [options]);
},
/**
* APIMethod: destroy
* Clean up the protocol.
*/
destroy: function() {
OpenLayers.Protocol.prototype.destroy.apply(this);
},
/**
* APIMethod: supported
* This should be overridden by specific subclasses
*
* Returns:
* {Boolean} Whether or not the browser supports the SQL backend
*/
supported: function() {
return false;
},
/**
* Method: evaluateFilter
* If postReadFiltering is true evaluate the filter against the feature
* and return the result of the evaluation, otherwise return true.
*
* Parameters:
* {<OpenLayers.Feature.Vector>} The feature.
* {<OpenLayers.Filter>} The filter.
*
* Returns:
* {Boolean} true if postReadFiltering if false, the result of the
* filter evaluation otherwise.
*/
evaluateFilter: function(feature, filter) {
return filter && this.postReadFiltering ?
filter.evaluate(feature) : true;
},
CLASS_NAME: "OpenLayers.Protocol.SQL"
});
/**
* Class: OpenLayers.Protocol.SQL.Gears

View File

@@ -1,6 +1,7 @@
<html>
<head>
<script src="../OLLoader.js"></script>
<script src="../../OLLoader.js"></script>
<script src="../../../lib/deprecated.js"></script>
<script type="text/javascript">
function test_initialize(t) {

View File

@@ -185,7 +185,6 @@
<li>Protocol.html</li>
<li>Protocol/HTTP.html</li>
<li>Protocol/Script.html</li>
<li>Protocol/SQL.html</li>
<li>Protocol/WFS.html</li>
<li>Protocol/SOS.html</li>
<li>Renderer.html</li>
@@ -230,6 +229,7 @@
<li>deprecated/Layer/WFS.html</li>
<li>deprecated/Layer/WMS.html</li>
<li>deprecated/Layer/WMS/Post.html</li>
<li>deprecated/Protocol/SQL.html</li>
<li>deprecated/Protocol/SQL/Gears.html</li>
<li>deprecated/Layer/Yahoo.html</li>
<li>deprecated/Tile/WFS.html</li>