Hi,
you have to ways of doing this, the first one is using the non
normalized view you have, for that you will need to add the element <is
Denormalised>true</isDenormalised> to your feature type mapping  [1]
[2].

The other approach is to use normalized tables [3].
Hope it helps,
Nuno Oliveira

[1] https://docs.geoserver.org/latest/en/user/data/app-schema/mapping-f
ile.html#typemappings-and-featuretypemapping
[2] https://docs.geoserver.org/latest/en/user/data/app-schema/mapping-f
ile.html#denormalised-sources
[3] https://docs.geoserver.org/latest/en/user/data/app-schema/mapping-f
ile.html#attributes-with-cardinality-1-n
On Mon, 2019-12-02 at 02:42 -0700, lge.geo wrote:
> Hi all, i have have problem with missing "duplicated" elements in the
> wfs
> output.
> 
> I am using postgres db, where I have table "ServiceName" ("ServiceId"
> uuid,
> "LanguageCode" text, "Name" text);
> 
> with data:
> e4217f80-90b2-45db-b5fe-c0b604449871  cz      service name 1
> e4217f80-90b2-45db-b5fe-c0b604449871  en      service name 1
> e4217f80-90b2-45db-b5fe-c0b604449871  de      service name 1
> in de
> 3c5296ef-60a4-46bc-afcb-c8248ca522ea  cz      service name 2
> 3c5296ef-60a4-46bc-afcb-c8248ca522ea  en      service name 2
> 3c5296ef-60a4-46bc-afcb-c8248ca522ea  de      service name 2
> de657585-ac43-4a8e-b7e2-409e108f148b  cz      service name 3
> in cz
> de657585-ac43-4a8e-b7e2-409e108f148b  en      service name 3
> in en
> de657585-ac43-4a8e-b7e2-409e108f148b  de      service name 3
> in de
> 
> As you can see, for the service with id 3c5296ef-60a4-46bc-afcb-
> c8248ca522ea
> the "name" value is the same for all the languages (value "service
> name 2").
> 
> I have created layer "serviceNames" via app-schema. So, i have:
> 
> definition of languageNameType (xsd):
> 
> <xsd:complexType name="LanguageNameType">
>   <xsd:sequence>
>     
> minOccurs="1"
> maxOccurs="unbounded"/>
>   </xsd:sequence>
> </xsd:complexType>
> 
> <xsd:complexType name="LanguagePropertyType">
>   <xsd:simpleContent>
>     <xsd:extension base="xsd:string">
>         <xsd:attribute type="xsd:string" name="languageCode"/>
>       </xsd:extension>
>   </xsd:simpleContent>
> </xsd:complexType>
> 
> definition of serviceName element:
> 
> <xsd:include schemaLocation="languageNameType.xsd" />
> <xsd:element name="serviceName" type="lge:LanguageNameType" />
> 
> in definition of data store i have:
> 
> 
> <AttributeMapping>
>   <targetAttribute>lge:serviceName</targetAttribute>
>   <idExpression><OCQL>ServiceId</OCQL></idExpression>
> </AttributeMapping>
> 
> 
> <AttributeMapping>
>   <targetAttribute>lge:name</targetAttribute>
>     <sourceExpression>
>       <OCQL>Name</OCQL>
>     </sourceExpression>
>     <ClientProperty>
>       <name>languageCode</name>
>       <value>LanguageCode</value>
>     </ClientProperty>
>     <isMultiple>true</isMultiple>
> </AttributeMapping>
> 
> 
> <AttributeMapping>
>   <targetAttribute>FEATURE_LINK</targetAttribute>
>     <sourceExpression>
>         <OCQL>ServiceId</OCQL>
>       </sourceExpression>
> </AttributeMapping>
> 
> When i call wfs request for layer serviceName, in the output is:
> 
> <lge:serviceName gml:id="3c5296ef-60a4-46bc-afcb-c8248ca522ea">
>   <lge:name languageCode="en">service name 2</lge:name>
> </lge:serviceName>
> 
> but i need to see names for all languages (even if name is the same),
> so i
> need:
> 
> <lge:serviceNames gml:id="3c5296ef-60a4-46bc-afcb-c8248ca522ea">
>     <lge:name languageCode="cz">service name 2</lge:name>
>     <lge:name languageCode="en">service name 2</lge:name>
>     <lge:name languageCode="de">service name 2</lge:name>
> </lge:serviceNames>
>         
>         
> Is there any way how to achieve this?
> 
> Many thanks for any advice.
> Lange
> 
> 
> 
> 
> --
> Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-User-f378639
> 0.html
> 
> 
> _______________________________________________
> 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://w
> ww.ianturton.com/talks/foss4g.html#/
> - The GeoServer user list posting guidelines: http://geoserver.org/co
> mm/userlist-guidelines.html
> 
> If you want to request a feature or an improvement, also see this: ht
> tps://github.com/geoserver/geoserver/wiki/Successfully-requesting-
> and-integrating-new-features-and-improvements-in-GeoServer
> 
> 
> [email protected]
> 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

-------------------------------------------------------

Con riferimento alla normativa sul trattamento dei dati 
personali (Reg. UE 2016/679 - Regolamento generale sulla 
protezione dei dati “GDPR”), si precisa che ogni 
circostanza inerente alla presente email (il suo contenuto, 
gli eventuali allegati, etc.) è un dato la cui conoscenza 
è riservata al/i solo/i destinatario/i indicati dallo 
scrivente. Se il messaggio Le è giunto per errore, è 
tenuta/o a cancellarlo, ogni altra operazione è illecita. 
Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to 
which it is addressed and may contain information that 
is privileged, confidential or otherwise protected from 
disclosure. We remind that - as provided by European 
Regulation 2016/679 “GDPR” - copying, dissemination or 
use of this e-mail or the information herein by anyone 
other than the intended recipient is prohibited. If you 
have received this email by mistake, please notify 
us immediately by telephone or e-mail.
_______________________________________________
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

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to