View Poll Results: If you read it, did you find DirectJNgine User's Guide adequate?

Voters
54. You may not vote on this poll
  • Yes

    40 74.07%
  • No

    14 25.93%
  1. #351
    Ext JS Premium Member
    Join Date
    May 2009
    Location
    Barcelona (Spain)
    Posts
    218
    Vote Rating
    19
    pagullo will become famous soon enough pagullo will become famous soon enough

      0  

    Default


    Hi,

    I haven't tried this myself.

    You can check whether it works easily by running the tests in the war enclosed in the djn distribution: if you substitute gson-1.3 by gson-1.5 and they all pass, you can be pretty sure it willl work.
    Pedro Agulló, Barcelona (Spain)
    Agile team building, consulting, training & development
    DirectJNgine: http://code.google.com/p/directjngine - Log4js-ext: http://www.softwarementors.com/projects/p/log4js-ext/

  2. #352
    Sencha User
    Join Date
    Mar 2010
    Location
    Modena, Italy
    Posts
    59
    Vote Rating
    1
    gianmarco is on a distinguished road

      0  

    Default


    Quote Originally Posted by pagullo View Post
    Hi,

    I haven't tried this myself.

    You can check whether it works easily by running the tests in the war enclosed in the djn distribution: if you substitute gson-1.3 by gson-1.5 and they all pass, you can be pretty sure it willl work.
    2 test are failing:

    test_serverReturningPrimitiveDoubleArray
    test_load

    I will debug server code late today if i've time (i need google app engine to run included eclipse project, right?)

  3. #353
    Sencha User
    Join Date
    Mar 2010
    Location
    Modena, Italy
    Posts
    59
    Vote Rating
    1
    gianmarco is on a distinguished road

      0  

    Default


    Quote Originally Posted by gianmarco View Post
    2 test are failing:

    test_serverReturningPrimitiveDoubleArray
    test_load

    I will debug server code late today if i've time (i need google app engine to run included eclipse project, right?)
    test_serverReturningPrimitiveDoubleArray fail due to this regression: http://code.google.com/p/google-gson.../detail?id=234

  4. #354
    Sencha User
    Join Date
    Mar 2010
    Location
    Modena, Italy
    Posts
    59
    Vote Rating
    1
    gianmarco is on a distinguished road

      0  

    Default


    Hi,
    as described in the docs, i'm trying to send parameters as JsonArray, so i have this method in Java

    Code:
    @DirectMethod
    public void method(JsonArray params);
    And i call it this way in Javascript:

    Code:
    Server.method('par1, 'par2', function () {
     // ...
    });
    But in Java params is an array containing just the first parameter, so:

    Code:
    ['par1']
    This seems a bug, can you confirm that i'm using it the right way??

    Thanks

  5. #355
    Sencha Premium Member
    Join Date
    Sep 2010
    Posts
    128
    Vote Rating
    1
    Tod is on a distinguished road

      0  

    Default Need to access JSF managed beans

    Need to access JSF managed beans


    I have a JSF-centric application that needs a few Extjs based pages. I'm a complete newcomer to Extjs. Can I use Ext.Direct to access my JSF managed beans and have them deliver JSON data? Or is there a different technology I should be using? Does anyone have an example? Much thanks. -Tod

  6. #356
    Ext JS Premium Member
    Join Date
    May 2009
    Location
    Barcelona (Spain)
    Posts
    218
    Vote Rating
    19
    pagullo will become famous soon enough pagullo will become famous soon enough

      0  

    Default


    Quote Originally Posted by gianmarco View Post
    Hi,
    as described in the docs, i'm trying to send parameters as JsonArray...
    Hi!

    Gian Marco, you can implement passing an arbitrary number of parameters as follows:

    Javascript code:
    Code:
      test_handleJsonDataMethodForMultipleParams : function() {
          var param = false;
          var param2 = "param2";
          var param3 = 3;
          ServerMethodParametersReceptionTest.test_handleJsonDataMethodForMultipleParams(
               [param, param2, param3], function(provider, response)
         {
            Djn.Test.checkSuccessfulResponse("test_handleJsonDataMethodForMultipleParams", 
               response, response.result === 100);
          });
      }
    Please, note that we are passing the parameters as an array.

    Java code:
    Code:
      @DirectMethod
      public int test_handleJsonDataMethodForMultipleParams( JsonArray data) {
        assert data != null;
        
        if( data.size() != 1) {
          throw new DirectTestFailedException( "We expected a json array with one element");
        }
        
        JsonElement element = data.get(0);
        if( !element.isJsonArray()) {
          throw new DirectTestFailedException( "We expected the first json item to be a json array");
        }
        
        JsonArray parameters = element.getAsJsonArray();
        if( parameters.size() != 3) {
          throw new DirectTestFailedException( "We expected a json array with three element");
        }
        
        element = parameters.get(0);
        if( !element.isJsonPrimitive()) {
          throw new DirectTestFailedException( "We expected the first json item to be a json primitive");
        }
        JsonPrimitive primitive = (JsonPrimitive)element;
        if( !primitive.isBoolean()) {
          throw new DirectTestFailedException( "We expected a primitive json boolean element");
        }
        if( primitive.getAsBoolean()) {
          throw new DirectTestFailedException( "We expected a false value");
        }
    
        element = parameters.get(1);
        if( !element.isJsonPrimitive()) {
          throw new DirectTestFailedException( "We expected the first json item to be a json primitive");
        }
        primitive = (JsonPrimitive)element;
        if( !primitive.isString()) {
          throw new DirectTestFailedException( "We expected a primitive json string element");
        }
        if( !primitive.getAsString().equals("param2")) {
          throw new DirectTestFailedException( "We expected a 'param2' value");
        }
        
        element = parameters.get(2);
        if( !element.isJsonPrimitive()) {
          throw new DirectTestFailedException( "We expected the first json item to be a json primitive");
        }
        primitive = (JsonPrimitive)element;
        if( !primitive.isNumber()) {
          throw new DirectTestFailedException( "We expected a primitive json number element");
        }
        if( primitive.getAsInt() != 3) {
          throw new DirectTestFailedException( "We expected a '3' value");
        }
        
        return 100;
      }
    When I have some time, I will update the User's Guide to show how to handle a variable number of arguments.

    BTW: I would like to handle this differently, though, more like what you attempted -but that would not be easy, as there are other parts of the system whose lifes are made easier by making the parameter to be a JsonArray of just one element (instead of just a JsonElement).

    Regards,
    Pedro Agulló, Barcelona (Spain)
    Agile team building, consulting, training & development
    DirectJNgine: http://code.google.com/p/directjngine - Log4js-ext: http://www.softwarementors.com/projects/p/log4js-ext/

  7. #357
    Sencha User
    Join Date
    Mar 2010
    Location
    Modena, Italy
    Posts
    59
    Vote Rating
    1
    gianmarco is on a distinguished road

      0  

    Default


    I'll try this, thanks!

    Quote Originally Posted by pagullo View Post
    Hi!

    Gian Marco, you can implement passing an arbitrary number of parameters as follows:

    Javascript code:
    Code:
      test_handleJsonDataMethodForMultipleParams : function() {
          var param = false;
          var param2 = "param2";
          var param3 = 3;
          ServerMethodParametersReceptionTest.test_handleJsonDataMethodForMultipleParams(
               [param, param2, param3], function(provider, response)
         {
            Djn.Test.checkSuccessfulResponse("test_handleJsonDataMethodForMultipleParams", 
               response, response.result === 100);
          });
      }
    Please, note that we are passing the parameters as an array.

    Java code:
    Code:
      @DirectMethod
      public int test_handleJsonDataMethodForMultipleParams( JsonArray data) {
        assert data != null;
        
        if( data.size() != 1) {
          throw new DirectTestFailedException( "We expected a json array with one element");
        }
        
        JsonElement element = data.get(0);
        if( !element.isJsonArray()) {
          throw new DirectTestFailedException( "We expected the first json item to be a json array");
        }
        
        JsonArray parameters = element.getAsJsonArray();
        if( parameters.size() != 3) {
          throw new DirectTestFailedException( "We expected a json array with three element");
        }
        
        element = parameters.get(0);
        if( !element.isJsonPrimitive()) {
          throw new DirectTestFailedException( "We expected the first json item to be a json primitive");
        }
        JsonPrimitive primitive = (JsonPrimitive)element;
        if( !primitive.isBoolean()) {
          throw new DirectTestFailedException( "We expected a primitive json boolean element");
        }
        if( primitive.getAsBoolean()) {
          throw new DirectTestFailedException( "We expected a false value");
        }
    
        element = parameters.get(1);
        if( !element.isJsonPrimitive()) {
          throw new DirectTestFailedException( "We expected the first json item to be a json primitive");
        }
        primitive = (JsonPrimitive)element;
        if( !primitive.isString()) {
          throw new DirectTestFailedException( "We expected a primitive json string element");
        }
        if( !primitive.getAsString().equals("param2")) {
          throw new DirectTestFailedException( "We expected a 'param2' value");
        }
        
        element = parameters.get(2);
        if( !element.isJsonPrimitive()) {
          throw new DirectTestFailedException( "We expected the first json item to be a json primitive");
        }
        primitive = (JsonPrimitive)element;
        if( !primitive.isNumber()) {
          throw new DirectTestFailedException( "We expected a primitive json number element");
        }
        if( primitive.getAsInt() != 3) {
          throw new DirectTestFailedException( "We expected a '3' value");
        }
        
        return 100;
      }
    When I have some time, I will update the User's Guide to show how to handle a variable number of arguments.

    BTW: I would like to handle this differently, though, more like what you attempted -but that would not be easy, as there are other parts of the system whose lifes are made easier by making the parameter to be a JsonArray of just one element (instead of just a JsonElement).

    Regards,

  8. #358
    Ext User
    Join Date
    Nov 2010
    Posts
    2
    Vote Rating
    0
    tfannon is on a distinguished road

      0  

    Default


    two questions:

    1) does DirectJNgine 1.3 work with ExtJS 3.3?
    2) I am very new to the app engine and java web development in general. Are there any quickstart guides for getting JDirect running directly in the app-engine? I have been trying to make the intro work from the user guide, but so far I am not having luck.

    Thanks,
    TF

  9. #359
    Ext User
    Join Date
    Nov 2010
    Posts
    2
    Vote Rating
    0
    tfannon is on a distinguished road

      0  

    Thumbs up some clarification.

    some clarification.


    Specifically, I think I am having trouble specifying the autogenerated api file when running the modified direct-form.php file. I have tried many permutations of the following:

    <script type="text/javascript"
    src="/djn/directprovider/src=demo/Api-debug.js">
    </script>

    In the output window of app engine as well as looking at the requests in Firebug, it seems it is trying to reach back to extjs/djn/directprovider and getting (3) 404 errors.

    Can anyone provide anyhelp?

  10. #360
    Ext JS Premium Member
    Join Date
    May 2009
    Location
    Barcelona (Spain)
    Posts
    218
    Vote Rating
    19
    pagullo will become famous soon enough pagullo will become famous soon enough

      0  

    Default


    Quote Originally Posted by tfannon View Post
    two questions:

    1) does DirectJNgine 1.3 work with ExtJS 3.3?
    It should work, but I haven't tested it yet. To be on the safe side, run the example test application included in the distribution, executing all tests.

    And, please, let us know what happens :-)

    2) I am very new to the app engine and java web development in general. Are there any quickstart guides for getting JDirect running directly in the app-engine? I have been trying to make the intro work from the user guide, but so far I am not having luck.

    Thanks,
    TF

    There is no quickstart guide for app-engine: probably, the best you can do is follow the User's Guide steps without attempting to provide support for app-engine. Once you make it work, provide support for the google app engine following the steps in the User's Guide

    I know, baby steps, but that way it will be easier to know when things go awry for you.
    Pedro Agulló, Barcelona (Spain)
    Agile team building, consulting, training & development
    DirectJNgine: http://code.google.com/p/directjngine - Log4js-ext: http://www.softwarementors.com/projects/p/log4js-ext/

Thread Participants: 88

  1. Animal (5 Posts)
  2. barton (4 Posts)
  3. Condor (1 Post)
  4. mauro_monti (6 Posts)
  5. mbarto (1 Post)
  6. aconran (1 Post)
  7. MoShAn480 (1 Post)
  8. asgillett (2 Posts)
  9. seade (4 Posts)
  10. zaqwsxqwer (3 Posts)
  11. Sesshomurai (16 Posts)
  12. ThierryC (3 Posts)
  13. maxm165 (3 Posts)
  14. techstudios (2 Posts)
  15. sayonara (2 Posts)
  16. kschlaudt (1 Post)
  17. hschaefer123 (2 Posts)
  18. omarc (2 Posts)
  19. lxbzmy (4 Posts)
  20. mct (6 Posts)
  21. mediacept (2 Posts)
  22. dionisexorcius (1 Post)
  23. alper (1 Post)
  24. steverc (2 Posts)
  25. chrizmaster (18 Posts)
  26. J@y (21 Posts)
  27. Georgioa (6 Posts)
  28. wguan (1 Post)
  29. minneyar (16 Posts)
  30. jhoweaa (1 Post)
  31. Ramez (2 Posts)
  32. malus (1 Post)
  33. dweller (8 Posts)
  34. stdunbar (1 Post)
  35. vlagorce (20 Posts)
  36. cwilliso (1 Post)
  37. Whatty (13 Posts)
  38. Ice (1 Post)
  39. clynnh (1 Post)
  40. SreevaniN (1 Post)
  41. Stsalomon90 (1 Post)
  42. GregT (9 Posts)
  43. jcalfee (6 Posts)
  44. set_ti (1 Post)
  45. maho2nd (3 Posts)
  46. dreamtaotao (3 Posts)
  47. Toxa (4 Posts)
  48. tungchau (3 Posts)
  49. wlan0 (2 Posts)
  50. jpr (2 Posts)
  51. gianmarco (5 Posts)
  52. extjslikeit (2 Posts)
  53. harmen_wessels (1 Post)
  54. Olivercomputing2 (4 Posts)
  55. brainformance (1 Post)
  56. vanessa_ng (2 Posts)
  57. alois.cochard (5 Posts)
  58. kyrillos52 (2 Posts)
  59. Tod (1 Post)
  60. Alinanila (1 Post)
  61. tfannon (2 Posts)
  62. Kynao (1 Post)
  63. feiq (4 Posts)
  64. dalt (1 Post)
  65. xfolch (1 Post)
  66. avijit (1 Post)
  67. marcelsnews (2 Posts)
  68. maddhippy (1 Post)
  69. sritter (1 Post)
  70. july (2 Posts)
  71. jtkeller7983 (1 Post)
  72. lfranchini (2 Posts)
  73. 7/11 (2 Posts)
  74. yAdEs (1 Post)
  75. zazz (1 Post)
  76. waqar (5 Posts)
  77. pjain11 (1 Post)
  78. alexMobimesh (2 Posts)
  79. zachHurt (4 Posts)
  80. n0n3 (5 Posts)
  81. adavis2 (1 Post)
  82. mark.peters (1 Post)
  83. lee el (4 Posts)
  84. frengo19 (3 Posts)
  85. prakashwagle (1 Post)
  86. extejnar (2 Posts)
  87. alin@sonatype.com (1 Post)
  88. ajay_kango (3 Posts)