The ATG Repository API (atg.repository.*) is the foundation of persistent object storage, user profiling, and content targeting in ATG products. A repository is a data access layer that defines a generic representation of a data store. Application developers use this generic representation to access data by using only interfaces such as Repository and RepositoryItem. Repositories access the underlying data storage device through a connector, which translates the request into whatever calls are needed to access that particular data store. Connectors for relational databases and LDAP directories are provided out-of-the-box. Connectors use an open, published interface, so additional custom connectors can be added if necessary.

Developers use repositories to create, query, modify, and remove repository items. A repository item is like a JavaBean, but its properties are determined dynamically at runtime. From the developer’s perspective, the available properties in a particular repository item depend on the type of item they are working with. One item might represent the user profile (name, address, phone number), while another might represent the meta-data associated with a news article (author, keywords, synopsis).

The purpose of the Repository interface system is to provide a unified perspective for data access. For example, developers can use targeting rules with the same syntax to find people or content.

Applications that use only the Repository interfaces to access data can interface to any number of back-end data stores solely through configuration. Developers do not need to write a single interface or Java class to add a new persistent data type to an application

Each repository connects to a single data store, but multiple repositories can coexist within ATG products, where various applications and subsystems use different repositories or share the same repository. Applications that use only the Repository API to access data can interface to any number of back-end data stores solely through configuration. For example, the security system can be directed to maintain its list of usernames and passwords in an SQL database by pointing the security system at an SQL repository. Later, the security system can be changed to use an LDAP directory by reconfiguring it to point to an LDAP repository. Which repositories you use depends on the data access needs of your application, including the possible requirement to access data in a legacy data store.

The ATG platform includes the following models for repositories:

When you store content in a repository, in addition to the meta-information about a document, you need access to the physical piece of content that is the document and path information that tells you where the document is stored. Content-specific repository extensions handle this. These are located in the atg.repository.content package, described later in the SQL Content Repositories chapter.

loading table of contents...