Configuration example

Configuration example

<config xmlns="http://software.in2p3.fr/lavoisier/config.xsd" xmlns:ns="http://software.in2p3.fr/lavoisier/config.xsd" version="4">
    <processors>
        <processor type="SelectProcessor">
            <parameter name="nodes" eval="path()"/>
        </processor>
    </processors>
    <processors name="getSingleNode">
        <processor type="SelectProcessor">
            <parameter name="namespaces">
                <entry key="prop">http://software.in2p3.fr/lavoisier/entries.xsd</entry>
            </parameter>
            <parameter name="nodes">/prop:entries/*</parameter>
            <parameter name="single_node">true</parameter>
        </processor>
    </processors>
    <processors name="indent">
        <processor type="IndentProcessor">
            <parameter name="amount">2</parameter>
        </processor>
    </processors>
    <view>
        <connector type="JMXConnector">
            <parameter name="mbean">fr.in2p3.lavoisier.jmx.Configuration</parameter>
        </connector>
        <processors>
            <processor type="ExcludeProcessor">
                <parameter name="namespaces">
                    <entry key="ns">http://software.in2p3.fr/lavoisier/config.xsd</entry>
                </parameter>
                <parameter name="xpath">/ns:config/ns:view/ns:connector/ns:parameter[@id='password' or @id='passphrase']/text()</parameter>
            </processor>
        </processors>
        <pre-renderers>
            <row foreach="/config/view">
                <column link="/lavoisier/{@name}">@name</column>
                <column>info/Description</column>
            </row>
        </pre-renderers>
    </view>
    <view name="properties">
        <connector type="XMLConnector">
            <parameter name="content" eval="document(concat(property('user.dir'),'/etc/lavoisier-config.properties'))"/>
        </connector>
        <processors>
            <processor type="PropertiesToXmlProcessor"/>
            <processor type="ExcludeProcessor">
                <parameter name="xpath">/properties/entry[contains(@key,'password')]/text()</parameter>
            </processor>
            <processor type="ExcludeProcessor">
                <parameter name="xpath">/properties/entry[contains(@key,'passphrase')]/text()</parameter>
            </processor>
        </processors>
    </view>
    <view name="status">
        <info>
            <ns:Description>for console</ns:Description>
            <ns:Criticity>low</ns:Criticity>
        </info>
        <connector type="JMXConnector">
            <parameter name="mbean">fr.in2p3.lavoisier.mbean.Status</parameter>
        </connector>
        <renderers html="xsl/status.xsl"/>
    </view>
    <view name="data">
        <info>
            <ns:Description>for users</ns:Description>
            <ns:Criticity>high</ns:Criticity>
        </info>
        <connector type="PathConnector">
            <parameter name="xpath" eval="path()"/>
        </connector>
        <processors>
            <for nodes="/operation">
                <connector type="HTTPConnector">
                    <parameter name="url" eval="concat('http://...?operation=', current()/@name)"/>
                    <parameter name="passphrase" eval="property('certificate.passphrase')"/>
                    <parameter name="certificate" eval="string(concat(property('user.home'),'/.globus/usercert.p12'))"/>
                </connector>
            </for>
        </processors>
    </view>
    <view name="index">
        <info>
            <ns:Description>for users</ns:Description>
            <ns:Criticity>high</ns:Criticity>
        </info>
        <connector type="XMLConnector">
            <parameter name="content">
                &lt;idx:index xmlns:idx="uri://"&gt;
                    &lt;idx:site xmlns="" id="CC-IN2P3"&gt;
                        &lt;idx:vo name="dteam"/&gt;
                        &lt;idx:vo name="biomed"/&gt;
                    &lt;/idx:site&gt;
                    &lt;idx:site xmlns="" id="LAPP"&gt;
                        &lt;idx:vo name="dteam"/&gt;
                    &lt;/idx:site&gt;
                &lt;/idx:index&gt;
            </parameter>
        </connector>
        <processors>
            <for nodes="/index/site">
                <connector type="XSLTConnector">
                    <parameter name="indent">true</parameter>
                    <parameter name="stylesheet">
                        &lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"/&gt;
                    </parameter>
                    <parameter name="input" eval="view('properties')"/>
                    <parameter name="documents">
                        <entry key="data" eval="view('data')"/>
                        <entry key="doc" eval="document('/path/to/file.xml')"/>
                    </parameter>
                    <parameter name="parameters">
                        <entry key="debug">false</entry>
                        <entry key="site" eval="current()/@id"/>
                    </parameter>
                </connector>
                <processors>
                    <processor type="MyProcessor1"/>
                    <processor type="MyProcessor2"/>
                </processors>
            </for>
        </processors>
        <cache exclusive="true" ttl="PT1H" type="FileCache">
            <parameter name="baseDirectory" eval="property('cache.BaseDir')"/>
            <trigger type="DependencyRefreshedTrigger">
                <parameter name="views">
                    <entry>index</entry>
                </parameter>
            </trigger>
        </cache>
        <pre-renderers>
            <namespace prefix="idx" uri="uri://"/>
            <row foreach="/idx:index/idx:site/idx:vo">
                <column>parent::idx:site/@id</column>
                <column link="/lavoisier/index~aView/index/site[@id='{parent::idx:site/@id}']/vo[@name='{@name}']/*">@name</column>
            </row>
        </pre-renderers>
    </view>
</config>