Your OCQL expression should be the attributes of your GeoServer layer
for example if your SOLR layer as an attribute 'Attribute_1' that should
be mapped to element 'Element_1' of your schema your mapping
should look like this:
<AttributeMapping>
<targetAttribute>
NAMESPACE:Element_1
</targetAttribute>
<sourceExpression>
<OCQL>
Attribute_1
</OCQL>
</sourceExpression>
</AttributeMapping>
Based on this exception:
java.lang.RuntimeException: Error applying mapping with targetAttribute
gml:name
Caused by: java.lang.IllegalArgumentException: Could not find working
property accessor for attribute (label) in object
(SimpleFeatureImpl:m4eu=[])
at
org.geotools.filter.AttributeExpressionImpl.evaluate(AttributeExpressionImpl.java:229)
It seems that label attribute is not available, if you publish your SORL
collection as a normal layer which attributes do you have ?
On 07/03/2017 02:52 PM, aquentin wrote:
Hello,
@Ben : Thanks for this help, setting schema-joining to false, allow me to
retrieve the first features from solR using app-schema plugin and a
lightweight mapping : keeping
<attributeMappings>
element empty, so the solr
Index was (automatically?) mapped to gml_id in my case:
<wfs:member>
<erl:MineralOccurrenceView gml:id="m-301"/>
</wfs:member>
but now, I would like to map the fields.
first, using the select request sent by solr module, I retreived the
response :
<response>
<result name="response" numFound="1" start="0">
<doc>
<str name="entity_type">
data
</str>
<arr name="sm_field_status">
<str>
historic
</str>
</arr>
<arr name="spell">
<str>
historic
</str>
<str>
MI2
</str>
<str>
FR
</str>
<str>
Fance
</str>
<str>
985
</str>
<str>
Ag
</str>
</arr>
<arr name="wkt_field_geometry">
<str>
POINT(3.463333 0.901389)
</str>
</arr>
<str name="bundle_name">
mine
</str>
<str name="id">
m-301
</str>
<str name="label">
MI2
</str>
<arr name="sm_field_country_code">
<str>
FR
</str>
</arr>
<str name="bundle">
data
</str>
<arr name="sm_field_country_name">
<str>
France
</str>
</arr>
<arr name="sm_field_miname">
<str>
985
</str>
<str>
Ag
</str>
</arr>
<long name="_version_">
1560122451930644480
</long>
<date name="timestamp">
2017-02-23T11:18:32.855Z
</date>
</doc>
</result>
<str name="nextCursorMark">
AoElbS0zMDE=
</str>
</response>
using OCQL, with different values raised an exception :
java.lang.RuntimeException: Error applying mapping with targetAttribute
gml:name
Caused by: java.lang.IllegalArgumentException: Could not find working
property accessor for attribute (label) in object
(SimpleFeatureImpl:m4eu=[])
at
org.geotools.filter.AttributeExpressionImpl.evaluate(AttributeExpressionImpl.java:229)
But, maybe, my ocql value is wrong, as it's not the xml element to use,
but
the xmlattribute
As the response is XML, I also tried to use data integration access, and
setup inputAttribute with xpath.
All values tested (str[@name='label'],...) return empty value without
exception.
Trying to use ALL log level, doesn't show anything helpful to me.
2017-07-03 13:48:02,525 TRACE [complex.filter] - ENTRY
FeatureImpl:MineralOccurrenceView
<MineralOccurrenceViewType
id=m4eu.m-301>=[] gml:name null null null
2017-07-03 13:48:02,528 DEBUG [geotools.xml] - AbstractFeature is
abstract
What should I use to map theses fields ?
Thanks
Kind regards,
Adrien.
--
View this message in context:
http://osgeo-org.1560.x6.nabble.com/Application-schema-plugin-and-filter-encoding-performance-concern-tp5325806p5326505.html
Sent from the GeoServer - User mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list
Please make sure you read the following two resources before posting to
this list:
- Earning your support instead of buying it, but Ian Turton:
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines:
http://geoserver.org/comm/userlist-guidelines.html
Geoserver-users@.sourceforge
https://lists.sourceforge.net/lists/listinfo/geoserver-users
--
Regards,
Nuno Oliveira
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.
==
Nuno Miguel Carvalho Oliveira
@nmcoliveira
Software Engineer
GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
-------------------------------------------------------
AVVERTENZE AI SENSI DEL D.Lgs. 196/2003
Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.
The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure,
reproduction, copying, distribution, or either dissemination, either whole
or partial, is strictly forbidden except previous formal approval of the
named addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list
Please make sure you read the following two resources before posting to
this list:
- Earning your support instead of buying it, but Ian Turton:
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines:
http://geoserver.org/comm/userlist-guidelines.html
Geoserver-users@.sourceforge
https://lists.sourceforge.net/lists/listinfo/geoserver-users