PDA

View Full Version : Ext Direct resource assumes static api



gbjk
21 Sep 2012, 1:21 AM
Sencha Architect 2.1.0
ExtJS 4.1.2

When you add a Direct resource, Architect assumes that it can inline the result of the url.

Our direct api isn't static.

We need a way to have it request the direct url at *runtime*, and then addProvider against the REMOTING_API after.

Our direct api returns, like most I think, Ext.app.REMOTING_API = {"actions"... }

We still need architect to request it itself, so that the actions available are available in the directFn drop down on direct proxies, though.

Suggestion:
Perhaps a defer attribute on the direct resource.

Thanks

Gareth

aconran
21 Sep 2012, 7:51 AM
Sounds like you should be dynamically requesting the API (perhaps after login) via an Ext.Ajax.request and then adding via addProvider. You can then manually type in the API that you would like to use.

There is no requirement that you actually use a script tag. A defer attribute on the direct resource is a good idea though.

gbjk
21 Sep 2012, 9:36 AM
Aaron,

Yeah, that's exactly what I've done.

The issue is just this one:
We still need architect to request it itself, so that the actions available are available in the directFn drop down on direct proxies, though.

Thanks

Gareth

aconran
24 Sep 2012, 9:38 AM
Gareth -

In a secured environment I'd imagine most of these requests would get rejected anyways wouldn't they?

Can't you just manually type in the name of the directFn?

gbjk
24 Sep 2012, 9:45 AM
Aaron,

We use local https proxies, and the api list is unauthenticated, so there's no real issue there for us.

And yes, that's what we're doing for now.

It might seem small, but allowing designers to use the directFn dropdown is really handy.
( Well obviously... cos you put it there for a reason, right? )

Otherwise they need to go discover api names and actions available themselves.

We can survive, but this would be really nice to have, and would mean we're living inside the way architect "should" work, which is something I'm striving hard for.

Thanks

Gareth