Previous Topic: Set Up Views

Next Topic: Ways to Use Views

About Views

A view lets you make a series of searches on a directory, and have the results returned together. Each phase of the search can use the results from previous phases as its inputs.

A view provides a virtual abstraction of directory data. This enables LDAP applications to view the data in a way that matches the needs of the application, similar to the way that database views are used in RDBMS systems. You define a view to the DSA process and can then invoke it multiple times.

Sometimes you need the results from one search to use as input to another one, and you may also need to include the results of multiple searches to get the result you need. A view helps in such situations because it gives you a way to define a single complex search that combines a number of ordinary LDAP searches. The searches can be performed across multiple DSAs, and a search can use the results of earlier searches in the view.

A view is a complex command, which can be stored in a configuration file. When you need to use a view you search the directory, invoking the view in the search command. The directory carries out the search, including the phases defined in the view. When the searches are all complete, it return the results in a single response.

Some advantages of views are as follows:

Example: A View Used by a Pay TV Company

In this example, the directory for a pay TV company stores information about devices, subscribers, the packages they subscribe to, and the services included in each package in separate places in the DIT:

The DIT in this example includes information held in four different locations of the tree

The structure of this directory makes it simple for staff to navigate, but it is not easy to find information about the services associated with a particular device.

The following diagram shows the series of searches required to find out the channels being served to a particular device:

A view includes phases, and the result from each phase can be used in the next phase

You can define a view so that a search for a device's MAC address can return the channels available on the device.

The following diagram shows the results of such a search:

Example view, showing the results from each phase being used as inputs for the next phase

Compare Views to Stored Procedures in a Database

Views allow relational concepts (well understood in databases) to be possible in directories, which have always been associated with fixed schemas and hierarchies.

This table compares views in CA Directory with stored procedures in databases:

Stored Procedure in a Database

View in CA Directory

A database application queries a stored procedure using its name

A directory application queries a view using its name (DN)

The SQL query to the stored object may have parameters (via the Where clause)

The LDAP query to the view object may have parameters (via the filter)

The stored procedure executes all instructions which may be conditional and/or branching etc.

The view template gets executed, invoking each phase which may be conditional and/or branching etc.

The stored procedure returns all/selected/pruned results

The View returns all/selected/pruned results

Limitations of Views

Views have the following limitations: