The google group is wrought with spam (only 1 real post out of 33 total), so I am putting my question here.
Let me start by saying thank you for building something like jpolite and offering it up to the masses! Very nice!
I am trying to come up with a design to house tabs/modules/moduleLayout & columnLayout in the db and tie it to a user (their preferences). I am failing at the columnLayout part. Not sure how to represent this in tables?
Has someone already done something like this?
Tabs table and modules table have a many to many relationship with col_id, and optional color class & template name. How do I correlate tab table with columnLayout? Should there simply be stored templates (like _default, t2, etc)? I am really having a hard time visualizing how to do this.
Guess you’re struggling to store the tree relationship in relational database. A solution I’d probably use FYI:
1.Users table: id, name …
2.Tabs table: id, user_id, label
2.1. Global unique id, correlated to user_id
2.2. Optionally, you may use user_id = 0 for shared tabs visible to all users
3.Modules table: id, user_id, title, url …
3.1. Can be shared or user unique
3.2. NO correlation to tabs, i.e., modules can be put in any tab
4.Layout table: user_id, tab_id, layout_data
4.1. To support the most common use case: retrieve layout data for 1 user
4.2. Layout_data: just raw JSON hash data (_moduleLayout, _columnLayout), no need to process it at backend
(No separate table for columns, since they always go with tabs, and no use case for retrieving info for a single column)
UI initialization sequence:
1. Select all from Tabs where user_id=ID OR user_id=0 ==> JPolite 2 assume all tabs represented in HTML, you can alter the logic to load via Ajax
2. Select all from Modules where user_id=ID OR user_id=0 ==> var _modules
3. Select all from Layout where user_id=ID OR user_id=0 ==> var _moduleLayout, _columnLayout ==> you may revise the logic to combine these 2 vars into 1
will u create a mailing list of jpolite, and why should u change the project page to jpolite2 , rather in jpolite
JPolite V2 is a 100% rewrite from V1, hardly anything from the old version except for the look and feel
A discussion group & mailing list is up at http://groups.google.com/group/jpolite/, I’ll get it started soon.
The google group is wrought with spam (only 1 real post out of 33 total), so I am putting my question here.
Let me start by saying thank you for building something like jpolite and offering it up to the masses! Very nice!
I am trying to come up with a design to house tabs/modules/moduleLayout & columnLayout in the db and tie it to a user (their preferences). I am failing at the columnLayout part. Not sure how to represent this in tables?
Has someone already done something like this?
Tabs table and modules table have a many to many relationship with col_id, and optional color class & template name. How do I correlate tab table with columnLayout? Should there simply be stored templates (like _default, t2, etc)? I am really having a hard time visualizing how to do this.
Thanks!
@Joey:
Guess you’re struggling to store the tree relationship in relational database. A solution I’d probably use FYI:
1.Users table: id, name …
2.Tabs table: id, user_id, label
2.1. Global unique id, correlated to user_id
2.2. Optionally, you may use user_id = 0 for shared tabs visible to all users
3.Modules table: id, user_id, title, url …
3.1. Can be shared or user unique
3.2. NO correlation to tabs, i.e., modules can be put in any tab
4.Layout table: user_id, tab_id, layout_data
4.1. To support the most common use case: retrieve layout data for 1 user
4.2. Layout_data: just raw JSON hash data (_moduleLayout, _columnLayout), no need to process it at backend
(No separate table for columns, since they always go with tabs, and no use case for retrieving info for a single column)
UI initialization sequence:
1. Select all from Tabs where user_id=ID OR user_id=0 ==> JPolite 2 assume all tabs represented in HTML, you can alter the logic to load via Ajax
2. Select all from Modules where user_id=ID OR user_id=0 ==> var _modules
3. Select all from Layout where user_id=ID OR user_id=0 ==> var _moduleLayout, _columnLayout ==> you may revise the logic to combine these 2 vars into 1