<?xml version="1.0" encoding="utf-8"?>
<creole>
    <files>
        <file filelist='iconito' name='/etc/eole/eole-db.d/iconito-db.yml' rm='True' mkdir='True'/>
        <file filelist='iconito' name='/usr/share/envole/eoledb/iconito' source='iconito.db' rm='True' mkdir='True'/>
        <file filelist='iconito' name='/usr/share/eole/db/iconito/gen/iconito-create-1.sql' rm='True' mkdir='True'/>
        <file filelist='iconito' name='/usr/share/eole/db/iconito/updates/iconito-update-1.sql' rm='True' mkdir='True'/>
    </files>	
    <containers>
        <container name='web'>
			<package>iconito-apps</package>
            <service method="apache" servicelist="iconito">iconito</service>
            <file filelist='iconito' name='/etc/apache2/sites-available/iconito' source='iconito-apache.conf' rm='True'/>
			<file filelist='iconito' name='/var/www/html/iconito/var/config/db_profiles.conf.php' source='iconito-db_profiles.conf.php' rm='True'/>
			<file filelist='iconito' name='/var/www/html/iconito/utils/simplesamlphp/config/authsources.php' source='iconito-authsources.php' rm='True'/>
            <file filelist='iconito' name='/var/www/html/posh-profil/include/iconito.php' source='iconito-synchro.php' rm='True'/>
        </container>
    </containers>
    <variables>
        <family name='applications web'>
            <variable name='activer_iconito' type='oui/non' description='Activer iconito (Portail 1er Degrés)'>
                <value>oui</value>
            </variable>
        </family>

        <family name='iconito' mode='expert'>
            <variable type='string' name='iconito_db_mode' description='Serveur de bases de données à utiliser'/>
            <variable type='string' name='iconito_dbserver' description='Adresse du serveur de base de données'/>
            <variable type='number' name='iconito_dbport' description="Port d'écoute du serveur de base de données"/>
            <variable type='string' name='iconito_allow_hosts' description="Hôtes authorisés à utiliser la base de données" multi='True'/>
            <variable type='string' name='iconito_dbuser' description='Utilisateur du serveur de base de données'/>
            <variable type='string' name='iconito_dbpass' description='Fichier de mot de passe du serveur'/>
        </family>	
    </variables>
    <constraints>
        <condition name='hidden_if_in' source='activer_apache'>
            <param>non</param>
            <target type='filelist'>iconito</target>
            <target type='servicelist'>iconito</target>
        </condition>
        		
        <condition name='hidden_if_in' source='activer_iconito'>
            <param>non</param>
            <target type='filelist'>iconito</target>
            <target type='servicelist'>iconito</target>
        </condition>

        <check name='valid_enum' target='iconito_db_mode'>
            <param>['default', 'externe', 'local']</param>
        </check>
        <condition name='disabled_if_in' source='iconito_db_mode'>
            <param>local</param>
            <target type='variable'>iconito_dbserver</target>
            <target type='variable'>iconito_dbuser</target>
            <target type='variable'>iconito_dbport</target>
            <target type='variable'>iconito_dbpass</target>
        </condition>
        <condition name='disabled_if_in' source='iconito_db_mode'>
            <param>default</param>
            <target type='variable'>iconito_dbserver</target>
            <target type='variable'>iconito_dbuser</target>
            <target type='variable'>iconito_dbport</target>
            <target type='variable'>iconito_dbpass</target>
            <target type='variable'>iconito_allow_hosts</target>
        </condition>
    </constraints>
</creole>
