Archiving localized presentations

When you create a new program, you can create a localized presentation by archiving the presentation objects and associating them with a specific locale in the locale hierarchy. You can store any localized object in an archive associated with the shared library containing your code. This archive can contain multiple localized versions of the same object, each one associated with a different locale.

When you create new localized program interface elements, archive them at the locale for which they are appropriate--for example, at the English or United States level. Localizers can then create localized versions for other locales--for example, for French or Japanese. The root level should contain only objects that are appropriate for use in all locales.

To ensure that a program runs even in locales for which the program hasn't been localized, the program archive has a default locale. If the archive doesn't contain objects for the specified locale, it uses the objects in the default locale. This means that a user will get a presentation that isn't localized rather than no presentation at all.

You can use the classes in the following diagram to archive and retrieve objects. You can also manipulate archives using the UI Builder--see the manual UI Builder for the CommonPoint Application System for information.


TArchive represents an archive and provides access to its contents. You instantiate a TArchive instance specifying a directory name and the name of the file containing the archived data--either opening an existing archive or creating a new one. You can open an archive for either read or read and write access.

NOTE TArchive represents only an access path to externally stored data--not the storage itself. Therefore, creating and destroying TArchive instances should not have any effect on the archived data.

TArchiveEnvelope provides a wrapper for an archivable object, along with the protocol for adding objects to an archive and retrieving objects from an archive. You instantiate a TArchiveEnvelope for a particular type of object and identify the object you want to add or retrieve by its name (a text instance). A TArchiveEnvelope instance is bound to a specific archive and either the current locale or a locale you specify.

TArchiveKey provides a way to reference individual items within an archive. An archive key contains the name of the object and the locale to which it belongs. Use archive keys to easily reference archived objects and to iterate through an archive's contents.

TArchiveIterator iterates through the items in a particular locale, returning a TArchiveKey representing each item. You can choose to iterate through all the items in the archive or through only those items associated with a specific locale. When you limit the iteration to a single locale, you can also iterate through items inherited by that locale. Create a TArchiveIterator for a particular archive by calling TArchive::CreateArchiveIterator.

TArchiveLocaleIterator iterates through the locales associated with the items in an archive. Create a TArchiveLocaleIterator for a particular archive by calling TArchive::CreateLocaleIterator.

Exception handling

The archive classes also include a set of classes used to issue exceptions. The abstract base class for exceptions is TArchiveException, derived from TStandardException. The archive classes define the following concrete classes derived from TArchiveException:

Exception class Description
TArchiveAccessError Issued when a client tries to access an archive without the correct permission or concurrency control.
TArchiveAlreadyExists Issued when a client tries to create an archive when an archive of the same name exists.
TArchiveObjectNotFound Issued when an object of a given name cannot be found within
an archive.
TArchiveNotFound Issued when an archive of a specified name cannot be found.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker