Hi,

I'm trying to configure an app-schema and get a bit lost with nested
features and link parameters.
The first case i will introduce looks pretty simple, and maybe help me to
figure out how does it work.

in my main mapping file, i have a feature type,
<targetElement>au:AdministrativeUnit</targetElement>, mapping a postgis
table.
in this feature, i have an attribute name, mapping the name field of the DB
table1.

                <AttributeMapping>

<targetAttribute>au:name/gn:GeographicalName/gn:spelling/gn:SpellingOfName/gn:text</targetAttribute>
                    <sourceExpression>
                        <OCQL>name</OCQL>
                    </sourceExpression>
                </AttributeMapping>

this gives me :

<au:name>
  <gn:GeographicalName>
    <gn:spelling>
      <gn:SpellingOfName>
        <gn:text>*FR2100000000*</gn:text>
      </gn:SpellingOfName>
    </gn:spelling>
  </gn:GeographicalName>
</au:name>

but actually, i have another postgis table2 that contains
id                        |       text
FR2100000000     |    Paris

and what i would like to have is

<au:name>
  <gn:GeographicalName>
    <gn:spelling>
      <gn:SpellingOfName>
        <gn:text>*Paris*</gn:text>
      </gn:SpellingOfName>
    </gn:spelling>
  </gn:GeographicalName>
</au:name>

so what i did is another mapping file, for a non feature type, but needed
datas, to configure au:name

here my spellingOfName.xml mapping file :

<targetElement>*au:name*</targetElement>
            <groupBy />
            <attributeMappings>
                <AttributeMapping>
                    <targetAttribute>au:name</targetAttribute>
                    <sourceExpression>
                        <OCQL>getID()</OCQL>
                    </sourceExpression>
                </AttributeMapping>
            </attributeMappings>
            <attributeMappings>
                <AttributeMapping>
                    <targetAttribute>FEATURE_LINK</targetAttribute>
                    <sourceExpression>
                        <OCQL>id</OCQL>
                    </sourceExpression>
                </AttributeMapping>
            </attributeMappings>
            <attributeMappings>
                <AttributeMapping>

<targetAttribute>au:name/gn:GeographicalName/gn:spelling/gn:SpellingOfName/gn:text</targetAttribute>
                    <sourceExpression>
                        <OCQL>text</OCQL>
                    </sourceExpression>
                </AttributeMapping>
            </attributeMappings>
        </FeatureTypeMapping>

then, in my root mapping file i added
    <includedTypes>spellingOfName.xml</includedTypes>

and i tried to link with (replacing uppon au:name definition) :
*
<AttributeMapping>
                    <targetAttribute>au:AdministrativeUnit</targetAttribute>
                    <sourceExpression>
                        <OCQL>getID()</OCQL>
                        <linkElement>au:name</linkElement>
                        <linkField>FEATURE_lINK</linkField>
                    </sourceExpression>
                </AttributeMapping>*

(au:AdministrativeUnit is the parent element of au:name)

the last definition is what i would like to discuss about ... cause i admit
to be quite lost with the use of the linkElement and linkField tags...

if anyone could spend time on this case, and discuss a bit about the
linking process of app-schema, i would really appreciate.

the funny thing is that if i remove the
<includedTypes>spellingOfName.xml</includedTypes>, it doesn't give anyerror
and give the same result : no tag au:name in my response.

thanks


-- 
Florent Gravin
CampToCamp - Chambéry
0479444492
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to