Commit fe0ebd19 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Merge branch 'master' into 'production'

Release 0.8.3

* Migrate to web2py 2.14.6 + pyDAL 16.03.
* Upgrade build_version to run third party tools behind a docker container.
* Release non-backward compatible due to changes in pyDAL.

See merge request !22
parents 3807949c 7b143b08
static/plugin_dbui/CHANGELOG
\ No newline at end of file
static/plugin_dbui/LICENCE_UK.html
\ No newline at end of file
# PLUGIN_DBUI
The `plugin_dbui` allows to develop database-driven web-based application
using a rich interface. It relies on the application
framework [web2py](http://www.web2py.com/) and on the javascript library
[Ext JS](https://www.sencha.com/products/extjs/).
The `web2py` framework implements the Model Controller View (MVC) approach.
It is written in [python](https://www.python.org/) and well designs for rapid
development of fast, scalable, secure and portable database-driven web-based
applications.
The `Ext JS` library provides a rich and modern set of widgets.
Written in javascript, the library provides a clean component model and it is
compatible with all major web browsers. Base widgets can be easily extended
using class inheritance or plugins mechanisms.
The plugin `plugin_dbui` acts as a bridge between the `web2py` framework
and the `Ext JS` library. It connects your model to the `Ext JS` widgets
and to the `web2py` Database Abstraction Layer. It generates automatically
forms and grids for each database table defined in your model resolving foreign
key. It also provides tools to customise forms and grids for complex
applications.
The `plugin_dbui` provides a generic approach to manipulate data in the
database through a rich interface. For the reporting, it relies on the
controller and the view capabilities of the `web2py` framework, the Ext
JS `grid` widgets and third party library like
[matplotlib](http://pandas.pydata.org/),
[mathjax](https://www.mathjax.org/) and [pandas](http://pandas.pydata.org/).
## Features
* Generate automatically `form` and `grid` for each table of the database.
* Resolve the foreign keys in `form` and `grid` widgets.
* Tools to customise auto-generated `forms` and `grids`.
* The customisation of `form` and `grids` is defined in one place, your model,
and in one language, python.
* Fields can be organised in many different ways in `forms` using either `Ext JS
layout` or panel like `tab panel`.
* Context menu to create, destroy, duplicate and update records in grid.
* Paging and filter mechanisms for grid.
* Plugins to export the `Ext JS` grid content as csv, latex or pdf files.
* Plugins to build dedicated wizard.
* Base widgets can be customized using class inheritance or plugins.
* Provide a mechanism to include your own widgets.
* Reporting using `selector` as well as mechanisms provided by the
`web2py` framework.
* Internationalisation.
* ...
## Installation
The packed version of the `plugin_dbui` and its friends can be obtained using
the versioning tool [git](http://git-scm.com/):
```
git clone https://gitlab.in2p3.fr/legac/plugin_dbui_build.git
```
* Install the `plugin_dbui` in your application using the `web2py`
administration interface.
* Install the `plugin_extjs` in the same way.
* Install the `plugin_mathjax` if you need to render equation.
* Install the `plugin_ace` if you need the [ace](http://ace.c9.io/) editor.
In order to run `plugin_dbui`, you have to modify the main controller
of your application. It is located in the file
`applications/myapp/controllers/default.py`:
```
def index():
return LOAD('plugin_dbui', 'index', vars=request.vars)
```
That's it.
## Documentation
The [documentation](https://marprod.in2p3.fr/plugin_dbui_book) is divided in
three parts: reference manual, API for the python classes and API for the
javascript classes.
## Changelog
Consult the [Changelog](CHANGELOG) page for fixes and enhancements of
each version.
## License
Copyright Renaud Le Gac, 2009-2016.
Distributed under the terms of the
[CECIL](http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.html) license,
`plugin_dbui` is free and open source software.
\ No newline at end of file
0.8.2
\ No newline at end of file
0.8.3
\ No newline at end of file
This diff is collapsed.
......@@ -46,23 +46,10 @@ db.define_table("publications",
Field("id_categories", 'reference categories', default=undef_id, label='AERES'),
migrate="publications.table")
# use different techniques to define foreign field
db.publications.id_categories.requires = \
IS_IN_DB(db, 'categories.id', 'categories.code')
IS_IN_DB(db, 'categories.id', 'categories.code')
db.publications.id_collaborations.requires = \
IS_IN_DB(db, 'collaborations.id', 'collaborations.collaboration')
db.publications.id_publishers.requires = IS_IN_DB(db, 'publishers.abbreviation')
db.publications.id_countries.requires = \
IS_IN_DB(db, 'countries.id', 'countries.country')
db.publications.id_publishers.requires = \
IS_IN_DB(db, 'publishers.id', 'publishers.abbreviation')
db.publications.id_projects.requires = \
IS_IN_DB(db, 'projects.id', 'projects.project')
db.publications.id_reports.requires = \
IS_IN_DB(db, 'reports.id', 'reports.type')
db.publications.id_teams.requires = \
IS_IN_DB(db, 'teams.id', 'teams.team')
\ No newline at end of file
db.publications.id_projects.requires = IS_IN_DB(db, db.projects.project)
......@@ -357,14 +357,15 @@ def get_foreign_field(field):
for vdt in validators:
if isinstance(vdt, IS_IN_DB):
# IS_IN_DB contains only the parent field.
# The key for the left join is the id key of the parent table
if len(vdt.ks) == 1:
return (vdt.ktable, vdt.ks[0], 'id')
if len(vdt.fieldnames) == 1:
return (vdt.ktable, vdt.fieldnames[0], 'id')
# IS_IN_DB contains the key for the join and the parent field
else:
return (vdt.ktable, vdt.ks[0], vdt.ks[1])
return (vdt.ktable, vdt.fieldnames[0], vdt.fieldnames[1])
# IS_IN_DB is not use.
# The parent key for the left join is the id key of the parent table
......
<html>
<head></head>
<body>
<h2>dbui plugin</h2>
<p>Allow to developp a database application in the
<a href="http://www.web2py.com/">web2py</a> framework using
the javascript librairy
<a href="http://www.sencha.com/products/js/">extjs</a>.</p>
<p>Once the database model is setup,
the plugin handles all basic widgets
to manipulate the data, resolving foreign keys.</p>
<h3>Features</h3>
<ul>
<li>Produce form and grid for each table defined in the model.</li>
<li>Resolve the relation (foreign key) in form and grid widgets.
when define in the model.</li>
<li>Context menu to create, add, delete and duplicate records.</li>
<li>Embedded powerfull mechasnism to filter content of a grid</li>
<li>Content of each table can be exported as a CSV file</li>
<li>Mechanisms to custom the application and to add new widgets.</li>
</ul>
<h3>Author</h3>
<p>R. Le Gac</p>
<h3>Licence</h3>
This software is distributed under the Open Source license CeCILL.
<br>
&copy; 2009 - 2012 R. Le Gac
</body>
</html>
\ No newline at end of file
<h1 id="plugin_dbui">PLUGIN_DBUI</h1>
<p>The <code>plugin_dbui</code> allows to develop database-driven web-based application using a rich interface. It relies on the application framework <a href="http://www.web2py.com/">web2py</a> and on the javascript library <a href="https://www.sencha.com/products/extjs/">Ext JS</a>.</p>
<p>The <code>web2py</code> framework implements the Model Controller View (MVC) approach. It is written in <a href="https://www.python.org/">python</a> and well designs for rapid development of fast, scalable, secure and portable database-driven web-based applications.</p>
<p>The <code>Ext JS</code> library provides a rich and modern set of widgets. Written in javascript, the library provides a clean component model and it is compatible with all major web browsers. Base widgets can be easily extended using class inheritance or plugins mechanisms.</p>
<p>The plugin <code>plugin_dbui</code> acts as a bridge between the <code>web2py</code> framework and the <code>Ext JS</code> library. It connects your model to the <code>Ext JS</code> widgets and to the <code>web2py</code> Database Abstraction Layer. It generates automatically forms and grids for each database table defined in your model resolving foreign key. It also provides tools to customise forms and grids for complex applications.</p>
<p>The <code>plugin_dbui</code> provides a generic approach to manipulate data in the database through a rich interface. For the reporting, it relies on the controller and the view capabilities of the <code>web2py</code> framework, the Ext JS <code>grid</code> widgets and third party library like <a href="http://pandas.pydata.org/">matplotlib</a>, <a href="https://www.mathjax.org/">mathjax</a> and <a href="http://pandas.pydata.org/">pandas</a>.</p>
<h2 id="features">Features</h2>
<ul>
<li>Generate automatically <code>form</code> and <code>grid</code> for each table of the database.</li>
<li>Resolve the foreign keys in <code>form</code> and <code>grid</code> widgets.</li>
<li>Tools to customise auto-generated <code>forms</code> and <code>grids</code>.</li>
<li>The customisation of <code>form</code> and <code>grids</code> is defined in one place, your model, and in one language, python.</li>
<li>Fields can be organised in many different ways in <code>forms</code> using either <code>Ext JS layout</code> or panel like <code>tab panel</code>.</li>
<li>Context menu to create, destroy, duplicate and update records in grid.</li>
<li>Paging and filter mechanisms for grid.</li>
<li>Plugins to export the <code>Ext JS</code> grid content as csv, latex or pdf files.</li>
<li>Plugins to build dedicated wizard.</li>
<li>Base widgets can be customized using class inheritance or plugins.</li>
<li>Provide a mechanism to include your own widgets.</li>
<li>Reporting using <code>selector</code> as well as mechanisms provided by the <code>web2py</code> framework.</li>
<li>Internationalisation.</li>
<li>...</li>
</ul>
<h2 id="installation">Installation</h2>
<p>The packed version of the <code>plugin_dbui</code> and its friends can be obtained using the versioning tool <a href="http://git-scm.com/">git</a>:</p>
<pre><code> git clone http://gitlab.in2p3.fr/legac/plugin_dbui_build.git</code></pre>
<ul>
<li>Install the <code>plugin_dbui</code> in your application using the <code>web2py</code> administration interface.</li>
<li>Install the <code>plugin_extjs</code> in the same way.</li>
<li>Install the <code>plugin_mathjax</code> if you need to render equation.</li>
<li>Install the <code>plugin_ace</code> if you need the <a href="http://ace.c9.io/">ace</a> editor.</li>
</ul>
<p>In order to run <code>plugin_dbui</code>, you have to modify the main controller of your application. It is located in the file <code>applications/myapp/controllers/default.py</code>:</p>
<pre><code> def index():
return LOAD(&#39;plugin_dbui&#39;, &#39;index&#39;, vars=request.vars)</code></pre>
<p>That's it.</p>
<h2 id="documentation">Documentation</h2>
<p>The <a href="https://marprod.in2p3.fr/plugin_dbui_book">documentation</a> is divided in three parts: reference manual, API for the python classes and API for the javascript classes.</p>
<h2 id="changelog">Changelog</h2>
<p>Consult the <a href="CHANGELOG">Changelog</a> page for fixes and enhancements of each version.</p>
<h2 id="license">License</h2>
<p>Copyright Renaud Le Gac, 2009-2016. Distributed under the terms of the <a href="http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.html">CECIL</a> license, <code>plugin_dbui</code> is free and open source software.</p>
......@@ -2,6 +2,11 @@
HEAD
0.8.3 (Jun 2016)
- Migrate to web2py 2.14.6 and pydal 16.03.
- Release is non backward compatible due to changes in pydal.
- Update build_version to run third party tools via a docker container.
0.8.2 (Feb 2016)
- Add missing files in the compressed version of the ace plugin.
- Minor modification to run the application via a docker image.
......
------------------------------------ TODO -------------------------------------
- Develop an helper function to instantiate a form, in a separated window,
fill with a database record allowing to modify values.
Something like showForm(tablename, id).
Therefore the form can be opened from the HTML when a user
click on a link or a span tag:
<span onclick="javascript: showForm(foo, 23)">bla bla </span>
(check the exact syntax)
- When Ext JS 4.2.2 will be available, review the user of the buffered store.
- Take benefit of the Ext JS 4.2 library to deploy the MCV approach
on the client side.
- Take benefit of the Ext JS 4.2 library to simplify the dialog
between the client and the server
- Take benefit of the Ext JS 4.2 library to deploy a field to upload file
on the server.
- Take benefit of Ext JS 4.2 to use the filter mechanism available
in grid and store. Remove out custo code.
0.6.1.0 (Mar 2014)
- Take benefit of Ext JS 4.2 to deploy the dynamic loading when running
in debug mode.
0.6.0.19 (Mar 2014)
- Take benefit of Ext JS 4.2 to user requires and use class parameters.
0.6.0.7 (Feb 2014)
- Review the plugin App.ViewportLogin.
It should be possible to change the different text from the python model.
0.6.0.0 (Dec 2013)
- Migrate to ExtJS 4.2
0.4.12.6 (Jun 2013)
- Review the component model to destroy properly plugin.
The main user case is the window of the pGridEditor which should be
destroyed when the grid is destroyed too
(see beforeDestroy, onDestroy, destroy for Ext.Component).
0.4.10.0 (Dec 2012)
- Review the converter to_panelWithUrlSlector.
It should be possible to change the title of the FieldSet from
the python model.
- Review the plugin App.grid.Export.
It should contain button to reset and to reload the grid.
The button export might be replaced by a menu containing
all possible actions. Name of the plugin should be change.
0.4.9.7 (Nov 2012)
......@@ -15,7 +15,7 @@ Ext.define('App', {
* The version of the plugin
* @property {String}
*/
version: '0.8.2',
version: '0.8.3',
/**
* The name of the application
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment