Extended User Data again and again...

This post has 41 Replies | 4 Followers

klim
Not Ranked
Posts 40
Points 635
By: klim
Posted: Mon, Oct 22 2007 2:31 PM

Hello there,

I spent some time trying to find anythig about extendig user registration, and found only the way, described by Jose Lema. The way CS extended properties work is that it does not allow running queries against tnat extended data because it's stored in kind of delimeted string.

There is also a frequent request from developers about the ability to store user data  “in the clear” in the database so that the data is available for querying and use in stored procedures.  

Here is and example of similar solution with TableProfielProvider  http://www.asp.net/downloads/sandbox/table-profile-provider-samples/ 

Is there any example of storing each extended property in a separate database column in cs_Users table (or any other table) ?

Let say, I extended cs_Users table adding some new fields. The next step would be adding some controls on registration form to collect additional user info and writing a routine to store it in those new fields. How to do it using sub-forms? Example of using sub-forms here http://docs.communityserver.org/wiki/page.aspx/312/how-to-extend-user-registration-using-sub-forms/ stores all additional data as a string in one field. How to use sub-forms to store data in separate fields? 

 I would appreciate any head start in that direction.

Thanks

Всю ночь котов душили-душили... душили-душили!
 
jeffesp
Top 75 Contributor
Posts 263
Points 3,880
By: jeffesp
Posted: Mon, Oct 22 2007 4:28 PM In reply to

If you are only looking to query the data for reporting, then you could do something like this.  But that probably isn't going to give you the performance you need.

--
--Jeff (ATGi)
 
  • Post Points: 20 |
klim
Not Ranked
Posts 40
Points 635
By: klim
Posted: Mon, Oct 22 2007 6:10 PM In reply to

Jeff,

Thank you for your responce. I've seen that idea before. Yes, performance would be an issue.

And the other problem is that I need to store historical data in side tables, like work history.

 

Any more ideas please?

c:\db.jpg

 

Всю ночь котов душили-душили... душили-душили!
 
  • Post Points: 20 |
Jon_ProactiveLogic
Top 500 Contributor
Posts 62
Points 1,040
By: Jon_ProactiveLogic
Posted: Wed, Oct 24 2007 7:44 AM In reply to

Hi Klim,

 I'm currently extending the CS Schema and source code to do this for my own needs.  I'm keeping notes and hope to have a blog post on it soon.

Unitl then, maybe someone else can help...

Jon 

Chief Technical Architect Proactive Logic, LLC http://proactivelogic.com/blog
Custom Web and Desktop Application Development
 
klim
Not Ranked
Posts 40
Points 635
By: klim
Posted: Wed, Oct 24 2007 1:31 PM In reply to

Jon,

Please keep me posted. I'm doing the same thing. If you want, we could consolidate our efforts. Community asked for such a sample long time ago. I see very old posts with such a request.

Thanks,

Klim

Всю ночь котов душили-душили... душили-душили!
 
  • Post Points: 20 |
Jon_ProactiveLogic
Top 500 Contributor
Posts 62
Points 1,040
By: Jon_ProactiveLogic
Posted: Wed, Oct 24 2007 5:21 PM In reply to

Hi Klim,

I'm putting about an hour and a half a day on the side trying to integrate CS with an existing site.

I identified the extension points, and have just merged my site with CS.  I updated the CS Schema and added an FK off of the profile to my tables.

Next, I'll update the code and see how it goes.

I'll keep you posted,

Jon 

Chief Technical Architect Proactive Logic, LLC http://proactivelogic.com/blog
Custom Web and Desktop Application Development
 
  • Post Points: 20 |
klim
Not Ranked
Posts 40
Points 635
By: klim
Posted: Tue, Oct 30 2007 2:05 AM In reply to

Jon,

which table did you extend with the new fields? sc_UserProfile or cs_Users?  I extended cs_Users.

Thanks

Всю ночь котов душили-душили... душили-душили!
 
  • Post Points: 20 |
Jon_ProactiveLogic
Top 500 Contributor
Posts 62
Points 1,040
By: Jon_ProactiveLogic
Posted: Tue, Oct 30 2007 9:23 AM In reply to

Hi Klim,

I actually got the whole registation process updated this morning.  I can register with the new attributes, and see them in the user profile page after registration.  I updated the cs_UserProfile table myself.  I don't think it really matters at this point as there is a view that joins the two tables to populate that user object.  My values seemed more profile-like, so I added them there.

I actually got a somewhat complex registration form working this morning.  I have created a new subform, but the article that I saw on doing this had code that did not work for me, as the selected value was not correct.  In the article I saw, they need to move the code for getting the selected value to the DataBind area, as asp.net will have no way of setting the selected value if the dropdown list does not have items in it yet.  Populating the list in the attach controls method is still ok.

I fixed the issues that I found in that articles code, and went a step further.

My subform has two dropdown lists.  One dropdown is meant to filter the second dropdown, and the second dropdown actually  has the value that I need to save to the profile.

I wrapped both of these in an ASP.net AJAX update panel and it is working well.  I now havea cascading dropdown that selects the extended attribute for the user and saves this to a table I can query.

I'm keeping details notes and plan to write a detailed post on all the steps it took.

How is your work going?

Jon 

 

 

Chief Technical Architect Proactive Logic, LLC http://proactivelogic.com/blog
Custom Web and Desktop Application Development
 
  • Post Points: 20 |
klim
Not Ranked
Posts 40
Points 635
By: klim
Posted: Tue, Oct 30 2007 2:59 PM In reply to
Hi Jon,

I extended cs_User with 16 more fields, added 12 tables to the schema and created subform for additional user registration info. At this point I store test data, collected from subform, into one field as delimited string. Just exact way as from CS provided example. It's just for testing purposes. Anyway, I'm also able to see all registered data in profile. But it's no t in the way I want it to be. I'm  new to CS and I'm trying to understand architecture behind, since there is no docs for this turkey.  I also have  several cascading DDLs and today I'm going to play with enabling  AJAX  form my project.

Jon, I'm curious, have you managed to store extended data into separate fields? Or, as myself, you store it as a delimited string?Correct me if I'm wrong. I think SQL data storing logic should be in the place where CS forms that delimited string from extended data. And it’s probably at DataBind area. Am I right?Thanks.Klim

 

Всю ночь котов душили-душили... душили-душили!
 
  • Post Points: 20 |
Jon_ProactiveLogic
Top 500 Contributor
Posts 62
Points 1,040
By: Jon_ProactiveLogic
Posted: Wed, Oct 31 2007 8:27 AM In reply to

Hi Klim,

I have saved all data to new columns in the cs_UserProfile table.  I have managed to aquire the information on registion and edit it in the edit profile page (I added a new tab on the edit page for the new fields).  Since I have some cascading dropdowns, I ajax enabled this with the UpdatePanel.

I can also see the new user information in:  user profile, flat forum view and the thread forum view.

So far so good.  I think I'm pretty close to where I want to be. 

BTW, the code structure is really clean.  The sub form concept is really good. They should have just put a few plug-in points in the data layer and it would have been really solid.

More work on this tomorrow... Cool

Jon 

Chief Technical Architect Proactive Logic, LLC http://proactivelogic.com/blog
Custom Web and Desktop Application Development
 
  • Post Points: 20 |
shakes
Top 75 Contributor
Posts 307
Points 4,670
By: shakes
Posted: Wed, Oct 31 2007 8:56 AM In reply to

Jon,

    I realize you are very busy however when you have a chance could you blog a little about how this is done?

peace shakes

Carolina Pulse

 
  • Post Points: 20 |
Jon_ProactiveLogic
Top 500 Contributor
Posts 62
Points 1,040
By: Jon_ProactiveLogic
Posted: Wed, Oct 31 2007 11:42 AM In reply to

Hey shakes,

I'm going to do a full write up hopefully on Saturday.

Hopefully my steps should be really easy to follow...

Cheers,

Jon 

Chief Technical Architect Proactive Logic, LLC http://proactivelogic.com/blog
Custom Web and Desktop Application Development
 
  • Post Points: 20 |
shakes
Top 75 Contributor
Posts 307
Points 4,670
By: shakes
Posted: Wed, Oct 31 2007 12:53 PM In reply to

looking forward to it...that is the next big mile stone in my little project!

peace shakes

Carolina Pulse

 
  • Post Points: 20 |
Jon_ProactiveLogic
Top 500 Contributor
Posts 62
Points 1,040
By: Jon_ProactiveLogic
Posted: Sat, Nov 3 2007 9:10 PM In reply to

As promised here is my write up.  I recommend downloading the pdf version that I linked in the post as I found out posting blog posts with code from MS word to Wordpress is not good.  In addition, I think I need to update my site to have a fluid layout so that I can post code samples.

http://proactivelogic.com/blog/index.php/2007/11/03/extending-community-server-2007-user-profiles-and-vista-setup/ 

A snippet from the post:

"This post will go over my notes on how I accomplished extending the CS Schema and code base in order to: acquire these additional fields on user registration, enable modification of these fields in the users control panel, display the new fields in the public view of the user’s profile, and display the data for the user in forum posts."

Let me know what you think.  I think I'll post a new thread here to let people know it's available.

Cheers,

Jon 

Chief Technical Architect Proactive Logic, LLC http://proactivelogic.com/blog
Custom Web and Desktop Application Development
 
shakes
Top 75 Contributor
Posts 307
Points 4,670
By: shakes
Posted: Sat, Nov 3 2007 10:01 PM In reply to

 Jon,

     Just wanted to say thank you. You said you would post on this and you did and on schedule at that. I like the full integration into cs chameleon controls and all. This how to was long overdue.  

oh yeah and the navigation on your site is rather slick too 

peace shakes

Carolina Pulse

 
  • Post Points: 35 |
Page 1 of 3 (42 items) 1 2 3 Next > | RSS
Powered by Community Server (Commercial Edition), by Telligent Systems

Copyright© 2008 Telligent Systems Inc. All rights reserved
CommunityServer.com  •  Telligent.com