Issue #212 has been updated by Rémy-Christophe Schermesser.
YES ! That is a great idea.
What about *update_not_exists_value* ?
You can do it like that in Javascript :
<pre>
lsc.syncoptions.task.myAttribute.action = F
lsc.syncoptions.task.myAttribute.default_value = var result = ""; \
if(srcBean.getAttributeValueById("myAttribute") != "") { \
result = srcBean.getAttributeValueById("myAttribute"); \
} else { \
result = dstBean.getAttributeValueById("myAttribute"); \
} \
result;
</pre>
----------------------------------------
Feature #212: Parameter to update a destination attribute only if there is a
non-empty value from source, default values, etc
http://tools.lsc-project.org/issues/show/212
Author: Jonathan Clarke
Status: New
Priority: Normal
Assigned to:
Category: Core
Target version: Sometime in the future
When setting up syncoptions to update attributes in the destination, we have a
choice of "Keep"/"Force"/"Merge" and "create"/"default"/"force" values (these
are described in
http://lsc-project.org/wiki/documentation/1.2/configuration/syncoptions).
If you use force_value or default_value to lookup a string from your source, it
will then replace any values in the destination. This includes the case when
the source attribute is empty, then the attribute in the destination is
deleted. For example :
|_. ID |_. Source |_. Force value |_. Destination |_. What happens |
| 1 | someAttr: "TEST" | srcBean.getAttributeValueById("someAttr") | someAttr:
"OLD" | Replace "OLD" with "TEST" |
| 2 | someAttr: "TEST" | srcBean.getAttributeValueById("someAttr") | someAttr:
<empty> | Add someAttr: "TEST" |
| 3 | someAttr: <empty> | srcBean.getAttributeValueById("someAttr") | someAttr:
"OLD" | Delete "OLD" |
However, sometimes you may want to update a value in the destination *ONLY IF*
you have a value from the source. So, I would like to be able to say "for cases
1 & 2: do the same, but in case 3: don't delete destination value if source
value is empty".
Of course, this can be acheived with some JavaScript if conditions... but it's
a pain to repeat this all time! I think a new _something__value or a new
"action" would be useful.
Any thoughts on this? Would this be useful for you? What would we call it?
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://tools.lsc-project.org/my/account
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org
lsc-dev mailing list
[email protected]
http://lists.lsc-project.org/listinfo/lsc-dev