This is an old revision of the document!
Roles - Import of data from CSV
1a. Prepare some virtual system
Please use this tutorial to do so!
1b. Prepare CSV file
Here is an example of CSV file which can be used for importing (or updating) roles and set their role attributes.
roles;description;attribute Manager-A;Leader; LAY-SP;Manager;attr1 "CORE-CLOSE AB-role";desc;attr1
As you can see roles column can contain single or multiple values (separated by a line; the separator can be specified in the settings of the LRT). For multivalued roles, description and attribute from the same row will be added to every role. CSV file can have optional number of columns, role, description, and attribute columns are specified in setup of LRT.
Create new LongRunningTask
Now we will create the new LongRunningTask (LRT). As shown in the picture, go to Settings → Task scheduler → Scheduled tasks and hit green "Add" button to add new LRT.
Fill all attributes
Now we need to create new LRT with these attributes:
- Task type - ImportRolesFromCSVExecutor - Import csv file - dropzone to select or drop csv file - Column with roles - Name of the column with roles in csv file - Column with description - name of the column with role description, can be also used to update description - Column with attributes - name of the column with role attributes, can be also used to update attributes - Form definition code - the code for the definition which will contain the added attributes - Column separator - separator of columns in csv file (default ; ) - Multi value separator - (Char, default: new line) separator of multi valued role names in the csv file, new line separator is default export from excel, but for better clarity of csv file, it's recommended to use some symbol instead - System name - name of the system to connect with roles - MemberOf attribute name - ( default: rights ) - name of multi valued attribute for merge, attribute named "rights" is automatically created on every virtual system, but you can create your own and change setup of LRT - Can be requested - ( Boolean ) - Fills can be requested, can be also used to update already imported settings
Run the task
Now we just need to hit run.
You can check the status of the created roles in the "all tasks" panel in the task detail. Here you can find information about roles created, updated, or already existing.
At this point, everything should be set up and when the task ends, roles are imported in IdM with their attributes, placed in the catalogue named by the system name.
Known issues
If you delete or upload new file via dropzone, you should delete old files, created from previous uploads.