Rapid Database Application Development
"Microsoft Access for Linux"
Kexi Mime Types, Data/Project Saving and Loading
started: 2003-10-18, js
1. Kexi project file extensions
We can still using single ".kexi" file extension. Kexi can distinguish between what to do with a file, reading its few first bytes from contents, although only KDE newer than 3.1 can be forced to always recognize mime types by file contents. While it is easy to check what is real file format by its contents from Kexi code, it can be hard to ensure that appropriate type information is shown in e.g. Konqueror (not mentioning GNOME or win32 filemanager). So, for compatibility (also with less flexible systems like win32 or macosx) we have forked to more extensions.
All valid file formats that can be currently encountered are described below.^ toc
1.1. Shortcut to a Kexi project on a database server
MimeType: application/x-kexiproject-shortcut Comment: Shortcut to Kexi Project on Database Server File extensions: .kexis or .KEXIS ('s' as in Shortcut)
Specification proposal is now commited to freedesktop.org
1. Justification A format named in general "Shortcut to a database connection data/data source" allows a user to store in a simple ini-file-like format. There is no single well known format for this. 2. Usage scenario 2.1. A file containing data compatible with the format can be kept by a user, who can pass the filename to an application to avoid entering all the information again. 2.2. Within desktop system, there can be associated filename extension with the file format, so a user can simply click the file to open connetion with default application. 2.3. User can decide to send the mentioned file, e.g. using e-mail, to allow connections. 3. Advantages The data structure stored using the format is quite linear, so we've succesfully avoided using XML, hence the format is human readable. 4. Other notes: - Security: storing passwords is optional. Integration with password managers (like KWallet) is beyond the scope of this specification. - The format can be also used to store files containing "recent connections' data" at user will. For this we may want to agree on a recommended subdirectory for saving such files within $HOME directory. - While the format is proposed as implementation-neutral, it is already implemented in Kexi and there are planse to reuse it within other database-related projects. - Further plans include integration with ODBC/JDBC connection data. - Formal specification will be provided later, for now I am asking for comments 5. Example file with comments: http://websvn.kde.org/trunk/koffice/kexi/tests/startup/testdb.kexis?view=markup^ toc
1.2. Binary format with Kexi meta information (engine inherited from SQLite)
MimeType: application/x-kexiproject-sqlite Comment: Kexi Database File-based Project File extensions: .kexi^ toc
2. Other file formats/extensions
For the end user's convenience not only above mentioned mimetypes should be available. It's usable to have:^ toc
2.1. Data for Database Server Connection
After executing (clicking) a file, connection will be established using a data saved in the file; then, for this connection, user will be able to:
This format just is a special version of .KEXIS, it just lacks of "database name" field.
MimeType: application/x-kexi-connectiondata Comment: Data for Database Server Connection File extensions: .kexic^ toc
3. Stored list of connection data
Location: ~/.kde/share/apps/kexi/connections/, in general, all dirs returned by
will be looked up. Format: connections/ directory (directories) can contain a number of .KEXIC files (see above).
User can add, edit and remove these connections, either by using Kexi GUI (ad/edit/remove butons in a connection-selection wizard's page) or by adding/editing/removing files directly.
Security: On creation, connections/ directory permissions will be set to rwx------ (0700). Every file's permissions inside it will be set to rw------- (0600).^ toc
4. Stored information about recent objects
We have extended original idea of "recent documents", by distingishing between recent database projects and recent connections. The list is dynamically managed as two FIFO queues (on every database/connection opening within Kexi).
Location: ~/.kde/share/apps/kexi/recent/, in general, all dirs returned by
will be looked up. Format: recent/ directory (directories) can contain a number of .KEXIS files (for database information) and .KEXIC files (connection data), see above for info about these files.
A simple mockup for "open recent" submenu:
Generally, we're deeply copying infromation about a recently opened databases/connections. This means that if a connection information has been edited, copied data is not updated. This is however how "open recent" data works even for regular files: moving them outside an application leads to dangling reference. The advantage of the solution is that we have developed a consistent way of storing information about database locations/connection data: all is stored as a list of files. Sorting is preserved thanks to file's modification time.
Security: On creation, recent/ directory permissions will be set to rwx------. Every file's permissions inside it will be set to rw------- on creation. Passwords, if any, will be removed from .KEXIS and .KEXIC files, so passwords can only be stored if a user explicity defined database connection (see 3.).^ toc
4.1. Recently Opened Databases (Projects)
A unique list of Kexi db projects recently opened. For file-based db projects, simplified URL is displayed. For db projects accessed via network connections, a db name and a server is displayed using KexiDB::ConnectionData::serverInfoString().
Depending on how infromation about database was obtained, following cases are possible:
4.2. Recently Connected Database Servers
A unique list of Kexi db connections a user has recently connected with.