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.