[midPoint] Scripted SQL Connector

Ivan Noris ivan.noris at evolveum.com
Wed Mar 16 15:36:37 CET 2016


Hi Stephen,

could you please also share the resource XML? (Anonymized if needed).
Thank you.

Regards,
Ivan

On 03/16/2016 03:03 PM, Stephen Barker wrote:
> Hi All,
>
> I could use some help with the scripted SQL Connector.
>
> I am using midpoint 3.3 and the scripted connector from
> net.tirasa.connid.bundles.db.scriptedsql.ScriptedSQLConnector.
>
> I have created a very simple schema and search script of which I can
> see the schema script is working well. When I go to "Accounts" though
> in the List Resources menu I get the error:
>
> 2016-03-16 08:28:58,305 [MODEL] [http-bio-8080-exec-7] ERROR
> (com.evolveum.midpo
> int.model.impl.controller.ModelController): Couldn't search objects in
> provision
> ing, reason: Generic error in the connector:
> org.identityconnectors.framework.co
> mmon.exceptions.ConnectorException(Search script
> error)->groovy.lang.MissingProp
> ertyException(No such property: midpoint for class: Script1) (class
> com.evolveum
> .midpoint.util.exception.SystemException)
>
>
> My search script is pretty simple basically just returning all results
> from a table.
>
> I'll include the contents at the bottom of this email.
>
> What am I missing in getting this set up?
>
> -----
> SEARCH SCRIPT
> -----
>
> import groovy.sql.Sql;
> import groovy.sql.DataSet;
> import groovy.text.SimpleTemplateEngine;
>
> log.info("Entering " + action + " Script");
>
> def sql = new Sql(connection);
> def result = []
> def where = "";
>
> if (query != null){
>
> //To implement...
>
> }
>
> switch ( objectClass ) {
>
> case "__ACCOUNT__":
>   sql.eachRow("SELECT * from identity",
> {result.add([__ENABLE__:true,__UID__:it.id, __NAME__:it.uin,
> uin:it.uin)} );
>   break;
>
> case "__GROUP__":
>   log.info("Search Group");
>   break;
>
> default:
>   result;
> }
>
> return result;
>

-- 
  Ing. Ivan Noris
  Senior Identity Management Engineer & IDM Architect
  evolveum.com                     evolveum.com/blog/
  ___________________________________________________
  "Semper ID(e)M Vix."




More information about the midPoint mailing list