Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: Direct API In Designer

  1. #1
    Sencha Premium Member
    Join Date
    Apr 2007
    Posts
    8
    Vote Rating
    0
      0  

    Default Direct API In Designer

    Just wondering if anyone has got Ext Direct to work in the designer. When i put in api url in the "Ext Direct Api" field in the preferences, it just says Specification failed to load ???

    Is this url dependant at all on the urlPrefix field??

  2. #2
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,487
    Vote Rating
    145
      0  

    Default

    It is not dependent on the urlPrefix. You can put a full path in the Ext Direct API.

    The Ext.Direct stack which you are running must support the format=json parameter to return JSON rather than standard JS.
    Aaron Conran
    @aconran

  3. #3
    Sencha Premium Member
    Join Date
    Apr 2007
    Posts
    8
    Vote Rating
    0
      0  

    Default

    Sorry, but i dont really understand.

    I just looked through the docs looking how to set the "format=json" parameter.
    No good.

    This is the output from my api call.

    PHP Code:
    Agt.rpc.REMOTING_API = {"url":"\/direct\/router","type":"remoting","actions":{"Setup":[{"name":"getAllAgents","len":4},{"name":"saveAgent","len":0,"formHandler":true},{"name":"loadAgent","len":1},{"name":"deleteAgent","len":1},{"name":"getAllCustomers","len":4},{"name":"saveCustomer","len":0,"formHandler":true},{"name":"loadCustomer","len":1},{"name":"deleteCustomer","len":1},{"name":"getAllSalesPersons","len":4},{"name":"saveSalesPerson","len":0,"formHandler":true},{"name":"loadSalesPerson","len":1},{"name":"deleteSalesPerson","len":1},{"name":"getAllAreasPaged","len":4},{"name":"getAllAreas","len":0},{"name":"saveArea","len":0,"formHandler":true},{"name":"loadArea","len":1},{"name":"deleteArea","len":1}],"Games":[{"name":"GetGamesCombo","len":1},{"name":"GetGameVariantsCombo","len":1},{"name":"GetGame","len":1},{"name":"GetGameVariants","len":3},{"name":"getGames","len":4},{"name":"updateGame","len":0,"formHandler":true},{"name":"loadGame","len":1},{"name":"getGameBcvs","len":1},{"name":"createBcv","len":1},{"name":"updateBcv","len":1},{"name":"deleteBcv","len":1},{"name":"getJackpotProfiles","len":1},{"name":"updateJackpotProfile","len":0,"formHandler":true},{"name":"deleteJackpotProfile","len":1},{"name":"getVariations","len":1},{"name":"createVariation","len":1},{"name":"updateVariation","len":1},{"name":"deleteVariation","len":1}],"CallReports":[{"name":"getAllSalesPersons","len":0},{"name":"getSummary","len":7},{"name":"getByCustomer","len":1},{"name":"getAllByRep","len":1},{"name":"getAll","len":5},{"name":"getTreeNodes","len":1}],"General":[{"name":"GetUserDetails","len":0},{"name":"getCustomersCombo","len":3},{"name":"getSalesRepsCombo","len":0},{"name":"getModelsCombo","len":0},{"name":"getGameTypesCombo","len":0},{"name":"getPartsCombo","len":0}],"Quotes":[{"name":"getAll","len":5},{"name":"getTreeNodes","len":1},{"name":"save","len":0,"formHandler":true},{"name":"submitQuote","len":1},{"name":"approveQuote","len":1},{"name":"rejectQuote","len":2},{"name":"loadQuote","len":1}]},"namespace":"Agt.rpc"}; 

  4. #4
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,487
    Vote Rating
    145
      0  

    Default

    The latest Ext.Direct specs support a url parameter of format=json.

    This would cause the direct api generator to valid JSON.

    "Agt.rpc.REMOTING_API" would be put in the JSON packet as a key of descriptor.

    For example
    Code:
    {"descriptor":"Agt.rpc.REMOTING_API","url":"\/direct\/router","type":"remoting","actions":{"Setup":[{"name":"getAllAgents","len":4},{"name":"saveAgent","len":0,"formHandler":true},{"name":"loadAgent","len":1},{"name":"deleteAgent","len":1},{"name":"getAllCustomers","len":4},{"name":"saveCustomer","len":0,"formHandler":true},{"name":"loadCustomer","len":1},{"name":"deleteCustomer","len":1},{"name":"getAllSalesPersons","len":4},{"name":"saveSalesPerson","len":0,"formHandler":true},{"name":"loadSalesPerson","len":1},{"name":"deleteSalesPerson","len":1},{"name":"getAllAreasPaged","len":4},{"name":"getAllAreas","len":0},{"name":"saveArea","len":0,"formHandler":true},{"name":"loadArea","len":1},{"name":"deleteArea","len":1}],"Games":[{"name":"GetGamesCombo","len":1},{"name":"GetGameVariantsCombo","len":1},{"name":"GetGame","len":1},{"name":"GetGameVariants","len":3},{"name":"getGames","len":4},{"name":"updateGame","len":0,"formHandler":true},{"name":"loadGame","len":1},{"name":"getGameBcvs","len":1},{"name":"createBcv","len":1},{"name":"updateBcv","len":1},{"name":"deleteBcv","len":1},{"name":"getJackpotProfiles","len":1},{"name":"updateJackpotProfile","len":0,"formHandler":true},{"name":"deleteJackpotProfile","len":1},{"name":"getVariations","len":1},{"name":"createVariation","len":1},{"name":"updateVariation","len":1},{"name":"deleteVariation","len":1}],"CallReports":[{"name":"getAllSalesPersons","len":0},{"name":"getSummary","len":7},{"name":"getByCustomer","len":1},{"name":"getAllByRep","len":1},{"name":"getAll","len":5},{"name":"getTreeNodes","len":1}],"General":[{"name":"GetUserDetails","len":0},{"name":"getCustomersCombo","len":3},{"name":"getSalesRepsCombo","len":0},{"name":"getModelsCombo","len":0},{"name":"getGameTypesCombo","len":0},{"name":"getPartsCombo","len":0}],"Quotes":[{"name":"getAll","len":5},{"name":"getTreeNodes","len":1},{"name":"save","len":0,"formHandler":true},{"name":"submitQuote","len":1},{"name":"approveQuote","len":1},{"name":"rejectQuote","len":2},{"name":"loadQuote","len":1}]},"namespace":"Agt.rpc"}
    This allows the designer to introspect the Direct router for the API with standard JSON.
    Aaron Conran
    @aconran

  5. #5
    Sencha Premium Member
    Join Date
    Apr 2007
    Posts
    8
    Vote Rating
    0
      0  

    Default

    Thanks. I should be right now.

    Cheers

  6. #6
    Sencha Premium Member
    Join Date
    Apr 2007
    Posts
    8
    Vote Rating
    0
      0  

    Default

    Still no good.

    My server is now returning valid json like so.

    PHP Code:
    {"url":"\/direct\/router","type":"remoting","actions":{"Setup":[{"name":"getAllAgents","len":4},{"name":"saveAgent","len":0,"formHandler":true},{"name":"loadAgent","len":1},{"name":"deleteAgent","len":1},{"name":"getAllCustomers","len":4},{"name":"saveCustomer","len":0,"formHandler":true},{"name":"loadCustomer","len":1},{"name":"deleteCustomer","len":1},{"name":"getAllSalesPersons","len":4},{"name":"saveSalesPerson","len":0,"formHandler":true},{"name":"loadSalesPerson","len":1},{"name":"deleteSalesPerson","len":1},{"name":"getAllAreasPaged","len":4},{"name":"getAllAreas","len":0},{"name":"saveArea","len":0,"formHandler":true},{"name":"loadArea","len":1},{"name":"deleteArea","len":1}],"Games":[{"name":"GetGamesCombo","len":1},{"name":"GetGameVariantsCombo","len":1},{"name":"GetGame","len":1},{"name":"GetGameVariants","len":3},{"name":"getGames","len":4},{"name":"updateGame","len":0,"formHandler":true},{"name":"loadGame","len":1},{"name":"getGameBcvs","len":1},{"name":"createBcv","len":1},{"name":"updateBcv","len":1},{"name":"deleteBcv","len":1},{"name":"getJackpotProfiles","len":1},{"name":"updateJackpotProfile","len":0,"formHandler":true},{"name":"deleteJackpotProfile","len":1},{"name":"getVariations","len":1},{"name":"createVariation","len":1},{"name":"updateVariation","len":1},{"name":"deleteVariation","len":1}],"CallReports":[{"name":"getAllSalesPersons","len":0},{"name":"getSummary","len":7},{"name":"getByCustomer","len":1},{"name":"getAllByRep","len":1},{"name":"getAll","len":5},{"name":"getTreeNodes","len":1}],"General":[{"name":"GetUserDetails","len":0},{"name":"getCustomersCombo","len":3},{"name":"getSalesRepsCombo","len":0},{"name":"getModelsCombo","len":0},{"name":"getGameTypesCombo","len":0},{"name":"getPartsCombo","len":0}],"Quotes":[{"name":"getAll","len":5},{"name":"getTreeNodes","len":1},{"name":"save","len":0,"formHandler":true},{"name":"submitQuote","len":1},{"name":"approveQuote","len":1},{"name":"rejectQuote","len":2},{"name":"loadQuote","len":1}]},"namespace":"Agt.rpc","descriptor":"Agt.rpc.REMOTING_API"
    Still says Ext.Direct Remoting Specification Failed To Load

  7. #7
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,487
    Vote Rating
    145
      0  

    Default

    Are you putting the full path? Is the api reachable via a browser?
    Aaron Conran
    @aconran

  8. #8
    Sencha Premium Member
    Join Date
    Apr 2007
    Posts
    8
    Vote Rating
    0
      0  

    Default

    Sure am. The json above was from the browser.

    I am putting in the fullpath

    i.e. http://ainsworthsales.local/direct/api

  9. #9
    Touch Premium Member
    Join Date
    Dec 2008
    Location
    Utrecht, The Netherlands
    Posts
    37
    Vote Rating
    0
      0  

    Default

    I didn't see the descriptor parameter in your json response:
    Code:
    { "descriptor":"Agt.rpc.REMOTING_API", ... }
    Best,

    Dirk Louwers

  10. #10
    Sencha Premium Member
    Join Date
    Apr 2007
    Posts
    8
    Vote Rating
    0
      0  

    Default

    its there, at the end of the json.

    Its was working in 1.0.0.3, but now its not again in 1.0.0.4

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •