Views

The template engine is based on the concept of views. In practice, all web-based digital repository systems offer several common views, interconnected by hyperlinks. These views, and the linkages between them, are what support convenient access to the information contained in the system. The dmBridge view architecture is illustrated in Figure 7.1, “The finding process in dmBridge”. The orange ellipses in this figure represent user intent, and the blue boxes represent concrete views.

Figure 7.1. The finding process in dmBridge

The finding process in dmBridge

An explanation of each view follows.

Error view

Error view is displayed automatically in place of any of the other views when there is an unrecoverable fatal error. Enabling debug mode in config.ini will display more information about the error.

Favorites view

Favorites view is a subset of results view that displays a user's favorites. Because it inherits from results view, it has the same display options (e.g. list, grid, tile). It adds checkboxes and a "Remove From Favorites" button.

The dmBridge favorites are stored in the same cookie as the default CONTENTdm® favorites, so changes made to the favorites in dmBridge will show up in the default CONTENTdm® templates, and vice versa.

Favorites view only displays those objects to which the user has access from the current template set. If two template sets (A and B) exist, and neither has access to any of the collections accessible by the other, neither will render any favorites that the other will. But the favorites are still present in the user's cookie at all times.

Object view

Object view is used in single-object context. Typically, it is accessed by clicking on a link from an object in results view. Object view supports both compound and non-compound objects. When using the HTML templates in this view, keep in mind that either view_simple.html.php or view_compound.html.php may be loaded depending on whether or not the object is compound.

Object-results view

Object-results view is used to display compound object search results. Results are displayed in a two-column HTML table, one object per row, with the page title in the left column and the full text of the page in the right column. Only pages that match the search query are displayed; matching terms are enclosed in an HTML <span> element with class dmHighlightedTerm. This view is only available for searchable compound objects.

Results view

Results view is used in contexts where a number of objects are displayed alongside each other. It can be populated by any group of objects, such as search results, browse results, or a user's favorites. (Favorites are handled by Favorites view, a subset of results view.)

There are two results view templates inside any template set folder: object/results.html.php and object/results_faceted.html.php. When dmBridge has facets to display, it will load the latter. The reason these are separate is because the presentation of facets often requires a major difference in HTML layout. If you would rather not display facets, or if your two templates end up basically the same, feel free to remove all of the content from one of them and include() the other from it in order to eliminate redundancy.

Results view can be customized in the on a per-collection basis. See the Control Panel section for a list and description of the available options.

Results view provides several possible views within itself, each of which are just different ways of displaying objects. An easy way of rendering links to each of these views is using the DMResultsTemplateHelper::viewLinks() method. The user can always get any view by supplying the view parameter in the URI query string, e.g. ?view=tile. It is not currently possible to disable those views entirely.

Grid view

Grid view displays results in an HTML table, with one result per row. Columns are customizable and configurable in the Collections section of the Control Panel on a per-collection (not per-template-set) basis. Grid view is the default view within results view.

List view

List view is like an inverted grid view, with metadata fields displayed vertically per-object instead of horizontally. List view can be accessed within results view by supplying the ?view=list parameter in the URI.

Tile view

Tile view, like grid view, displays results in an HTML table. However, in tile view, each object has its own table cell. The number of columns is configurable in the Collections section of the Control Panel on a per-collection (not per-template set) basis. If you are using DMResultsTemplateHelper::getHtmlResults() to display results in your templates, which the built-in "Basic" template set does, tile view can be accessed within results view by supplying the ?view=tile parameter in the URI.

Search view

Search view is used to display the advanced search form(s) (not search results, which are handled by results view). This view is not strictly necessary for all digital collections - you could write your own search interface, or use Custom Queries and Results (CQR) - but is provided anyway due to the complexity of the forms.

As you may already know, CONTENTdm® provides four different search forms on its Advanced Search page, allowing the user to search "across all fields;" "selected fields;" "by proximity;" or "by date." dmBridge merges the first two of these forms together, offering a total of three different search forms, which can be added to the advanced search template (search/index.html.php) using the fieldSearch(), proximitySearch(), and dateSearch() methods of the DMSearchTemplateHelper class.

Login view

Login view is used to display a login form for authorized users to authenticate themselves. The login form is rendered by DMGenericTemplateHelper::getHtmlLoginForm() and is very simple, consisting of only two text fields and a submit button.

Like search view, login view is not strictly necessary for all digital collections. You could just as easily display the form on any other page, and never point users to login view at all.

By default, the authentication process uses CONTENTdm®'s authentication system. This can be changed; see the chapter on custom authentication services.

[Note]Note

There is no "logout view;" the process of logging out sends the user to results view.