Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Custom profile provider...Custom profile provider...
Previous
 
Next
New Post
6/14/2007 10:18 PM
 

I apologize if I'm asking for advice on something that has been answered elsewhere. I've searched for a few hours now and haven't found an answer yet.

I'm currently integrating DNN with my company's ERP system, which is built on a MS Sql backend. I've succeeded in creating a membership provider, controller and info classes, and I can authenticate and control new and existing users, within my database.

I'm now on to creating a custom profile provider, and I seem to have hit a stumbling block. My problem is, I can't seem to wrap my head around how to implement the profile provider, without modifying the core code. Essentially, I'm trying to find a way to present my data to DNN in the format it expects, so I can eliminate changing the core at all (BLL on up through the UI). However, my profile data is stored in a table, in which each row represents a user profile. DNN expects (as I understand it) a collection of rows, for each user, with each row pertaining to a particular profile definition.

My theory was to create an "extended" ProfilePropertyDefinition table, in which I would have the same schema as the default DNN table, with the addition of one column, which would have the name of my profile table's corresponding column, for each property. However, I would have to at least inherit and override the ProfileController class, in a new assembly, so I could define the defaults and match them to my table schema. Using the visiblity column, to hide certain properties by default. This way the only core change (I can think of!) would be to the PortalCotroller class' CreateProfileDefinitions method, which would call the overridden AddDefaultDefinitions method of my new assembly, instead.

I would also create another table which lists my table's schema, and corresponding default property names, which I would pull data from when inserting the defaults (I was thinking of this because I don't want to also modify the ProfilePropertyDefinition class to include a property for my column name). I would then create a stored procedure for gathering the data, using a table variable, and filling it with the appropriate values from my profile table. The only approach I can think of to this would be to use parameterized dynamic sql (sp_executesql). Is there a better way?

With this plan, I believe I can use my existing table to store the data it was designed for, while still providing the ability to create custom profile properties, and storing them in the DNN tables (so long as I include that functionality in my provider).

Does anyone have any suggestions and/or comments on my approach? Am I totally off base in anything I've stated? I'm pretty new to DNN, and programming in general for that matter, so any comments or criticism are welcome.

Thanks in advance.

 
New Post
6/28/2007 8:55 AM
 

Hi Sully,
Well, re-implementing the membership provider, controller and specially the info class is a brave thing to do, as you say: "I'm pretty new to DNN, and programming in general". Normally to customize dnn, you only would make new implementations for the (membership, profile and roles) providers, and possibly for the data provider. Changing the controllers and infoclasses can cause a difficult upgrade when new Dnn versions are coming. But I too have the experiance that changes to the aspnet membership provider are almost impossible without changing the other providers and next to that the userinfo class and userprofile class.

I am not sure yet, but I think there are 3 main problems:
1] Too many data/props are duplicated and require 2 way updates: Updating a user must updating the profile, because some props use the profile to store the values.
2] Multiple keys for users are used: userId, userName. You somewhere need to make a mapping between these.
3] Mostly because of 1: the order of doing things is important. When creating a new userinfo object, always fill PortalId, UserId, UserName first. You must do this because setting FirstName and LastName will call in the profile, that will load the profile based on these props.

In my opinion Dnn 5.0 must clean this up. I don't mind the extra work because of interface changes, or  reimplementing  part of the providers. That said, maybe it's best to start with a new usercontroller and profile controller, user info and possibly userprofile class like you do Suly.

Good luck, Leo.

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Custom profile provider...Custom profile provider...


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out