Reputation: 4647
I thought of re-framing this question once again, to make it clear. Thanks a lot the comments. I am developing a web application in which I am making use of widgets.
Take a real use case scenario, suppose USER-A logins into the my web app and he uses some widgets say A,B and C widgets. He places Widget A in the center, WIDGET-B on to the top right hand side and WIDGET-C on to the left hand side of the page.
USER_B logins into my system and uses the some widgets and places the widgets in different positions since widgets are made draggable and resizable. When the user publishes the page the widget should appear exactly in the same position exactly in the same position where he/she placed.
We are using Jquery HTML5 at the front end and servlet and my sql at the back end.
Upvotes: 0
Views: 272
Reputation: 55937
Forget about users, just consider retrieving any dynamic content. You've got some arbitrary URL
http://mysite.com/some/path/or/other
or possibly with some parameters
http://mysite.com/some/path/or/other?thing=somevalue
When the browser hits that URL some code of your will run, and you have access to the URL. Depending upon the tools you are using you may even have the parts of the URL broken out for you into some useful variables, if not you can extract the bits you care about.
String interestingBit; // somehow gets set to "other"
String thing; // somehow gets set "somevalue"
Now you can write some code to go fetch data from a file or a database,
databaseRetrieve( interstingBit, thing);
once again nice frameworks may make all this really easy. Then it's just a matter of presenting the data. So dealing with user-specific content can follow this approach. You've got to deal with other issues such as deciding how to structure the repository of content and managing the security, but as I understand your question you were asking about the interpretion of the URL.
Editedin response to clarified question:
Seems like you're developing "personalisation" function that is often provided by "Portal" products and frameworks. The key point is that you have a per-user set of preferences, which control what content is displayed and where it is displayed. There are many such products, I work for IBM so I know about WebSphere Portal and Lotus Mashups, to name but two.
So to implement this you need:
Upvotes: 1
Reputation: 660
Wow, you need to take a look at your question and possibly clarify it a bit. There are many things in action here, first you talk about personal user spaces, this is very common practice, you need to look into routing requests ( for instance I'd look into rails for zombies tutorial to see how to do this in ROR). You also need to define what you are using to develop this: PHP, java, asp etc... your question is lacking a lot of details that make it impossible to answer correctly or usefully.
Finally you need to show us what you have done so far, because its absolutely impossible to see from your question. Show us some code, give us more specifications as to what you have done , how and what tools you are using.
It seems you are starting with this, so you can start by looking at MVC design pattern, and web frameworks that help you implement this. Routing is the term used to define how the requests are mapped to your application.
Edit:
For your widgets its just a matter of storing the positions foe each user and each widget in some efficient way, then loading it upon login, and using your libraries to re-set the positions on the elements. You have to decide where to store it, but most logical approach is server side ( use a DB table or an attribute per widget to store this). Upon login, get the values and return them to the library (either ajax response, or setting js variables etc.. there are many ways).
Upvotes: 1