Custom database contributor groups


As part of the CMS Ametys integration process, it is necessary to define how contributor groups will be managed.

CMS Ametys offers a number of predefined group managers. However, you can also define your own group manager to use an existing group database in your information system.

The handler that can be used in this case is the database handler: org.ametys.runtime.plugins.core.group.jdbc.ModifiableJdbcGroupsManager

Database connection

If the database is not the default database on CMS, you must first define a new connection pool to this database or"data source".

Go to SQL (data source) and follow the procedure to create a new connection pool.

Declaration of a new user group database

The new user group manager is declared in the plugin.xml file of a plugin.

You may need to create a new plugin; to do this, follow the instructions on the Architecture page. plugin Ametys

Example of a group base declaration

<extension point="org.ametys.runtime.group.GroupsManager"
            id="org.ametys.custom.CustomJdbcGroupsManager"
            class="org.ametys.runtime.plugins.core.group.jdbc.ModifiableJdbcGroupsManager">
	<pool>custom.datasource.jdbc.pool</pool>
    <list>
    	<table>Groups</table> 	<!-- Nom de la table SQL portant les groupes -->
        <id>Id</id>				<!-- Nom de la colonne contenant l'identifiant du groupe -->
        <label>Label</label>    <!-- Nom de la colonne contenant le libellé du groupe -->
    </list>
    <composition>
    	<table>Groups_Users</table> <!-- Nom de la table SQL reliant un groupe aux utilisateurs -->
        <group>Group_Id</group>		<!-- Nom de la colonne contenant l'identifiant du groupe -->
        <user>Login</user>			<!-- Nom de la colonne contenant l'identifiant de l'utilisateur -->
    </composition>
</extension>            

It is your responsibility to modify and maintain the script SQL corresponding to your group table.

Use

You can then select this new extension point using either the "Plugins and Workspaces"This can be done via the administration interface, or by directly modifying the WEB-INF/param/runtime.xml (see Runtime file.xml) .

Extract from the runtime file.xml

<extensions>
    <org.ametys.runtime.group.GroupsManager>org.ametys.custom.CustomJdbcGroupsManager</org.ametys.runtime.group.GroupsManager>
    ...
</extensions>



 


 

 

 

 

 

Back to top