Prerequisites
Tutorial
These 2 references are materialized by 2 files in our tutorial : Aliments.json and Additives.csv
fileAliments.json=${user.home}/Documents/Aliments.json fileAdditives.csv=${user.home}/Documents/Additives.csv
<view name="Aliments"> <connector type="FileConnector"> <parameter name="path" eval="property('fileAliments.json')"/> </connector> <serializer type="JSONStreamSerializer"/> <processors> <element in="item" out="products"> <element in="object" out="product"> <element in="additives"> <element-ignore in="additive"> <element in="item" out="additive"/> </element-ignore> </element> </element> </element> </processors> <cache type="FileCache"> <trigger type="ViewNotifiedTrigger"/> <trigger type="ViewCreatedTrigger" ignore-during="P1D"/> </cache> </view>
INFO: Cache has been refresh for view: Aliments
<element namespace-ignore="true" recursive="true"/>
|
INFO: Cache has been refresh for view: Aliments_filter
Use option Run this view within range [N..M] to get an extract that shows the structure of the data views to be joined:
Additives | Aliments_filter |
---|---|
Create a new view named Additives_aliments to join the 2 data sources ; the goal is to associate each additive to the list of aliments that use this additive.
<pre-renderers> <title>'Number of aliments per additive'</title> <row foreach="/additives/additive"> <column label="Id" link="/lavoisier/ListAdditifs/additives/additive[id/text()='{id/text()}']/*">id/text()</column> <column label="nbAliments" link="/lavoisier/ListAliments_filter/products/product[additives_tags/token/text()='{id/text()}']/name" unit="nb">@nbAliments</column> <column label="danger" unit="danger">danger/text()</column> </row> </pre-renderers>