From aef4ca050e49a87db6d282c7ef5fa9c641870692 Mon Sep 17 00:00:00 2001 From: Renaud Le Gac <renaud.legac@free.fr> Date: Tue, 23 Nov 2010 21:52:33 +0000 Subject: [PATCH] Configuration of remote call and high level variables are moved to appbase.js --- controllers/plugin_dbui.py | 3 +-- static/plugin_dbui/lib/appbase.js | 33 +++++++++++++++++++++---------- views/plugin_dbui.html | 10 +--------- 3 files changed, 25 insertions(+), 21 deletions(-) diff --git a/controllers/plugin_dbui.py b/controllers/plugin_dbui.py index 655977fb..2a24b379 100644 --- a/controllers/plugin_dbui.py +++ b/controllers/plugin_dbui.py @@ -152,8 +152,7 @@ def index(): return dict(clibs=csslibs,\ jlibs=jslibs,\ alibs= applibs,\ - appdebug=debug,\ - cfgSvcMethods=cfgSvc._getMethods()) + appdebug=debug) def database(): diff --git a/static/plugin_dbui/lib/appbase.js b/static/plugin_dbui/lib/appbase.js index 20bc8a0b..4d705482 100644 --- a/static/plugin_dbui/lib/appbase.js +++ b/static/plugin_dbui/lib/appbase.js @@ -10,26 +10,39 @@ Ext.namespace('App'); /** - * @cfg {Object} App.cfgSvcMethods - * Ext.direct.Provider exposing methods for a web service. + * @cfg {String} App.name + * Name of the web application. * This constants is defined by the server. */ /** - * @cfg {String} App.dburl - * Define the url of the database router/controller + * @cfg {Boolean} App.debug + * Activate the debug mode on the server side. * This constants is defined by the server. + * */ /** - * @cfg {Boolean} App.debug - * Activate the debug mode on the server side. + * @cfg {String} App.dburl + * Define the url of the database router/controller * This constants is defined by the server. - * */ +App.dburl = '/' + App.name + '/plugin_dbui/database'; /** - * @cfg {String} App.name - * Name of the web application. + * @cfg {Object} App.cfgSvcMethods + * Ext.direct.Provider exposing methods for a web service. * This constants is defined by the server. - */ \ No newline at end of file + */ + +App.cfgSvcMethods = { + "url": '/' + App.name + '/plugin_dbui/configuration', + "type":"remoting", + "actions": { + "cfgSvc": [{'name': 'getFormModel', 'len': 1}, + {'name': 'getGridModel', 'len': 1}, + {'name': 'getTables', 'len': 0}] + } +}; + + diff --git a/views/plugin_dbui.html b/views/plugin_dbui.html index c549076a..d7d3c14e 100644 --- a/views/plugin_dbui.html +++ b/views/plugin_dbui.html @@ -17,19 +17,11 @@ {{for el in jlibs:}} <script type="text/javascript" src="{{=el}}"></script>{{pass}} - <!-- Namespace, global variables and remote methods for the application --> + <!-- Namespace, global variables for the application --> <script type="text/javascript"> Ext.namespace('App'); App.name = '{{=request.application}}'; App.debug = {{=str(appdebug).lower()}}; - App.dburl = '/{{=request.application}}/plugin_dbui/database'; - App.cfgSvcMethods = { - "url": '/{{=request.application}}/plugin_dbui/configuration', - "type":"remoting", - "actions": { - "cfgSvc": {{=XML(cfgSvcMethods)}} - } - }; </script> <!-- application librairies --> -- GitLab