DNN Blog

Jun 14

Posted by: Charles Nurse
6/14/2006  RssIcon

In an early Blog, I described the new Property Editor Control.  In this blog I will expand on this new control.

As described earlier the control was developed in order to dynamically build a Profile form from an indeterminate collection of Profile Properties.  In discussions with Joe Brinkman, it immediately became clear to us that this control would have quite a few uses, and would be a powerful addition to the module developers toolkit.

This article will begin to describe the underlying arhcitecture of the suite of controls (collectively know as the Property Editor).  

The Property Editor comprises a number of building blocks.
  1. Five top level controls are included that can be used directly by a developer.
    1. FieldEditorControl - this control encapsulates what would usually be one row of an Edit Page (ie a Label, an Edit Control, a Required Icon, and Validator controls).  This control is used as a fundamental building block by all other top level controls
    2. PropertyEditorControl - this control uses 1 or more FieldEditorControls to display the properties of an instance of a class.  The control is configured by decorating the properties of the class with Attributes.
    3. CollectionEditorControl - this control uses one or more FieldEditorControls to display the values of a Collection (actually anything that implements IEnumerable).
    4. ProfileEditorControl - this is a customised override of the CollectionEditorControl, used to edit a user's profile, which contains a collection of ProfilePropertyDefinition objects - each ProfilePropertyDefinition object maps to a single FieldEditorControl.
    5. SettingsEditorControl - this control uses 1 or more FieldEditorControls to display the values of a Settings Hashtable.
  2. EditorInfo Class - This fundamental supporting class defines a single row of the Editor, and is used to "build" a single row.    I will go into more detail on this class in a future Blog.
  3. IEditorInfoAdapter interface - this interface defines three methods CreateEditor, UpdateValue and UpdateVisibility. Again I will go into more detail on this interface (and the three included implementations), but the simple description is that it allows us to use the same underlying engine to display, edit, and update different types of data.
  4. EditControlFactory - This Factory class builds the appropriate EditControl for the data.  So for instance text data might be displayed using a text box, boolean data using a check box and List data using a drop-down combo or radio-button list.
  5. EditControl - This is a base class for all the edit controls.
  6. Custom Edit Controls - Different overrides of EditControl are provided for different data types. The system is very flexible and extensible, allowing the developer to create their own EditControl for their own DataType.
If you look at the PropertyEditor folder you will see there are 48 files(classes) as part of the core distribution.

This Blog is just an overview of these classes.  Future Blogs will delve into some of the classes in more detail.

Tags:
Categories:
Location: Blogs Parent Separator Charles Nurse

19 comment(s) so far...


Re: Introducing the Property Editor Control - Fundamentals - Part 1

Overall, this is a great and much needed change however there is a problem... I can't find any way to require users to fill out Required profile information at Registration... or initial login... or anywhere...

Do I need to write a module (or enhancements to my module) to verify this info is filled in and if not send them to the profile page?

By davido on   6/16/2006

Re: Introducing the Property Editor Control - Fundamentals - Part 1

If you go to the User Accounts Admin page, there is an Action Menu item (User Settings).

Towards the bottom of the User Settings page there is an option to require a valid profile on registration and/or login.

By cnurse on   6/16/2006

Re: Introducing the Property Editor Control - Fundamentals - Part 1

Yup, just found it... perfect... Awesome work Charles! Seems like you thought of everything.

One nice to have thing, can't seem to set a default country... tried settting United States and US but it keeps showing Afghanistan.

By davido on   6/16/2006

Re: Introducing the Property Editor Control - Fundamentals - Part 1

When you create a new Profile Property or edit an existing one, it shows up as blank on the Login and/or Register screen. I'm guessing I need to add a localization string somewhere but I have no idea where.

By davido on   6/17/2006

Re: Introducing the Property Editor Control - Fundamentals - Part 1

Please also post the reply to the above to this thread: http://www.dotnetnuke.com/Community/ForumsDotNetNuke/tabid/795/forumid/118/threadid/45767/scope/posts/Default.aspx

By davido on   6/17/2006

Re: Introducing the Property Editor Control - Fundamentals - Part 1

Found it: admin/Users/App_LocalResources/Profile.ascx.resx
Just follow the pattern there, it's quite easy...

Example

Company:


Enter your Company Name


Company is required

By davido on   6/17/2006

Re: Introducing the Property Editor Control - Fundamentals - Part 1

Though I feel I'm just talking to myself at this point, let me summarize known issues...
-There needs to be a way to hide the visibility stuff (i.e. Visibilty:Public,Members Only,Admin Only) for many sites this just isn't necessary and therefore is unnecessary clutter
-There's no way to add new entries for Profile Properties through the language editor so you have to modify admin/Users/App_LocalResources/Profile.ascx.resx directly
-Modifications to admin/Users/App_LocalResources/Profile.ascx.resx will be overwritten on upgrade
-Being able to set default Country would be lovely

By davido on   6/22/2006

Re: Introducing the Property Editor Control - Fundamentals - Part 1

Davido - I will address these issues in future Blogs, but the Visibility issue can be tweaked by modifying Profile.ascx.

Currently showVisibility = "<%# Is User %>".

Change this to showVisibility = "false".

Now the downside in this is that this is now disabled for all sites on the same dnn installation, but it is a short term fix you can implement.

By cnurse on   6/23/2006

Re: Introducing the Property Editor Control - Fundamentals - Part 1

I'm still waiting for more details about Property Editor Control, do you remember?

By Sirioz10 on   9/18/2006

Re: Introducing the Property Editor Control - Fundamentals - Part 1

Hello Charles,
I am sitting here at 10:43pm pulling what is left of my hair out. I have put a breakpoint on every 'UserController.UpdateUser' within the DotNetNuke project and when I run a registration I get no stop points? Please tell me where within the ManageUsers.ascx.vb or the associated User.ascx.vb I can get a reference to the new user registration data prior to it updating sql. Thanks!!

By jherington on   11/29/2006

Re: Introducing the Property Editor Control - Fundamentals - Part 1

I'm newbie with dotnetnuke development, and i'm interested to use the property editor control to do a form with my own info class. The only documentation that i find was your posts this blog, and i don't now how to do somethings.
I want to display a form with a info class than contains some fields that need to be filled throw a dropdownlist, and i don't now how to display this dropdownlist.
I try to do this:

_
Public ReadOnly Property Center() As List(Of CenterInfo)
Get
Dim lst As New List(Of CenterInfo)
'CenterInfo(CenterID, Name)
lst.Add(New CenterInfo(1, "Center 1"))
lst.Add(New CenterInfo(2, "Center 2"))
lst.Add(New CenterInfo(3, "Center 3"))
Return lst
End Get
End Property

but it don't work.

Can you help me?

Thanks in advance!

By block on   3/14/2007

Re: Introducing the Property Editor Control - Fundamentals - Part 1

Hello,
Property Edit Controls seems to be great ! I've just read your article at DNN Dev Zone(http://www.dnndevcenter.com/Library/tabid/126/ArticleId/4/Default.aspx) and I was wondering something : if I create a UserEditControl, how could I dynamically filter users in edit mode ? I mean what could I use to tell a UserEditControl Profile Property that it should list users only from a given security role for instance ?
Thanks anyway, I don't know how to tell it in english so I will use french : DotNetNuke, ça déchire !!

By rodonso on   6/21/2007

Re: Introducing the Property Editor Control - Fundamentals - Part 1

This looks a great control, but I can't seem to use it when in the settings screen of a module. When using the 'UpdateSettings' method in a page that inherits from the ModulesSettingsBase, the PropertyEditorControl just doesn't seem to have any properties - the Datasourc is nothing, Feilds item count is 0, etc
What am I missing?

By bramborak on   7/9/2007

Re: Introducing the Property Editor Control - Fundamentals - Part 1

Has the property editor been added to the controls toolkit?
Is there documentation for developers that would like to use it?

By pspeth on   1/17/2008

Re: Introducing the Property Editor Control - Fundamentals - Part 1

How do you add an image datatype entry to the profile property editor? How can I limit the file size and pixel size of the user's image. Also how do you replace the old user image with the new user image when the user decides to change their image in the manage your profile section? If you send me how-to-instructions on adding an image datatype, I'll send you $50-$100 through Paypal, Google Checkout or any other online credit card transaction.

By ajsansone on   6/3/2008

Re: Introducing the Property Editor Control - Fundamentals - Part 1

How do you add an image datatype entry to the profile property editor? How can I limit the file size and pixel size of the user's image. Also how do you replace the old user image with the new user image when the user decides to change their image in the manage your profile section? If you send me how-to-instructions on adding an image datatype, I'll send you $50-$100 through Paypal, Google Checkout or any other online credit card transaction. Oh yeah here's my email address, sorry I've been in summer school all day. ajs@graphicsphere.net

By ajsansone on   6/3/2008

Charles Nurse we need your help!

Charles Nurse We Need Your Help! I have thought alot about your documentation on creating new editor controls and have a question before I begin. Do you recommend having an image upload control in the profile property editor? The chart below shows your organization structure of the editor controls and need some advice on how to implement a new image upload control in the profile property editor. Where do you reccommend storing the settings of the new image upload control?


Thanks for your help,































Anthony Sansone, President
Graphicsphere.Net - 3D Modeling
Palm Harbor, Florida, United States
website View Website detail Send E-Mail




EditControls.png


Where in the organizational structure would you implement the image upload control in the profile property editor?

By ajsansone on   6/23/2008

Charles Nurse we need your help!

Charles Nurse We Need Your Help! I have thought alot about your documentation on creating new editor controls and have a question before I begin. Do you recommend having an image upload control in the profile property editor? The chart below shows your organization structure of the editor controls and need some advice on how to implement a new image upload control in the profile property editor. Where do you reccommend storing the settings of the new image upload control?


Thanks for your help,































Anthony Sansone, President
Graphicsphere.Net - 3D Modeling
Palm Harbor, Florida, United States
website View Website detail Send E-Mail




EditControls.png


Where in the organizational structure would you implement the image upload control in the profile property editor?

By ajsansone on   6/23/2008
Gravatar

Re: Introducing the Property Editor Control - Fundamentals - Part 1

Charles:

I have a customer who seems incapable of creating usernames: "It's too much work." So they have asked if DNN can automagically generate a user name based on the first and last name fields.

I quoted a very high price and yet this requirement persists. So, I ask you: Where would I start? I have examined everything I can find about the Property Editor control and I am hoping to attach some type of javascript to the onblur() of first and last name. Does this sound like a reasonable approach? If so, where does this stuff hide?

I have also considered letting the database create the username, but I suspect that will be rife with issues.

Thanks much.
Mark

By Mark Deweese on   7/13/2010
Attend A Webinar
Free Demo Site
Download DotNetNuke Professional Edition Trial
Have Someone Contact Me
Have Someone Contact Me

Like Us on Facebook Join our Network on LinkedIn Follow DNN Corporate on Twitter Follow DNN on Twitter

Advertisers

Sponsors

DotNetNuke Corporation

DotNetNuke Corp. is the steward of the DotNetNuke open source project, the most widely adopted Web Content Management Platform for building web sites and web applications on Microsoft. Organizations use DotNetNuke to quickly develop and deploy interactive and dynamic web sites, intranets, extranets and web applications. The DotNetNuke platform is available in a free Community and subscription-based Professional and Enterprise Editions with an Elite Support option. DotNetNuke Corp. also operates the DotNetNuke Store where users purchase third party apps for the platform.