On 16/10/15 03:12, Stefano Costa wrote:
> Not sure either, perhaps you can come up with a better name. However, as
> said above, I could force the content to be simple, in which case I might
> as well reuse the "simpleContent" special property that is already taken
> care of by the current code.

If you can reuse simpleContent, that may keep the code simpler and 
require a smaller adjustment. I think lists of values are simple. The 
original implementation will likely need some improvement.

> Now, I created just one attribute mapping with <targetAttributeNode>, and
> it works:
> <!-- this works! -->
> <AttributeMapping>
>      <targetAttribute>om:result/swe:DataArray/swe:values</targetAttribute>
>      <targetAttributeNode>gml:CodeType</targetAttributeNode>
>      <encodeIfEmpty>true</encodeIfEmpty>
>      <sourceExpression>
>          <OCQL>array_values</OCQL>
>      </sourceExpression>
> </AttributeMapping>
> OK, so this could be fine as a workaround... but not as a general solution,
> I believe.

Great! You are getting close. I agree that this is an ugly hack. I agree 
that, as soon as you have something requiring other XML attributes to be 
encoded (like those specifying units), a better fix will be needed.

> I have a pretty simple fix for that (see attached patch), I can prepare a
> separate PR if you think it's worth it.

A PR or a branch in your fork would make it easier to see your changes 
in context. There is (IIRC) some tricky time list test coverage in the 
gs-app-schema-test suite added for WaterML or CSML(?). I would like to 
run these on proposed changes before merging; I usually just check out 
your branch and see if I can break it.  :-)

One other question: will this work with isList?
http://docs.geoserver.org/latest/en/user/data/app-schema/mapping-file.html#islist-optional

Kind regards,

-- 
Ben Caradoc-Davies <b...@transient.nz>
Director
Transient Software Limited <http://transient.nz/>
New Zealand

------------------------------------------------------------------------------
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to