简体   繁体   中英

How to store the personalization setting of IGoogle component?

I use IGoogle component inettuts to make my portal more attractive and easy to use interface. The main problem I want to ask about is:

  • How to store the personalization setting, to make it the default when the user logs into the application again?

I can't use cookies because it's related to the user machine so I think I need to store these data in my database. But I don't know the beginning. What should the structure of database look like? And what's the storing mechanism? I mean, should I store every single action of the user or put all the actions in one transaction or what?

I use Informix database, so no membership so I can't use web parts.

I hope someone can help me with an explanation about how to store all the settings in a performant way.

One thing you can do is make the entire storage client side. Newer browsers have a localStorage variable which can store a string persistantly across sessions. But this way, when they change their computers, the preferences are lost.

Another option is to do all the configuration in JavaScript, but use the backend as a JSON Store.

var settings = {
    components:[
        {
            'title': 'Foo',
            'state': 'opened'
        },
        {
            'title': 'Bar',
            'state': 'opened'
        }
    }
}

function close_component(index)
{
    settings.components[index].state = 'closed';
    save_settings();
}

var save_settings = function() {
    $.ajax({
        url:'/settings/save',
        data: {
            'settings': JSON.stringify(settings)
        }
    };
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM