Hello,
First, thanks for all the replies. I'm not sure why the various
suggestions didn't work as expected, unless it is the version of idp
software we are using (2.4.0).
Given that our LDAP attribute extensionAttribute1 was seen as an
'object', I tried printing out its properties:
for (key in extensionAttribute1) {
logger.debug("EA1 property key: " + key + " has value: " +
extensionAttribute1[key]);
}
This showed the property 'values'. It was another object, but seemed to
indicate whether a value was present or not.
Getting the properties of 'values' showed the function 'isEmpty()' and
the property 'empty'. This was set to true if there was no value, and
false if a value was present. Exactly what I wanted :-)
So, our test condition is now:
if (typeof extensionAttribute1 != "undefined" &&
extensionAttribute1.getValues().isEmpty() === false) {
...
I left the 'typeof' condition in there just in case things change, and
it becomes undefined.
John.
--
John Horne Tel: +44 (0)1752 587287
Plymouth University, UK Fax: +44 (0)1752 587001
|