Extending Community Server User Profiles in Vast Rank
I built Vast Rank integrating a lot of different pieces of technology, ASP.Net, ASP.NET AJAX, Google Maps API, Google Ajax Search API, Google Custom Search, CSS, and the list goes on and on.
I have been a Microsoft oriented developer all of my life so when I built Vast Rank, I wanted to find a decent profile system and forum system based on .NET that I could build on top of. Community Server was by far the best platform to use when I started developing Vast Rank in 2007.
One of the challenges that I faced was that I wanted to extend the Community Server User Profiles in such a way that those profiles can be queried based on the extended properties. Before you follow this post any further, if you are considering going down path, ask yourself “do I really need to query these extended attributes?”, because it gets complicated. If you don’t need to query this extended user profile data, but just store and display it, then I suggest using the out of the box ExtendedAttirute storage mechanism that comes with CS. It is a heck of a lot less work.
Anyway, I spent the time extending user profiles and detailed it in an old post here. In that post I went through changing the source code in the CS SDK, but here I will post a few blurbs from the CS forums that I posted about how to extend CS User profiles without changing any CS SDK source code. I originally did these modifications in CS 2007, then I rolled them into CS 2008.5 in one day. (Some of the CS code changed a little but it was easy to fix up my extensions to align with these changes). So the big payoff of using this new strategy: ease of upgrade to new versions of CS.
The basic “A Ha” moment for this new extension strategy was, hey doesn’t CS use the provider model? Maybe I can hook in at that level to override and extend the CRUD and search operations. Well that worked.
I am posting some CS specific source code directly from Vast Rank here:
Since so many people were interested in more details around this new strategy, I slotted an hour out of the many other dev things I’m working on to put this up for my friends over in CS land. I figured it was better to get something into your hands than nothing at all…
So… the code posted does not compile because it depends on Community Server (which you can download from them) and my own Service / Data Access Layer (which I’m not posting:) ). But, if you are pretty good dev you can look through the code and get some “A Ha” moments.
The code has a sample configuration where I load my overridden version of the the CommonDataProvider. That file in my project is called “VRSqlCommonDataProvider” and it shows how I extended the CRUD and search code. I also included a few of my theme files where you can see where I integrate the extended data (creating, editing, viewing, and searching profiles). There are also some sub forms and helpers in there. You’re just going to have to dig through…
Here are a couple of links to my “A HA” moments from the CS forums. You can test these things live at http://www.vastrank.com
- My “A HA”, I bet I can extend CRUD operations via the provider layer: here: Extended User Data – Might have a better way
- My “A HA”, I can search this crap too but it’s complicated (I chimed in on this thread): Expanding Member Search
Please chime in on this post if this helps ya, or if you have any feedback. As I said it’s a little sloppy but I wanted to get something into my friends hands over on the CS forums.