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%
Page 36 of 49 FirstFirst ... 26343536373846 ... LastLast
Results 351 to 360 of 489

Thread: Ext Direct Java based implementation

  1. #351
    Ext JS Premium Member
    Join Date
    May 2009
    Location
    Barcelona (Spain)
    Posts
    222
    Vote Rating
    20
      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) - pagullo.soft.dev at gmail.com
    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
      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
      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
      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
    129
    Vote Rating
    9
      0  

    Default 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
    222
    Vote Rating
    20
      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) - pagullo.soft.dev at gmail.com
    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
      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
      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
      0  

    Thumbs up 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
    222
    Vote Rating
    20
      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) - pagullo.soft.dev at gmail.com
    Agile team building, consulting, training & development
    DirectJNgine: http://code.google.com/p/directjngine - Log4js-ext: http://www.softwarementors.com/projects/p/log4js-ext/

Page 36 of 49 FirstFirst ... 26343536373846 ... 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
  •