DN Representation
This chapter describes how to configure the representation of distinguished names (DNs) within Web Center.
Overview
Web Center distinguishes between a normal DN representation and a short form.The short form is used to save space when rendering role parameter values of type DN or hierarchical DN in tables and read-only fields.
The representations are controlled by a set of configuration parameters defining the name parts to be included, the delimiters between name parts, whether to include name part types (like cn and ou) etc.
The name parts to be included may be overridden per renderer or per form property.
The configurable representations include:
cn=Taspatch Nik,ou=Global IT,o=My-Company,cn=Users,cn=My-Company Taspatch Nik, Global IT, My-Company, Users, My-Company Taspatch Nik, Global IT, My-Company /cn=Users/o=My-Company/ou=Global IT/cn=Taspatch Nik Users --> My-Company --> Global IT --> Taspatch Nik
Configuration
The configuration parameters are defined in two files, one of which is evaluated in the browser while the other one is utilized on the server.
Client-Side Configuration
The configuration parameters in the Javascript file resources/build/config/config.js are evaluated by Javascript code running in the browser.The parameters control the representation of DNs in the user interface.
Configuration Parameters
The parameters are stored in section dn:
-
delim – String; the delimiter between adjacent nodes; default: ", ".
-
excludeTopNodes – Number; the number of top nodes to be excluded from the representation; default: 1.
-
oldStyle – Boolean; whether to use the traditional DN representation; if true all other configuration parameters are ignored; default: false.
-
prefix – String; a prefix for the representation; default: the empty string.
-
reversed – Boolean; whether to list the nodes in reversed order (from top to bottom); default: false.
-
types – Boolean; whether to display name part types; default: false.
Additional parameters controlling the short DN representation are stored in subsection shortForm.
-
ellipsis – String; an appendix to the representation indicating an abbreviated form; default: " …".
-
includeNodes – A number array; the nodes to be included in the representation (for details see below); default: [0,1].
Parameter includeNodes
The value for parameter includeNodes is a number array of length 1 or 2:
-
[bottomIndex] – The representation includes all name parts from the bottom index to the topmost name part.
-
[bottomIndex,topIndex] – The representation includes all name parts starting from the bottom index and ending just before the top index.
The index of the bottommost node is 0. Negative indexes indicate offsets from the top; -1 denotes the topmost name part.
Samples:
-
[0] – All name parts.
-
[1] – All name parts besides the first one, which gives the parent DN.
-
[0,1] – Just the first node.
-
[0,-1] – All nodes besides the topmost one.
Parameter Evaluation Order
-
Apply parameter excludeTopNodes.
-
Apply parameter includeNodes.
-
Apply parameter reverse.
-
Apply parameters delim and prefix.
The other parameters are order independent.
Samples
Sample DN:
cn=Taspatch Nik,ou=Global IT,o=My-Company,cn=Users,cn=My-Company.
-
The default configuration:
-
dn.delim: “, “
-
dn.excludeTopNodes: 1
-
dn.prefix: “”
-
dn.reversed: false
-
dn.types: false
-
dn.shortForm.ellipsis: “…”
-
dn.shortForm.include: [0,1]
The DN representation is
Taspatch Nik, Global IT, My-Company, Users.The abbreviated DN representation is
Taspatch Nik ... -
-
A customized configuration:
-
dn.delim: “/“
-
dn.excludeTopNodes: 2
-
dn.prefix: “/”
-
dn.types: true
-
dn.reversed: true
-
dn.shortForm.ellipsis: “”
-
dn.shortForm.includeNodes: [0,-1]
The DN representation is
/o=My-Company/ou=Global IT/cn=Taspatch Nik.The abbreviated DN representation is
/ou=Global IT/cn=Taspatch Nik. -
-
The old-style configuration:
-
dn.oldStyle: true
DN and abbreviated DN representation are
cn=Taspatch Nik,ou=Global IT,o=My-Company,cn=Users,cn=My-Company. -
Server-Side Configuration
The configuration parameters in the file WEB-INF/config/webCenter.properties are evaluated by Web Center code running on the server. The parameters control the representation of DNs in export files.
Renderer Configuration
Some DN renderers allow for overriding the globally defined value for the includeNodes parameter.
Affected Renderers
The includeNodes option is evaluated by the renderer snippets
-
dn.htm
-
dnList.js
-
roDN.js
The option is not supported by the renderer snippet
-
dn.js
The renderers based on the listed snippets are
-
dn – The renderer is used for single-valued DN form fields. It is based on the snippets dn.htm and dn.js.
-
dnCombobox – The renderer is used for role parameter values of type hierarchical DN. It is based on the snippets dn.htm and roDN.js.
-
dnList – The renderer is used for multi-valued DN properties like role owner. It is based on the snippets roStringList.htm and dnList.js.
-
roDN – The renderer is used for read-only form fields like parent folder of a role. It is based on the snippets dn.htm and roDN.js.
Renderer Parameter
-
includeNodes – A number array; the nodes to be included in the representation (for details see configuration file config.js).
Sample
<renderer id="roDN"
defURL="/WEB-INF/snippets/dn/dn.htm"
jsURL="/WEB-INF/snippets/dn/roDN.js">
<renderer-property name="includeNodes" value="[0]"/>
<renderer-property name="link" value="false"/>
</renderer>
Form Property Configuration
Form properties rendered by one of the renderers listed above allow for overriding the includeNodes parameter value defined for the renderer.
The includeNodes option can be passed from the form property to the renderer via the form property attribute rendererProperties that serves to set renderer properties in a generic way.
Individual DN Representations
In some situations it’s preferable to render a distinguished name in a way different from the default representation.
Single-valued DN attributes
For single-valued DN attributes, Web Center provides the renderer path.The renderer lets you define
-
delim – The name part delimiter; default: /.
-
includeNodes – The name parts to include; default: [0].
-
reversed – Whether to display the name parts in reverse order; default: true.
-
link – When used to render a DN in a table column: Whether clicking a DN opens the entry displayed in the table row. Default: false.
The default values are assigned to the properties of the renderer in file renderers-config.xml.
The renderer can be used to display single-valued DN attributes in form fields or table columns. Editing attributes is not supported.
Multi-valued DN attributes
For multi-valued DN attributes, Web Center provides the renderer pathList. The renderer let’s you define
-
itemRenderer – The id of the underlying single-valued DN renderer; default: path.
The renderer can be used to display multi-valued DN attributes in form fields. Displaying attributes in table columns and editing attributes is not supported.
Note that you cannot overwrite the properties of the underlying renderer (delim, includeNodes, reversed) via properties of the pathList renderer or the rendererProperties attribute of the form properties. All you can do is assign a customized copy of the path renderer as item renderer.