1. #11
    Sencha User
    Join Date
    Jun 2007
    Posts
    46
    Vote Rating
    6
    kesteb is on a distinguished road

      1  

    Default


    A minor update. I had to block in the constructor in order to make sure the store loads. Otherwise the first query is against an empty store.

    PHP Code:
    /*
     * File: RemoteStorageProvider.js
     * Date: 20-Jul-2011
     * By  : Kevin L. Esteb
     *
     * This module provides a state provider that uses remote storage as
     * the backing store.
     *
     *   RemoteStorageProvider.js is free software: you can redistribute
     *   it and/or modify it under the terms of the GNU General Public License
     *   as published by the Free Software Foundation, either version 3 of the
     *   License, or (at your option) any later version.
     *
     *   RemoteStorageProvider.js is distributed in the hope that it will be
     *   useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
     *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     *   General Public License for more details.
     *
     *   You should have received a copy of the GNU General Public License
     *   along with RemoteStorageProvider.js. If not, see
     *   <http://www.gnu.org/licenses/>.
     *
     */

    Ext.define('Ext.ux.state.RemoteStorageProvider', {
        
    extend'Ext.state.Provider',
        
    mixins: {
            
    observable'Ext.util.Observable'
        
    },
        
    uses: [
            
    'Ext.data.Model',
            
    'Ext.data.Store',
            
    'Ext.state.Provider',
            
    'Ext.util.Observable'
        
    ],

        
    store: {},

        
    constructor: function(config) {

           
    config config || {};
           
    this.initialConfig config;

           
    Ext.apply(thisconfig);

           
    this.store this.storeage();

           
    // Have to block to load the store before leaving the constructor
           // otherwise, the first query will be against an empty store.
           // There must be a better way...

           
    Ext.data.Connection.prototype.async false;
           
    this.store.load();
           
    Ext.data.Connection.prototype.async true;

           
    this.mixins.observable.constructor.call(thisconfig);

        },

        
    set: function(namevalue) {
            var 
    posrow;

            if ((
    pos this.store.find('name'name)) > -1) {

                
    row this.store.getAt(pos);
                
    row.set('value'this.encodeValue(value));

            } else {

                
    this.store.add({
                    
    namename,
                    
    valuethis.encodeValue(value)
                });

            }

            
    this.store.sync();
            
    this.fireEvent('statechange'thisnamevalue);

        },

        
    get: function(namedefaultValue) {
            var 
    posrowvalue;

            if ((
    pos this.store.find('name'name)) > -1) {

                
    row this.store.getAt(pos);
                
    value this.decodeValue(row.get('value'));

            } else {

                
    value defaultValue;

            }

            return 
    value;

        },

        
    clear: function(name) {
            var 
    pos;

            if ((
    pos this.store.find('name'name)) > -1) {

                
    this.store.removeAt(pos);
                
    this.store.sync();
                
    this.fireEvent('statechange'thisnamenull);

            }

        },

        
    storeageExt.emptyFn

    }); 

  2. #12
    Sencha User
    Join Date
    Jun 2007
    Posts
    46
    Vote Rating
    6
    kesteb is on a distinguished road

      1  

    Default


    Another minor update. This one introduces the concept of throttling. It is turned off by default. Throttling will buffer state changes until a certain number have occurred, when that happens the changes are then batched to the store. You do lose some granularity in the state of the state. So you need to balance that out with performance needs.

    PHP Code:
    /*
     * File: RemoteStorageProvider.js
     * Date: 20-Jul-2011
     * By  : Kevin L. Esteb
     *
     * This module provides a state provider that uses remote storage as
     * the backing store.
     *
     *   RemoteStorageProvider.js is free software: you can redistribute
     *   it and/or modify it under the terms of the GNU General Public License
     *   as published by the Free Software Foundation, either version 3 of the
     *   License, or (at your option) any later version.
     *
     *   RemoteStorageProvider.js is distributed in the hope that it will be
     *   useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
     *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     *   General Public License for more details.
     *
     *   You should have received a copy of the GNU General Public License
     *   along with RemoteStorageProvider.js. If not, see
     *   <http://www.gnu.org/licenses/>.
     *
     */

    Ext.define('Ext.ux.state.RemoteStorageProvider', {
        
    extend'Ext.state.Provider',
        
    mixins: {
            
    observable'Ext.util.Observable'
        
    },
        
    uses: [
            
    'Ext.data.Model',
            
    'Ext.data.Store',
            
    'Ext.state.Provider',
            
    'Ext.util.Observable'
        
    ],

        
    store: {},
        
    throttledfalse,
        
    queue10,
        
    count0,

        
    constructor: function(config) {

           
    config config || {};
           
    this.initialConfig config;

           
    Ext.apply(thisconfig);

           
    this.store this.storeage();

           
    // Have to block in order to load the store before leaving the
           // constructor, otherwise, the first query may be against an
           // empty store. There must be a better way...

           
    Ext.data.Connection.prototype.async false;

           
    this.store.load();

           
    Ext.data.Connection.prototype.async true;

           
    this.mixins.observable.constructor.call(thisconfig);

        },

        
    set: function(namevalue) {
            var 
    posrow;

            if ((
    pos this.store.find('name'name)) > -1) {

                
    row this.store.getAt(pos);
                
    row.set('value'this.encodeValue(value));

            } else {

                
    this.store.add({
                    
    namename,
                    
    valuethis.encodeValue(value)
                });

            }

            
    this.sync();
            
    this.fireEvent('statechange'thisnamevalue);

        },

        
    get: function(namedefaultValue) {
            var 
    posrowvalue;

            if ((
    pos this.store.find('name'name)) > -1) {

                
    row this.store.getAt(pos);
                
    value this.decodeValue(row.get('value'));

            } else {

                
    value defaultValue;

            }

            return 
    value;

        },

        
    clear: function(name) {
            var 
    pos;

            if ((
    pos this.store.find('name'name)) > -1) {

                
    this.store.removeAt(pos);
                
    this.sync();
                
    this.fireEvent('statechange'thisnamenull);

            }

        },

        
    sync: function() {

            if (
    this.throttled) {

                if (
    this.count >= this.queue) {

                    
    this.count 0;
                    
    this.store.sync();

                } else {

                    
    this.count++;

                }

            } else {

                
    this.store.sync();

            }

        },

        
    storeageExt.emptyFn

    }); 

  3. #13
    Sencha User Vital Aaron's Avatar
    Join Date
    Jun 2011
    Posts
    24
    Vote Rating
    0
    Vital Aaron is on a distinguished road

      0  

    Default One glitch...

    One glitch...


    The function 'storeage' should be spelled 'storage'.

  4. #14
    Ext JS Premium Member
    Join Date
    May 2008
    Posts
    372
    Vote Rating
    4
    ttbgwt is on a distinguished road

      0  

    Default


    Will this work with 4.1?

  5. #15
    Sencha Premium Member
    Join Date
    Apr 2011
    Posts
    101
    Vote Rating
    3
    sskow200 is on a distinguished road

      0  

    Default


    Quote Originally Posted by ttbgwt View Post
    Will this work with 4.1?
    It should. The code for this is fairly simple and does not use any functionality that might have been removed in 4.1.

  6. #16
    Sencha User
    Join Date
    Jun 2007
    Posts
    46
    Vote Rating
    6
    kesteb is on a distinguished road

      0  

    Default


    I have been using it with a internal 4.1 application.

  7. #17
    Ext JS Premium Member
    Join Date
    May 2008
    Posts
    372
    Vote Rating
    4
    ttbgwt is on a distinguished road

      0  

    Default


    Any updates with this extension?

  8. #18
    Ext Premium Member Jan (HL)'s Avatar
    Join Date
    Aug 2010
    Location
    Germany
    Posts
    111
    Vote Rating
    9
    Jan (HL) will become famous soon enough

      0  

    Default


    Hey, could you release this with a dual license (GPL/Sencha) for a commercial support?

    Additionally, I would prefer something like a github repo incl. the required store/model configuration. I would do this, but it's actually "your" code...

  9. #19
    Sencha User
    Join Date
    Jun 2007
    Posts
    46
    Vote Rating
    6
    kesteb is on a distinguished road

      0  

    Default


    Updates? Sure, why not. This fixes the above noted spelling error:

    PHP Code:
    /*
     * File: RemoteStorageProvider.js
     * Date: 20-Jul-2011
     * By  : Kevin L. Esteb
     *
     * This module provides a state provider that uses remote storage as
     * the backing store.
     *
     *   RemoteStorageProvider.js is free software: you can redistribute
     *   it and/or modify it under the terms of the GNU General Public License
     *   as published by the Free Software Foundation, either version 3 of the
     *   License, or (at your option) any later version.
     *
     *   RemoteStorageProvider.js is distributed in the hope that it will be
     *   useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
     *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     *   General Public License for more details.
     *
     *   You should have received a copy of the GNU General Public License
     *   along with RemoteStorageProvider.js. If not, see
     *   <http://www.gnu.org/licenses/>.
     *
     */

    Ext.define('Ext.ux.state.RemoteStorageProvider', {
        
    extend'Ext.state.Provider',
        
    mixins: {
            
    observable'Ext.util.Observable'
        
    },
        
    uses: [
            
    'Ext.data.Model',
            
    'Ext.data.Store',
            
    'Ext.state.Provider',
            
    'Ext.util.Observable'
        
    ],

        
    store: {},
        
    throttledfalse,
        
    queue10,
        
    count0,

        
    constructor: function(config) {

           
    config config || {};
           
    this.initialConfig config;

           
    Ext.apply(thisconfig);

           
    this.store this.storage();

           
    // Have to block in order to load the store before leaving the
           // constructor, otherwise, the first query may be against an
           // empty store. There must be a better way...

           
    Ext.data.Connection.prototype.async false;

           
    this.store.load();

           
    Ext.data.Connection.prototype.async true;

           
    this.mixins.observable.constructor.call(thisconfig);

        },

        
    set: function(namevalue) {
            var 
    posrow;

            if ((
    pos this.store.find('name'name)) > -1) {

                
    row this.store.getAt(pos);
                
    row.set('value'this.encodeValue(value));

            } else {

                
    this.store.add({
                    
    namename,
                    
    valuethis.encodeValue(value)
                });

            }

            
    this.sync();
            
    this.fireEvent('statechange'thisnamevalue);

        },

        
    get: function(namedefaultValue) {
            var 
    posrowvalue;

            if ((
    pos this.store.find('name'name)) > -1) {

                
    row this.store.getAt(pos);
                
    value this.decodeValue(row.get('value'));

            } else {

                
    value defaultValue;

            }

            return 
    value;

        },

        
    clear: function(name) {
            var 
    pos;

            if ((
    pos this.store.find('name'name)) > -1) {

                
    this.store.removeAt(pos);
                
    this.sync();
                
    this.fireEvent('statechange'thisnamenull);

            }

        },

        
    sync: function() {

            if (
    this.throttled) {

                if (
    this.count >= this.queue) {

                    
    this.count 0;
                    
    this.store.sync();

                } else {

                    
    this.count++;

                }

            } else {

                
    this.store.sync();

            }

        },

        
    storageExt.emptyFn

    }); 
    I use the following model:

    PHP Code:
    /*
     * File: WAM.desktop.model.State.js
     * Date: 19-Jul-2011
     * By  : Kevin L. Esteb
     *
     * This module provides a state provider for the desktop using remote storage.
     *
     */

    Ext.define('WAM.desktop.model.State', {
        
    extend'Ext.data.Model',
        
    idProperty'id',
        
    fields: [
            { 
    name'id',        type'int' },
            { 
    name'name',    type'string' },
            { 
    name'value',    type'string' },
            { 
    name'revision'type'int' }
        ]
    }); 
    Along with this store:

    PHP Code:
    /*
     * File: State.js
     * Date: 12-Dec-2011
     * By  : Kevin Esteb
     *
     * This is the various stores for usage within WAM.
     *
     */

    Ext.define('WAM.desktop.store.State', {
        
    extend'Ext.data.Store',
        
    uses: [
            
    'Ext.data.Store',
            
    'WAM.desktop.model.State',
            
    'WAM.lib.mixins.MessageHandler'
        
    ],
        
    mixins: {
            
    messageHandler'WAM.lib.mixins.MessageHandler'
        
    },

        
    constructor: function(opts) {

            var 
    config = {
                
    model'WAM.desktop.model.State',
                
    proxy: {
                    
    timeout100000,
                    
    type'ajax',
                    
    reader: {
                        
    type'json',
                        
    root'data',
                        
    idProperty'id',
                        
    totalProperty'count',
                        
    successProperty'success'
                    
    },
                    
    writer: {
                        
    type'json',
                        
    root'data',
                        
    encodetrue
                    
    },
                    
    listeners: {
                        
    exception: {
                            
    fnthis.onException,
                            
    scopethis
                        
    }
                    },
                    
    api: {
                        
    create:  opts.app_rootp 'desktop/state/create',
                        
    read:    opts.app_rootp 'desktop/state/read',
                        
    update:  opts.app_rootp 'desktop/state/update',
                        
    destroyopts.app_rootp 'desktop/state/delete'
                    
    }
                }
            };

            
    Ext.merge(thisconfig);
            
    this.callParent();

        }

    }); 
    Which is specific to my application. I really don't see a need for a git repository and I don't see a need to change the license.

  10. #20
    Ext Premium Member Jan (HL)'s Avatar
    Join Date
    Aug 2010
    Location
    Germany
    Posts
    111
    Vote Rating
    9
    Jan (HL) will become famous soon enough

      0  

    Default


    Sad to here so.

    Because the time goes, I'd prepared the stuff already. I had to find something for a commercial Ext JS application propose. Anywhere, I will provide a solution which works more reliable (my opinion). At GitHub and with the Sencha License being more compatible. In the next few weeks, expecting October.

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi