Central Repository Overview

The Central Repository stores data such as application settings, component settings, configuration parameters and data used for localisation and customisation.

Purpose

The central repository was introduced to avoid the use of multiple .ini files specific to each application. Typical uses are persisting application data such as default file names, locale settings and user preferences from one session to another: data of this kind can also be used by device creaters to customise a device. Examples include phone book data, bookmarks, event logging and default keyboard layout.

Required background

The central repository is used in the implementation of many libraries. Application developers using these libraries generally do not need to access the central repository API directly. Developers maintaining and extending such libraries need to know how to use the API to read and modify repository data and set up change notification. Developers creating new extensions to Symbian, such as device drivers need to know when it is appropriate to use the central repository to persist settings. They will also need to understand the mechanism of key spaces and initialisation files used to implement the central repository and how to create repository files, as explained in Central Repository Initialisation Files Guide. Product integrators and device creators need to know where in ROM central repository data can reside, to know the installation mechanism and to understand the impact on data security.

Key concepts and terms

Repository

A data structure holding data to be persisted for a component or application, equivalent to a file. Also called a keyspace.

Setting

An item of data in a repository, equivalent to a line in a file. Also called a key.

Initialisation file

The text file from which a repository is created.

Keyspaces

Another term for a repository.

Access policies

Read or write permissions on a setting or group of settings.

Architecture

Many applications and modules come with a data structure called a repository or keyspace which is used to persist application data. The Central Repository is the component which stores and manages repositories. Repositories are created and initialised individually along with their associated application on installation, or as a group when a device is built by device creators. The purpose of the Central Repository API is to enable application developers and device creators to modify repository data and to provide notification of changes to a repository.

Conceptually, the Central Repository is comparable to a folder, an individual repository to a file and a setting to a line in a file. In fact repositories are implemented as binary files held at various locations in memory and are accessed through C++ classes which encapsulate them with a single API. Repositories are created with the applications to which they refer at device build time or at installation by the Application Installer on runtime. The Central Repository API is only used to access repositories, not to create them.

APIs

The Central Repository API provides the CRepository class to provide access to repositories.

API Description

CRepository

Provides the functionality to access the repository created with an application.

CCenRepNotifyHandler

Creates notification of changes to a repository.

MCenRepNotifyHandlerCallback

A callback interface to be implemented to respond to change notification.

Typical uses

The Central Repository is typically used by applications such as messaging services to retrieve logins, localisation data and information needed for interprocess communication.

Related concepts