Module Component

Return to previous page

  • 4/7/2015
  • 4933 Views

Comments

4933 Views

Module Component

Last updated 6 years ago

Comments

Common

(Enter the content of this article below)

Advanced

 
The Module component is used to package and install modules. All modules should use this component to define their controls, supported features, etc.

Only one component module is allow per package. To install a series of modules as a unit different packages can be included in the same manifest file, each one containing the definition of a single module.

Each module can include a number of "ModuleDefitions" and "Module Controls".

Elements and attributes

The basic structure of the Module component is as follows:

<component type="Module">

<desktopModule>
<moduleName/>
<foldername/>
<businessControllerClass/>
<codeSubdirectory />
<isAdmin />
<isPremium/>
<supportedFeatures>
<supportedFeature type="" />
</supportedFeatures>
<moduleDefinitions />
</desktopModule>
<eventMessage />
</component>

  • moduleName: the name of the module
  • foldername: the folder where the module will be installed (relative to DesktopModules)
  • businessControllerClass: the fully qualified name of the class that includes the extension methods (search, import/export, ...) as required by DNN
  • codeSubdirectory: the folder under \App_Code where the code files for the module will be installed
  • isAdmin: defines the module as an Admin module
  • isPremium: defines the module as a Premium module. Premium modules must be explicitely assigned to portals in order to be available for users to install in the portal. By default, isPremium is set to false
  • supportedFeatures: can be used to explicitely declare the features supported by the module. This option requires a business controller class. Currently allowed features include:
    • Portable: for import/export capabilities
    • Searchable: defines a module that can be indexed/searched
    • Upgradeable: supports the upgrade interface for modules
  • moduleDefinitions: a module definition is the minimum logical unit of functionality defined for a module. Each module can contain multiple module definitions that will contain at least one module control (see below).
  • eventMessage: (see below).

The description, friendlyName and version information fields for the module are read from the nodes defined on the package level on the manifest.

Module Definitions

<moduleDefinition>

<friendlyName/>
<defaultCacheTime/>
<moduleControls>
<moduleControl>
<controlKey />
<controlSrc />
<supportsPartialRendering />
<controlTitle />
<controlType />
<iconFile />
<helpUrl></helpUrl>
<viewOrder>0</viewOrder>
</moduleControl>
</moduleControls>
<permissions>
<permission code="" key="" name="" />
</permissions>
</moduleDefinition>

The moduleDefinition node includes all information required to correctly define a DNN module.
Custom permissions for the module can be defined declaratively on the permissions node. Here is a sample from the events module:
<permissions>

<permission code="EVENTS_MODULE" key="EVENTSSET" name="Edit Settings" />
<permission code="EVENTS_MODULE" key="EVENTSMOD" name="Events Moderator" />
<permission code="EVENTS_MODULE" key="EVENTSCAT" name="Global Category Editor" />
<permission code="EVENTS_MODULE" key="EVENTSLOC" name="Global Location Editor" />
</permissions>

Event Message

The eventMessage allows a module to define an event that will be added to the DNN Event Queue for later processing.

<eventMessage>

<processorType/>
<processorCommand/>
<attributes>
<node>value</node>
</attributes>
</eventMessage>

Here is a sample from the events module:

<eventMessage>

<processorType>DotNetNuke.Entities.Modules.EventMessageProcessor,
DotNetNuke</processorType>
<processorCommand>UpgradeModule</processorCommand>
<attributes>
<businessControllerClass>DotNetNuke.Modules.Events.EventController,
DotNetNuke.Modules.Events</businessControllerClass>
<desktopModuleID>[DESKTOPMODULEID]</desktopModuleID>
<upgradeVersionsList>01.01.01,04.00.02,04.01.00</upgradeVersionsList>
</attributes>
</eventMessage>

Notice that is the module needs to implement the IUpgradeable interface it must define the business controller class, register the feature, and finally define all the versions required to be fired by the installer.


Sample

<component type="Module">

<desktopModule>
<moduleName>MyModule</moduleName>
<foldername>MyModule</foldername>
<businessControllerClass>DotNetNuke.Modules.MyModule.BusinessController,
DotNetNuke.Modules.MyModule</businessControllerClass>
<supportedFeatures>
<supportedFeature type="Portable" />
<supportedFeature type="Searchable" />
</supportedFeatures>
<moduleDefinitions>
<moduleDefinition>
<friendlyName>MyModule</friendlyName>
<defaultCacheTime>-1</defaultCacheTime>
<moduleControls>
<moduleControl>
<controlKey />
<controlSrc>DesktopModules/MyModule/Default.ascx</controlSrc>
<supportsPartialRendering>False</supportsPartialRendering>
<controlTitle />
<controlType>View</controlType>
<iconFile />
<helpUrl></helpUrl>
<viewOrder>0</viewOrder>
</moduleControl>
</moduleControls>
<permissions>
<permission code="MYCODE" key="ROWEDIT" name="Edit Row" />
</permissions>
</moduleDefinition>
</moduleDefinitions>
</desktopModule>
</component>

References

Contents
No sections defined

DNN Digest is our monthly email newsletter. It highlights news and content from around the DNN ecosystem, such as new modules and themes, messages from leadership, blog posts and notable tweets. Keep your finger on the pulse of the ecosystem by subscribing.  


Copyright 2017 by DNN Corp Terms of Use Privacy
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out