A repository is a collection of repository items. In general, a repository item (a JavaBean component implementing atg.repository.RepositoryItem or one of its sub-interfaces) corresponds to the smallest uniquely identifiable entity in the underlying data store. In the SQL repository, for example, a repository item often corresponds roughly to a row in a table. In the SQL profile repository, each user profile is a repository item.

Each repository item is made of properties. These properties store the data that makes up a repository item. Each property has a name, such as id, firstName, or lastName. In the SQL repository, these properties correspond roughly to columns of a table. The properties available to a type of repository item are defined in the repository’s itemdescriptors.

Each repository item must have an identifier, which is called a repository ID. The repository ID must uniquely identify the repository item from all other repository items of the same type. The repository will typically be configured to find the repository ID from some elements of the underlying data. In the SQL repository, for instance, each item descriptor must specify the columns that act as the repository ID (which will usually be the same as the table’s primary key). Depending on the repository’s configuration, the repository ID may or may not be exposed as a property of the repository item.

Properties of repository items may be single-valued or multi-valued. In some repository implementations, such as the SQL repository, a property’s value may refer to one or more other repository items. This enables a repository item to use properties that are complex data structures. It also lets a repository item’s property refer to items in other repositories.

The combination of item descriptors, properties, identifiers, and items allows a repository to read application data from the underlying data store, and to write application data back to the data source. Some repositories allow certain properties or even entire item descriptors or repositories to be exposed as read-only. Sometimes properties can even act as translators between the underlying data source and the Java application. For example, you might have a database column that stores first names of users. Your ATG application, however, wants to use first names that are exclusively uppercase. You can define a repository property named firstNameUpperCase that takes the first name value from the database and returns it as an uppercased version. The Repository API allows for this kind of flexibility without modifying any application code.

 
loading table of contents...