Installation and operation manual


This plugin allows you to change certain parameters at server start-up. Useful for regularly deploying data from another server and adapting settings, for example.

How it works

This plugin is used by placing a 'start-actions.xml' file in the WEB-INF/param folder on the server.

The file contains the instructions to be carried out.

The file is then archived as 'start-actions-2020-01-01T120000.000100.xml' so that it cannot be run a second time.

Configuration

The file format is as follows:

<actions> 
    <users-populations> 
        ... 
    </users-populations> 

    <rights> 
        ... 
    </rights>

    <schedulables>
        ...
    </schedulables>
</actions> 

Change a user's password

Dans la balise <users-populations> vous pouvez mettre des balises <users-population> au format :

<users-population id="POPULATIONID"> 
    <user login="LOGIN"> 
        <password>PASSWORD</password> 
    </user> 
</users-population> 

where :

  • POPULATIONID is the population identifier
  • LOGIN is the user's identifier in the population
  • PASSWORD is the new password to be set

This instruction is used to change the administrator password if it has been lost.
Population "admin_population" and login "admin".

Since 4.6, the administrator password must comply with the robustness requirements imposed by ametys:
* The password must contain at least 8 characters
* The password must contain at least one capital letter
* The password must contain at least one numeric character
* The password must contain at least one special character among !%&@#$^*?_~

Modify a rights profile

Dans la balise <rights> vous pouvez mettre une balise <profiles> qui contient des balises <profile> :

<profiles> 
    <profile id="PROFILEID"> 
        <remove right="RIGHTID"/> 
    </profile> 
</profiles> 

where :

  • PROFILEID is a profile identifier
  • RIGHTID is the identifier of a right

Start a task

Available from version 1.2.0.

Dans la balise <schedulables>, pour lancer une tâche au démarrage, vous pouvez mettre des balises <schedulable> structurée comme suit :

<schedulable id="SCHEDULABLE_ID">
    <params>
        <PARAM_NAME>PARAM_VALUE</PARAM_NAME>
        <PARAM_NAME type="config">PARAM_CONFIG_ID</PARAM_NAME>
    </params>
</schedulable>

where :

  • SCHEDULABLE_ID is the identifier of the task to be launched
  • PARAM_NAME is the name of the parameter
  • PARAM_VALUE is the value of the parameter
  • PARAM_CONFIG_ID is the parameter value if extracted from the general configuration (type="config" on the tag bearing the parameter name)

Example of a script launch at startup, with results sent to the platform administrator via email :

<?xml version="1.0" encoding="UTF-8" ?>
<actions>
    ...
    <schedulables>
        <schedulable id="org.ametys.core.schedule.Script">
            <params>
                <recipient type="config">smtp.mail.sysadminto</recipient>
                <script>
                    var logger = Ametys.getLogger("deploy-starter");
                    logger.error("Test !");
                </script>
                <workspace>admin</workspace>
            </params>
        </schedulable>
    </schedulables>
</actions>
Back to top

Deploy starter