It looks like you are trying to map a ModelView into an individualName property, which is of type xs:string. This does not make sense, so app-schema converts the ModelView to its Java String representation as a final fallback.

Have you considered using a denormalised source table? This works for gml:name and will likely work for gsmlp:individualName:
http://docs.geoserver.org/latest/en/user/data/app-schema/mapping-file.html#denormalised-sources

Kind regards,
Ben.

On 23/09/17 00:33, aquentin wrote:
Hi,

In order to better understand the problem, many details added :


I'm trying to use app schema to expose a simple feature that have attributes
with cardinality 0...N.
The xsd is here and concern modelview=>
https://forge.brgm.fr/svnrepository/epos/trunk/schemas/epos-lite.xsd

for example :
element name="individualName" type="string" maxOccurs="unbounded">
<annotation>
<documentation>Name of the author(s).</documentation>
</annotation>
</element>



In database, I create one table "modelview" with foreign key to another
table "individualname", to respect multiplicity.

I tried to use feature link but an error raised "No top level element found
in schemas". It shouldn't be the good manner to do mapping.

I tried FEATURE LINK as is :

in modelview mapping :

...
        <includedTypes>
                <Include>mapping_individualname.xml</Include>
        </includedTypes>
...

<FeatureTypeMapping>
                        <isDenormalised>false</isDenormalised>
                        <sourceDataStore>datastore</sourceDataStore>
                        <sourceType>modelview</sourceType>
                        <targetElement>gsmlp:ModelView</targetElement>          
            
                        <attributeMappings>
                                <AttributeMapping>
                                        
<targetAttribute>gsmlp:ModelView</targetAttribute>
                                        <idExpression>
                                                <OCQL>modelid</OCQL>
                                        </idExpression>
                                </AttributeMapping>
                                 <AttributeMapping>
                                        
<targetAttribute>gsmlp:individualName</targetAttribute>
                                        <sourceExpression>
                                                <OCQL>modelid</OCQL>
                                                
<linkElement>individualNameType</linkElement>
                                                
<linkField>FEATURE_LINK</linkField>
                                        </sourceExpression>
                                        <isMultiple>true</isMultiple>
                                </AttributeMapping>

and in mapping_individualname.xml file :

<typeMappings>
                <FeatureTypeMapping>
                        <isDenormalised>false</isDenormalised>
                        <sourceDataStore>datastore</sourceDataStore>
                        <sourceType>modelview_individualname</sourceType>
                        <targetElement>gsmlp:ModelView</targetElement>      
                        <mappingName>individualNameType</mappingName>
                        <attributeMappings>
                                <AttributeMapping>
                                        
<targetAttribute>gsmlp:individualName</targetAttribute>
                                        <sourceExpression>
                                                <OCQL>individualname</OCQL>
                                        </sourceExpression>       
                                </AttributeMapping>
                                <AttributeMapping>
                                        
<targetAttribute>FEATURE_LINK</targetAttribute>
                                        <sourceExpression>
                                                <OCQL>modelid</OCQL>
                                        </sourceExpression>
                                </AttributeMapping>
                        </attributeMappings>
                </FeatureTypeMapping>
        </typeMappings>

but the output here
(https://epos.brgm-rec.fr/geoserver/ows?service=wfs&version=2.0.0&request=GetFeature&typenames=gsmlp:ModelView&OUTPUTFORMAT=GML3)
is not really what I'm waiting for :

<gsmlp:individualName>
FeatureImpl:ModelView<ModelViewType
id=modelview_individualname.fid--57ce97cc_15e846f8924_-7fd6>=[AttributeImpl:individualName<string>=G.
Courrioux]
</gsmlp:individualName>
<gsmlp:individualName>
FeatureImpl:ModelView<ModelViewType
id=modelview_individualname.fid--57ce97cc_15e846f8924_-7fd5>=[AttributeImpl:individualName<string>=S.
Gabalda]
</gsmlp:individualName>
<gsmlp:individualName>
FeatureImpl:ModelView<ModelViewType
id=modelview_individualname.fid--57ce97cc_15e846f8924_-7fd4>=[AttributeImpl:individualName<string>=C.
Allanic]
</gsmlp:individualName>
<gsmlp:individualName>
FeatureImpl:ModelView<ModelViewType
id=modelview_individualname.fid--57ce97cc_15e846f8924_-7fd3>=[AttributeImpl:individualName<string>=K.
Schulmann]
</gsmlp:individualName>
<gsmlp:individualName>
FeatureImpl:ModelView<ModelViewType
id=modelview_individualname.fid--57ce97cc_15e846f8924_-7fd2>=[AttributeImpl:individualName<string>=E.
Skrzypek]
</gsmlp:individualName>
<gsmlp:individualName>
FeatureImpl:ModelView<ModelViewType
id=modelview_individualname.fid--57ce97cc_15e846f8924_-7fd1>=[AttributeImpl:individualName<string>=A.
Guillen]
</gsmlp:individualName>


thank you
Regards.



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-User-f3786390.html

------------------------------------------------------------------------------
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


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

------------------------------------------------------------------------------
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to