PDA

View Full Version : [INFOREQ] ExtDirect.Resource always failed to load



hschaefer123
21 Oct 2012, 10:49 PM
I am trying to get Ext.Direct running inside SA.

ExtDirect itself works, but how should this be done inside SA?!?

My API is always rejected (load failure).
I tested it with JSON and JavaScript Notation:


{

"url": "/edr_router",
"type": "remoting",
"actions": {

"CL_EXT_MODEL": [

{

"name": "CUSTOMER",
"len": 1
},
{

"name": "CUSTOMER_PAV",
"len": 1
},
{

"name": "INTER_REDEFO_LOAD_001",
"len": 1
}
]
}
}




Ext.app.REMOTING_API ={ "url":"/edr_router", "type":"remoting", "actions":{ "CL_EXT_MODEL":[ { "name":"CUSTOMER", "len":1 }, { "name":"CUSTOMER_PAV", "len":1 }, { "name":"INTER_REDEFO_LOAD_001", "len":1 }, { "name":"INTER_REDEFO_LOAD_002", "len":1 }, { "name":"INTER_REDEFO_LOAD_PAV_001", "len":1 }, { "name":"INTER_REDEFO_SAVE_001", "len":1 }, { "name":"INTER_REDEFO_SAVE_002", "len":1 }, { "name":"INTER_REDEFO_SAVE_PAV_001", "len":1 }, { "name":"MATERIAL", "len":1 }, { "name":"PRINT", "len":1 }, { "name":"SEARCHHELP", "len":1 }] }};none of them worked for me.I also had some issues to get it running the right way using Ext.Loader. The store always throwed some errors, because ExtDirect API was loaded to late to be used for ExtDirectFn.My only solution was to hardcode API and constructor and launch method:
... launch: function() {
Ext.direct.Manager.addProvider(Ext.app.REMOTING_API = {
type: 'remoting',
url: 'edr_router',
actions: {
"ZCL_EXT_MODEL": [{
"name": "A8500_MARGIN_CALCULATION_NEW",
"len": 1
}]
}
//namespace: 'Veka'
});


var directStore = Ext.create('Veka.store.BwDirectStore', {
proxy: {
directFn: ZCL_EXT_MODEL.A8500_MARGIN_CALCULATION_NEW,
extraParams: {
//CUSTOMER: '',
//MATERIAL: '',
FISCYEAR: '2010',
FISCPER_FROM: '1',
FISCPER_TO: '12'
}
}
});
directStore.load();


var grid = Ext.create('Veka.view.BwGrid', {
fullscreen: true
});
var titleBar = Ext.getCmp('gridTitleBar');
titleBar.setTitle(titleBar.getTitle() + ' (' + SYS_UNAME + ')');
}



was is the prefered, working way to do this?

Cheers Holger

aconran
22 Oct 2012, 10:07 AM
Holger -

There was a bug with Direct not taking the urlPrefix into account properly that has recently been fixed. I have a feeling this should fix your issue and will be out in the next patch. Please let us know if it doesn't. For now what you have above looks like it will work just fine.

aconran
22 Oct 2012, 10:09 AM
For reference our bug number is DSGNR-2405.

hschaefer123
22 Nov 2012, 6:02 AM
Hi Aaron,
i just testet 2.1.0.676 concerning ext direct, but is is not working!



Using a JSON string config i got error "Ext Direct Remote Specification failed to load".
Using a JavaScript based configuration, i got a popup dialog telling "An error ocurred"

You're trying to decode an invalid JSON String: Ext.app.REMOTING_API ={ "url":"/edr_router", "type":"remoting", "actions":{ "CL_EXT_MODEL":[ { "name":"CUSTOMER", "len":1 }, { "name":"CUSTOMER_PAV", "len":1 }, { "name":"INTER_REDEFO_LOAD_001", "len":1 }, { "name":"INTER_REDEFO_LOAD_002", "len":1 }, { "name":"INTER_REDEFO_LOAD_PAV_001", "len":1 }, { "name":"INTER_REDEFO_SAVE_001", "len":1 }, { "name":"INTER_REDEFO_SAVE_002", "len":1 }, { "name":"INTER_REDEFO_SAVE_PAV_001", "len":1 }, { "name":"MATERIAL", "len":1 }, { "name":"PRINT", "len":1 }, { "name":"SEARCHHELP", "len":1 }] } };


Source Class: Ext.JSON
Source Method: decode



Any help how to get ExtDirect working.

Ext Direct works in my Sencha Designer 1.0 i am currently using for a productive Szenario.
What are the issues? Why do i can't use Direct in Architect 2.0.

Release Cycles on bugs are very long!

Cheers Holger

aconran
26 Nov 2012, 7:53 AM
What server side stack are you using? Is it abiding by the format=json param? It looks like its returning JavaScript instead of JSON and we're trying to decode it as JSON.

hschaefer123
26 Nov 2012, 8:25 AM
It is a custom implementation inside a SAP Application Server. I wrote an ext direct implementation that support api uri with javaScript and JSON Format. Our Solution works in Sencha Architect 1.0 (which i am using currently in productive SAP Solutions).

Using URI: http://fo50.eaton.de/edr_api?CONF=JSON

I return

Content-Type
: application/json; charset=utf-8



and the following content:


{

"url": "/edr_router",
"type": "remoting",
"actions": {

"CL_EXT_MODEL": [

{

"name": "CUSTOMER",
"len": 1
},
{

"name": "CUSTOMER_PAV",
"len": 1
},
{

"name": "INTER_REDEFO_LOAD_001",
"len": 1
},
{

"name": "INTER_REDEFO_LOAD_002",
"len": 1
},
{

"name": "INTER_REDEFO_LOAD_PAV_001",
"len": 1
},
{

"name": "INTER_REDEFO_SAVE_001",
"len": 1
},
{

"name": "INTER_REDEFO_SAVE_002",
"len": 1
},
{

"name": "INTER_REDEFO_SAVE_PAV_001",
"len": 1
},
{

"name": "MATERIAL",
"len": 1
},
{

"name": "PRINT",
"len": 1
},
{

"name": "SEARCHHELP",
"len": 1
}
]
}
}

I am also able to generate JavaScript API including code, using
URI: http://fo50.eaton.de/edr_api?CONF=JS
and


Content-Type:
application/javascript; charset=utf-8



Please can you tell me what did you exactly need from Web Server.
I think, the above JSON Object is valid and also the content type (or am i wrong).

Currently i am using an uri for testing that is not inside app domain (fully qualified).

Cheers Holger