Changeset 7883
- Timestamp:
- 08/28/08 09:33:11 (3 months ago)
- Files:
-
- trunk/openlayers/lib/OpenLayers/Protocol.js (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Protocol.js
r7708 r7883 39 39 */ 40 40 initialize: function(options) { 41 options = options || {}; 41 42 OpenLayers.Util.extend(this, options); 42 43 this.options = options; … … 58 59 * Parameters: 59 60 * options - {Object} Optional object for configuring the request. 61 * 62 * Returns: 63 * {<OpenLayers.Protocol.Response>} An <OpenLayers.Protocol.Response> 64 * object, the same object will be passed to the callback function passed 65 * if one exists in the options object. 60 66 */ 61 67 read: function() { … … 71 77 * {<OpenLayers.Feature.Vector>} 72 78 * options - {Object} Optional object for configuring the request. 79 * 80 * Returns: 81 * {<OpenLayers.Protocol.Response>} An <OpenLayers.Protocol.Response> 82 * object, the same object will be passed to the callback function passed 83 * if one exists in the options object. 73 84 */ 74 85 create: function() { … … 83 94 * {<OpenLayers.Feature.Vector>} 84 95 * options - {Object} Optional object for configuring the request. 96 * 97 * Returns: 98 * {<OpenLayers.Protocol.Response>} An <OpenLayers.Protocol.Response> 99 * object, the same object will be passed to the callback function passed 100 * if one exists in the options object. 85 101 */ 86 102 update: function() { … … 94 110 * feature - {<OpenLayers.Feature.Vector>} 95 111 * options - {Object} Optional object for configuring the request. 112 * 113 * Returns: 114 * {<OpenLayers.Protocol.Response>} An <OpenLayers.Protocol.Response> 115 * object, the same object will be passed to the callback function passed 116 * if one exists in the options object. 96 117 */ 97 118 "delete": function() { … … 106 127 * Parameters: 107 128 * features - {Array({<OpenLayers.Feature.Vector>})} 108 * options - {Object} Map of options, the keys of the map are 109 * 'create', 'update', and 'delete' 129 * options - {Object} Object whose possible keys are "create", "update", 130 * "delete", "callback" and "scope", the values referenced by the 131 * first three are objects as passed to the "create", "update", and 132 * "delete" methods, the value referenced by the "callback" key is 133 * a function which is called when the commit operation is complete 134 * using the scope referenced by the "scope" key. 135 * 136 * Returns: 137 * {Array({<OpenLayers.Protocol.Response>})} An array of 138 * <OpenLayers.Protocol.Response> objects. 110 139 */ 111 140 commit: function() { … … 119 148 * Protocols return Response objects to their users. 120 149 */ 121 OpenLayers.Protocol.Response = newOpenLayers.Class({150 OpenLayers.Protocol.Response = OpenLayers.Class({ 122 151 /** 123 152 * Property: code 124 * { Integer} - OpenLayers.Protocol.Response.SUCCESS or125 * OpenLayers.Protocol.Response.FAILURE153 * {Number} - OpenLayers.Protocol.Response.SUCCESS or 154 * OpenLayers.Protocol.Response.FAILURE 126 155 */ 127 156 code: null, 157 158 /** 159 * Property: requestType 160 * {String} The type of request this response corresponds to. Either 161 * "create", "read", "update" or "delete". 162 */ 163 requestType: null, 164 165 /** 166 * Property: last 167 * {Boolean} - true if this is the last response expected in a commit, 168 * false otherwise, defaults to true. 169 */ 170 last: true, 128 171 129 172 /** … … 165 208 */ 166 209 success: function() { 167 return !!(this.code & OpenLayers.Protocol.Response.SUCCESS_MASK);210 return this.code > 0; 168 211 }, 169 212 … … 171 214 }); 172 215 173 OpenLayers.Protocol.Response.SUCCESS_MASK = 0x000000ff; 174 OpenLayers.Protocol.Response.SUCCESS = 0x00000001; 175 176 OpenLayers.Protocol.Response.FAILURE_MASK = 0x0000ff00; 177 OpenLayers.Protocol.Response.FAILURE = 0x00000100; 216 OpenLayers.Protocol.Response.SUCCESS = 1; 217 OpenLayers.Protocol.Response.FAILURE = 0;
