<?xml version="1.0" encoding="utf-8"?>
<creole>
    <files>
       <package>bergamote-sso</package>
       <file filelist='bergamote' name='/etc/cron.d/bergamote' source='cron-bergamote' mode='0755' rm='True'/>
    </files>
    <containers>
         <container name='web'>
             <service method="apache" servicelist="bergamote">bergamote</service>
             <package>bergamote-apps</package>
             <file filelist='bergamote' name='/etc/bergamote/config.ini' mkdir='True' source='bergamote-config.ini'/>
         </container>
         <container name='fichier'>
             <package>bergamote-index</package>
             <file filelist='bergamote' name='/etc/bergamote/config.ini' mkdir='True' source='bergamote-config.ini'/>
         </container>
    </containers>
    <variables>
        <family name='applications web'>
            <variable name='activer_bergamote' type='oui/non' description='Activer Bergamote (indexation et recherche de fichiers)'>
                <value>oui</value>
            </variable>
            <variable name='bergamote_ftp' type='string' description='Adresse du serveur FTP utilisé par Bergamote' hidden='True' mandatory='True'/>
        </family>
        <family name='bergamote' mode='expert'>
            <variable name="bergamote_frequence" type='string' description="Fréquence d'indexation des fichiers">
                <value>horaire</value>
            </variable>
        </family>
    </variables>
    <constraints>
        <check name="valid_enum" target="bergamote_frequence">
            <param>['horaire', 'quotidienne', 'hebdomadaire']</param>
        </check>
        <condition name='hidden_if_in' source='activer_proftpd'>
            <param>non</param>
            <target type='variable'>activer_bergamote</target>
        </condition>
        <condition name='hidden_if_in' source='activer_bergamote'>
            <param>non</param>
            <target type='filelist'>bergamote</target>
            <target type='servicelist'>bergamote</target>
        </condition>
        <auto name='calc_container' target='bergamote_ftp'>
            <param type='eole'>mode_conteneur_actif</param>
            <param type='container'>fichier</param>
            <param type='eole' optional='True'>mode_zephir</param>
        </auto>
    </constraints>

    <help>
        <variable name='activer_bergamote'>Bergamote, pour indexer et retrouver les fichiers</variable>
    </help>
</creole>
