AttributeExtractor: remove leading/trailing whitespace created by formatter
Basics
Technical
Logistics
Basics
Technical
Logistics
Description
Given a Metadata AttributeExtractor like that:
and ContactPerson entries in metadata containing only a SurName or only a GivenName (which seems to be a common way of specifying the name for a role account, taking into account that Good Practice as well as e.g. eduGAIN recommend use of Role accounts instead of personal accounts in ConcactPerson elements) the resulting formatted Attribute would look something like that:
with a leading (or trailing, in case of missing SurName) blank, introduced by above formatter (so clearly it's the admins choice; here the admin coulld have split "Technical" and "Support" into Given and SurName but that's both unattainable on a global scale and might not always be possible when there's only one word-like component).
Could the metadata attribute extractor (in the formatting stage) remove any leading and/or trailing blanks (or whitespace)? Of course there could be anything put into the formatter by the admin but removing whitespace shouldn't do any harm here, I would hope.
Reviewed code base. Most of the new extraction features are already trimming data. Identified a pair of common exceptions in the ExtensibleAttribute and NameIDAttribute serialization logic, which is where those formatter strings get applied. I added automatic trimming there.
Also added trimming in the new resolver plugins that are likely to introduce whitespace when combining attributes.
I note that the specific example given is not something the code can look into. It doesn't know that your formatting string has an internal need for trimming inside itself.
It might be possible to pull that off with some kind of combination of extraction and Transform resolver steps.
Scott Cantor July 5, 2012 at 9:53 PM
Including time in estimate to cover the other plugins so I can create a uniform option.
Fixed
Pinned fields
Click on the next to a field label to start pinning.
Given a Metadata AttributeExtractor like that:
and ContactPerson entries in metadata containing only a SurName or only a GivenName (which seems to be a common way of specifying the name for a role account, taking into account that Good Practice as well as e.g. eduGAIN recommend use of Role accounts instead of personal accounts in ConcactPerson elements) the resulting formatted Attribute would look something like that:
with a leading (or trailing, in case of missing SurName) blank, introduced by above formatter (so clearly it's the admins choice; here the admin coulld have split "Technical" and "Support" into Given and SurName but that's both unattainable on a global scale and might not always be possible when there's only one word-like component).
Could the metadata attribute extractor (in the formatting stage) remove any leading and/or trailing blanks (or whitespace)? Of course there could be anything put into the formatter by the admin but removing whitespace shouldn't do any harm here, I would hope.