[TinyOWS-users] INSERT without geometry

Olivier Courtin olivier.courtin at gmail.com
Wed Dec 16 04:54:35 EST 2009


On Dec 16, 2009, at 10:33 AM, Haftish 21 wrote:

Hi,

> Dear Olivier, Thank you for ur quick reply.
>
> Here is the function that triggers onclick to save on a form...
>
> function plzSave() {
>     var QoQ = getSelected(); // the to-be modified feature
>    // console.log(QoQ); // CHECKED: QoQ & Attributes
>     if (isValid(QoQ, featAttr)){ // FEW CHECKS
>
>         if(QoQ.state != OpenLayers.State.INSERT) {
>             QoQ.state = OpenLayers.State.UPDATE;
>             //alert(QoQ.state)
>         };
>
>         switch(QoQ.layer.protocol.CLASS_NAME) {
>           case "OpenLayers.Protocol.HTTP":
>             QoQ.layer.protocol.commit([QoQ]);
>
>             break;
>           case "OpenLayers.Protocol.WFS.v1_0_0":
>             saveStrategy.save([QoQ]);
>             break;
>           default:
>             alert("unsuported protocol!!!");
>         }
>         editor.selectControl.unselect(QoQ);
>     }
> }


Ok but that's the OpenLayers JS code,
what's the HTTP request look like and especially the POST xml part,  
For example:

<?xml version="1.0" encoding="UTF-8"?><wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs 
" xmlns="http://www.occamlab.com/ctl" xmlns:xsd="http://www.w3.org/2001/XMLSchema 
" xmlns:sf="http://cite.opengeospatial.org/gmlsf" xmlns:ogc="http://www.opengis.net/ogc 
" xmlns:saxon="http://saxon.sf.net/" xmlns:p="http://teamengine.sourceforge.net/parsers 
" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:gml="http://www.opengis.net/gml 
" xmlns:ows="http://www.opengis.net/ows" xmlns:ctl="http://www.occamlab.com/ctl 
" xmlns:xi="http://www.w3.org/2001/XInclude"  
xmlns:te="java:com.occamlab.te.TECore" xmlns:parsers="http://www.occamlab.com/te/parsers 
" xmlns:myparsers="http://teamengine.sourceforge.net/parsers"  
service="WFS" version="1.1.0"><wfs:Insert  
handle="ins-1"><sf:PrimitiveGeoFeature gml:id="cite.gmlsf0- 
f16"><gml:name codeSpace="http://cite.opengeospatial.org/ 
gmlsf">cite.gmlsf0-f16</gml:name><sf:curveProperty><gml:LineString  
srsName="urn:x-ogc:def:crs:EPSG:6.11.2:4326"><gml:posList>48.76926  
27.590446 46.54372 24.856320 42.89878 20.067233 42.414574 15.148127</ 
gml:posList></gml:LineString></sf:curveProperty><sf:intProperty>76512</ 
sf:intProperty><sf:measurand>8000</ 
sf:measurand><sf:dateTimeProperty>2006-07-30T08:34:12+01:00</ 
sf:dateTimeProperty><sf:decimalProperty>75.12</sf:decimalProperty></ 
sf:PrimitiveGeoFeature><sf:PrimitiveGeoFeature gml:id="cite.gmlsf0- 
f17"><gml:name codeSpace="http://cite.opengeospatial.org/ 
gmlsf">cite.gmlsf0-f17</gml:name><sf:curveProperty><gml:LineString  
srsName="urn:x-ogc:def:crs:EPSG:6.11.2:4326"><gml:posList>46.76926  
25.590446 45.54372 22.856320 41.89878 18.067233 41.414574 13.148127  
39.414574 9.148127</gml:posList></gml:LineString></ 
sf:curveProperty><sf:intProperty>111222</ 
sf:intProperty><sf:measurand>450</ 
sf:measurand><sf:dateTimeProperty>2005-11-22T11:51:43+02:00</ 
sf:dateTimeProperty><sf:decimalProperty>15.12</sf:decimalProperty></ 
sf:PrimitiveGeoFeature><sf:EntitéGénérique gml:id="cite.gmlsf0- 
f18"><gml:description>Lorem ipsum dolor sit amet, consectetuer  
adipiscing elit.</gml:description><gml:name codeSpace="http://cite.opengeospatial.org/gmlsf 
">cite.gmlsf0-f18</gml:name><sf:attribut.Géométrie><gml:LineString  
srsName="urn:x-ogc:def:crs:EPSG:6.11.2:4326"><gml:posList>52.68416  
0.826830 50.19039 3.537679 53.00112 5.850914 54.53406 13.099472  
54.400627 18.411608</gml:posList></gml:LineString></ 
sf:attribut.Géométrie><sf:boolProperty>true</ 
sf:boolProperty><sf:str4Property>wxÿz</ 
sf:str4Property><sf:featureRef>cite.gmlsf0-f16</sf:featureRef></ 
sf:EntitéGénérique></wfs:Insert></wfs:Transaction>


If you play with OpenLayers, Firebug could help to find this.



P.S: I add the users list in CC

--
Olivier


More information about the TinyOWS-users mailing list