<?xml version="1.0" encoding="utf-8"?>
<creole>
    <files>
        <file filelist='eportail' name='/usr/share/eole/db/eportail/gen/eportail-create-1.sql' mkdir='True' rm='True'/>
        <file filelist='eportail' name='/usr/share/eole/db/eportail/updates/eportail-update-1.sql' mkdir='True' rm='True'/>
        <file filelist='eportail' name='/etc/eole/eole-db.d/eportail-db.yml' rm='True' mkdir='True'/>
		<file filelist='eportail-bareos' name='/etc/bareos/bareosfichiers.d/eportail.conf' source='eportail-bareos.conf' rm='True'/>
    </files>

    <containers>
        <container name='web'>
            <package>eportail-apps</package>
            <file filelist='eportail' name='/etc/apache2/sites-available/eportail' source='eportail-apache.conf'/>
            <file filelist='eportail' name='/etc/cron.d/eportail' source='eportail.cron' rm='True'/>
            <file filelist="eportail" name="/var/www/html/eportail/include/config.php" source="eportail-config.php" rm="True"/>
            <file filelist="eportail" name="/var/www/html/eportail/include/ldap.php" source="eportail-ldap.php" rm="True"/>
            <file filelist="eportail" name="/var/www/html/eportail/lib/unread/unread.php" source="eportail-unread.php" rm="True"/>
            <!-- fichier de configuration pour la migration -->
            <file filelist='eportail-migration' name='/var/www/html/envole-migration/config/config-db-eportail.php' source='eportail-migration.php' mkdir='True'/>
            <service method='apache' servicelist='eportail'>eportail</service>
        </container>
    </containers>

    <variables>
        <family name='ePortail' icon='home'>
            <variable name='activer_eportail' type='oui/non' description='Activer eportail (portail web)'>
                <value>oui</value>
            </variable>
            

            <variable name='activer_eportailwidpronote' type='oui/non' description='Activer Widget eportail pour Pronote'>
                <value>non</value>
            </variable>
            <variable name='eportail_widpronote' type='string' description='URL complète de votre Pronote' mandatory='True' />
            

            <variable name='activer_eportailwidmoodle' type='oui/non' description='Activer Widget eportail pour Moodle'>
                <value>non</value>
            </variable>

            <variable name='eportail_widmoodle' type='string' description='URL complète de votre moodle (https://mondomaine.fr/moodle)' mandatory='True' />
            <variable name='eportail_keymoodle' type='string' description='API Key de votre moodle' mandatory='True' />

            <variable name='eportail_synchrodelegation' type='string' description='URL Poshprofil pour gerer la délagation de droits (https://mondomaine.fr/synchrodelegation/' mode='expert' />
            <variable name='eportail_synchrobalado' type='string' description='URL Poshprofil de synchro Balado (https://mondomaine.fr/synchrobalado/' mode='expert' />
            <variable name='eportail_synchrocdt' type='string' description='URL Poshprofil de synchro CDT (https://mondomaine.fr/synchrocdt/' mode='expert' />
            <variable name='eportail_synchrogepiannuaire' type='string' description='URL Poshprofil de synchro GEPI via annuaire (https://mondomaine.fr/gepi/' mode='expert' />
            <variable name='eportail_synchrogepisiecle' type='string' description='URL Poshprofil de synchro GEPI via SIECLE (https://mondomaine.fr/synchrogepi/' mode='expert' />
            <variable name='eportail_synchrolimesurvey' type='string' description='URL Poshprofil de synchro Limesurvey (https://mondomaine.fr/synchrolimesurvey/' mode='expert' />
            <variable name='eportail_synchromoodle' type='string' description='URL Poshprofil de synchro Moodle (https://mondomaine.fr/synchromoodle/)' mode='expert' />
            <variable name='eportail_synchroowncloud' type='string' description='URL Poshprofil de synchro Owncloud (https://mondomaine.fr/synchroowncloud/' mode='expert' />
            <variable name='eportail_synchronextcloud' type='string' description='URL Poshprofil de synchro Nextcloud (https://mondomaine.fr/synchronextcloud/' mode='expert' />
            <variable name='eportail_synchropiwigo' type='string' description='URL Poshprofil de synchro Piwigo (https://mondomaine.fr/synchropiwigo/' mode='expert' />
            <variable name='eportail_synchrosacoche' type='string' description='URL Poshprofil de synchro Sacoche (https://mondomaine.fr/synchrosacoche/' mode='expert' />
            <variable name='eportail_synchrowordpress' type='string' description='URL Poshprofil de synchro Wordpress (https://mondomaine.fr/synchrowordpress/' mode='expert' />
        </family>

        <family name='EoleDB' icon='database' mode='expert'>
            <variable type='string' name='eportail_db_mode' description='Serveur de bases de données à utiliser'/>
            <variable type='string' name='eportail_dbserver' description='Adresse du serveur de base de données'/>
            <variable type='number' name='eportail_dbport' description="Port d'écoute du serveur de base de données"/>
            <variable type='string' name='eportail_allow_hosts' description="Hôtes authorisés à utiliser la base de données" multi='True'/>
            <variable type='string' name='eportail_dbuser' description='Utilisateur du serveur de base de données'/>
            <variable type='string' name='eportail_dbpass' description='Fichier de mot de passe du serveur'/>
        </family>


        <separators>
            <separator name="eportail_db_mode">Paramètres EoleDB associés à ePortail</separator>
        </separators>          
    </variables>

    <constraints>
        <condition name='hidden_if_in' source='activer_apache'>
            <param>non</param>
            <target type='filelist'>eportail</target>
            <target type='filelist'>eportail-migration</target>
            <target type='filelist'>eportail-bareos</target>
            <target type='servicelist'>eportail</target>
        </condition>

        <condition name='hidden_if_in' source='activer_eportail'>
            <param>non</param>
            <target type='filelist'>eportail</target>
            <target type='filelist'>eportail-migration</target>
            <target type='filelist'>eportail-bareos</target>
            <target type='servicelist'>eportail</target>
            <target type='variable'>activer_eportailwidmoodle</target>
            <target type='variable'>activer_eportailwidpronote</target>
        </condition>

        <condition name='hidden_if_in' source='activer_eportailwidpronote'>
            <param>non</param>
            <target type='variable'>eportail_widpronote</target>
        </condition>

        <condition name='hidden_if_in' source='activer_eportailwidmoodle'>
            <param>non</param>
            <target type='variable'>eportail_widmoodle</target>
            <target type='variable'>eportail_keymoodle</target>
        </condition>

        <condition name='hidden_if_in' source='activer_envole_migration' fallback='True'>
            <param>non</param>
            <target type='filelist'>eportail-migration</target>
        </condition>

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

        <check name='valid_enum' target='eportail_db_mode'>
            <param>['default', 'externe', 'local']</param>
        </check>
        <condition name='disabled_if_in' source='eportail_db_mode'>
            <param>local</param>
            <target type='variable'>eportail_dbserver</target>
            <target type='variable'>eportail_dbuser</target>
            <target type='variable'>eportail_dbport</target>
            <target type='variable'>eportail_dbpass</target>
        </condition>
        <condition name='disabled_if_in' source='eportail_db_mode'>
            <param>default</param>
            <target type='variable'>eportail_dbserver</target>
            <target type='variable'>eportail_dbuser</target>
            <target type='variable'>eportail_dbport</target>
            <target type='variable'>eportail_dbpass</target>
            <target type='variable'>eportail_allow_hosts</target>
        </condition>
    </constraints>
    <help>
    </help>
</creole>
