29.2.6. Client, session and settings

This section gives an overview of hardware and software in BASE.

UML diagram

Figure 29.7. Client, sessions and settings

Client, sessions and settings

Clients

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

A client application doesn't have to be registered with BASE to be able to use it. But we recommend it since:

  • The permission system allows an admin to specify exactly which users that may use a specific application.

  • The application can't store any context-sensitive or application-specific settings unless it is registered.

  • The application can store context-sensitive help in the BASE database.

Sessions

A session represents the time between login and logout for a single user. The SessionData object is entirely managed by the BASE core, and should be considered read-only for client applications.

Settings

There are two types of settings: context-sensitive settings and regular settings. The regular settings are simple key-value pairs of strings and can be used for almost anything. There are four subtypes:

  • Global default settings: Settings that are used by all users and client applications on the BASE server. These settings are read-only except for administrators. BASE has not yet defined any settings of this type.

  • User default settings: Settings that are valid for a single user for any client application. BASE has not yet defined any settings of this type.

  • Client default settings: Settings that are valid for all users using a specific client application. Each client application is responsible for defining it's own settings. Settings are read-only except for administrators.

  • User client settings: Settings that are valid for a single user using a specific client application. Each client application is responsible for defining it's own settings.

The context-sensitive settings are designed to hold information about the current status of options related to the listing of items of a specific type. This includes:

  • Current filtering options (as 1 or more PropertyFilterData objects).

  • Which columns and direction to use for sorting.

  • The number of items to display on each page, and which page that is the current page.

  • Simple key-value settings related to a given context.

Context-sensitive settings are only accessible if a client application has been registered. The settings may be named to make it possible to store several presets and to quickly switch between them. In any case, BASE maintains a current default setting with an empty name. An administrator may mark a named setting as public to allow other users to use it.