LDAP or SQL connections and queries
This extension allows the webmaster to defines connections to SQL databases or LDAP directories, and to define associated requests to get information from those connections, so the contributor can use them in his rich content.
The defined request must be written according to the SQL or LDAP syntax (depending on the data source associated). Kknowledges on these technologies are required to be able to create queries.
Samples of requests :
- get the list of teachers and their contact
- get the list of staff in a service
- get the phone number of secretariat
Sample
LDAP connection
To add a LDAP connection you must enter the following parameters:
- the name of the connection
- the URL of LDAP server
- the search filter (ex: objectClass=eduPerson)
- the scope of search (object, one or sub level)
- the administrator DN
- the administrator password
- the authentication method (anonymous or simple)
- use ssl protocol
SQL connection
To add a SQL connection you must enter the following parameters:
- the name of the connection
- the SQL driver (ex: com.mysql.jdbc.Driver for MySQL, org.apache.derby.jbc.EmbeddedDriver )
- the database URL (ex: jdbc:mysql://myserver/base)
- the user login to connect to database
- the user passwords to connect to database
LDAP requests
To add a LDAP request, select the LDAP connection and click on 'New query'
In dialog box, set :
- the unique name for the query
- a descriptionn sufficiently clear to facilitate its use, especially when the query is parameterized
- the result type : simple to insert simple result in a the inline text or multiple to insert multiple result in a table
- the name of the LDAP attributes to list, separated by commas. To use a different label for the display, enter the display name in brackets :
givenName[Lastname],sn[Firstname],mail[E-Mail address]
- an optional constraint which can be parametrized.
Constraint not configurable:
(mail=*.com)
Constraint configurable
(supannAffectation=${affectation})
SQL requests
To add a SQL request, select the SQL connection and click on 'New query'
In dialog box, set :
- the unique name for the query
- a descriptionn sufficiently clear to facilitate its use, especially when the query is parameterized
- the result type : simple to insert simple result in a the inline text or multiple to insert multiple result in a table
- the SQL request
SQL query not configurable:
SELECT firstname AS 'Firstname', lastname AS 'LastName', mail AS 'E-Mail address', service FROM Staff
SQL query configurable:
SELECT firstname AS 'Firstname', lastname AS 'LastName', mail AS 'E-Mail address' FROM Staff WHERE service=${service}