====== DataBase2 Plugin ====== ---- plugin ---- description: Integrates DB-driven table featuring list and detail view, record editor, record-based locking for concurrent edit, file upload and more author : Oliver Geisen, Thomas Urban email : oliver@rehkopf-geisen.de type : Syntax, Admin lastupdate : 2017-08-01 compatible : Detritus, Hrun, Ponder Stibbons, Binky, Weatherwax, Adora Belle, Angua, Rincewind, Anteater, Lemming, 2009-02-14b, 2008-05-05 depends : conflicts : similar : database tags : database, tables downloadurl: https://github.com/igittigitt/dokuwiki-plugin-database2/archive/master.zip bugtracker : https://github.com/igittigitt/dokuwiki-plugin-database2/issues sourcerepo : https://github.com/igittigitt/dokuwiki-plugin-database2 donationurl: screenshot_img : ---- ===== Summary ===== On July 2017 this plugin was adopted by me with bless of the author "Thomas Urban". Please also note the [[plugin:database2:credits]], taken from his homepage. ===== Current Features ===== Here is a short list of features included with this plugin: * local and remote database support * local databases are stored in current page's meta folder using SQLite((Recently they were stored in "namespace" and thus available for sharing by all pages in same namespace, however this association with namespaces was inconsistent and so changed to association with page. Sharing is still available by using explicit database selection in table option ''database''.)) * using PHP's PDO several remote database systems are basically supported (**tested: MySQL**) * integrate one table per tag from connected database. * list all records in a table featuring * limited number of records per page supporting flipping and page selection * sorting by single column ascendingly or descendingly * selecting subset of columns listed * selecting virtual fields aliasing computed data * filter listed records * multi-component filter supporting intersection and union * hard-coded definition for (initial) filter * optional filter controls - always available or requiring authorization to become available * select single record for detail view containing all available columns * included actions((available if table has a single integer column as primary key)) * adding new records * editing existing records * delete existing records * copy existing records * several value types (internally mapped into SQL types) having effect on record editor elements * text fields * checkboxes * enumeration selectors * image/file upload * "foreign keys" * single-record locking enabling several users concurrently work on a single table * table-, row- and column-related authorization rules for controlling access on supported actions * any performed action causing a change of data is logged in a separate table * provides extended access on data * exporting all or filtered records to CSV file * export table's change log to CSV for inspecting when someone has recently changed what in table * provides special print version listing all matching records in a vanilla document * read-only views using custom SELECT-statement * read-only integration of computed SQL terms * optionally supports DokuWiki markup in text values * console for administrative operations on locally managed SQLite databases ===== Installation ===== Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually. To access remote databases, the plugin uses PDO. The appropriate drivers must be installed in the underlying operating-system, resp. PHP. ===== Examples/Usage ===== SELECT * FROM mytable ===== Syntax ===== The plugin is integrated in a page by using a special tag called ''database2'' like this: column definition column definition ... The tag is surrounding a set of column definitions. Additionally the tag **must** contain a table's name to use in connected database and **may** contain further options. These options are called **table options** furtheron since every column may have individual options as well called **column options** throughout the rest of this documentation. //**[[plugin:database2:database2_syntax|Here you find a complete definition and examples of the syntax.]]**// ===== Configuration and Settings ===== ==== Enable ''database2'' ==== On successfully installing plugin or upgrading from versions prior to 0.4.0 you need to enable the plugin on a per-page basis. Change to your wiki's configuration manager and look for the section related to plugin database2. === Enable on all pages === If your wiki isn't providing any open write access including wiki markup support and/or if you trust all your users you may globally enable database2 on every page using separate option in configuration manager. Doing so any patterns provided for selecting enabled pages are ignored. === Enable on selected pages === If global option described before is ''off'', you may enter one or more patterns for matching pages' full path selecting those pages being enabled for using database2 tag. Write one pattern per line. Each pattern may be a PCRE pattern wrapped in slashes or a shell pattern with ''*'' and ''?'' as wildcards. /^software:database2:demo/i *:database2 ===== Change Log ===== {{rss>https://github.com/igittigitt/dokuwiki-plugin-database2/commits/master.atom date}} ===== Known Bugs and Issues ===== :!: **Plugins like ''discussion'' are used to enable unauthenticated users to post comments. As such posts may include any sort of Wiki markup. This way it's possible for commenters to embed database2 tags with public write access to databases into pages.** Starting with 0.4.0 support for database2 must be enabled explicitly for selected pages of your Wiki. Now, it's possible to install both plugins. **However you shouldn't have discussions on pages enabled for database2.** ===== ToDo/Wish List ===== The following points are on my agenda: - Remove option "wikistyle" and make it default and the only display mode. No one needs anything other. - Render as normal Dokuwiki-table, using all provided classes to smoothly fits users template style. - Default to render a table only, no extra functionality (pagers, filters, sorters, etc.). All those should come only after giving the appropriate option by syntax. - Rework option parsing. Move all of it into syntax.php and parse the whole syntax on pagesave inside handle()-function. Currently only table options parsed and column options in a later pass. - Hashing text input (e.g. for entering passwords) - Adding missing columns/fields to a table [[plugin:database2:database2_syntax_draft|A DRAFT version of syntax]] ===== Discussion ===== * [[plugin:database2:discussion]] * [[https://nihilum.de/software:database2:talk.html]] ===== Translations ===== [[ru:plugin:database2|Russian translation of the manual]]