Previous Topic: set view Command—Define a View

Next Topic: shutdown Command

Views Parameters

You use a views parameter inside the set view command to specify a placeholder for a string. The DSA will determine the value of the views parameter when the view is invoked or after the DSA has run an earlier phase within the view.

The syntax of a views parameter is as follows:

[$][phaseNumberList:]attributeName[substringIdentifier]

Example: View Parameter $cn

When the view is invoked, the DSA replaces the example string with the value of the cn attribute provided in the filter of the search command that was used to invoke the view.

In this example, the search is invoked with the following command:

ldapsearch... (cn="Smith, John")

The $cn is replaced with the following value:

Smith, John

Example: View Parameter $cn[,:1]

When the view is invoked, the DSA replaces the example string with the characters preceding the first comma in the value of the cn attribute.

In this example, the search is invoked with the following command:

ldapsearch... (cn="Smith,John")

The $cn[,:1] is replaced with the following value:

Smith

Example: $cn[7]

When the view is invoked, the DSA replaces the example string with the first seven characters in the value of the cn attribute.

In this example, the search is invoked with the following command:

ldapsearch... (cn="Smith,John")

The $cn[7] is replaced with the following value:

Smith,J

Example: $3:cn

Immediately after running phase three of the view, the DSA replaces the example string with the value of the cn attribute returned by phase three. The example string is only valid in phases four and later.

Example: $2,3:cn

Using $2,3:cn in the following example uses $2:cn or $3:cn depending on which phase was invoked.

if ( condition )
{ (phase = 2) }
else
{ (phase = 3) }

Example: subtree= $1:dn

...
(phase=2
subtree = $1:dn
...

This is a fragment of a set view command. Immediately after running phase one, the DSA replaces the string $1:dn with the value of the DN of each search result returned in phase one. If phase one returns multiple DNs, then phase two is run multiple times—once for each DN result returned from phase one.

Example: subtree= $1:dn[3]

...
(phase=2
subtree = $1:dn[3]
...

This is a fragment of a set view command. Immediately after running phase one, the DSA replaces the string $1:dn[3] with the value of the first three RDNs of the DNs of each search result returned in phase one. If phase one returns multiple DNs, then phase two is run multiple times—once for each DN result returned from phase one.

Example: subtree="uid=$1:uids,o=Democorp,c=AU"

...
(phase=2
subtree="uid=$1:uids,o=Democorp,c=AU"
...

This is a fragment of a set view command. Immediately after running phase one, the DSA replaces the string $1:uid with the value of 'uids returned by the phase one search. If phase one returns multiple DNs, then phase two is run multiple times: once for each DN result returned from phase one.

For example, if phase returns 12345 for the value of uid, then this fragment is exactly equivalent to the following:

...
(phase=2
subtree="uid=12345,o=Democorp,c=AU"
...


Copyright © 2009 CA. All rights reserved. Email CA about this topic