5

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.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
Anyname Donotcare
  • 11,113
  • 66
  • 219
  • 392
  • 1
    Its not easy. First you get the savePreferences javascript and change it to get the result into string, then you save this string in database on user settings using ajax. And on load you read this string and attach it to the inettuts.js start up reference. Many steps. – Aristos Feb 19 '12 at 19:09
  • 1
    The choice of DBMS is almost entirely coincidental to this process. You need to sort out how to make the personalization work without cookies. If the user logs into your system, then it is relatively a piece of cake. If you don't have a formal mechanism analogous to that, then you are definitely in a world of hurt if you can't or won't use cookies. The tutorial you reference describes how to use cookies (if the title is anything to go by). – Jonathan Leffler Feb 21 '12 at 02:45

1 Answers1

2

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)
        }
    };
}
skyronic
  • 1,577
  • 1
  • 11
  • 15