Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Products › Development › Forge › Provider - Authentication › OpenID Provider Register  |  

 

 

  Quick Links  
 


  Team Leadership  

Mike Horton
(Team Lead)

 

 Charles Nurse
(Core Team Sponsor)

 


  Team Members  

 Daniel Bartholomew
(CardSpace)

Mike Horton
(Active Directory)

Ian Sampson
(Active Directory)

  Charles Nurse
(LiveID, OpenID)

We're recruiting!  Can you handle support for the LiveID or OpenID provider?

 


  DotNetNuke Projects  
The DotNetNuke Projects are a special category of platform extensions which are developed by volunteers to conform to the high professional standards mandated by DotNetNuke Corporation. The DotNetNuke Projects are distributed as a standard part of the DotNetNuke core application release offerings.

 


PortalWebHosting
  Ads  
WebHostForAsp.net
 


  Sponsors  

Meet Our Sponsors

CrystalTech Web Hosting™
Webhost4life, specialists in DNN hosting
Mad Development is a full service interactive agency focusing on the merge of design, technology, e-commerce, and affiliate marketing by providing total website solutions.
AspDotNetStoreFront - E-Commerce by Design - The Leading ASP.NET shopping cart platform for developers!
Click here to go to dev.live.com for Windows Live developer resources
SteadyRain
 


Authentication Provider :: OpenID

The OpenID provider allows a user to authenticate to a website using their OpenID credentials.

More information on OpenID can be found at http://openid.net/what/

 


Team Member Blog
May 28

Posted by: Charles Nurse
5/28/2008

Michael Washington in a blog about updating his sites made reference to the fact that you no longer need to manualy modify your web.config settings prior to upgrading a site.

Why is this?  The answer is a new class that was introduced into the core (in 4.6.0) called XmlMerge.  This class is designed to allow developers to create xml files that can be used to "update" one of the core "config" files, and is especially useful for upgrades or component installations.

We have had the ability for some time to provide cleanup files - these files are named xx.xx.xx.txt and contain a list of folders and files to delete when upgrading to version xx.xx.xx.  This allows us to remove unneccessary files from production sites.  Starting in version 4.6.0 we added the ability to add a "xx.xx.xx.config" file which contained the changes required to "upgrade" a core config file.

Rather than try and explain - lets look at an example. The 4.6.0.config file:

<configuration>
    <nodes configfile="web.config">
        <node path="/configuration/system.web/httpModules" action="update" key="name" collision="overwrite">
            <add name="Compression" type="DotNetNuke.HttpModules.Compression.CompressionModule, DotNetNuke.HttpModules" />
            <add name="RequestFilter" type="DotNetNuke.HttpModules.RequestFilter.RequestFilterModule, DotNetNuke.HttpModules" />
            <add name="UrlRewrite" type="DotNetNuke.HttpModules.UrlRewriteModule, DotNetNuke.HttpModules" />
            <add name="Exception" type="DotNetNuke.HttpModules.Exceptions.ExceptionModule, DotNetNuke.HttpModules" />
            <add name="UsersOnline" type="DotNetNuke.HttpModules.UsersOnline.UsersOnlineModule, DotNetNuke.HttpModules" />
            <add name="DNNMembership" type="DotNetNuke.HttpModules.Membership.MembershipModule, DotNetNuke.HttpModules" />
            <add name="Personalization" type="DotNetNuke.HttpModules.Personalization.PersonalizationModule, DotNetNuke.HttpModules" />
        </node>
        <node path="/configuration/dotnetnuke/friendlyUrl/providers" action="update" key="name" collision="overwrite">
            <add name="DNNFriendlyUrl"
                 type="DotNetNuke.Services.Url.FriendlyUrl.DNNFriendlyUrlProvider, DotNetNuke.HttpModules"
                 includePageName="true"
                 regexMatch="[^a-zA-Z0-9 _-]" />
        </node>
    </nodes>
</configuration>

In version 4.6 - the HttpModules were all merged into a single assembly - the web.config file therefore needed to be updated to reflect this.  In this config file - there are two "node" elements which are the building blocks of the XmlMerge file.  The attributes tell the XmlMerge class how to deal with the content inside the node. 

So for the first node we have:

  • path="/configuration/system.web/httpModules" - this is an Xpath path that identifies the node being modified in the target file - in this case the "httpModules" element in the system.web element of the configuration
  • action="update" - this is the action - in this case the existing element is being "updated"
  • key="name"  - this is the key to use - in this case "name" - the XmlMerge class will identify the child nodes to change by matching the name attribute "Compression", "Exception etc.
  • collision="overwrite" - this is the behaviour to use if the child node exists - in this case the old entry will be overwritten by the new one

The target file is "web.config" as identified by the configfile attribute on the outer nodes element.

In addition to using this in the core Installer/Upgrader - the new "Universal Extension Installer" supports this ability too.  Again - as an example lets look at a fragment of a manifest from the new installer.

                    <config>
                        <configFile>web.config</configFile>
                        <install>
                            <configuration>
                                <nodes>
                                    <node path="/configuration/dotnetnuke/caching/providers" action="update" key="name" collision="overwrite">
                                        <add name="BroadcastPollingCachingProvider"
                                             type="DotNetNuke.Services.Cache.BroadcastPollingCachingProvider.BPCachingProvider, DotNetNuke.Caching.BroadcastPollingCachingProvider"
                                             providerPath="~\Providers\CachingProviders\BroadcastPollingCachingProvider\" />
                                    </node>
                                </nodes>
                            </configuration>
                        </install>
                        <uninstall>
                            <configuration>
                                <nodes>
                                    <node path="/configuration/dotnetnuke/caching/providers/add[@name='BroadcastPollingCachingProvider']" action="remove" />
                                </nodes>
                            </configuration>
                        </uninstall>
                    </config>

In this example (part of the manifest for installing the BroadcastPollingCachingProvider) you can see that the manifest defines a "config" element - which tells the Installer that we are "updating" a config file.  It has two separate sections that correspond to the same basic structure as the XmlMerge file above, one for installing the provider - with a similar set of attributes, and one for uninstalling, which shows how you would remove a section of the config file.

A full description of the API is beyond the scope of this blog, but if you want to start learning how to use this in your own modules/extensions - I would suggest that you look for the "XmlMerge.vb" file in the DotNetNuke project - the main entry points are the "UpdateConfig" methods.

 

Tags:

Re: XmlMerge - what is it?

So, in summary, what you're saying is:
You can use the straight up Upgrade package, and DNN will handle the web.config changes? Is that correct?

By christoc on   5/28/2008

Re: XmlMerge - what is it?

I hope that what people take away from this is that not only is this great for DNN upgrades, but it positions DNN to allow module developers to deploy complex modules in a manner that is easy for the portal administrator. Editing web.config files is not an easy task and causes most of the problems when it is required.

By AdefWebserver on   5/28/2008

Re: XmlMerge - what is it?

Charles,

This is an awesome bit of functionality that I'm quite sure not very many of us knew about....

...runs off to go update his own blog.....

By mitchel.sellers@gmail.com on   5/28/2008

Re: XmlMerge - what is it?

It was only mentioned in passing in one of Joe's blogs (maybe one line and a link to the Gemini enhancement), but I did speak about it in my Open Force Europe talk last year :)

By cnurse on   5/28/2008

Re: XmlMerge - what is it?

@ech01 you can change web.config when installing modules in a number of ways. For example when adding the first instance of a module in one page. When you install a module you give it access to your entire DNN install, thus it is only available for host users. The XML Merge only makes it easier for some scenarios to work.

By hooligannes on   5/28/2008

Re: XmlMerge - what is it?

I'm hesitant to endorse module developers from modifying the web.config, without the user's knowledge or consent. It seems like a pandora's box o' problems waiting to happen.

By ech01 on   5/28/2008

Re: XmlMerge - what is it?

Wow, so cool. I can't wait for 4.8.4 so I can see this work. If there was a book entitled "The 7 Habits of a Highly Effective (and Efficient) DotNetNuke Host/Admin/Professional" and in that book there is an entire chapter is devoted to staying up to date with new features in the product.