Skip to content
Snippets Groups Projects
Commit 4bdc4cde authored by Renaud Le Gac's avatar Renaud Le Gac
Browse files

Define all constants related to the application.

parent 2dfb36e4
No related branches found
No related tags found
Loading
......@@ -9,9 +9,41 @@
Ext.namespace('App');
App.cfgurl = '/'+App.name+'/configuration';
App.dburl = '/'+App.name+'/database';
/**
* @cfg {Object} App.cfgSvcMethods
* Ext.direct.Provider exposing methods for a web service.
* This constants is defined by the server.
*/
App.cfgSvcMethods = null;
/**
* @cfg {String} App.dburl
* Define the url of the database router/controller
* This constants is defined by the server.
*/
App.dburl = null;
/**
* @cfg {Boolean} App.debug
* Activate the debug mode on the server side.
* This constants is defined by the server.
*
*/
App.debug = null;
/**
* @cfg {String} App.name
* Name of the web application.
* This constants is defined by the server.
*/
App.name = null;
/**
* Function to handle HTTP exception appearing in Form transation.
*
* @param {Object} form
* @param {Object} action
*/
App.httpFailure = function(form, action){
if (action.response) {
if (action.response.status != 200) {
......
......@@ -19,11 +19,16 @@
{{for el in jlibs:}}
<script type="text/javascript" src="{{=el}}"></script>{{pass}}
<!-- application librairies -->
{{for el in alibs:}}
<script type="text/javascript" src="{{=el}}"></script>{{pass}}
<!-- Namespace, global variables and remote methods for the application -->
<script type="text/javascript">
Ext.namespace('App');
App.name = '{{=request.application}}';
App.debug = {{=str(appdebug).lower()}};
App.dburl = '/{{=request.application}}/database';
App.cfgSvcMethods = {
"url": '/{{=request.application}}/configuration',
"type":"remoting",
......@@ -33,10 +38,6 @@
};
</script>
<!-- application scripts -->
{{for el in alibs:}}
<script type="text/javascript" src="{{=el}}"></script>{{pass}}
<div id='appmain'></div>
</body>
</html>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment