PDA

View Full Version : Way to tell dynamic loader to ignore namespace?



estesbubba
12 Jul 2012, 1:51 PM
We have an app that is actually a kiosk running on a desktop in Awesomium (Chrome). The Awesomium build has a JavaScript API with the namespace of Nano built into it. When I run 'sencha app build production' it's trying to resolve methods for the Nano namespace. How can I tell the dynamic loader to ignore this namespace? I tried this with no luck.



Ext.Loader.exclude('Nano');
Ext.Loader.setConfig({
paths: {
'Ext': '../../commonjs/touch-2.0.1/src',
'Csg': '../../kiosktouch/app',
'Csg.common': '../../cxpe-common/js/touch2/common',
'Csg.client': '../../client/mobile/app'
},
disableCaching: false
});

jay@moduscreate.com
12 Jul 2012, 1:56 PM
how are you using the nano namespace? Sounds like an issue with the build process we are experiencing where we have an ajax request in the app controller's init function.

estesbubba
12 Jul 2012, 2:11 PM
Just checked and no Ajax requests in any controller's init(). Here is how we use the Nano namespace and the only place it is referenced. There is no JavaScript file for it as it is built into the Awesomium process.



Ext.define('Csg.api.KioskDeviceNanoApi', {
singleton: true,
name: 'nano',


getKioskName: function(callbackFn, scope) {
this.getParameter('CareExpressKioskName', callbackFn, scope);
},


setParameter: function(parameter, value) {
this.log(Csg.util.Log.DEVICE_API, 0, 0, 'Calling ' + this.getCaller() + ':' + parameter + ':' + value);
Nano.SetParameter(parameter, value);
},

...

mitchellsimoens
14 Jul 2012, 7:01 AM
Where is the setParameter method being called?

estesbubba
18 Jul 2012, 7:16 AM
These calls are made in several different controllers. Here is the workaround I put at the top of app.js



// Need to fake out external Nano API for SDK tools
var Nano = Nano || {
AttractLoop: Ext.emptyFn,
DebugLog: Ext.emptyFn,
GetBarCodeReaderStatus: Ext.emptyFn,
Log: Ext.emptyFn,
GetAvailableDevices: Ext.emptyFn,
GetBarCodeReaderStatus: Ext.emptyFn,
GetCashReaderStatus: Ext.emptyFn,
GetCardReaderStatus: Ext.emptyFn,
GetCheckReaderStatus: Ext.emptyFn,
GetPrinterStatus: Ext.emptyFn,
GetParameter: Ext.emptyFn,
PrintReceipt: Ext.emptyFn,
ResetAllDevices: Ext.emptyFn,
SetParameter: Ext.emptyFn,
StartCashReader: Ext.emptyFn,
StopCashReader: Ext.emptyFn,
StartCardReader: Ext.emptyFn,
StopCardReader: Ext.emptyFn,
StartCheckReader: Ext.emptyFn,
StopCheckReader: Ext.emptyFn,
StartBarCodeReader: Ext.emptyFn,
StopBarCodeReader: Ext.emptyFn
};