<?xml version="1.0" encoding="utf-8"?>
<creole>
    <files>
        <file filelist='sacoche' name='/usr/share/eole/db/sacoche/gen/sacoche-create-1.sql' mkdir='True' rm='True'/>
        <file filelist='sacoche' name='/usr/share/eole/db/sacoche/updates/sacoche-update-1.sql' mkdir='True' rm='True'/>
        <file filelist='sacoche' name='/etc/eole/eole-db.d/sacoche-db.yml' rm='True' mkdir='True'/>
        <file filelist='sacoche' name='/usr/share/envole/eoledb/sacoche' source='sacoche.db' rm='True' mkdir='True'/>
		<file filelist='sacoche-bareos' name='/etc/bareos/bareosfichiers.d/sacoche.conf' source='sacoche-bareos.conf' rm='True'/>        
    </files>
    
    <containers>
        <container name='web'>
            <package>sacoche-apps</package>
            <file filelist='sacoche' name='/etc/apache2/sites-available/sacoche' source='sacoche-apache.conf'/>
            <file filelist="sacoche" name="/var/www/html/sacoche/__private/config/constantes.php" source="sacoche-constantes.php" rm="True"/>
            <file filelist="sacoche" name="/var/www/html/sacoche/__private/mysql/serveur_sacoche_structure.php" source="sacoche-serveur.php" rm="True"/>
            <file filelist='sacoche' name='/var/www/html/posh-profil/include/sacoche.php' source='sacoche-synchro.php' rm='True'/>
            <service method='apache' servicelist='sacoche'>sacoche</service>
        </container>
    </containers>
    
    <variables>
        <family name='applications web'>
            <variable name='activer_sacoche' type='oui/non' description='Activer SACoche'>
                <value>oui</value>
            </variable>
        </family>
        
        <family name='EoleDB' icon='database' mode='expert'>
            <variable type='string' name='sacoche_db_mode' description='Serveur de bases de données à utiliser'/>
            <variable type='string' name='sacoche_dbserver' description='Adresse du serveur de base de données'/>
            <variable type='number' name='sacoche_dbport' description="Port d'écoute du serveur de base de données"/>
            <variable type='string' name='sacoche_allow_hosts' description="Hôtes authorisés à utiliser la base de données" multi='True'/>
            <variable type='string' name='sacoche_dbuser' description='Utilisateur du serveur de base de données'/>
            <variable type='string' name='sacoche_dbpass' description='Fichier de mot de passe du serveur'/>
        </family>  

        <separators>
            <separator name="sacoche_db_mode">Paramètres EoleDB associés à Sacoche</separator>
        </separators>                 
    </variables>
    
    <constraints>
        <condition name='hidden_if_in' source='activer_apache'>
            <param>non</param>
            <target type='filelist'>sacoche</target>
            <target type='filelist'>sacoche-bareos</target>
            <target type='servicelist'>sacoche</target>
        </condition>		
        
        <condition name='hidden_if_in' source='activer_sacoche'>
            <param>non</param>
            <target type='filelist'>sacoche</target>
            <target type='filelist'>sacoche-bareos</target>
            <target type='servicelist'>sacoche</target>
        </condition>

        <condition name='hidden_if_in' source='activer_bareos_dir' fallback='True'>
            <param>non</param>
            <target type='filelist'>sacoche-bareos</target>			
		</condition>        

        <check name='valid_enum' target='sacoche_db_mode'>
            <param>['default', 'externe', 'local']</param>
        </check>
        <condition name='disabled_if_in' source='sacoche_db_mode'>
            <param>local</param>
            <target type='variable'>sacoche_dbserver</target>
            <target type='variable'>sacoche_dbuser</target>
            <target type='variable'>sacoche_dbport</target>
            <target type='variable'>sacoche_dbpass</target>
        </condition>
        <condition name='disabled_if_in' source='sacoche_db_mode'>
            <param>default</param>
            <target type='variable'>sacoche_dbserver</target>
            <target type='variable'>sacoche_dbuser</target>
            <target type='variable'>sacoche_dbport</target>
            <target type='variable'>sacoche_dbpass</target>
            <target type='variable'>sacoche_allow_hosts</target>
        </condition>
    </constraints>

    <help>
    </help>
</creole>
	
