Client, session and settings

NOTE! This document is outdated and has been replaced with newer documentation. See The database schema and the Data Layer API

This document covers the details of clients that has access to base core, the settings for each user and clientent and the session where a user interact with base.

See also

Last updated: $Date: 2009-04-06 14:52:39 +0200 (må, 06 apr 2009) $


Client

The ClientData class stores information about a client application. The externalId column is a unique name for the application. To avoid name clashes the name should be constructed in the same way as Java packages, for example net.sf.basedb.clients.web.

It is not necessare for a client application to be registered, but then it will not ba able to use and store application specific settings. It may still use session settings and read the user and global default settings.

Sessions

The SessionsData class stores information about user sessions. The information in this class should be considered read-only. Information can only be changed by the core at login or logout time.

A Session is automatically created at login time. At the same time it will also load all global and user default settings for the user. If a client application is specified it will also load the default and user-specifiec settings for that client application.

The settings are kept in memory until the user logs out. Any changes to user-specific settings are then saved to the database. It is not possible to change the client or global default settings throgh the session object.

The getSetting(name) method will search for the setting with the specified name among all types of settings in the following order:

Settings

The Settings class stores information about all types of settings. ClientDefaultSetting and GlobalDefaultSetting has a restriction value attached that enables client applications to access those settings without logging in. The descriminator holds a code to indicate the type of setting:

Setting Description
1 The setting is for a specific user and client application. The user and client columns may not be null.
2 The setting is a default setting for a specific user. The user column may not be null and the client column must be null.
3 The setting is a default setting for a specific client application. The client column may not be null and the user column must be null.
4 The setting is a global default setting. The user and client columns must be null.

HelpData

The HelpData class holds help information for a registerd client application. The class should be used to add a short and a long help text for different components in tne client application.