[Geoserver-users] mapping of primary key and gml:id ??

me again...

i make a wfs-t transaction

<wfs:Insert>
<wims:foo gml:id="wp_cbbl.200612141200000">
<wims:geometry>
<gml:Polygon srsName="urn:ogc:def:crs:EPSG:4326">
<gml:exterior>
<gml:LinearRing>
<gml:posList>0.672702 49.9706 3.90024 49.97063 3.90024 47.6684 0.672702 47.6684 0.672702 49.9706</gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
</wims:geometry>
</wims:foo>
</wfs:Insert>

and i receive wfs response :
...
    <wfs:InsertResults>
    <wfs:Feature>
      <ogc:FeatureId fid="foo.fid-d032fde_115a421c09d_-7fc7"/>
   </wfs:Feature>
   </wfs:InsertResults>

the question is about the primary key.
i need thaht this primary key is set by the producer in the request gml:id="wp_cbbl.200612141200000"
how can i configure my entity to do that ???

thanks again !!

--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr

Sébastien Geindre ha scritto:

me again...

i make a wfs-t transaction

<wfs:Insert>
<wims:foo gml:id="wp_cbbl.200612141200000">
<wims:geometry>
<gml:Polygon srsName="urn:ogc:def:crs:EPSG:4326">
<gml:exterior>
<gml:LinearRing>
<gml:posList>0.672702 49.9706 3.90024 49.97063 3.90024 47.6684 0.672702 47.6684 0.672702 49.9706</gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
</wims:geometry>
</wims:foo>
</wfs:Insert>

and i receive wfs response :
...
    <wfs:InsertResults>
    <wfs:Feature>
      <ogc:FeatureId fid="foo.fid-d032fde_115a421c09d_-7fc7"/>
   </wfs:Feature>
   </wfs:InsertResults>

the question is about the primary key.
i need thaht this primary key is set by the producer in the request gml:id="wp_cbbl.200612141200000"
how can i configure my entity to do that ???

Hmmm... usually people do use an automatically generated primary key,
but in this case you're trying to provide one. I'm not sure the wfs 1.0
specification supports this, wfs 1.1 talks about it but again I'm
not sure we're bound to support this use case by the spec.

Anyways, if the gml parser sets the fid in the feature, it would just
be a matter of modifying the BasicFidMapper class in Geotools to use
the fid provided in the feature. Justin, do you have the information
I miss at your fingertips?

Cheers
Andrea

Nope, I think you have it right andrea. There is nothing in the spec
that says that those ID's must be used to used as the id's to persist
the feature, as its storage dependent.

Would not using the ID specified by the user be tricky? I guess its
doable... although some additional checks for uniqueness and all that
would have to be performed.

Anyways, if the gml parser sets the fid in the feature, it would just
be a matter of modifying the BasicFidMapper class in Geotools to use
the fid provided in the feature. Justin, do you have the information
I miss at your fingertips?

Cheers
Andrea

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4007,471385aa90132090977483!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Justin Deoliveira a écrit :

Nope, I think you have it right andrea. There is nothing in the spec
that says that those ID's must be used to used as the id's to persist
the feature, as its storage dependent.

Would not using the ID specified by the user be tricky? I guess its
doable... although some additional checks for uniqueness and all that
would have to be performed.
  
OK guys, so i have to set my own field to store these id ?

What about related objects ? with xlink for instance.
Imagine 2 objects related together via xlink.

They could be stored in 2 database tables.
how manage the foreign key case ?

it was a kind of philosophic question, no answer is requested :wink: !

Anyways, if the gml parser sets the fid in the feature, it would just
be a matter of modifying the BasicFidMapper class in Geotools to use
the fid provided in the feature. Justin, do you have the information
I miss at your fingertips?

Cheers
Andrea

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4007,471385aa90132090977483!

--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr

Sébastien Geindre ha scritto:

Justin Deoliveira a écrit :

Nope, I think you have it right andrea. There is nothing in the spec
that says that those ID's must be used to used as the id's to persist
the feature, as its storage dependent.

Would not using the ID specified by the user be tricky? I guess its
doable... although some additional checks for uniqueness and all that
would have to be performed.
  
OK guys, so i have to set my own field to store these id ?

Nope, we would have to change our code.

What about related objects ? with xlink for instance.
Imagine 2 objects related together via xlink.

They could be stored in 2 database tables.
how manage the foreign key case ?

You can't. GeoServer does not handle neither xlink nor complex features.
Sorry :frowning:

Cheers
Andrea

Justin Deoliveira ha scritto:

Nope, I think you have it right andrea. There is nothing in the spec
that says that those ID's must be used to used as the id's to persist
the feature, as its storage dependent.

Would not using the ID specified by the user be tricky? I guess its
doable... although some additional checks for uniqueness and all that
would have to be performed.

It should be doable and relatively easy. If the xml parser generates
a feature with the id that the user specified, we just need to change
the basic fid mapper. The database will make sure the value is unique.
What do you think?

Cheers
Andrea

Yeah, seems logical. The parser already uses the id to create the
feature. What will be the behavior when a bad fid is encountered. Just
ignore it? Or throw exception? I think to be spec compliant we will just
have to ignore it and generate a warning.

It should be doable and relatively easy. If the xml parser generates
a feature with the id that the user specified, we just need to change
the basic fid mapper. The database will make sure the value is unique.
What do you think?

Cheers
Andrea

!DSPAM:4007,47139264128542092453641!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Justin Deoliveira a écrit :

Yeah, seems logical. The parser already uses the id to create the
feature. What will be the behavior when a bad fid is encountered. Just
ignore it? Or throw exception? I think to be spec compliant we will just
have to ignore it and generate a warning.
  

do i have to make a jira issue ?

It should be doable and relatively easy. If the xml parser generates
a feature with the id that the user specified, we just need to change
the basic fid mapper. The database will make sure the value is unique.
What do you think?

Cheers
Andrea

!DSPAM:4007,47139264128542092453641!

--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr

Sébastien Geindre ha scritto:

Justin Deoliveira a écrit :

Yeah, seems logical. The parser already uses the id to create the
feature. What will be the behavior when a bad fid is encountered. Just
ignore it? Or throw exception? I think to be spec compliant we will just
have to ignore it and generate a warning.
  

do i have to make a jira issue ?

Yes please, make one
Cheers
Andrea

Would not using the ID specified by the user be tricky? I guess its
doable... although some additional checks for uniqueness and all that
would have to be performed.
  
OK guys, so i have to set my own field to store these id ?

Nope, we would have to change our code.

it appears to be a bit complex with other datastore than database...
Chris Holmes explain that here http://jira.codehaus.org/browse/GEOS-1427

But do you think i could do that just for my application instead of creating new fields/mapping/...

Do i have to modify geotools??
Do you which part ?

thanks again...

--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr