[midPoint] Scripted SQL Connector

Stephen Barker sbarker at illinois.edu
Wed Mar 16 15:03:38 CET 2016


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;

-- 
Thanks,
Stephen Barker
Senior Software Engineer - AITS
sbarker at uillinois.edu
265-0942
--
"we tend to be masters of our own fate, the only thing that stops us 
from doing really cool things is time." -- Monty Oum



More information about the midPoint mailing list