Hi, I have two doubts about lsc capabilities.

I'm trying to synchronize an ldap source with a jdbc destionation. The
destination is a MYSQL and I'm trying to populate mysql.user table.

1)
I'm able to to the synchronization but the "User" field is a Char(16). In
the source configuration I want to use the ldap attribute "fullName" as
pivotAttribute.  To create all the user entries I have to force the values
and insert only the first 16 chars.

<dataset>
<name>fullName</name>
<policy>KEEP</policy>
<forceValues>
<string>
var result = "";
if (srcBean.getDatasetFirstValueById("fullName").length() > 15) result =
srcBean.getDatasetFirstValueById("fullName").substring(0,16);
else result = srcBean.getDatasetFirstValueById("fullName"); result;
</string>
</forceValues>
</dataset>
<dataset>

This works as expected but then if i launch a second time the "lsc -s all",
the process compare the entire fullName as pivot attribute and retry to
create the trimmed entry, giving error.

Is there any way to manipulate the pivotAttribute before comparing it with
the destination source?

My SqlMap

<sqlMap namespace="InetOrgPerson">
<select id="getInetOrgPersonList" resultClass="java.util.HashMap">
<!-- SELECT pers.User AS id -->
SELECT User AS fullName FROM user
</select>
<select id="getInetOrgPerson" resultClass="java.util.HashMap" parameterClass
="java.util.Map">
SELECT User as fullName, Password as userPassword FROM user WHERE User =
#fullname#
</select>
<insert id="insertInetOrgPerson" parameterClass="java.util.Map">
INSERT INTO user
(Host,User,Password,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Reload_priv,Shutdown_priv,Process_priv,File_priv,Grant_priv,References_priv,Index_priv,Alter_priv,Show_db_priv,Super_priv,Create_tmp_table_priv,Lock_tables_priv,Execute_priv,Repl_slave_priv,Repl_client_priv,Create_view_priv,Show_view_priv,Create_routine_priv,Alter_routine_priv,Create_user_priv,Event_priv,Trigger_priv,ssl_type,ssl_cipher,x509_issuer,x509_subject,max_questions,max_updates,max_connections,max_user_connections)
VALUES
('localhost',#fullname#,"defaulthashedpassword",'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','','0','0','0','0')
</insert>
<update id="updateInetOrgPerson" parameterClass="java.util.Map">
UPDATE user SET Password=PASSWORD(#userpassword#) WHERE User=#fullname#
</update>
<delete id="deleteInetOrgPerson" parameterClass="java.util.Map">
....
</delete>
</sqlMap>

I know this isn't a best practice because username should be unique and a
truncation can generate multiple associations with the same mysql user, but
this is only for test purpose


2) during the update, I'm not able to instruct a "FLUSH PRIVILEGES" command
to mysql via lsc. Is there any way to send it via lsc? Should I write a
stored procedure in mysql? But in this case, is lsc able to handle stored
procedure calls?


Thanks in advance for any help

     Natan
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org

lsc-users mailing list
[email protected]
http://lists.lsc-project.org/listinfo/lsc-users

Reply via email to