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. #361
    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
    Specifically, I think I am having trouble specifying the autogenerated api file when running the modified direct-form.php file.
    Just in case, and to avoid confusion, note that DJN does not create a physical file when you configure it to run with Google AppEgine, the code is returned via an URL.

    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?
    If you look at the User's Guide, page 26, there I mention that you need to specify the context name too in the script 'src' attribute. I think you are missing this.

    Besides, the documentation in page 26 specifies that you need to set several configuration parameters. Can you check that you did that right?

    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/

  2. #362
    Ext User
    Join Date
    Jan 2011
    Posts
    1
    Vote Rating
    0
    xfolch is on a distinguished road

      0  

    Default GridPanel with DirectJNgine

    GridPanel with DirectJNgine


    Hi Pedro.

    I'm trying to create a CRUD (Create, Read, Update, Delete) GridPanel using ExtJS 3, Spring and DirectJNgine last version. To do this, I have defined a bean class and a controller class called 'ExpedienteController' with the following direct method:

    Code:
        @DirectMethod
        public ModelMap create(List<Expediente> expedienteList) throws Exception {
    
            try {
                expedienteService.create(newExpedientes);
                return getMap(newExpedientes);
            } catch (Exception e) {
                return getModelMapError("Error intentado crear un expediente");
            }
        }
    Note that the method 'create' receives as parameter a list of records.

    In javascript file, I define the following DirectStore:

    Code:
        Ext.Direct.addProvider(Ext.app.REMOTING_API);
        
        var Expediente = Ext.data.Record.create([
         {
             name: 'dbid',
             type: 'long'
         }, {
             name: 'analista',
             type: 'string'
         }, {
             name: 'estado',
             type: 'string'
         }]);
        
        var store = new Ext.data.DirectStore( {
            paramsAsHash: false,
            root: '',
            idProperty: 'dbid',
            fields: Expediente,
            api: {
        		read: ExpedienteController.view,
        		create: ExpedienteController.create,
        		update: ExpedienteController.update,
        		destroy: ExpedienteController.delete
        	},
        	writer: new Ext.data.JsonWriter({
        		encode: false,
        		listful: true,
        		writeAllFields: true
        	}),
        	autoSave: false
          });
    Here the GridPanel code:

    Code:
        var editor = new Ext.ux.grid.RowEditor({
            saveText: 'Modificar',
            cancelText: 'Cancelar'
        });
        
    
        // create grid
        var grid = new Ext.grid.GridPanel({
            store: store,
            columns: [
                {header: "DBID",
                 width: 170,
                 sortable: true,
                 dataIndex: 'dbid',
                 hidden: false
                },
                {header: "ANALISTA",
                 width: 160,
                 sortable: true,
                 dataIndex: 'analista',
                 editor: {
                     xtype: 'textfield',
                     allowBlank: false
                }},
                {header: "ESTADO",
                 width: 170,
                 sortable: true,
                 dataIndex: 'estado',
                 editor: {
                    xtype: 'textfield',
                    allowBlank: false
                }}
            ],
            viewConfig:{forcefit:true},
            plugins: [editor],
            title: 'Expedientes de analisis',
            height: 300,
            width:535,
    		frame:true,
    		tbar: [{
                iconCls: 'icon-user-add',
                text: 'Añadir Expediente',
                handler: function(){
                    var e = new Expediente({
                    	dbid: 00000,
                        analista: 'Informar',
                        estado: 'CP'
                    });
                    editor.stopEditing();
                    store.insert(0, e);
                    grid.getView().refresh();
                    grid.getSelectionModel().selectRow(0);
                    editor.startEditing(0);
                }
            },{
                iconCls: 'icon-user-delete',
                text: 'Eliminar Expediente',
                handler: function(){
                    editor.stopEditing();
                    var s = grid.getSelectionModel().getSelections();
                    for(var i = 0, r; r = s[i]; i++){
                        store.remove(r);
                    }
                }
            },{
                iconCls: 'icon-user-save',
                text: 'Guardar modificaciones',
                handler: function(){
                    store.save();
                	Ext.Msg.show({
                		title: 'Info',
                		msg: 'Modificaciones realizadas correctamente',
                		icon: Ext.MessageBox.INFO,
                		buttons: Ext.Msg.OK
                	});
                }
            }]
        });
    The problem occurs when I try to save in the store. In the Javascript console I get the following error:

    JsonException: Failed attempt to convert from a json string to java method parameters. Method='ExpedienteController.create', Json string='[{"":[{"dbid":0,"analista":"Informar","estado":"CP"}]}]', ExpectedTypes='java.util.List'

    If I change the create method of the controller to receive an array instead of a list, also get the following error:

    IllegalArgumentException: '{"":[{"dbid":0,"analista":"Informar","estado":"CP"}]}' is not a valid json text for the '[Lorg.test.persistence.entities.Expediente;' Java type

    Is correct DirectStore code? How could I save the elements from a GridPanel?

    On the other hand, I also tried making the call to create method directly:
    ExpedienteController.create([{dbid:0,analista:"informar",estado:"EC"}]);

    but I receive this error:

    JsonException: Failed attempt to convert from a json string to java method parameters. Method='ExpedienteController.create', Json string='[[{"dbid":0,"analista":"Informar","estado":"CP"}]]', ExpectedTypes='java.util.List'

    Only in the case of changing the method create to receive an array (Expediente[]) instead of a list, this call works correctly!

    How could I send a java.util.List?

    Thanks in advance.

  3. #363
    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

      -1  

    Default


    Hi!

    Let me answer the second part of your post first, regarding the use of a List vs array and the fact that arrays work but Lists do not...


    On the other hand, I also tried making the call to create method directly:
    ExpedienteController.create([{dbid:0,analista:"informar",estado:"EC"}]);

    but I receive this error:

    JsonException: Failed attempt to convert from a json string to java method parameters. Method='ExpedienteController.create', Json string='[[{"dbid":0,"analista":"Informar","estado":"CP"}]]', ExpectedTypes='java.util.List'

    Only in the case of changing the method create to receive an array (Expediente[]) instead of a list, this call works correctly!

    How could I send a java.util.List?
    DJN uses GSON to perform class transfer from Java to Javascript, and due to the fact that lists are generic and how generics are implemented in Java (sigh!), GSON has trouble in some situations. Please, check the documentation at http://sites.google.com/site/gson/gs...ns-Limitations for details.

    Converting data Java<=>Javascript is done by GSON in 95% of cases, and you will do well spending a bit of time with its documentation when you find trouble with data conversion :-)

    Now, how to write create so that it works with a list? Don't! Use an array. If you pass an array, GSON can ascertain more things via introspection than if you pass a List, namely the type of the objects the array contains: that's why the array version works. Just provide a private method for DirectJNgine usage only that works with arrays and converts the array from/to the List your business code likes, and calls the list-based method -pure boilerplate code!

    I must insist: do not "bend" your public business code to please GSON. If you use lists, do not change to arrays, write a DJN-friendly private method that performs conversion -in some scenarios it might be even better to write a DJN-friendly wrapper class so that you do not "contaminate" business code, but that is not required.

    BTW: if you take a look at how GSON works with generic collections, you'll find that there are other workarounds, but most of the time the solution I propose is easier.

    With regard to the first part of your post, using the DirectStore, I am not sure about what's going on. I have to confess I do not use the api thing. What is clear to me is that using the List-based version of the method is a no-no, for the reasons mentioned above. Maybe somebody else can shed light on what's going on with the array based version and DirectStore.

    As an easy workaround, you can call the array-based methods directly via event handlers, instead of wiring them via the api thing in DirectStore. Not that much extra work, really.

    Hope this helps.
    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/

  4. #364
    Ext User
    Join Date
    Jan 2011
    Posts
    1
    Vote Rating
    0
    avijit is on a distinguished road

      0  

    Default


    Hi Tod,
    Even i have similar scenario need to include Extjs in Jsf 2.0 project .Did you manage to use Ext.Direct with JSf ?
    Please share your experience on this.

    thanks
    avi

  5. #365
    Sencha User
    Join Date
    Nov 2007
    Posts
    294
    Vote Rating
    0
    Sesshomurai is on a distinguished road

      0  

    Default


    I tried to find the answer for this, but no luck so far.

    So every time I make a call to my DirectJEngine method in my class, a new instance is created for every call.
    Is there a way to tell DirectJNgine to use the same object for every call and leave the synchronization up to me?

  6. #366
    Ext JS Premium Member minneyar's Avatar
    Join Date
    Apr 2009
    Location
    San Antonio, TX
    Posts
    35
    Vote Rating
    0
    minneyar is on a distinguished road

      0  

    Default


    Quote Originally Posted by Sesshomurai View Post
    Is there a way to tell DirectJNgine to use the same object for every call and leave the synchronization up to me?
    There are a few different ways you can handle that. One is that you can make your functions static, in which case no instance of the class will be allocated when the function is called.

    Alternately, you can use the @ActionScope annotation on your class to tell DirectJNgine to create an instance of the class for each call (Scope.STATELESS), create one instance per user session (Scope.SESSION), or one instance per web application (Session.APPLICATION). See the "State management and session/application scope support" section of the manual for more information on that.

  7. #367
    Sencha User
    Join Date
    Nov 2007
    Posts
    294
    Vote Rating
    0
    Sesshomurai is on a distinguished road

      0  

    Default


    Thank you very much for the suggestion, it works great.

  8. #368
    Sencha User
    Join Date
    May 2011
    Posts
    4
    Vote Rating
    0
    july is on a distinguished road

      0  

    Question ExtJs3.3.3

    ExtJs3.3.3


    hi,

    have anyone trie DJN with weblogic10.3.3, i have problems:

    <Servlet: "DjnServlet" failed to preload on startup in Web application: "MIS.war".
    java.lang.NullPointerException
    at com.softwarementors.extjs.djn.jscodegen.CodeFileGenerator.getDebugFileName(CodeFileGenerator.java:171)
    at com.softwarementors.extjs.djn.jscodegen.CodeFileGenerator.generateCode(CodeFileGenerator.java:106)
    at com.softwarementors.extjs.djn.jscodegen.CodeFileGenerator.updateSource(CodeFileGenerator.java:64)
    at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.createDirectJNgineRouter(DirectJNgineServlet.java:195)
    at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.init(DirectJNgineServlet.java:155)
    http://forums.oracle.com/forums/thre...sageID=4329385

    thanks
    Last edited by july; 17 Jun 2011 at 10:59 PM. Reason: DJN directstore weblogic

  9. #369
    Sencha User
    Join Date
    Apr 2011
    Posts
    10
    Vote Rating
    0
    sritter is on a distinguished road

      0  

    Default EXT JS 4

    EXT JS 4


    Hey guys,
    any one tried with ExtJS 4?

    My API is loaded correclty and I can access my method on the client.
    Debugging with Firebug, I see 2 calls for the server, one post, with 302 repsonse and ContentLength 0.
    Immediately afterwards a GET Request is fired which results in a server-side exception.

    Returnvalue of called function is "undefined".

    Is this a problem of Ext JS 4 with ExtDirectJngnine or does anyone have any other ideas?

    Thanks in advance

  10. #370
    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 july View Post
    hi,

    have anyone trie DJN with weblogic10.3.3, i have problems:



    http://forums.oracle.com/forums/thre...sageID=4329385

    thanks
    It smells a lot like lack of permissions for DJN to generate the api files.

    Please, try using the technique used to support Google AppEngine, as explained in the User's Guide, as that technique does not create a physical file in the server.
    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: 86

  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. vanessa_ng (2 Posts)
  56. alois.cochard (5 Posts)
  57. kyrillos52 (2 Posts)
  58. Tod (1 Post)
  59. Alinanila (1 Post)
  60. tfannon (2 Posts)
  61. Kynao (1 Post)
  62. feiq (4 Posts)
  63. dalt (1 Post)
  64. xfolch (1 Post)
  65. avijit (1 Post)
  66. marcelsnews (2 Posts)
  67. maddhippy (1 Post)
  68. sritter (1 Post)
  69. july (2 Posts)
  70. jtkeller7983 (1 Post)
  71. lfranchini (2 Posts)
  72. 7/11 (2 Posts)
  73. yAdEs (1 Post)
  74. zazz (1 Post)
  75. waqar (5 Posts)
  76. pjain11 (1 Post)
  77. alexMobimesh (2 Posts)
  78. zachHurt (4 Posts)
  79. n0n3 (5 Posts)
  80. adavis2 (1 Post)
  81. mark.peters (1 Post)
  82. lee el (4 Posts)
  83. frengo19 (3 Posts)
  84. prakashwagle (1 Post)
  85. extejnar (2 Posts)
  86. alin@sonatype.com (1 Post)

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar