This plugin brings 5 new rights
Directory" category
Right title | Role |
---|---|
Search for users | Access to user research tool |
Find entities | Access to the entity search tool |
Create a user | Authorizes the creation of a user |
Create an entity | Authorizes the creation of an entity |
Directory root page | Allows you to position the root page of a directory |
Organization chart root page | Allows you to position the root page of the flowchart |
Delete an entity | Allows you to delete an entity |
Service creation law" category
Right title | Role |
---|---|
Organization chart | Authorizes insertion of "Organizational chart" service |
Remember to assign these new rights to the users and/or user groups concerned.
From version 2.2 onwards, plugin provides 3 user synchronizations:
To configure these user synchronizations, see the doc here.
For the source configuration, we have for :
Parameters | Description |
---|---|
Population | Define the Ametys population associated with synchronization |
First name | The content type metadata defined, which corresponds to the first name of the users in the population. Ametys |
Name | The content type metadata defined, which corresponds to the name of the users in the population. Ametys |
The content type metadata defined, which corresponds to the e-mail of the population's users. Ametys | |
Additional search filter |
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 :
You can override this content type - like any other content type - to add new fields.
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).
Synchronization of entities requires 2 tables SQL :
The name of the tables SQL is not imposed.
The entity table must contain :
The type and name of columns is not imposed.
Example
id | parent_id | name | description |
type |
---|---|---|---|---|
1876 | null | Chairmanship | null |
PR |
1114 | 1876 | General Management | null |
DIR |
1354 | 1114 | Administrative and financial management | null |
P |
1130 | 1114 | Business & Marketing | null |
P |
The user table must contain :
The type and name of columns is not imposed.
Example
login | lastname | firstname | role | entity_id |
---|---|---|---|---|
mpaul | Martin | Paul | null | 1354 |
jdupont | Dupont | Jean | Marketing Manager | 1130 |
tdubert | Dubert | Thierry | General Manager | 1114 |
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.
Wording | Description |
---|---|
Database | A database SQL |
Entities table | The name of the table representing the entities |
Entity identifier | Entity content type field (metadata) corresponding to its unique identifier |
Entity identifier column | Name of SQL column in entity table, bearing the unique identifier of each entity. |
User table | The 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 IDs | User content type field (metadata) corresponding to its unique identifier. |
User ID column | Name of SQL column in user table, identifying user in Ametys |
User role column | Column name SQL from user table to user role (optional fields) |
Corresponding fields | Map 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
In the "Content synchronization" tool, select entity synchronization and click on "Synchronize content".