HI Victor:
I am not sure the specific difference in ContentDataStore (rather than
AbstractDataStore) tripped up app schema. I assume it was the introduction
of call DataUtiltieis.simplify (which no doubt makes a copy using
DuplicatingFilterVisitor).
As per the patch Torben linked to we applied a "fix" to
NestedAttributeExpresionImpl:
+ public Object accept(ExpressionVisitor visitor, Object extraData) {
+ //Workaround for GEOT-4981: NestedAttributeExpresionImpl is
incompatible with DuplicatingFilterVisitor
+ if (visitor instanceof DuplicatingFilterVisitor) {
+ return new NestedAttributeExpression(fullSteps, rootMapping);
+ }
+ return visitor.visit(this,extraData);
+ }
The general feedback is that NestedAttributeExpresionImpl is a "bad idea"
that does not match the design of geotools :)
The "expression" data structure is intended to be "just" a data structure
(so DuplicatingFilterVisitor was quite happy to recreate the same user
request using implementation supplied by filter factory.
Taking a look at the internals of NestedAttributeExpresionImpl it takes
some effort to parse the provided XPath expression (into some member
fields) which it then uses when "evaluating" the expression against a
feature (returning a list of values when the XPath selects more than one
"nested" value). This implementation is *fine* - but the location of it in
the code base is wrong.
I got three fixes for you:
1) Write a PropertyAccessor (there is already one in application schema).
This is the "hook" used by geotools to look at xpath expression and select
an appropriate implementation. You should be able to package up the
"evaluate" implementation you need in this manner. If you cannot then I
have a API design problem I would be happy to work through with you :)
2) Supply your own customer filter factory to DuplicatingFileVisitor that
creates a NestedAttributeExpressionImpl. This is what I do in the uDig
codebase if I want a copy of the users request using my own classes. I am
not sure if this work for you (depends if you want to use
NestedAttributeExpressionImpl everywhere.
3) Hack the accept method as Torbien has done for a quick fix. While this
works for the test case it is not a good long term fix (in case app schema
starts interacting with a datastore that manipulates filters before use -
as is done when generating SQL queries).
--
Jody
--
Jody Garnett
On 18 January 2015 at 18:22, <victor....@csiro.au> wrote:
> Hi Torben,
>
>
>
> I apologize for the late reply, I just got back today from break. I am not
> entirely sure what is the new property-ng implementation. Can you give me
> some background on this? As Jody had mentioned, we lost Ben and Rini have
> gone on maternity leave therefore we are slightly short on staff. Again, I
> apologize if we are not on top of things with the community.
>
>
>
> Is it possible for us to replicate this failure? Is it on a repo somewhere
> for us to fork from?
>
>
>
>
>
>
>
>
>
> *From:* Torben Barsballe [mailto:tbarsba...@boundlessgeo.com]
> *Sent:* Friday, 9 January 2015 7:52 AM
> *To:* GeoTools Developers list
> *Subject:* [Geotools-devel] gt-app-schema - Test Failures
>
>
>
> While migrating the new property-ng implementation to be used by geotools,
> I ran into a new test failure in gt-app-schema
>
> On line 133
> <https://github.com/geotools/geotools/blob/master/modules/extension/app-schema/app-schema/src/test/java/org/geotools/data/complex/PolymorphicChainingTest.java#L113>
> of PolymorphicChainingTest, the test fails. I have tracked the issue down
> to the artifactSource mapping, which only contains the
> PropertyFeatureSource corresponding to the Artifact featuteType, so that
> when it goes to read through the FeatureSource, it only finds Artifact
> features, not the StringAttribute it is looking for. This appears to occur
> because the artifactSource is passed in the Artifact feature type when it
> is created.
>
> I am curious how this test was supposed to work? I assume it was intended
> to get all of the features, not just the one type?
>
> I have verified that all the expected feature source mappings (Artifact,
> GeoAttribute, StringAttribute, NumberAttribute) are contained in the
> AppSchemaDataAccess class at runtime.
>
> Torben Barsballe
>
>
> ------------------------------------------------------------------------------
> New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
> GigeNET is offering a free month of service with a new server in Ashburn.
> Choose from 2 high performing configs, both with 100TB of bandwidth.
> Higher redundancy.Lower latency.Increased capacity.Completely compliant.
> http://p.sf.net/sfu/gigenet
> _______________________________________________
> GeoTools-Devel mailing list
> GeoTools-Devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>
>
------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel