﻿<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Vicenç Masanas</title>
    <description>My personal blog on DotNetNuke.</description>
    <link>http://www.dotnetnuke.com/Products/Development/Forge/GroupLocalization/tabid/839/BlogId/7/Default.aspx</link>
    <language>en-US</language>
    <managingEditor>vmasanas@hotmail.com</managingEditor>
    <webMaster>admin1@dotnetnuke.com</webMaster>
    <pubDate>Wed, 09 Jul 2008 03:51:13 GMT</pubDate>
    <lastBuildDate>Wed, 09 Jul 2008 03:51:13 GMT</lastBuildDate>
    <docs>http://backend.userland.com/rss</docs>
    <generator>Blog RSS Generator Version 3.4.0.39853</generator>
    <item>
      <title>DotNetNuke event in Alicante - Spain</title>
      <description>&lt;p&gt;(If you don't understand spanish, you'd better don't come, because we'll not have translators &lt;img alt="" src="/Providers/HtmlEditorProviders/Fck/FCKeditor/editor/images/smiley/msn/wink_smile.gif" /&gt;. The event will also be available online thanks to Microsoft)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Soluciones Web Empresariales con DotNetNuke&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Nos complace invitarle al segundo evento sobre DotNetNuke organizado por la comunidad en españa TodoDNN.es. DotNetNuke es el CMS (Sistema de Gestión de Contenido) líder desarrollado en ASP.NET el cual es de libre distribución y código libre (Open Source). Promocionando este tipo de software disponemos de la colaboración de Microsoft MSDN España entre otras empresas. La asistencia es gratuita y puede registrarse a dicho evento al final de este mensaje.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Fecha&lt;/strong&gt;: 25 de Julio de 2.008 &lt;br /&gt;
&lt;strong&gt;Lugar&lt;/strong&gt;: &lt;a href="http://www.centrodenegociosalicante.com/"&gt;Centro de Negocios de Alicante&lt;/a&gt; (Alicante)&lt;br /&gt;
&lt;strong&gt;Agenda&lt;/strong&gt; &lt;br /&gt;
16:00-16:30 Bienvenida e introducción a DNN &lt;br /&gt;
16:30-17:45 Localización en DotNetNuke (Vicenç Masanas) &lt;br /&gt;
17:45-18:15 Descanso &lt;br /&gt;
18:15-19:30 Plataforma de negocios para ISPs (Francisco Pérez)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Organiza&lt;/strong&gt;: TodoDNN.es &lt;br /&gt;
&lt;strong&gt;Colaboradores&lt;/strong&gt;: MSDN España, Disgrafic ITec, Dotware, 2P Systems, Xepient Solutions y Live Data Security.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032381363&amp;Culture=es-ES"&gt;Registro Presencial&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032381361&amp;Culture=es-ES"&gt;Registro Webcast&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://www.dotnetnuke.com/Products/Development/Forge/GroupLocalization/tabid/839/EntryID/1888/Default.aspx</link>
      <author>vmasanas@hotmail.com</author>
      <comments>http://www.dotnetnuke.com/Products/Development/Forge/GroupLocalization/tabid/839/EntryID/1888/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dotnetnuke.com/Default.aspx?tabid=839&amp;EntryID=1888</guid>
      <pubDate>Fri, 04 Jul 2008 11:03:00 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.dotnetnuke.com/DesktopModules/Blog/Trackback.aspx?id=1888</trackback:ping>
    </item>
    <item>
      <title>RAD with DotNetNuke</title>
      <description>&lt;p&gt;Next week I'm presenting DNN as a successfull tool for Web RAD on Madrid and Barcelona thanks to Microsoft Spain. If you're around come by and say hello. It will be an introductiory session on what DNN is but also we'll see some of the new features DNN Cambrian will give us.&lt;/p&gt;
&lt;p&gt;More information and registrations: &lt;a href="http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032375244&amp;Culture=es-ES"&gt;Madrid&lt;/a&gt;, &lt;a href="http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032375246&amp;Culture=es-ES"&gt;Barcelona&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://www.dotnetnuke.com/Products/Development/Forge/GroupLocalization/tabid/839/EntryID/1804/Default.aspx</link>
      <author>vmasanas@hotmail.com</author>
      <comments>http://www.dotnetnuke.com/Products/Development/Forge/GroupLocalization/tabid/839/EntryID/1804/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dotnetnuke.com/Default.aspx?tabid=839&amp;EntryID=1804</guid>
      <pubDate>Wed, 16 Apr 2008 17:44:00 GMT</pubDate>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://www.dotnetnuke.com/DesktopModules/Blog/Trackback.aspx?id=1804</trackback:ping>
    </item>
    <item>
      <title>Big sites, big modules, big problems? Easy solution!</title>
      <description>&lt;p&gt;I've been fighthing for long with an issue we have on a quite big installation (75+ portals, 6500+ pages, 11000+ modules).&lt;br /&gt;
The issue only manifested when installing some modules and it would cause the application to die because of a timeout, so we were unable to install any new modules.&lt;/p&gt;
&lt;p&gt;The problem turned out to be in the way the installer process the .dnn file and how it updates the module information.&lt;br /&gt;
Basically it went that way:&lt;br /&gt;
- Register the DesktopModules&lt;br /&gt;
- Register any ModuleDefintions for the modules&lt;br /&gt;
- Register all the ModuleControls for all definitions&lt;/p&gt;
&lt;p&gt;So in a medium-large module this could be like 4-5 modules, 10-12 moduledefinitions, and 30-40 controls.&lt;br /&gt;
The problem is that in each of these updates the system did a clear on the host cache. So all the information that DNN uses to cache was cleared after each of these updates (so around 50 times). That caused that the same information was read again from the db after each call causing at the end the timeout.&lt;/p&gt;
&lt;p&gt;The issue with this problem is that it would only appear in big sites and when installing big modules. This it's like and exponential issue: the bigger the site and the bigger the module the easier you'll get this error.&lt;/p&gt;
&lt;p&gt;We changed the code so next version will include the fix for this but in the meantime you can patch your DNN installations by doing this easy fix (this applies to any DNN version up and including 4.8). To solve this issue you'll have to open the DotNetNuke solution in VS.NET and recompile the DotNetNuke.dll:&lt;/p&gt;
&lt;p&gt;In &lt;strong&gt;&lt;u&gt;PaDnnInstallerBase.vb&lt;/u&gt;&lt;/strong&gt;, look for method:&lt;br /&gt;
&lt;em&gt;Protected Overridable Sub RegisterModules(ByVal Folder As PaFolder, ByVal Modules As ArrayList, ByVal Controls As ArrayList)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;change the following calls:&lt;br /&gt;
&lt;em&gt;objDesktopModules.UpdateDesktopModule(objDesktopModule)&lt;br /&gt;
objModuleDefinitons.UpdateModuleDefinition(objModuleDefinition)&lt;br /&gt;
ModuleControlController.UpdateModuleControl(objModuleControl)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;to:&lt;br /&gt;
&lt;em&gt;objDesktopModules.UpdateDesktopModule(objDesktopModule, &lt;strong&gt;&lt;font color="#ff0000"&gt;False&lt;/font&gt;&lt;/strong&gt;)&lt;br /&gt;
objModuleDefinitons.UpdateModuleDefinition(objModuleDefinition, &lt;font color="#ff0000"&gt;&lt;strong&gt;False&lt;/strong&gt;&lt;/font&gt;)&lt;br /&gt;
ModuleControlController.UpdateModuleControl(objModuleControl, &lt;strong&gt;&lt;font color="#ff0000"&gt;False&lt;/font&gt;&lt;/strong&gt;)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;and just before this line, at the end of the method code:&lt;br /&gt;
&lt;em&gt;InstallerInfo.Log.EndJob(REGISTER_End)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;add&lt;br /&gt;
&lt;strong&gt;&lt;font color="#ff0000"&gt;&lt;em&gt;DataCache.ClearHostCache(True)&lt;/em&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In &lt;strong&gt;&lt;u&gt;DesktopModuleController.vb&lt;/u&gt;&lt;/strong&gt; change:&lt;br /&gt;
&lt;em&gt;Public Sub UpdateDesktopModule(ByVal objDesktopModule As DesktopModuleInfo)&lt;br /&gt;
    DataProvider.Instance().UpdateDesktopModule(objDesktopModule.DesktopModuleID, objDesktopModule.ModuleName, objDesktopModule.FolderName, objDesktopModule.FriendlyName, objDesktopModule.Description, objDesktopModule.Version, objDesktopModule.IsPremium, objDesktopModule.IsAdmin, objDesktopModule.BusinessControllerClass, objDesktopModule.SupportedFeatures, objDesktopModule.CompatibleVersions, objDesktopModule.Dependencies, objDesktopModule.Permissions)&lt;br /&gt;
    DataCache.ClearHostCache(True)&lt;br /&gt;
End Sub&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;to:&lt;br /&gt;
&lt;em&gt;Public Sub UpdateDesktopModule(ByVal objDesktopModule As DesktopModuleInfo)&lt;br /&gt;
 UpdateDesktopModule(objDesktopModule, True)&lt;br /&gt;
End Sub&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Friend Sub UpdateDesktopModule(ByVal objDesktopModule As DesktopModuleInfo, ByVal clearCache As Boolean)&lt;br /&gt;
 DataProvider.Instance().UpdateDesktopModule(objDesktopModule.DesktopModuleID, objDesktopModule.ModuleName, objDesktopModule.FolderName, objDesktopModule.FriendlyName, objDesktopModule.Description, objDesktopModule.Version, objDesktopModule.IsPremium, objDesktopModule.IsAdmin, objDesktopModule.BusinessControllerClass, objDesktopModule.SupportedFeatures, objDesktopModule.CompatibleVersions, objDesktopModule.Dependencies, objDesktopModule.Permissions)&lt;br /&gt;
 If clearCache Then DataCache.ClearHostCache(True)&lt;br /&gt;
End Sub&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;In &lt;strong&gt;&lt;u&gt;ModuleDefinitionController.vb&lt;/u&gt;&lt;/strong&gt; change:&lt;br /&gt;
&lt;em&gt;Public Sub UpdateModuleDefinition(ByVal objModuleDefinition As ModuleDefinitionInfo)&lt;br /&gt;
    DataProvider.Instance().UpdateModuleDefinition(objModuleDefinition.ModuleDefID, objModuleDefinition.FriendlyName, objModuleDefinition.DefaultCacheTime)&lt;br /&gt;
    DataCache.ClearHostCache(True)&lt;br /&gt;
End Sub&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;to:&lt;br /&gt;
&lt;em&gt;Public Sub UpdateModuleDefinition(ByVal objModuleDefinition As ModuleDefinitionInfo)&lt;br /&gt;
 UpdateModuleDefinition(objModuleDefinition, True)&lt;br /&gt;
End Sub&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Public Sub UpdateModuleDefinition(ByVal objModuleDefinition As ModuleDefinitionInfo, ByVal clearCache As Boolean)&lt;br /&gt;
 DataProvider.Instance().UpdateModuleDefinition(objModuleDefinition.ModuleDefID, objModuleDefinition.FriendlyName, objModuleDefinition.DefaultCacheTime)&lt;br /&gt;
 If clearCache Then DataCache.ClearHostCache(True)&lt;br /&gt;
End Sub&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;And finally in &lt;strong&gt;&lt;u&gt;ModuleControlController.vb&lt;/u&gt;&lt;/strong&gt; change:&lt;br /&gt;
&lt;em&gt;Public Shared Sub UpdateModuleControl(ByVal objModuleControl As ModuleControlInfo)&lt;br /&gt;
    provider.UpdateModuleControl(objModuleControl.ModuleControlID, objModuleControl.ModuleDefID, objModuleControl.ControlKey, objModuleControl.ControlTitle, objModuleControl.ControlSrc, objModuleControl.IconFile, CType(objModuleControl.ControlType, Integer), objModuleControl.ViewOrder, objModuleControl.HelpURL, objModuleControl.SupportsPartialRendering)&lt;br /&gt;
    DataCache.ClearHostCache(True)&lt;br /&gt;
End Sub&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;to:&lt;br /&gt;
&lt;em&gt;Public Shared Sub UpdateModuleControl(ByVal objModuleControl As ModuleControlInfo)&lt;br /&gt;
 UpdateModuleControl(objModuleControl, True)&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
Public Shared Sub UpdateModuleControl(ByVal objModuleControl As ModuleControlInfo, ByVal clearCache As Boolean)&lt;br /&gt;
 provider.UpdateModuleControl(objModuleControl.ModuleControlID, objModuleControl.ModuleDefID, objModuleControl.ControlKey, objModuleControl.ControlTitle, objModuleControl.ControlSrc, objModuleControl.IconFile, CType(objModuleControl.ControlType, Integer), objModuleControl.ViewOrder, objModuleControl.HelpURL, objModuleControl.SupportsPartialRendering)&lt;br /&gt;
 If clearCache Then DataCache.ClearHostCache(True)&lt;br /&gt;
End Sub&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;now recompile and just copy DotNetNuke.dll to your DNN installation.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;As always remember to make a copy of your files before doing any upgrade and try it on a testing site.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Conclusion:&lt;br /&gt;
Caching is a very important thing since it can save your application from the most expensive db calls (and in DNN we have quite a few of those).&lt;br /&gt;
But it's also very important to understand how it is used and check that your code is working fine in different situations.&lt;/p&gt;</description>
      <link>http://www.dotnetnuke.com/Products/Development/Forge/GroupLocalization/tabid/839/EntryID/1713/Default.aspx</link>
      <author>vmasanas@hotmail.com</author>
      <comments>http://www.dotnetnuke.com/Products/Development/Forge/GroupLocalization/tabid/839/EntryID/1713/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dotnetnuke.com/Default.aspx?tabid=839&amp;EntryID=1713</guid>
      <pubDate>Sat, 26 Jan 2008 09:59:00 GMT</pubDate>
      <slash:comments>13</slash:comments>
      <trackback:ping>http://www.dotnetnuke.com/DesktopModules/Blog/Trackback.aspx?id=1713</trackback:ping>
    </item>
    <item>
      <title>OpenForce material</title>
      <description>I've just posted the material for the presentations I did both in OpenForce Europe and USA.
Get them &lt;a href="http://dnnjungle.vmasanas.net/Home/OpenForce07/tabid/126/Default.aspx"&gt;here&lt;/a&gt;.</description>
      <link>http://www.dotnetnuke.com/Products/Development/Forge/GroupLocalization/tabid/839/EntryID/1629/Default.aspx</link>
      <author>vmasanas@hotmail.com</author>
      <comments>http://www.dotnetnuke.com/Products/Development/Forge/GroupLocalization/tabid/839/EntryID/1629/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dotnetnuke.com/Default.aspx?tabid=839&amp;EntryID=1629</guid>
      <pubDate>Thu, 08 Nov 2007 16:03:41 GMT</pubDate>
      <slash:comments>3</slash:comments>
      <trackback:ping>http://www.dotnetnuke.com/DesktopModules/Blog/Trackback.aspx?id=1629</trackback:ping>
    </item>
    <item>
      <title>Recommendation for a Book Reader / TabletPC</title>
      <description>&lt;p&gt;&lt;img height="128" hspace="30" width="195" align="right" vspace="30" alt="" src="/Portals/25/CoreTeam/BlogFiles/vmasanas/PRS500U2.jpg" /&gt;I've been thinking lately on getting something like the &lt;a href="http://www.sonystyle.com/webapp/wcs/stores/servlet/ProductDisplay?catalogId=10551&amp;storeId=10151&amp;langId=-1&amp;productId=11038811"&gt;Sony Book Reader&lt;/a&gt;. You know with so many information on the net I'm very used to download documents, manuals, even blogs! and read them offline at night. Since I'm not a top computer geek I'm not very familiar with this kind of hardware. I was thinking also that maybe a simple &lt;a href="http://www.tabletpcreview.com/"&gt;TabletPC&lt;/a&gt; or &lt;a href="http://www.windowsmarketplace.com/content.aspx?ctId=392&amp;tabid=1"&gt;ultramobile pc&lt;/a&gt; would do the job, but I'm not sure.&lt;/p&gt;
&lt;p&gt;Has to be something realy slim and portable and easy to read with, something you would take with you to bed ( well, not for that you are thing of...).&lt;/p&gt;
&lt;p&gt;The idea is that it should be mainly for reading and other features as a bonus. Any suggestion?&lt;/p&gt;</description>
      <link>http://www.dotnetnuke.com/Products/Development/Forge/GroupLocalization/tabid/839/EntryID/1514/Default.aspx</link>
      <author>vmasanas@hotmail.com</author>
      <comments>http://www.dotnetnuke.com/Products/Development/Forge/GroupLocalization/tabid/839/EntryID/1514/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dotnetnuke.com/Default.aspx?tabid=839&amp;EntryID=1514</guid>
      <pubDate>Wed, 15 Aug 2007 09:34:49 GMT</pubDate>
      <slash:comments>4</slash:comments>
      <trackback:ping>http://www.dotnetnuke.com/DesktopModules/Blog/Trackback.aspx?id=1514</trackback:ping>
    </item>
    <item>
      <title>Installing and upgrading modules in DNN, a developer's view</title>
      <description>&lt;p&gt;There's some misunderstanding on how DotNetNuke Modules are installed and which steps are executed during a module installation or upgrade.&lt;br /&gt;
I'll try to cover both scenarios on this post and I hope this helps to get a clearer idea of how this works.&lt;/p&gt;
&lt;p&gt;Let's first take a look at &lt;span class="SubHead"&gt;what happens when a module is installed:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;As you may know all the internal versioning of modules (and even the core itself) is built around the &lt;strong&gt;&lt;version&gt;&lt;/strong&gt; node on the .dnn installer manifest and the sql scripts that are included in the installation zip.&lt;/p&gt;
&lt;p&gt;When the module is installed DNN will run all sql scripts with a number lower or equal than the one specified in the &lt;version&gt; node. Finally the version in that node will be saved on the DesktopModules table. This will help the core on future upgrades so it can know what version is currently installed.&lt;/p&gt;
&lt;p&gt;First thing to note here: A given xx.xx.xx.SqlDataProvider script will only be run once. So no matter how many times you reinstall the same module, each sql script will only run once. This is great because otherwise you will see lots of errors when (for example) trying to create a table that already exists.&lt;br /&gt;
This gives to another point: if you had some trouble with a module (for example you removed a stored procedure accidentally during development), repeating the same process again (without first deinstalling the module) will not produce the same result.&lt;br /&gt;
So don't expect that reinstalling the same version that's currently installed will solve that problem. Can solve others, but not problems with the database.&lt;/p&gt;
&lt;p&gt;Another thing that happens when you install a module is that it fires the "UpgradeModule" method if the module implements the IUpgradeable interface.&lt;/p&gt;
&lt;pre&gt;Public Interface IUpgradeable&lt;br /&gt;  Function UpgradeModule(ByVal Version As String) As String&lt;br /&gt;End Interface&lt;/pre&gt;
&lt;p&gt;In fact this method will be called once after any sql script has been executed and it will be passed the version number of the current script. So you have to code your upgrade logic knowing that this method can be called multiple times. This is usually done testing for the Version parameter on a "select case" statement.&lt;br /&gt;
The method call will be routed through the EventQueue system after the web application is restarted. A minor difference with regards to how the sql scripts are executed exists though: even if there's no sql script on the module, this method will be called at least once. This is needed to be sure that at least the upgrade logic is executed, even if no sql script exists. So if you are installing a module whose final version will be 03.03.03, be sure that UpgradeModule will be called at least once with that version number.&lt;/p&gt;
&lt;p&gt;Also notice that all UpgradeModule(..) calls will be made after all sql scripts have already run. This is true because they will be fired after the application is restarted and the end of the module installation process.&lt;br /&gt;
So again, be sure not to do something "strange" on your upgrade logic, assuming that the database has a special structure. For example query a given stored proc, you know in version 01.01.01 existed, because the code will be executed when all scripts for version 03.03.03 are already installed and maybe that stored proc. doesn't exist anymore.&lt;/p&gt;
&lt;p&gt;On first time installations this is more or less all that's involved. Upgrading a module has a couple of differences worth noting.&lt;/p&gt;
&lt;p&gt;&lt;span class="SubHead"&gt;What happens when a module is upgraded:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Execution of sql scripts is more or less the same: each file with a version number greater than the current version number stored on the DesktopModules table, and less or equal than the number included in the &lt;version&gt; node of the .dnn installer manifest will be run in order.&lt;/p&gt;
&lt;p&gt;After each xx.xx.xx.SqlDataProvider script is run, the core will search for a corresponding "xx.xx.xx.txt" file on the upgrade package. This file can contain a list of files you want to remove from older versions of your module. You have to specify a file on any line using the relative path from the root of the DNN installation. For example:&lt;br /&gt;
bin\DotNetNuke.Modules.Survey.dll&lt;br /&gt;
bin\DotNetNuke.Modules.Survey.SqlDataProvider.dll&lt;br /&gt;
DesktopModules\Survey\c.gif&lt;/p&gt;
&lt;p&gt;So if this file is 03.03.03.txt, and there's a 03.03.03.SqlDataProvider file, it will be "executed" just after the sqlscript and before the UpgradeModule for this version.&lt;br /&gt;
This is also another point where you have to make attention: the delete file will only be processed if there's a related sql script. &lt;br /&gt;
Afterwards the application is restarted all the UpgradeModule(...) will be called for each sql script that has been run before. Again, UpgradeModule will be called at least once for the final version (the one in the &lt;version&gt; node) , even if no sql script exists.&lt;/p&gt;
&lt;p&gt;I hope this brief explanation helps to understand how DNN processes modules during installation and successive upgrades.&lt;/p&gt;</description>
      <link>http://www.dotnetnuke.com/Products/Development/Forge/GroupLocalization/tabid/839/EntryID/1246/Default.aspx</link>
      <author>vmasanas@hotmail.com</author>
      <comments>http://www.dotnetnuke.com/Products/Development/Forge/GroupLocalization/tabid/839/EntryID/1246/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dotnetnuke.com/Default.aspx?tabid=839&amp;EntryID=1246</guid>
      <pubDate>Tue, 09 Jan 2007 23:28:00 GMT</pubDate>
      <slash:comments>14</slash:comments>
      <trackback:ping>http://www.dotnetnuke.com/DesktopModules/Blog/Trackback.aspx?id=1246</trackback:ping>
    </item>
    <item>
      <title>New features on page management</title>
      <description>&lt;p&gt;DotNetNuke latest 4.4 version contains two new features on the page settings control that helps a lot when maintaining large web sites with subsections where you tend to apply different skins and / or permissions.&lt;/p&gt;
&lt;p&gt;On any page, when you go to "Page Settings" you will see a new option below the permissions grid.&lt;/p&gt;
&lt;p&gt;&lt;img height="162" width="388" alt="" src="/Portals/25/CoreTeam/BlogFiles/newdnn44-1.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;This option, as the name explains, will copy the currently selected permissions to all descendents of the current page. Can you imagine a good use for this when trying to set some permission to a set of related pages?&lt;/p&gt;
&lt;p&gt;On the same idea, how many times have you had to apply the same skin to a page and all descendants (so to a full section of the web site)?&lt;/p&gt;
&lt;p&gt;&lt;img height="137" width="487" alt="" src="http://www.dotnetnuke.com/Portals/25/CoreTeam/BlogFiles/newdnn44-2.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;"Copy design" comes to rescue! &lt;/p&gt;
&lt;p&gt;Both options (copy permissions and copy design) will honor the current user permissions, so this will only be applied to pages where the user has edit permissions. &lt;/p&gt;</description>
      <link>http://www.dotnetnuke.com/Products/Development/Forge/GroupLocalization/tabid/839/EntryID/1245/Default.aspx</link>
      <author>vmasanas@hotmail.com</author>
      <comments>http://www.dotnetnuke.com/Products/Development/Forge/GroupLocalization/tabid/839/EntryID/1245/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dotnetnuke.com/Default.aspx?tabid=839&amp;EntryID=1245</guid>
      <pubDate>Tue, 09 Jan 2007 16:28:00 GMT</pubDate>
      <slash:comments>10</slash:comments>
      <trackback:ping>http://www.dotnetnuke.com/DesktopModules/Blog/Trackback.aspx?id=1245</trackback:ping>
    </item>
    <item>
      <title>DotNetNuke Trainning in Paris</title>
      <description>&lt;p&gt;Next week, from December 11 to december 15, there's a full week of DNN trainning in Paris. They will cover a lot of interesting items: skinning, the framework, module development, DNN services, security, etc.&lt;br /&gt;
I've been invited to give a presentation on the first day and I'm very excited to meet all the people interested in DNN and share our vision and ideas around it.&lt;/p&gt;
&lt;p&gt;If you are interested in DNN and want to know a lot more about it this is a great opportunity for you. For more information visit Aricie's &lt;a href="http://www.aricie.net"&gt;web site&lt;/a&gt;. &lt;/p&gt;</description>
      <link>http://www.dotnetnuke.com/Products/Development/Forge/GroupLocalization/tabid/839/EntryID/1207/Default.aspx</link>
      <author>vmasanas@hotmail.com</author>
      <comments>http://www.dotnetnuke.com/Products/Development/Forge/GroupLocalization/tabid/839/EntryID/1207/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dotnetnuke.com/Default.aspx?tabid=839&amp;EntryID=1207</guid>
      <pubDate>Sun, 03 Dec 2006 17:45:00 GMT</pubDate>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://www.dotnetnuke.com/DesktopModules/Blog/Trackback.aspx?id=1207</trackback:ping>
    </item>
    <item>
      <title>Custom Module Permissions. Enhance your modules!</title>
      <description>&lt;P&gt;There's a "old" feature in DNN that allows module developers to create their own custom permissions for the modules they are creating. This will allow you to create a module and specify more granular permissions than the default VIEW / EDIT options DotNetNuke provides by default.&lt;/P&gt;
&lt;P&gt;Yet a very powerfull feature I've seen this option not being much used. Actually very few module use that.&lt;BR&gt;Why? I think the reason is because of a lack of documentation and examples from DNN core modules itself (an exceptional exception is the &lt;A href="http://www.dotnetnuke.com/Default.aspx?tabid=877"&gt;UDT&lt;/A&gt; module, from which I based some of this code). So I thought it would be good idea to provide some explanation on this and a piece of sample code for everybody to use.&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=subhead&gt;What do we want&lt;/SPAN&gt;&lt;BR&gt;The overall goal of this exercise is to create some custom permissions for a module so it can have other options than the VIEW / EDIT default permissions. For example, decide which roles will be able to edit a specific item in the module.&lt;BR&gt;The new permissions for the module will appear *&lt;STRONG&gt;automatically&lt;/STRONG&gt;* on the permission grid in the module settings page without any extra step on your (the developer) part.&lt;/P&gt;
&lt;P align=center&gt;&lt;IMG src="http://dnnjungle.vmasanas.net/portals/0/blogfiles/perm.grid.jpg"&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=subhead&gt;Structure&lt;/SPAN&gt; &lt;BR&gt;DotNetNuke provides two tables that support this feature. First there is the Permission table where all permissions are defined&lt;/P&gt;
&lt;P align=center&gt;&lt;IMG src="http://dnnjungle.vmasanas.net/portals/0/blogfiles/perm.data.jpg"&gt;&lt;/P&gt;
&lt;P&gt;and then we have the ModulePermission table where permission for each module are stored.&lt;/P&gt;
&lt;P align=center&gt;&lt;IMG src="http://dnnjungle.vmasanas.net/portals/0/blogfiles/perm.db.jpg"&gt;&lt;/P&gt;
&lt;P&gt;Note that this table contains not just module related permissions but all permission types (including folder and tabs). If at any given time DNN supports more granular permissions for these objects you will see them defined here.&lt;/P&gt;
&lt;P&gt;On the Modules side note that the default permissions are defined with a code of "SYSTEM_MODULE_DEFINITION".&lt;BR&gt;So the first thing to do when creating custom permissions is decide a unique code for your module. I suggest you use something similar to "MODULE_YOURMODULENAME".&lt;BR&gt;ModuleDefId is a reference to the module that "owns" the permissions and PermissionKey, PermissionName define every permission you want to add.&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=subhead&gt;Setup&lt;/SPAN&gt;&lt;BR&gt;A small problem with the current solution is that DNN does not provide any automated way to install new permission definitions when a module is installed. I'm sure we will solve this in a future version.&lt;/P&gt;
&lt;P&gt;So we'll have to create some code to handle this, and the best way of doing it is by implementing the core IUpgrade interface. This interface defines a method that will be called everytime a new version of the module is installed, even the first version. So just add this piece of code to your controller class to handle the setup of module permissions:&lt;/P&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Courier New"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  162&lt;/SPAN&gt;         &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; UpgradeModule(&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; Version)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  163&lt;/SPAN&gt;         {&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  164&lt;/SPAN&gt;             &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (Version == &lt;SPAN style="COLOR: maroon"&gt;"01.00.00"&lt;/SPAN&gt;)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  165&lt;/SPAN&gt;             {&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  166&lt;/SPAN&gt;                 &lt;SPAN style="COLOR: green"&gt;// Install module permissions&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  167&lt;/SPAN&gt;                 InitModulePermissions();&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  168&lt;/SPAN&gt;             }&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  169&lt;/SPAN&gt;             &lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; Version;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  170&lt;/SPAN&gt;         }&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  171&lt;/SPAN&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  172&lt;/SPAN&gt;         &lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; InitModulePermissions()&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  173&lt;/SPAN&gt;         {&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  174&lt;/SPAN&gt;             PermissionController permCtl = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; PermissionController();&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  175&lt;/SPAN&gt;             &lt;SPAN style="COLOR: teal"&gt;ArrayList&lt;/SPAN&gt; arr = permCtl.GetPermissionByCodeAndKey(ModuleSecurity.PERMISSIONCODE, &lt;SPAN style="COLOR: maroon"&gt;""&lt;/SPAN&gt;);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  176&lt;/SPAN&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  177&lt;/SPAN&gt;             DesktopModuleController desktopMod = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; DesktopModuleController();&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  178&lt;/SPAN&gt;             DesktopModuleInfo desktopInfo = desktopMod.GetDesktopModuleByModuleName(&lt;SPAN style="COLOR: maroon"&gt;"MyModule"&lt;/SPAN&gt;);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  179&lt;/SPAN&gt;             ModuleDefinitionController modDef = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; ModuleDefinitionController();&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  180&lt;/SPAN&gt;             ModuleDefinitionInfo modDefInfo = modDef.GetModuleDefinitionByName(desktopInfo.DesktopModuleID, &lt;SPAN style="COLOR: maroon"&gt;"MyModule"&lt;/SPAN&gt;);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  181&lt;/SPAN&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  182&lt;/SPAN&gt;             &lt;SPAN style="COLOR: blue"&gt;try&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  183&lt;/SPAN&gt;             {&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  184&lt;/SPAN&gt;                 PermissionInfo pi = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; PermissionInfo();&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  185&lt;/SPAN&gt;                 pi.ModuleDefID = modDefInfo.ModuleDefID;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  186&lt;/SPAN&gt;                 pi.PermissionCode = ModuleSecurity.PERMISSIONCODE;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  187&lt;/SPAN&gt;                 pi.PermissionKey = ModuleSecurity.PERMISSION1;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  188&lt;/SPAN&gt;                 pi.PermissionName = &lt;SPAN style="COLOR: maroon"&gt;"A custom permission"&lt;/SPAN&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  189&lt;/SPAN&gt;                 permCtl.AddPermission(pi);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  190&lt;/SPAN&gt;             }&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  191&lt;/SPAN&gt;             &lt;SPAN style="COLOR: blue"&gt;catch&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  192&lt;/SPAN&gt;             {&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  193&lt;/SPAN&gt;             }&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  194&lt;/SPAN&gt;             &lt;SPAN style="COLOR: blue"&gt;try&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  195&lt;/SPAN&gt;             {&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  196&lt;/SPAN&gt;                 PermissionInfo pi = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; PermissionInfo();&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  197&lt;/SPAN&gt;                 pi.ModuleDefID = modDefInfo.ModuleDefID;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  198&lt;/SPAN&gt;                 pi.PermissionCode = ModuleSecurity.PERMISSIONCODE;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  199&lt;/SPAN&gt;                 pi.PermissionKey = ModuleSecurity.PERMISSION2;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  200&lt;/SPAN&gt;                 pi.PermissionName = &lt;SPAN style="COLOR: maroon"&gt;"Another custom permission"&lt;/SPAN&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  201&lt;/SPAN&gt;                 permCtl.AddPermission(pi);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  202&lt;/SPAN&gt;             }&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  203&lt;/SPAN&gt;             &lt;SPAN style="COLOR: blue"&gt;catch&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  204&lt;/SPAN&gt;             {&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  205&lt;/SPAN&gt;             }&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;  206&lt;/SPAN&gt;         }&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;!--EndFragment--&gt;
&lt;P&gt;Note that this code references a class named ModuleSecurity, more on this in a moment.&lt;/P&gt;
&lt;P&gt;At this point, when you enter the module settings page for any module of this kind you will see the custom permissions on the permission grid.&lt;/P&gt;
&lt;P align=center&gt;&lt;IMG src="http://dnnjungle.vmasanas.net/portals/0/blogfiles/perm.dat2.jpg"&gt;&lt;/P&gt;
&lt;P&gt;and this is how the permission table data should look now.&lt;/P&gt;
&lt;P align=center&gt;&lt;IMG src="http://dnnjungle.vmasanas.net/portals/0/blogfiles/perm.grid2.jpg"&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=subhead&gt;Use&lt;/SPAN&gt;&lt;BR&gt;At this point we have all the infrastructe ready to start using these permissions on our custom module.&lt;BR&gt;Here is a sample class the encapsulates then common needs.&lt;BR&gt;- it defines the permissions definition constants (used in all access to the data)&lt;/P&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Courier New"&gt;&lt;!--EndFragment--&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Courier New"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;   23&lt;/SPAN&gt;         &lt;SPAN style="COLOR: green"&gt;// Constants&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;   24&lt;/SPAN&gt;         &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;const&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; PERMISSION1 = &lt;SPAN style="COLOR: maroon"&gt;"PERMISSION1"&lt;/SPAN&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;   25&lt;/SPAN&gt;         &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;const&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; PERMISSION2 = &lt;SPAN style="COLOR: maroon"&gt;"PERMISSION2"&lt;/SPAN&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;   26&lt;/SPAN&gt;         &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;const&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; PERMISSIONCODE = &lt;SPAN style="COLOR: maroon"&gt;"MODULE_MYMODULE"&lt;/SPAN&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;!--EndFragment--&gt;&lt;BR&gt;- the interesting part in is the contructor, where you define a varible / property pair to define all the permissions in a more easy way.&lt;/DIV&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Courier New"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;/P&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Courier New"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;   43&lt;/SPAN&gt;         &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; ModuleSecurity(ModuleInfo modInfo)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;   44&lt;/SPAN&gt;         {&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;   45&lt;/SPAN&gt;             ModulePermissionCollection permCollection;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;   46&lt;/SPAN&gt;             permCollection = modInfo.ModulePermissions;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;   47&lt;/SPAN&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;   48&lt;/SPAN&gt;             ModulePermissionController permCtl = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; ModulePermissionController();&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;   49&lt;/SPAN&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;   50&lt;/SPAN&gt;             _permission1 = ModulePermissionController.HasModulePermission(permCollection, PERMISSION1);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;   51&lt;/SPAN&gt;             _permission2 = ModulePermissionController.HasModulePermission(permCollection, PERMISSION2);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;   52&lt;/SPAN&gt;         }&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt; &lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;- and finally define a couple properties to wrap these permissions:&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt; &lt;/P&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Courier New"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;   56&lt;/SPAN&gt;         &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;bool&lt;/SPAN&gt; CanDoThis&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;   57&lt;/SPAN&gt;         {&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;   58&lt;/SPAN&gt;             &lt;SPAN style="COLOR: blue"&gt;get&lt;/SPAN&gt; { &lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; _permission1; }&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;   59&lt;/SPAN&gt;         }&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;   60&lt;/SPAN&gt;         &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;bool&lt;/SPAN&gt; CanDoThat&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;   61&lt;/SPAN&gt;         {&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;   62&lt;/SPAN&gt;             &lt;SPAN style="COLOR: blue"&gt;get&lt;/SPAN&gt; { &lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; _permission2; }&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;   63&lt;/SPAN&gt;         }&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;!--EndFragment--&gt;&lt;/DIV&gt;&lt;!--EndFragment--&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;P&gt;Now you can use that class on your module's code and do something like that:&lt;/P&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Courier New"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;    1&lt;/SPAN&gt; ModuleSecurity ms = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; ModuleSecurity(&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.ModuleConfiguration);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;    2&lt;/SPAN&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;    3&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (ms.CanDoThis)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;    4&lt;/SPAN&gt; {&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;    5&lt;/SPAN&gt;  &lt;SPAN style="COLOR: green"&gt;// do it&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;    6&lt;/SPAN&gt;  ...&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;    7&lt;/SPAN&gt; }&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;!--EndFragment--&gt;&lt;SPAN class=subhead&gt;Conclusion&lt;BR&gt;&lt;/SPAN&gt;You can see that without much effort you can provide a much richer configuration interface to your module configuration using builtin DNN capabilities, and take advantage of the gread security features the framework has right out of the box.&lt;/P&gt;</description>
      <link>http://www.dotnetnuke.com/Products/Development/Forge/GroupLocalization/tabid/839/EntryID/1052/Default.aspx</link>
      <author>vmasanas@hotmail.com</author>
      <comments>http://www.dotnetnuke.com/Products/Development/Forge/GroupLocalization/tabid/839/EntryID/1052/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dotnetnuke.com/Default.aspx?tabid=839&amp;EntryID=1052</guid>
      <pubDate>Tue, 01 Aug 2006 08:05:00 GMT</pubDate>
      <slash:comments>29</slash:comments>
      <trackback:ping>http://www.dotnetnuke.com/DesktopModules/Blog/Trackback.aspx?id=1052</trackback:ping>
    </item>
    <item>
      <title>Jason Zander video on .NET versions</title>
      <description>&lt;P&gt;A very interesting &lt;A href="http://channel9.msdn.com/Showpost.aspx?postid=217428"&gt;video&lt;/A&gt; from &lt;A href="http://blogs.msdn.com/jasonz/"&gt;Jason Zander&lt;/A&gt; on the new .NET versions (WinFX to .NET 3.0 move) and how they manage all this. Sure this will help clear some misunderstandings on the subject.&lt;/P&gt;</description>
      <link>http://www.dotnetnuke.com/Products/Development/Forge/GroupLocalization/tabid/839/EntryID/1051/Default.aspx</link>
      <author>vmasanas@hotmail.com</author>
      <comments>http://www.dotnetnuke.com/Products/Development/Forge/GroupLocalization/tabid/839/EntryID/1051/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dotnetnuke.com/Default.aspx?tabid=839&amp;EntryID=1051</guid>
      <pubDate>Tue, 01 Aug 2006 08:00:00 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.dotnetnuke.com/DesktopModules/Blog/Trackback.aspx?id=1051</trackback:ping>
    </item>
  </channel>
</rss>