[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
add rich data into attribute type definition possible?
GUI explains to the end user what each field is about, by reciting DESC of
olcAttributeTypes - this design seems passable, after all, DESC is intended
to describe the attribute type. This method worked for years.
Now user base grows, there are speakers of different languages. It is
required the field being described in multiple languages.
Had DESC been like the 'description' attribute type, an attribute type
defined in RFC2256, then I would be able to use language modifier:
description: Weight, in kg. It is used to screen health problems.
description;lang-zh: 体重,用于检查健康问题。
But it is not.
I can see only two ways to workaround the problem:
1. Extend DESC. This look ugly but simple:
... NAME 'ibmWeight' DESC 'Your weight, in kg. It is used to screen health
problems.|lang-zh: 您的体重,用于检查健康问题。' ...
The application would read DESC, split it by vertical-bars, find the
langauge that matches the users's and only display that part.
2. Build a shadow entry for every attributeType:
dn: olcAttributeTypes=ibmWeight,cn=shadowAttributeTypes,dc=ibm,dc=com
objectClass: ibmShadowAttributeType
olcAttributeTypes: ibmWeight
description: Weight, in kg. It is used to screen health problems.
description;lang-zh: 体重,用于检查健康问题。
and laboriously manually update shadow attribute entry when user add or
modify existing olcAttributeTypes.
What do you think? How can such a need can be solved?
Thanks in advance!
P.S. === about openldap's choice of design ===
When a few years ago I learned that
a attribute type is defined by adding an olcAttributeTypes attribute
my first reaction was, why not design it in such a way, that
a attribute type is defined by adding an olcAttributeType *entry*?
Like this:
--> objectClasss: olcAttributeType
--> olcAttributeName: ibmWeight
--> description: Weight, in kg. It is used to screen health problems.
--> description;lang-zh: 体重,用于检查健康问题。
The advantage, is to allow extension and inheritance. e.g. the following
example has olcConstrainedAttributeType which inherits olcAttributeType
--> objectClasss: olcAttributeType
++> objectClasss: olcConstrainedAttributeType
--> olcAttributeName: ibmWeight
--> description: Weight, in kg. It is used to screen health problems.
--> description;lang-zh: 体重,用于检查健康问题。
++> olcConstraintRegex: [0-9.][0-9.]kg
For usability reasons, some developer may as well add jpegPhoto into
attribute type definition.