Le 21/06/2017 à 12:38, Alexander Herr a écrit :

Well Clément, you are absolutely right of course. In the end, I forgot to split my returned string into an array, so of course this didn’t work. So thanks for clarifying!

But if I may be so bold and suggest an improvement:

The schema for the valuesType is too ambiguous, imho, and I blame it a bit that I came to my conclusion. One of the datasets I’d like to use for comparison here is `description`:

<dataset>

<name>description</name>

<policy>FORCE</policy>

<forceValues>

      <string>srcBean.getDatasetValuesById("description")</string>

</forceValues>

</dataset>

This translates into what I have in my initial mail. What you describe was my initial thought, so I looked into the schema of the lsc.xml (`lsc-core-2.1.xsd`) and forceValues is of type valuesType which is defined as:

<xsd:complexType name="valuesType">

<xsd:sequence>

<xsd:element name="string" type="xsd:string" minOccurs="0"

maxOccurs="unbounded" />

</xsd:sequence>

<xsd:attribute name="id" type="xsd:string" use="optional" />

</xsd:complexType>

That means only <string> is allowed. So whatever you pass into your forceValues (even arrays, as noted above) are interpreted as a string, delimited by a “;”. At least this is how I understand it. The obvious “fix” would be to include an element called `array`, that can – for all intents and purposes – behave absolutely the same under the hood, but would semantically distinguish between the two use cases. But really, just humble food for thought. J

On a related note, `description` is a very mean example for this in the AD-world. Seems that even though the AD-schema allows multiple values, the AD-system does not, so it throws with an error code 20 when trying to add multiple description.* Threw me off, too, so that influenced my conclusion as well. ;)


You are talking about XML schema which is only used to validate the syntax of the configuration file. It has nothing to do with values managed by LSC.

LSC is clever enough to understand that depending on the return value of the dataset, it will sync only one value or multiple value.

Concerning AD and the "description" attribute, it means that you need to adapt your JS code to return a string, to for LSC to push a single value. Else it will return multiple values.


--
Clément OUDOT
Consultant en logiciels libres, Expert infrastructure et sécurité
Savoir-faire Linux
137 boulevard de Magenta - 75010 PARIS
Blog: http://sflx.ca/coudot

_______________________________________________________________
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