Thanks Ben,
I'll have to check out HALE. Automatic mapping files sounds nice!
Unfortunately, I haven't had a chance to step through the debugger yet as I've
been away from the office and don't have direct access to my dev system. That
is my next step though.
I've attached both my mapping files for the discrete coverage. You'll see a
few commented out blocks in each of stuff I've tried that hasn't worked.
Thanks for taking a look.
I don't see any warn logs regarding wxxm:DomainSetType. It seems to create &
register the attribute successfully.
Kevin M. Weiss
Software Engineer
CRITICAL NETWORKS / HARRIS CORPORATION
harris.com / kevin.we...@harris.com
-----Original Message-----
From: Ben Caradoc-Davies [mailto:b...@transient.nz]
Sent: Thursday, December 08, 2016 5:25 PM
To: Weiss, Kevin <kweis...@harris.com>
Cc: Nuno Oliveira <nuno.olive...@geo-solutions.it>;
geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] App-schema troubleshooting
On 09/12/16 10:24, kweis...@harris.com wrote:
> I figured the debugger was the way to go, but hoped there was an
> easier way. :P
Kevin, I feel your pain. The debugger is an end-user-interface antipattern.
One interesting user interface option is HALE, which I have heard of but not
used. HALE has app-schema support. It might be useful to see what app-schema
mapping HALE generates for the problematic element:
http://www.geo-solutions.it/blog/inspire-support-in-geoserver-made-easy-with-hale/
http://hale.igd.fraunhofer.de/2.9.4/help/topic/eu.esdihumboldt.hale.doc.appschema/html/introduction/intro.html
> I'll take a look at the recommended breakpoints and see if I can figure out
> what's happening. The element I'm trying to encode is a
> wxxm:DiscreteCoverage which should have a wxxm:domainSet element with 0-N
> wxxm:DomainObject within. DiscreteCoverage displays fine as does any gml
> prefixed elements within it, but the wxxm:domainSet refuses to encode (along
> with any of its children). I've tried specifying the complexType via
> targetAttributeNode as I've had that issue before, but it hasn't made a
> difference here.
> The wxxm schema is available here (http://www.wxxm.aero/schema/2.0/wxxm.xsd)
> with the objects in question present in the adjacent coverage.xsd file.
Can we please see your mapping for this element, and the targetAttributeNode
mapping you tried? It is possible that for some reason the type substitution
search fails to detect the target type as valid for this element. Are there any
warnings in the logs about this mapping?
Kind regards,
--
Ben Caradoc-Davies <b...@transient.nz>
Director
Transient Software Limited <http://transient.nz/> New Zealand
<?xml version="1.0" encoding="UTF-8"?>
<as:AppSchemaDataAccess xmlns:as="http://www.geotools.org/app-schema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.geotools.org/app-schema AppSchemaDataAccess.xsd">
<namespaces>
<Namespace>
<prefix>wxxm</prefix>
<uri>http://www.wxxm.aero/wxxm/2.0</uri>
</Namespace>
<Namespace>
<prefix>gml</prefix>
<uri>http://www.opengis.net/gml/3.2</uri>
</Namespace>
<Namespace>
<prefix>xlink</prefix>
<uri>http://www.w3.org/1999/xlink</uri>
</Namespace>
</namespaces>
<includedTypes>
<Include>discretecoverage_domain.xml</Include>
</includedTypes>
<sourceDataStores>
<DataStore>
<!-- arbitrary name for this datastore -->
<id>wxxm_discretecoverage</id>
<parameters>
<!-- configure for postgres -->
<Parameter>
<name>dbtype</name>
<value>postgisng</value>
</Parameter>
<Parameter>
<name>jndiReferenceName</name>
<value>java:comp/env/jdbc/postgres</value>
</Parameter>
<Parameter>
<name>Expose primary keys</name>
<value>true</value>
</Parameter>
</parameters>
</DataStore>
</sourceDataStores>
<targetTypes>
<FeatureType>
<schemaUri>../wxxm/wxxm.xsd</schemaUri>
</FeatureType>
</targetTypes>
<typeMappings>
<FeatureTypeMapping>
<!-- arbitray mapping name -->
<mappingName>discretecoverage</mappingName>
<!-- datastore name from above-->
<sourceDataStore>wxxm_discretecoverage</sourceDataStore>
<!-- source type must be a table or view from DataStore. For feature links, a sub-table. -->
<sourceType>discretecoverage</sourceType>
<!-- top level element this configuration maps to -->
<targetElement>wxxm:DiscreteCoverage</targetElement>
<isDenormalized>false</isDenormalized>
<!-- Feature link needs to be the foreign key that associates this data set with the parent -->
<attributeMappings>
<AttributeMapping>
<targetAttribute>wxxm:DiscreteCoverage</targetAttribute>
<targetAttributeNode>wxxm:DiscreteCoverageType</targetAttributeNode>
<idExpression>
<OCQL>uuid</OCQL>
</idExpression>
</AttributeMapping>
<!--
<AttributeMapping>
<targetAttribute>wxxm:domainSet</targetAttribute>
<targetAttributeNode>wxxm:DomainSetType</targetAttributeNode>
<encodeIfEmpty>true</encodeIfEmpty>
<sourceExpression>
<inputAttribute>id</inputAttribute>
<linkElement>discretecoverage_domain</linkElement>
<linkField>FEATURE_LINK[3]</linkField>
</sourceExpression>
</AttributeMapping>
-->
<!--
<AttributeMapping>
<targetAttribute>wxxm:domainSet</targetAttribute>
<targetAttributeNode>wxxm:DomainSetType</targetAttributeNode>
<encodeIfEmpty>true</encodeIfEmpty>
</AttributeMapping>
<AttributeMapping>
<targetAttribute>wxxm:domainSet/wxxm:DomainObject</targetAttribute>
<targetAttributeNode>wxxm:DomainObjectType</targetAttributeNode>
<encodeIfEmpty>true</encodeIfEmpty>
<idExpression>
<OCQL>strConcat(uuid,'-domainObjectId')</OCQL>
</idExpression>
</AttributeMapping>
<AttributeMapping>
<targetAttribute>wxxm:domainSet/wxxm:DomainObject/wxxm:elements/wxxm:ForecastTime</targetAttribute>
<ClientProperty>
<name>forecastLeadTimes</name>
<value>forecast_period</value>
</ClientProperty>
<ClientProperty>
<name>gml:id</name>
<value>strConcat(uuid,'-forecastTimeId')</value>
</ClientProperty>
</AttributeMapping>
<AttributeMapping>
<targetAttribute>wxxm:domainSet/wxxm:DomainObject/wxxm:elements/wxxm:ForecastTime/gml:timePosition</targetAttribute>
<sourceExpression>
<OCQL>valid_time</OCQL>
</sourceExpression>
</AttributeMapping>
<AttributeMapping>
<targetAttribute>wxxm:domainSet/wxxm:DomainObject/wxxm:elements/gml:MultiCurve</targetAttribute>
<encodeIfEmpty>true</encodeIfEmpty>
<idExpression>
<OCQL>strConcat(uuid,'-geomId')</OCQL>
</idExpression>
<sourceExpression>
<OCQL>geom</OCQL>
</sourceExpression>
<ClientProperty>
<name>srsName</name>
<value>'http://www.opengis.net/def/crs/EPSG/0/4052'</value>
</ClientProperty>
<ClientProperty>
<name>axisLabels</name>
<value>'latitude longitude'</value>
</ClientProperty>
</AttributeMapping>
-->
<!--
<AttributeMapping>
<targetAttribute>gml:name</targetAttribute>
<sourceExpression>
<OCQL>name</OCQL>
</sourceExpression>
</AttributeMapping>
-->
<AttributeMapping>
<targetAttribute>wxxm:domainSet</targetAttribute>
<targetAttributeNode>wxxm:DomainSetType</targetAttributeNode>
<encodeIfEmpty>true</encodeIfEmpty>
<sourceExpression>
<inputAttribute>id</inputAttribute>
<linkElement>discretecoverage_domain</linkElement>
<linkField>FEATURE_LINK</linkField>
</sourceExpression>
</AttributeMapping>
<AttributeMapping>
<targetAttribute>gml:rangeSet/gml:ValueArray</targetAttribute>
<idExpression>
<OCQL>strConcat(uuid,'-valueArrayId')</OCQL>
</idExpression>
</AttributeMapping>
<AttributeMapping>
<targetAttribute>gml:rangeSet/gml:ValueArray/gml:valueComponents/wxxm:Amount</targetAttribute>
<ClientProperty>
<name>uom</name>
<value>amount_uom</value>
</ClientProperty>
<ClientProperty>
<name>xlink:href</name>
<value>amount_href</value>
</ClientProperty>
<sourceExpression>
<OCQL>amount</OCQL>
</sourceExpression>
</AttributeMapping>
<AttributeMapping>
<targetAttribute>gml:coverageFunction/gml:CoverageMappingRule/gml:ruleDefinition</targetAttribute>
<sourceExpression>
<OCQL>rule</OCQL>
</sourceExpression>
</AttributeMapping>
<AttributeMapping>
<targetAttribute>gml:identifier</targetAttribute>
<ClientProperty>
<name>codeSpace</name>
<value>'urn:ietf:rfc:1738'</value>
</ClientProperty>
<sourceExpression>
<OCQL>'http://www.wxxm.aero/feature/contour'</OCQL>
</sourceExpression>
</AttributeMapping>
</attributeMappings>
</FeatureTypeMapping>
</typeMappings>
</as:AppSchemaDataAccess>
<?xml version="1.0" encoding="UTF-8"?>
<as:AppSchemaDataAccess xmlns:as="http://www.geotools.org/app-schema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.geotools.org/app-schema AppSchemaDataAccess.xsd">
<namespaces>
<Namespace>
<prefix>wxxm</prefix>
<uri>http://www.wxxm.aero/wxxm/2.0</uri>
</Namespace>
<Namespace>
<prefix>gml</prefix>
<uri>http://www.opengis.net/gml/3.2</uri>
</Namespace>
<Namespace>
<prefix>xlink</prefix>
<uri>http://www.w3.org/1999/xlink</uri>
</Namespace>
</namespaces>
<sourceDataStores>
<DataStore>
<!-- arbitrary name for this datastore -->
<id>wxxm_discretecoverage_domain</id>
<parameters>
<!-- configure for postgres -->
<Parameter>
<name>dbtype</name>
<value>postgisng</value>
</Parameter>
<Parameter>
<name>jndiReferenceName</name>
<value>java:comp/env/jdbc/postgres</value>
</Parameter>
<Parameter>
<name>Expose primary keys</name>
<value>true</value>
</Parameter>
</parameters>
</DataStore>
</sourceDataStores>
<targetTypes>
<FeatureType>
<schemaUri>../wxxm/wxxm.xsd</schemaUri>
</FeatureType>
</targetTypes>
<typeMappings>
<FeatureTypeMapping>
<!-- arbitray mapping name -->
<mappingName>discretecoverage_domain</mappingName>
<!-- datastore name from above-->
<sourceDataStore>wxxm_discretecoverage_domain</sourceDataStore>
<!-- source type must be a table or view from DataStore. For feature links, a sub-table. -->
<sourceType>discretecoverage_domain</sourceType>
<!-- top level element this configuration maps to -->
<targetElement>wxxm:DomainObject</targetElement>
<isDenormalized>false</isDenormalized>
<!--
<AttributeMapping>
<targetAttribute>wxxm:DomainObject</targetAttribute>
<targetAttributeNode>wxxm:DomainObjectType</targetAttributeNode>
<idExpression>
<OCQL>uuid</OCQL>
</idExpression>
</AttributeMapping>
-->
<!-- Feature link needs to be the foreign key that associates this data set with the parent -->
<attributeMappings>
<AttributeMapping>
<targetAttribute>FEATURE_LINK</targetAttribute>
<encodeIfEmpty>true</encodeIfEmpty>
<sourceExpression>
<OCQL>discretecoverage_id</OCQL>
</sourceExpression>
</AttributeMapping>
<AttributeMapping>
<targetAttribute>wxxm:elements</targetAttribute>
<targetAttributeNode>wxxm:SpatioTemporalElementsPropertyType</targetAttributeNode>
<encodeIfEmpty>true</encodeIfEmpty>
</AttributeMapping>
<AttributeMapping>
<targetAttribute>wxxm:elements/wxxm:ForecastTime</targetAttribute>
<ClientProperty>
<name>forecastLeadTimes</name>
<value>forecast_period</value>
</ClientProperty>
<ClientProperty>
<name>gml:id</name>
<value>strConcat(uuid,'-forecastTimeId')</value>
</ClientProperty>
</AttributeMapping>
<AttributeMapping>
<targetAttribute>wxxm:elements/wxxm:ForecastTime/gml:timePosition</targetAttribute>
<sourceExpression>
<OCQL>valid_time</OCQL>
</sourceExpression>
</AttributeMapping>
<AttributeMapping>
<targetAttribute>wxxm:elements/gml:MultiCurve</targetAttribute>
<idExpression>
<OCQL>strConcat(uuid,'-geomId')</OCQL>
</idExpression>
<sourceExpression>
<OCQL>geom</OCQL>
</sourceExpression>
<ClientProperty>
<name>srsName</name>
<value>'http://www.opengis.net/def/crs/EPSG/0/4052'</value>
</ClientProperty>
<ClientProperty>
<name>axisLabels</name>
<value>'latitude longitude'</value>
</ClientProperty>
</AttributeMapping>
</attributeMappings>
</FeatureTypeMapping>
</typeMappings>
</as:AppSchemaDataAccess>
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users