Note | ||
---|---|---|
| ||
The content below is for Apache Syncope <= 1.2 - for later versions the Reference Guide is available. |
Table of Contents | ||
---|---|---|
|
Introduction
The Scripted SQL connector provides a lot of great flexibility in the interaction with a database resource. There is one script A different Groovy script can be configured for each type of operation.
This wiki page shows all the steps needed to configure a Scripted SQL resource identified by the following connection parameters:
...
- Download JDBC driver (MySQL JDBC driver in this case) and include it into your JEE container classpath.
- Install OpenICF ScriptedSQL connector bundle.
- Implementation of Implement custom groovy SQL scripts.
Configuration steps
Install OpenICF ScriptedSQL connector bundle
Note | ||
---|---|---|
| ||
A bug in the current stable version of this connector bundle makes |
Scripted SQL connector bundles can be added at run-time just performing the following two steps.
- Download Scripted SQL connector bundle JAR file from OpenICF site
- Copy downloaded JAR file into the connector bundles directory specified into the configuration parameter
bundles.directory
Implementation of custom Groovy SQL scripts
Every action script receives a set of parameters and an attribute map. The set of parameters varies for each action.
Configuration steps
Configure Scripted SQL connector instance
Please, use Use this page as example for your configuration.
- Open your browser and access to the Syncope administration console (http://host:port/syncope-console).
- Log into the interface by providing the following credentials:
- Login: admin
- Password: password
- Click on the Resources tab.
- Click on the Connectors sub-tab.
- Click on Create new Connector button (configuration modal page appears).
- Click on tab General.
- Provide Display name (e.g. 'Sql Scripted Connector').
- Select the correct Bundle name (org.forgerock.openicf.connectors.scriptedsql.ScriptedSQLConnector).
- Select the correct Bundle version (1.1.0.1).
- Click on tab Configurations and provide connector instance configuration.
User: root
Password: password
Host: localhost
TCP Port: 3306
Database: HR
JDBC Driver: com.mysql.jdbc.Driver
JDBC Connection URL: jdbc:mysql://%h:%p/%d
clearTextPasswordToScript: true
reloadScriptOnExecution: true
createScriptFileName: /opt/scriptsql/groovy/CreateScript.groovy
updateScriptFileName: /opt/scriptsql/groovy/UpdateScript.groovy
deleteScriptFileName: /opt/scriptsql/groovy/DeleteScript.groovy
searchScriptFileName: /opt/scriptsql/groovy/SearchScript.groovy
syncScriptFileName: /opt/scriptsql/groovy/SyncScript.groovy
- Click on tab Capabilities.
- Check needed capabilities as shown at Connector instance configuration.
- Click on Save button.
Configure Scripted SQL resource
- Click on the Resources tab.
- Click on the Resources sub-tab.
- Click on Create new Resource button (configuration modal page appears).
- Click on Resource Details tab.
- Choose from the list the correct Connector instance name.
- Provide the following information
- Name: Sql Scripted Resource
- Connector: Sql Scripted Connector
- Click on Schema Mappings tab.
- Click on Add button to insert attributes mapping.
- Click on Save button.
Panel | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
Implementation of custom groovy SQL scripts
Every action script receives a set of parameters and an attribute map. The set of parameters varies for each action.
...