Administration manual


  1. Rights
  2. User synchronization
  3. Synchronization of entities (departments, divisions, etc.)
    1. Entity" content type
    2. Synchronization
      1. Table structure SQL
        1. Entity tables
        2. User table
      2. Configuring the entity synchronization model
    3. Launch entity synchronization

 

Rights

This plugin brings 5 new rights

Directory" category

Right titleRole
Search for usersAccess to user research tool
Find entitiesAccess to the entity search tool
Create a userAuthorizes the creation of a user
Create an entityAuthorizes the creation of an entity
Directory root pageAllows you to position the root page of a directory
Organization chart root pageAllows you to position the root page of the flowchart
Delete an entityAllows you to delete an entity

Service creation law" category

Right titleRole
Organization chartAuthorizes insertion of "Organizational chart" service

Remember to assign these new rights to the users and/or user groups concerned.

 

User synchronization

 From version 2.2 onwards, plugin provides 3 user synchronizations:

  • User directory: users from a population Ametys
    Allows you to define a population as a data source. In this way, synchronized content will correspond to data from this population (currently, only users from LDAP are managed).
  • User directory: users from a data source LDAP
    This allows you to define a data source that comes from a LDAP directory.
  • User directory: users from a SQL
    data source. Allows you to define a data source from a SQL database. (Only Oracle and MySQL are currently supported).

To configure these user synchronizations, see the doc here.

For the source configuration, we have for :

  • User directory: users from a population Ametys :

ParametersDescription
PopulationDefine the Ametys population associated with synchronization
First nameThe content type metadata defined, which corresponds to the first name of the users in the population. Ametys
NameThe content type metadata defined, which corresponds to the name of the users in the population. Ametys
EmailThe content type metadata defined, which corresponds to the e-mail of the population's users. Ametys
Additional search filter 

 

  • User directory: users from a data source LDAP :

    It is equivalent to Data source LDAP except :

    • It adds the Population parameter

    • It removes the Identifier parameter

  • User directory: users from a data source SQL :

    It is equivalent to Data source SQL except :

    • It adds the Population parameter

    • It removes the Identifier parameter

 

Synchronization of entities (departments, divisions, etc.)

Entity" content type

plugin Directory provides a new type of content called "User directory: entities from a SQL data source", for the poles or services in your directory.

By default, this type of content is composed of :

  • a title
  • a description
  • a type (reference table)
  • a Boolean to display or not the entity title in the flowchart
  • a "repeater" for members of this entity with :
    • the user
    • the user's role within this entity

You can override this content type - like any other content type - to add new fields.

Synchronization

Entity" content can be synchronized with a SQL database.

Prerequisites
- Entities can be synchronized with a database MySQL or Oracle
- The table structure SQL is imposed (see below)
- To attach users to entities, users must first exist in Ametys (synchronize users first).

Table structure SQL

Synchronization of entities requires 2 tables SQL :

  • a table representing the entities,
  • a table representing the users attached to each entity

The name of the tables SQL is not imposed.

Entity tables

The entity table must contain :

  • a column for the unique identifier of each entity
  • a column identifying the parent entity

The type and name of columns is not imposed.

Example

idparent_idnamedescription

 type

1876nullChairmanshipnull

 PR

11141876General Managementnull

 DIR

13541114Administrative and financial managementnull

 P

11301114Business & Marketingnull

 P

User table

The user table must contain :

  • a column with the identifier of the entity to which it belongs
  • a column for uniquely identifying the user in Ametys (login)

The type and name of columns is not imposed.

Example

loginlastnamefirstnameroleentity_id
mpaulMartinPaulnull1354
jdupontDupontJeanMarketing Manager1130
tdubertDubertThierryGeneral Manager1114

Configuring the entity synchronization model

To synchronize entities, you need to create a new synchronization based on the entity synchronization template.

To do this, from the administration interface, click on "Content synchronization" in the "Administration" tab.

Then click on "New definition".

In the form, select the "Source SQL of entities " type.

In the "Synchronized contents" section, select the content type corresponding to the entities ("Entities" by default).

In the "Lifecycle" section, choose the "Entity" lifecycle (see Plugin Directories - Integration manual v2.1.0)
If you have not customized the entity workflow file, the initial action is numbered 11 and the validation action is numbered 41.

Then configure the source according to the structure of your database.
The example below corresponds to the SQL tables given as an example above.

WordingDescription
DatabaseA database SQL
Entities tableThe name of the table representing the entities
Entity identifierEntity content type field (metadata) corresponding to its unique identifier
Entity identifier columnName of SQL column in entity table, bearing the unique identifier of each entity.
User tableThe name of the table representing users
Column linking to entities

Name of the SQL column in the users table, bearing the identifier of the entity to which the user belongs.

User IDsUser content type field (metadata) corresponding to its unique identifier.
User ID columnName of SQL column in user table, identifying user in Ametys
User role columnColumn name SQL from user table to user role (optional fields)
Corresponding fieldsMap other metadata to SQL columns for the entity table

From version 2.2.0 of plugin, you can choose a specific treatment for the entity type.
If your database contains the entity type code, select the "Convert entity types to Ametys content" operator.

This operator will attempt to find a match between the entity type code in the database and the contents of the "Entity type" reference table.
Make sure you have correctly entered the "code" field in the reference table:

Record.

To go further
It will always be possible to modify the default behavior by overloading the files defining the SQL requests to retrieve users and entities:
- Users: overload the sql-user-search.xml file in the WEB-INF/param/userdirectory/sql
- Entities: overload the sql-search.xml file in the WEB-INF/param/contentIO/ directory.sql

Launch entity synchronization

In the "Content synchronization" tool, select entity synchronization and click on "Synchronize content".

 

Back to top

User directory