About the new profile feature

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
1/10/2007 6:38:01 AM
Gravatar
Total Posts 488

About the new profile feature

Joe, thanks for the great job on the profile feature! It's really great.


Still, there are some my thoughts on how to improve it.

1. Need to add default values for all the profile property options to documentation (and implement it if it is not done already). As a result I do not need to write, for example, 'lazyLoad="false"' for each profile property. It would be nice to place this documentation to the beginning of mojoProfile.config.

2. Some web interface to manage the properties list would be great, but not so nesessary.

3. Need property option like 'VisibleOnWeb="false"' to prevent the property from showing to anyone, even web site administrators. Such properties can be accessed only from the code and store some technical information attached to the user).

4. If I add my custom properties, all the strings are in the same resource file. So, when I translate both mojoPortal and my custom properties to russian, it would be difficult for me to share the translation. Optional custom profile property for resource file name or just text will be the solution.

5. If I add my custom properties or remove some standard ones I have a conflict with SVN file.
Possible solution is the following:
- move this section back to web.config
- add a property like <mojoProfile OptionalFileOfUserSpecificProperties="mojoProfileUser.Config">
- implement <add>, <clear /> and <remove> tags for this file
- ignore the option if this file does not exist
- add a template for this file to SVN (as you did for user.config).


6. Rules like "if the property name contains 'url' it is rendered as a link" do not seem to be a good style for me. May be, add type definitions something like that (it shall not work just as written below, but I just want to show the idea):

<mojoProfile>
    <types>
        <add name="text"
                type="System.String"
                editControl="System.Web.UI.WebControls.TextBox"
                editControlValueProperty="Text"
                viewControl="System.Web.UI.WebControls.Label"
                viewControlValueProperty="Text"
                viewControlAdditionalOptions=""
                ...
                >
        <add name="yesno"
                type="System.Boolean"
                editControl="System.Web.UI.WebControls.CheckBox"
                editControlValueProperty="Checked"
                viewControl="System.Web.UI.WebControls.CheckBox"
                viewControlValueProperty="Checked"
                viewControlAdditionalOptions="Enabled=false"
                ...
                >
        ...
    </types>
    <properties>
        <add  name="MSN"
                type="text"
                ...
                >
        ...
    </properties>
</mojoProfile>

Or just hardcode several types for text, number, positive_number, date, link, yesno, etc.
1/10/2007 9:43:05 AM
Gravatar
Total Posts 18439

Re: About the new profile feature

Hi Alexander,

1. all properties have defaults so it is not needed to put lazyLoad="false" I will update the documentation to indicate the defaults

2. might be nice but not a priority for me, things like this should be a server configuration so a config file is appropriate in my thinking, it is not something to change frequently. It would be much more complex to implement this on a per site basis.

3. yes I've been thinking about that but not sure its really needed. the mojoProfile.config file is for what does show up in the UI. It is already possible in code to create and retrieve arbitrary properties using SiteUser.GetProperty and SiteUser.SetProperty. As long as these have lazyLoad = true they won't add any weight to normal operations and as long as they are not configured in the config file they will not show up in the UI

4. Good point, I will add a ResourceFile property, which will default to ProfileResource, so custom properties can have a separate resource file

5. I agree its a problem. For some things developers may need to back up things, I'm just not sure how much effort its worth, there are other things in web.config that are also an issue for svn like if you want to use a different machine key.  There are many things I would like to do in mojoPortal so I must choose my battles wisely. 
You can already specify an alternate file from web.config
<mojoProfile configSource="mojoProfile.config"></mojoProfile>
I'm not sure of what is involved to implement add, clear remove etc
One thing is though that in Medium trust you cannot access config sections at all so I catch a security exception when trying to get the config section and if the exception occurs I access the file directly as xml instead and in that case its hard coded to use mojoProfile.config

6. In trying to keep things simple sometimes a simple solution is acceptable even if it isn't pretty. I do think I want to make the display of boolean values use an image true.png or false.png and maybe this can come from the skin folder

Joe
1/11/2007 4:18:34 AM
Gravatar
Total Posts 488

Re: About the new profile feature

1. Ok. Please, add it also to the beginning of mojoProfile.Config.

2. Ok, I also think it's not so nesessary.

3. I mean some non-humanreadable user properties of my custom pages. Something like timestamps for remote operations, etc.

4. Ok.

5. You have already implemented an <add tag>, i just meant to implement the rest 2 as they are rather simple.
It's not good that "mojoProfile.Config" file name is hardcoded. As this file is stored in SVN, the easiest way to minimize conflicts is to create my own congig file and to change Web.config as
<mojoProfile configSource="myProfile.config"></mojoProfile>
May be, just remove the line above from Web.config and add a new property to appSettings section like "ProfileConfigurationFileName"? In this case it will also be easy to overwrite it in user.config without any conflicts in Web.config.

6. May be, you are right - your solution is much more easy... But it still requires some more types like date.
1/11/2007 9:14:01 AM
Gravatar
Total Posts 18439

Re: About the new profile feature

If I were to switch from using a custom config section to just use XmlDocument and put the name of the file in appsettings section in web.config that would work well for svn as you could specify a different file in user.config.

I thought about doing that also because Medium trust is getting more common and I don't like the idea of catching the securityexception frequently in Medium trust environments.

My question is are there any benefits to the config section approach that I would lose if I do this?
Perhaps I should cache the XmlNodeList?

Thoughts?

Joe
1/11/2007 12:12:25 PM
Gravatar
Total Posts 18439

Re: About the new profile feature

I've just implemented a DatePicker for System.DateTime and use of images for System.Boolean in ProfileView.aspx

Its in svn branches/2.x

Joe
1/12/2007 12:52:11 AM
Gravatar
Total Posts 488

Re: About the new profile feature

As far as I know the only benefit of the config section is that the application automatically restarts after any change.
I think that it is not so important in this case. You can use cache file dependency if you really want to reload the profile settings without application restart.

P.S. What about incapsulating the display and edit logic into some controls like ProfilePropertyViewControl and ProfilePropertyEditControl?
1/19/2007 8:44:28 AM
Gravatar
Total Posts 488

Re: About the new profile feature

Still waiting for ResourceFile property and documentation on the default values.
1/19/2007 9:02:13 AM
Gravatar
Total Posts 18439

Re: About the new profile feature

Both of those are already done.
http://www.mojoportal.com/userprofileconfiguration.aspx

For each setting I mention the default. See the part about resourceFile setting.

Joe
1/19/2007 9:55:40 AM
Gravatar
Total Posts 488

Re: About the new profile feature

1. About resourceFile property. I did not see it in the picture, so I did not notice the change of the documentation page. Thanks.

2. About documentation on the default values. Even if I know it is there I still cannot see it for all properties. Can you please add some more-user-friendly documentation, just say for each property if it is optional and default value like that:

name (mandatory) - must be unique for each property in the mojoProfile.config file, it is the name of the property.

lazyLoad
(optional, defaults to "false") - in most cases you do not need it. When set to true, the property will be loaded from the database on demand rather than as a group with the other profile properties. This should only be true for seldom used or particularly expensive to retrieve properties.
2/5/2007 12:39:39 PM
Gravatar
Total Posts 488

Re: About the new profile feature

Thanks for an update!
You must sign in to post in the forums. This thread is closed to new posts.