falkolab.ext3.direct yra server-side kamino ExtJS 3 d.
Kaip jį naudoti? "
Leiskite registruotis API ir Peržiūrėjo:
& Nbsp; & gt; & gt; & gt; nuo zope.configuration importo xmlconfig
& Nbsp; & gt; & gt; & gt; kontekstas = xmlconfig.string ("" "
& Nbsp; ... & lt; konfigūruoti
& Nbsp; ... Xmlns = "http://namespaces.zope.org/zope"
& Nbsp; ... Xmlns: extdirect = "http://namespaces.zope.org/extdirect"
& Nbsp; ... & gt;
& Nbsp; ... & lt; įtraukti pakuotės = "falkolab.ext3.direct" failas = "meta.zcml" / & gt;
& Nbsp; ...
& Nbsp; ... & lt; extdirect: API
& Nbsp; ... už = "zope.app.folder.interfaces.IFolder"
& Nbsp; ... vardų = "my.app"
& Nbsp; ... / & gt;
& Nbsp; ...
& Nbsp; ... & lt; extdirect: vaizdas
& Nbsp; ... už = "zope.app.folder.interfaces.IFolder"
& Nbsp; ... class = "falkolab.ext3.direct.testing.AlbumList"
& Nbsp; ... Permission = "zope.ManageContent"
& Nbsp; ... Name = "albumlist"
& Nbsp; ... / & gt;
& Nbsp; ...
& Nbsp; ... & lt; extdirect: vaizdas
& Nbsp; ... už = "zope.app.folder.interfaces.IFolder"
& Nbsp; ... class = "falkolab.ext3.direct.testing.Contact"
& Nbsp; ... Permission = "zope.ManageContent"
& Nbsp; ... / & gt;
& Nbsp; ...
& Nbsp; ... "" ")
Tiesioginis API:
& Nbsp; & gt; & gt; & gt; Spausdinti Http (R "" "
& Nbsp; ... Get /@@directapi HTTP / 1.1
& Nbsp; ... Autorizacija: Pagrindinis bWdyOm1ncnB3
& Nbsp; ... "" ")
& Nbsp; HTTP / 1.1 200 OK
& Nbsp; Laikinoji-Control ": no-cache
& Nbsp; Turinio Ilgis: ...
& Nbsp; Content-Type: text / javascript yra; charset = UTF-8
& Nbsp; Pasibaigs: ...
& Nbsp; Pragma ": no-cache
& Nbsp; & lt; BLANKLINE & gt;
& Nbsp; Ext.namespace (my.app ');
& Nbsp; my.app.REMOTING_API = {"URL": "http: // localhost /@@directrouter", "vardų": "my.app", "tipas": "Remoting", "veiksmus": {"Susisiekite "[{" vardas ":" getInfo "," LEN ": 1}]" albumlist ": [{" formHandler ": tiesa," vardas ":" pridėti "," Len ": 0}, {" vardas ":" getAll "," LEN ": 0}]}};
Automatinis pridėti teikėją:
& Nbsp; & gt; & gt; & gt; Spausdinti Http (R "" "
& Nbsp;? ... Get /@@directapi add_provider HTTP / 1.1
& Nbsp; ... Autorizacija: Pagrindinis bWdyOm1ncnB3
& Nbsp; ... "" ")
& Nbsp; HTTP / 1.1 200 OK
& Nbsp; Laikinoji-Control ": no-cache
& Nbsp; Turinio Ilgis: ...
& Nbsp; Content-Type: text / javascript yra; charset = UTF-8
& Nbsp; Pasibaigs: ...
& Nbsp; Pragma ": no-cache
& Nbsp; & lt; BLANKLINE & gt;
& Nbsp; Ext.namespace (my.app ');
& Nbsp; my.app.REMOTING_API = {"URL": "http: // localhost /@@directrouter", "vardų": "my.app", "tipas": "Remoting", "veiksmus": {"Susisiekite "[{" vardas ":" getInfo "," LEN ": 1}]" albumlist ": [{" formHandler ": tiesa," vardas ":" pridėti "," Len ": 0}, {" vardas ":" getAll "," LEN ": 0}]}};
& Nbsp; Ext.Direct.addProvider (my.app.REMOTING_API);
Ir Tiesioginės užklausos hanling (už to matyti ROUTER.TXT):
& Nbsp; & gt; & gt; & gt; Spausdinti Http (R "" "
& Nbsp; ... Post /@@directrouter HTTP / 1.1
& Nbsp; ... Autorizacija: Pagrindinis bWdyOm1ncnB3
& Nbsp; ... Turinio ilgis: 71
& Nbsp; ... Content-Type: application / JSON; charset = UTF-8
& Nbsp; ... Referer http: // localhost /
& Nbsp; ...
& Nbsp; ... {"veiksmas": "albumlist", "metodas": "getAll", "duomenys": [], "tipas": "RPC", "TID": 1} "" ")
& Nbsp; HTTP / 1.1 200 OK
& Nbsp; Turinio ilgis: 89
& Nbsp; Content-Type: text / javascript yra
& Nbsp; & lt; BLANKLINE & gt;
& Nbsp; {"veiksmas": "albumlist", "TID": 1, "tipas": "RPC", "metodas": "getAll", "rezultatas" [1, 2, 3]}
Kas naujo , šioje laidoje:
- Pokyčiai remti Python 2.6
Reikalavimai
- Python,
Komentarai nerastas