TreeLayout
From Elektra Initiative
Contents |
Purpose
There are Backends which use the filesystem to store Data. These backends SHOULD use the following TreeLayout structure to save their Key.
Layout
There are following trees for Configuration available:
| Namespace | Name | Folder |
| doc/ | documentation and default keys | /usr/share/doc/kdb/ |
| system/ | system configuration | /etc/kdb/system/ |
| local | local application configuration | /usr/local/$APP/kdb/ |
| user/ | user configuration | $HOME/.kdb/user/ |
Subdirs
Every of the above mentioned trees has a set of required subdirs.
| Subdir | Description |
| sw | Configuration for installed Software |
| hw | Hardware specific configurations |
| menu | Menu Entries for applications |
| keys | Shortcuts for Applications |
| other standards | more to come... |
Global Configurations
In many parts it is needed to have global settings (for user and system) which sets configurations when the applications don't say anything else. That would be very important for Shortcuts in Applications. Its a very common wish to have a specific shortcut for an often used Action (find, quit, copy, paste,...) for every application.
So it is needed to have a global configuration. When user sets a shortcut global, every application will use that shortcut. But it is possible to change it application specific.
The question is, if this feature is needed in other parts then Shortcuts?
- Yes, for instance a mail app may use domain names, SMTP servers, etc. specified in the system configuration unless they are overridden by the user.
Order
The applications using elektra will get the configuration in the above used order. This is done by
kdbGetKeys (,,RECURSIVE);
Doc is hidden per default, you get it with the flag DOCUMENTATION.
If no system configuration is found the current path will be used (local/). Otherwise local/ will be hidden.
The */global configurations are for items used by many applications.
Example: You want the shortcut for opening files. Your program will first do
kdbGetKeys("/app/key/open",return,RECURSIVE);
Following will happen:
- Doc will be ignored.
- system/global/key/open may find "Strg+O"
- system/app/key/open finds nothing because admin wanted no other key binding for opening files.
- local will be ignored, because system was found.
- user/global/key/open may find "Strg+t" because user more likes that for all his apps as open shortcut.
- user/app/key/open may find "Alt+O" because for this app in special the user more liked this shortcut.
