Hi Soisik,

as you can see I don't know much about java .... ;-(

I changed it to
 <propertiesBasedSyncOptions>
                                <mainIdentifier>"uid=" + 
srcBean.getDatasetFirstValueById("uid") + 
",ou=people,dc=ppi,dc=org"</mainIdentifier>
                                <defaultDelimiter>;</defaultDelimiter>
                                <defaultPolicy>FORCE</defaultPolicy>
                                <conditions>
                                        <create>false</create>
                                        <update><![CDATA[rjs:
                                                var update = false;
                                                if ( 
srcBean.getDatasetFirstValueById("uid").equals("mar")) {
                                                        update = true;
                                                }
                                                update;
                                        ]]></update>
                                        <delete>false</delete>
                                        <changeId>false</changeId>
                                </conditions>
                                <dataset>
                                        <name>gecos</name>
                                        <policy>FORCE</policy>
                                        <forceValues>
 <string>srcBean.getDatasetFirstValueById("gecos")</string>
                                        </forceValues>
                                </dataset>
                        </propertiesBasedSyncOptions>

But again a dry run said 

Nov 05 09:27:31 - INFO  - All entries: 949, to modify entries: 0, 
successfully modified entries: 0, errors: 0

Will a dry run perhaps always show only this message ?

Regards

Martin



Von:    "Soisik Froger" <[email protected]>
An:     [email protected]
Datum:  05.11.2018 07:32
Betreff:        Re: [lsc-users] Antwort: Re: Antwort: Re: Antwort: Re: 
Antwort: Re: NIS plugin and filtering
Gesendet von:   "lsc-users" <[email protected]>



On 02/11/2018 12:19, Martin Röh wrote:
>   <update><![CDATA[rjs:
>                                                 var update = false;
>                                                 if ( 
srcBean.getDatasetFirstValueById("uid") == "mar" ) {
>                                                         update = true;
>                                                 }
>                                                 update;
>                                         ]]></update>
Hi Martin,

In java, using "==" on a string will compare the memory address of the 
object.

To compare chars, your have to use equals method, eg 
srcBean.getDatasetFirstValueById("uid").equals("mar")

Regards

-- 
Soisik Froger 
Worteks | https://www.worteks.com
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org

lsc-users mailing list
[email protected]
https://lists.lsc-project.org/cgi-bin/mailman/listinfo/lsc-users

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

lsc-users mailing list
[email protected]
https://lists.lsc-project.org/cgi-bin/mailman/listinfo/lsc-users

Reply via email to