Ok, after a lot of debugging I have some answers. First off, apologies.
The feature type building stuff was not meant to be extended in this
way, hence the problems. Fixing some of these issues is somethign i have
wanted to but not had that much time. I have the geotools part done with
the better xsd management, but have not gotten around to fixing the
geoserver schema management. As I said before it is doing some silly
things like hacking the wfs schema object directly, which his just plain
wrong. Anyways, enough whining and on to some answers.
So, the reason why you do not see the additional attributes is because
the VErsionedSchemaBuilder was still using the proper gml schema, which
has no notion of the versioned feature type. You were on the right track
with trying to implement the schema locator to build the correct schema.
However, there is a pretty severe issue with this. It has to do with the
fact that hte types are in the wfs schema itself. Anyways long story
short when the schema is built a circular dependency occurs and kaboom,
stack overflow. The issue is more of an implementation issue. But as i
said before it is not trivial, and part of it is fixed on trunk, not on
2.4.x
So... moving along, I tried building the schema so that the
AbstractVersionedFeautreType is in the gml namespace, and not wfsv. This
worked somewhat. There are still some issues with how the encoder is
being set up:
1. It is encoding WFS.FeatureCollection, when it should be encoding
WFSV.VersionedFeatureCollection.
2. The xsd definition for VersionedFeatureCollection does not seem to
refrence the "_VersionedFeature" element at all. Which means again the
encoder misses the required versioning attributes, only asking the
bindigns for the one defined by "_Feature".
And the light at the end of the title... creating a
VersionedPropertyExtractor which returns the versioned properties
directly, this is what Gabriel suggested. However I did not suggest this
at first because the whole PropertyExtractor interface is again a hack
and something that I plan to fix on trunk so that it is unnecessary.
However a quick test and it did work.
So the only question is will it be possible to move the versioned
feature type definition to the gml namespace?
-Justin
Andrea Aime wrote:
Hi,
I basically spent the afternoon trying to get the WFSV versioned
feature collection encoded to no avail so far. Well, no avail
is an exxageration, I know what's going on, just don't know how
to fix it.
The versioned feature collection is supposed to contain
versioned features, that is, features whose schema has 4 extra
attributes such as author, date of last change, version
and commit comment.
Now, the returned GML3 looks like:
<wfs:FeatureCollection numberOfFeatures="2"
timeStamp="2007-12-11T18:33:29.106+01:00"
xsi:schemaLocation="http://www.opengis.net/wfsv
http://localhost:8080/geoserver/schemas/wfs/1.1.0/wfs.xsd
http://www.openplans.org/topp
http://localhost:8080/geoserver/wfs?service=WFSV&version=1.1.0&request=DescribeVersionedFeatureType&typeName=topp:archsites">
<gml:featureMembers>
<topp:archsites gml:id="archsites.26">
<gml:boundedBy>
<gml:Envelope srsName="http://www.opengis.net/gml/srs/epsg.xml#26713">
<gml:lowerCorner>604000.0 4930000.0</gml:lowerCorner>
<gml:upperCorner>604000.0 4930000.0</gml:upperCorner>
</gml:Envelope>
</gml:boundedBy>
<topp:cat>2</topp:cat>
<topp:str1>Alien crash site</topp:str1>
−
<topp:the_geom>
−
<gml:Point>
<gml:pos>604000.0 4930000.0</gml:pos>
</gml:Point>
</topp:the_geom>
</topp:archsites>
...
As you can see http://www.openplans.org/topp is bound to
an alternative DescribeFetaureType calls that will
return the extra feature types. Too bad the encoder
won't listen to it, and use a precanned schema
for topp:archsites that only contains the basic
attributes that comes from the WFSSchemaLocator object.
Now, if I change the config to return a plain SchemaLocator
I'm greeted by a nice NPE (the FeaturePropertyExtractor
fails to find the element declaration in schema index).
Now, the WFSSchemaLocator builds schemas using the
FeatureTypeSchemaBuidler, so I used the one I use
the create describe feature type in the first place (which
makes features extending AbstactVersionedFeatureType,
which in turn does have the 4 extra attributes), but I keep on getting
only the base attributes...
Why is this happening? Confused...
Cheers
Andrea
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
!DSPAM:4007,475ed7a7277718362916074!
--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org