This extension implements a Sync Source which can be used to detect and synchronize changes from CSV files in a given directory, by default source-dir or as defined by the source-dir argument. The extension will look for any files with the .csv extension and interpret each row to be a single entry to be synchronized. After a file has been completely processed, it will be moved to a separate directory, by default csv/processedas defined by the processed-dir argument.
For the sake of simplicity, the columns in the files should be LDAP attributes (for example cn, sn, givenName, etc). This would avoid the need for attribute mapping in the sync class. If the first line does not contain attribute names valid at the destination then mapping will be necessary.
The first line (CSV header) must contain the attribute names, NOT data and the first column must always be the same attribute, by default 'id' or as defined by the rdn-attribute argument.
The DN for the entries will be constructed as follows by default dn: rdn-attribute={rdn-attribute}
If the base-dn argument is provided, then entry DNs will be construct as dn: rdn-attribute={rdn-attribute},{base-dn}
Each row in a CSV file is expected to have values for all of the LDAP attributes, not just those that have changed. Note that in almost all cases, a DN map will be required on the sync class to be able to place entries built from the CSV file at the proper location at the destination.
No arguments are required, all defaults should work out of the box while preserving the ability to customize them.
Allowed Arguments
Argument Name: | source-dir |
Description: | The file system directory to monitor for CSV files |
Data Type: | Directory Path |
Is Required: | false |
Maximum Occurrences: | 1 |
Argument Name: | processed-dir |
Description: | The file system directory where the extension should move CSV files after it finishes processing them |
Data Type: | Directory Path |
Is Required: | false |
Maximum Occurrences: | 1 |
Argument Name: | object-class |
Description: | One or more objectClasses to build a corresponding entry for each CSV row |
Data Type: | String |
Is Required: | false |
Maximum Occurrences: | 2147483647 |
Argument Name: | rdn-attribute |
Description: | The name of the RDN attribute to build entries constructed from source CSV data (Default: id) |
Data Type: | String |
Is Required: | false |
Maximum Occurrences: | 1 |
Argument Name: | base-dn |
Description: | The base DN to use for entries in the CSV files |
Data Type: | LDAP Distinguished Name |
Is Required: | false |
Maximum Occurrences: | 1 |