• Share
    • Twitter
    • LinkedIn
    • Facebook
    • Email
  • Feedback
  • Improve this Doc

Class ModuleController

ModuleController provides the Business Layer for Modules.

Inheritance
System.Object
ServiceLocator<IModuleController, ModuleController>
ModuleController
Implements
IModuleController
Inherited Members
ServiceLocator<IModuleController, ModuleController>.Instance
ServiceLocator<IModuleController, ModuleController>.Factory
ServiceLocator<IModuleController, ModuleController>.SetTestableInstance(IModuleController)
ServiceLocator<IModuleController, ModuleController>.ClearInstance()
ServiceLocator<IModuleController, ModuleController>.GetFactory()
Namespace: DotNetNuke.Entities.Modules
Assembly: DotNetNuke.dll
Syntax
public class ModuleController : ServiceLocator<IModuleController, ModuleController>, IModuleController

Methods

| Improve this Doc View Source

AddModule(ModuleInfo)

add a module to a page.

Declaration
public int AddModule(ModuleInfo module)
Parameters
Type Name Description
ModuleInfo module

moduleInfo for the module to create.

Returns
Type Description
System.Int32

ID of the created module.

| Improve this Doc View Source

ClearCache(Int32)

Clears the cache.

Declaration
public void ClearCache(int tabId)
Parameters
Type Name Description
System.Int32 tabId

The tab id.

| Improve this Doc View Source

CopyModule(ModuleInfo, TabInfo, String, Boolean)

Copies the module to a new page.

Declaration
public void CopyModule(ModuleInfo sourceModule, TabInfo destinationTab, string toPaneName, bool includeSettings)
Parameters
Type Name Description
ModuleInfo sourceModule

The source module.

TabInfo destinationTab

The destination tab.

System.String toPaneName

Name of to pane.

System.Boolean includeSettings

if set to true include settings.

| Improve this Doc View Source

CopyModules(TabInfo, TabInfo, Boolean, Boolean)

Copies all modules in source page to a new page.

Declaration
public void CopyModules(TabInfo sourceTab, TabInfo destinationTab, bool asReference, bool includeAllTabsMobules)
Parameters
Type Name Description
TabInfo sourceTab

The source tab.

TabInfo destinationTab

The destination tab.

System.Boolean asReference

if set to true will use source module directly, else will create new module info by source module.

System.Boolean includeAllTabsMobules

if set to true will include modules which shown on all pages, this is used when create localized copy.

| Improve this Doc View Source

CopyModules(TabInfo, TabInfo, Boolean)

Copies all modules in source page to a new page.

Declaration
public void CopyModules(TabInfo sourceTab, TabInfo destinationTab, bool asReference)
Parameters
Type Name Description
TabInfo sourceTab

The source tab.

TabInfo destinationTab

The destination tab.

System.Boolean asReference

if set to true will use source module directly, else will create new module info by source module.

| Improve this Doc View Source

CopyTabModuleSettings(ModuleInfo, ModuleInfo)

ModuleController provides the Business Layer for Modules.

Declaration
public void CopyTabModuleSettings(ModuleInfo fromModule, ModuleInfo toModule)
Parameters
Type Name Description
ModuleInfo fromModule
ModuleInfo toModule
| Improve this Doc View Source

CreateContentItem(ModuleInfo)

ModuleController provides the Business Layer for Modules.

Declaration
public void CreateContentItem(ModuleInfo module)
Parameters
Type Name Description
ModuleInfo module
| Improve this Doc View Source

DeleteAllModules(Int32, Int32, List<TabInfo>, Boolean, Boolean, Boolean)

DeleteAllModules deletes all instances of a Module (from a collection), optionally excluding the current instance, and optionally including deleting the Module itself.

Declaration
public void DeleteAllModules(int moduleId, int tabId, List<TabInfo> fromTabs, bool softDelete, bool includeCurrent, bool deleteBaseModule)
Parameters
Type Name Description
System.Int32 moduleId

The Id of the module to copy.

System.Int32 tabId

The Id of the current tab.

List<TabInfo> fromTabs

An ArrayList of TabItem objects.

System.Boolean softDelete

A flag that determines whether the instance should be soft-deleted.

System.Boolean includeCurrent

A flag to indicate whether to delete from the current tab as identified ny tabId.

System.Boolean deleteBaseModule

A flag to indicate whether to delete the Module itself.

Remarks

Note - the base module is not removed unless both the flags are set, indicating to delete all instances AND to delete the Base Module.

| Improve this Doc View Source

DeleteAllModules(Int32, Int32, List<TabInfo>)

ModuleController provides the Business Layer for Modules.

Declaration
public void DeleteAllModules(int moduleId, int tabId, List<TabInfo> fromTabs)
Parameters
Type Name Description
System.Int32 moduleId
System.Int32 tabId
List<TabInfo> fromTabs
| Improve this Doc View Source

DeleteModule(Int32)

Delete a module instance permanently from the database.

Declaration
public void DeleteModule(int moduleId)
Parameters
Type Name Description
System.Int32 moduleId

ID of the module instance.

| Improve this Doc View Source

DeleteModuleSetting(Int32, String)

Delete a Setting of a module instance.

Declaration
public void DeleteModuleSetting(int moduleId, string settingName)
Parameters
Type Name Description
System.Int32 moduleId

ID of the affected module.

System.String settingName

Name of the setting to be deleted.

| Improve this Doc View Source

DeleteModuleSettings(Int32)

ModuleController provides the Business Layer for Modules.

Declaration
public void DeleteModuleSettings(int moduleId)
Parameters
Type Name Description
System.Int32 moduleId
| Improve this Doc View Source

DeleteTabModule(Int32, Int32, Boolean)

Delete a module reference permanently from the database. if there are no other references, the module instance is deleted as well.

Declaration
public void DeleteTabModule(int tabId, int moduleId, bool softDelete)
Parameters
Type Name Description
System.Int32 tabId

ID of the page.

System.Int32 moduleId

ID of the module instance.

System.Boolean softDelete

A flag that determines whether the instance should be soft-deleted.

| Improve this Doc View Source

DeleteTabModuleSetting(Int32, String)

Delete a specific setting of a tabmodule reference.

Declaration
public void DeleteTabModuleSetting(int tabModuleId, string settingName)
Parameters
Type Name Description
System.Int32 tabModuleId

ID of the affected tabmodule.

System.String settingName

Name of the setting to remove.

| Improve this Doc View Source

DeleteTabModuleSettings(Int32)

ModuleController provides the Business Layer for Modules.

Declaration
public void DeleteTabModuleSettings(int tabModuleId)
Parameters
Type Name Description
System.Int32 tabModuleId
| Improve this Doc View Source

DeLocalizeModule(ModuleInfo)

Des the localize module.

Declaration
public int DeLocalizeModule(ModuleInfo sourceModule)
Parameters
Type Name Description
ModuleInfo sourceModule

The source module.

Returns
Type Description
System.Int32

new module id.

| Improve this Doc View Source

DeserializeModule(XmlNode, ModuleInfo, Int32, Int32)

Deserializes the module.

Declaration
public static void DeserializeModule(XmlNode nodeModule, ModuleInfo module, int portalId, int tabId)
Parameters
Type Name Description
XmlNode nodeModule

The node module.

ModuleInfo module

ModuleInfo of current module.

System.Int32 portalId

The portal id.

System.Int32 tabId

The tab id.

| Improve this Doc View Source

DeserializeModule(XmlNode, XmlNode, Int32, Int32, PortalTemplateModuleAction, Hashtable)

Deserializes the module.

Declaration
public static void DeserializeModule(XmlNode nodeModule, XmlNode nodePane, int portalId, int tabId, PortalTemplateModuleAction mergeTabs, Hashtable hModules)
Parameters
Type Name Description
XmlNode nodeModule

The node module.

XmlNode nodePane

The node pane.

System.Int32 portalId

The portal id.

System.Int32 tabId

The tab id.

PortalTemplateModuleAction mergeTabs

The merge tabs.

Hashtable hModules

The modules.

| Improve this Doc View Source

GetAllModules()

get info of all modules in any portal of the installation.

Declaration
public ArrayList GetAllModules()
Returns
Type Description
ArrayList

moduleInfo of all modules.

Remarks

created for upgrade purposes.

| Improve this Doc View Source

GetAllTabsModules(Int32, Boolean)

get Module objects of a portal, either only those, to be placed on all tabs or not.

Declaration
public ArrayList GetAllTabsModules(int portalID, bool allTabs)
Parameters
Type Name Description
System.Int32 portalID

ID of the portal.

System.Boolean allTabs

specify, whether to return modules to be shown on all tabs or those to be shown on specified tabs.

Returns
Type Description
ArrayList

ArrayList of TabModuleInfo objects.

| Improve this Doc View Source

GetAllTabsModulesByModuleID(Int32)

get TabModule objects that are linked to a particular ModuleID.

Declaration
public ArrayList GetAllTabsModulesByModuleID(int moduleID)
Parameters
Type Name Description
System.Int32 moduleID

ID of the module.

Returns
Type Description
ArrayList

ArrayList of TabModuleInfo objects.

| Improve this Doc View Source

GetFactory()

Gets the service locator factory.

Declaration
protected override Func<IModuleController> GetFactory()
Returns
Type Description
Func<IModuleController>

A factory function.

Overrides
DotNetNuke.Framework.ServiceLocator<DotNetNuke.Entities.Modules.IModuleController, DotNetNuke.Entities.Modules.ModuleController>.GetFactory()
| Improve this Doc View Source

GetMasterTabId(ModuleInfo)

Get the Tab ID corresponding to the initial Tab where the module was added.

Declaration
public int GetMasterTabId(ModuleInfo module)
Parameters
Type Name Description
ModuleInfo module

A ModuleInfo object to be checked.

Returns
Type Description
System.Int32

The Tab Id from initial Tab where the module was added.

| Improve this Doc View Source

GetModule(Int32, Int32, Boolean)

get a Module object.

Declaration
public ModuleInfo GetModule(int moduleID, int tabID, bool ignoreCache)
Parameters
Type Name Description
System.Int32 moduleID

ID of the module.

System.Int32 tabID

ID of the page.

System.Boolean ignoreCache

flag, if data shall not be taken from cache.

Returns
Type Description
ModuleInfo

ModuleInfo object.

| Improve this Doc View Source

GetModule(Int32, Int32)

get a Module object.

Declaration
public ModuleInfo GetModule(int moduleID, int tabID)
Parameters
Type Name Description
System.Int32 moduleID

ID of the module.

System.Int32 tabID

ID of the page.

Returns
Type Description
ModuleInfo

ModuleInfo object.

| Improve this Doc View Source

GetModule(Int32)

get a Module object.

Declaration
public ModuleInfo GetModule(int moduleID)
Parameters
Type Name Description
System.Int32 moduleID

ID of the module.

Returns
Type Description
ModuleInfo

ModuleInfo object.

Remarks

This overload ignores any cached values and always retrieves the latest data from the database.

| Improve this Doc View Source

GetModuleByCulture(Int32, Int32, Int32, Locale)

get Module by specific locale.

Declaration
public ModuleInfo GetModuleByCulture(int moduleId, int tabid, int portalId, Locale locale)
Parameters
Type Name Description
System.Int32 moduleId

ID of the module.

System.Int32 tabid

ID of the tab.

System.Int32 portalId

ID of the portal.

Locale locale

The wanted locale.

Returns
Type Description
ModuleInfo

ModuleInfo associated to submitted locale.

| Improve this Doc View Source

GetModuleByDefinition(Int32, String)

Get ModuleInfo object of first module instance with a given name of the module definition.

Declaration
public ModuleInfo GetModuleByDefinition(int portalId, string definitionName)
Parameters
Type Name Description
System.Int32 portalId

ID of the portal, where to look for the module.

System.String definitionName

The name of module definition (NOTE: this looks at DefinitionName, not FriendlyName).

Returns
Type Description
ModuleInfo

ModuleInfo of first module instance.

Remarks

preferably used for admin and host modules.

| Improve this Doc View Source

GetModuleByUniqueID(Guid)

get a Module object.

Declaration
public ModuleInfo GetModuleByUniqueID(Guid uniqueID)
Parameters
Type Name Description
Guid uniqueID

The module's unique ID.

Returns
Type Description
ModuleInfo

The ModuleInfo instance or null.

| Improve this Doc View Source

GetModules(Int32)

get all Module objects of a portal.

Declaration
public ArrayList GetModules(int portalID)
Parameters
Type Name Description
System.Int32 portalID

ID of the portal.

Returns
Type Description
ArrayList

ArrayList of ModuleInfo objects.

| Improve this Doc View Source

GetModulesByDefinition(Int32, String)

Gets the modules by definition.

Declaration
public ArrayList GetModulesByDefinition(int portalID, string definitionName)
Parameters
Type Name Description
System.Int32 portalID

The portal ID.

System.String definitionName

The name of the module definition.

Returns
Type Description
ArrayList

module collection.

| Improve this Doc View Source

GetModulesByDesktopModuleId(Int32)

Gets the modules by DesktopModuleId.

Declaration
public ArrayList GetModulesByDesktopModuleId(int desktopModuleId)
Parameters
Type Name Description
System.Int32 desktopModuleId

The Desktop Module Id.

Returns
Type Description
ArrayList

module collection.

| Improve this Doc View Source

GetModuleSettings(Int32)

ModuleController provides the Business Layer for Modules.

Declaration
public Hashtable GetModuleSettings(int moduleId)
Parameters
Type Name Description
System.Int32 moduleId
Returns
Type Description
Hashtable
| Improve this Doc View Source

GetModuleTabs(Int32)

ModuleController provides the Business Layer for Modules.

Declaration
public ArrayList GetModuleTabs(int moduleID)
Parameters
Type Name Description
System.Int32 moduleID
Returns
Type Description
ArrayList
| Improve this Doc View Source

GetRecycleModules(Int32)

ModuleController provides the Business Layer for Modules.

Declaration
public ArrayList GetRecycleModules(int portalID)
Parameters
Type Name Description
System.Int32 portalID
Returns
Type Description
ArrayList
| Improve this Doc View Source

GetSearchModules(Int32)

For a portal get a list of all active module and tabmodule references that are Searchable either by inheriting from ModuleSearchBase or implementing the older ISearchable interface.

Declaration
public ArrayList GetSearchModules(int portalID)
Parameters
Type Name Description
System.Int32 portalID

ID of the portal to be searched.

Returns
Type Description
ArrayList

Arraylist of ModuleInfo for modules supporting search.

| Improve this Doc View Source

GetTabModule(Int32)

get a Module object.

Declaration
public ModuleInfo GetTabModule(int tabModuleID)
Parameters
Type Name Description
System.Int32 tabModuleID

ID of the tabmodule.

Returns
Type Description
ModuleInfo

An ModuleInfo object.

| Improve this Doc View Source

GetTabModules(Int32)

Get all Module references on a tab.

Declaration
public Dictionary<int, ModuleInfo> GetTabModules(int tabId)
Parameters
Type Name Description
System.Int32 tabId
Returns
Type Description
Dictionary<System.Int32, ModuleInfo>

Dictionary of ModuleID and ModuleInfo.

| Improve this Doc View Source

GetTabModulesByModule(Int32)

Get a list of all TabModule references of a module instance.

Declaration
public IList<ModuleInfo> GetTabModulesByModule(int moduleID)
Parameters
Type Name Description
System.Int32 moduleID

ID of the Module.

Returns
Type Description
IList<ModuleInfo>

ArrayList of ModuleInfo.

| Improve this Doc View Source

GetTabModuleSettings(Int32)

ModuleController provides the Business Layer for Modules.

Declaration
public Hashtable GetTabModuleSettings(int tabModuleId)
Parameters
Type Name Description
System.Int32 tabModuleId
Returns
Type Description
Hashtable
| Improve this Doc View Source

InitialModulePermission(ModuleInfo, Int32, Int32)

ModuleController provides the Business Layer for Modules.

Declaration
public void InitialModulePermission(ModuleInfo module, int tabId, int permissionType)
Parameters
Type Name Description
ModuleInfo module
System.Int32 tabId
System.Int32 permissionType
| Improve this Doc View Source

IsSharedModule(ModuleInfo)

Check if a ModuleInfo belongs to the referenced Tab or not.

Declaration
public bool IsSharedModule(ModuleInfo module)
Parameters
Type Name Description
ModuleInfo module

A ModuleInfo object to be checked.

Returns
Type Description
System.Boolean

True is TabId points to a different tab from initial Tab where the module was added. Otherwise, False.

| Improve this Doc View Source

LocalizeModule(ModuleInfo, Locale)

ModuleController provides the Business Layer for Modules.

Declaration
public void LocalizeModule(ModuleInfo sourceModule, Locale locale)
Parameters
Type Name Description
ModuleInfo sourceModule
Locale locale
| Improve this Doc View Source

MoveModule(Int32, Int32, Int32, String)

MoveModule moes a Module from one Tab to another including all the TabModule settings.

Declaration
public void MoveModule(int moduleId, int fromTabId, int toTabId, string toPaneName)
Parameters
Type Name Description
System.Int32 moduleId

The Id of the module to move.

System.Int32 fromTabId

The Id of the source tab.

System.Int32 toTabId

The Id of the destination tab.

System.String toPaneName

The name of the Pane on the destination tab where the module will end up.

| Improve this Doc View Source

RestoreModule(ModuleInfo)

Restores the module.

Declaration
public void RestoreModule(ModuleInfo objModule)
Parameters
Type Name Description
ModuleInfo objModule

The module.

| Improve this Doc View Source

SerializeModule(XmlDocument, ModuleInfo, Boolean)

SerializeModule.

Declaration
public static XmlNode SerializeModule(XmlDocument xmlModule, ModuleInfo module, bool includeContent)
Parameters
Type Name Description
XmlDocument xmlModule

The Xml Document to use for the Module.

ModuleInfo module

The ModuleInfo object to serialize.

System.Boolean includeContent

A flak that determines whether the content of the module is serialised.

Returns
Type Description
XmlNode

An representing the module.

| Improve this Doc View Source

SynchronizeModule(Int32)

Synchronizes the module content between cache and database.

Declaration
public static void SynchronizeModule(int moduleID)
Parameters
Type Name Description
System.Int32 moduleID

The module ID.

| Improve this Doc View Source

UpdateModule(ModuleInfo)

Update module settings and permissions in database from ModuleInfo.

Declaration
public void UpdateModule(ModuleInfo module)
Parameters
Type Name Description
ModuleInfo module

ModuleInfo of the module to update.

| Improve this Doc View Source

UpdateModuleOrder(Int32, Int32, Int32, String)

set/change the module position within a pane on a page.

Declaration
public void UpdateModuleOrder(int tabId, int moduleId, int moduleOrder, string paneName)
Parameters
Type Name Description
System.Int32 tabId

ID of the page.

System.Int32 moduleId

ID of the module on the page.

System.Int32 moduleOrder

position within the controls list on page, -1 if to be added at the end.

System.String paneName

name of the pane, the module is placed in on the page.

| Improve this Doc View Source

UpdateModuleSetting(Int32, String, String)

Adds or updates a module's setting value.

Declaration
public void UpdateModuleSetting(int moduleId, string settingName, string settingValue)
Parameters
Type Name Description
System.Int32 moduleId

ID of the module, the setting belongs to.

System.String settingName

name of the setting property.

System.String settingValue

value of the setting (String).

Remarks

empty SettingValue will remove the setting, if not preserveIfEmpty is true.

| Improve this Doc View Source

UpdateTabModuleOrder(Int32)

set/change all module's positions within a page.

Declaration
public void UpdateTabModuleOrder(int tabId)
Parameters
Type Name Description
System.Int32 tabId

ID of the page.

| Improve this Doc View Source

UpdateTabModuleSetting(Int32, String, String)

Adds or updates a module's setting value.

Declaration
public void UpdateTabModuleSetting(int tabModuleId, string settingName, string settingValue)
Parameters
Type Name Description
System.Int32 tabModuleId

ID of the tabmodule, the setting belongs to.

System.String settingName

name of the setting property.

System.String settingValue

value of the setting (String).

Remarks

empty SettingValue will relove the setting.

| Improve this Doc View Source

UpdateTranslationStatus(ModuleInfo, Boolean)

Updates the translation status.

Declaration
public void UpdateTranslationStatus(ModuleInfo localizedModule, bool isTranslated)
Parameters
Type Name Description
ModuleInfo localizedModule

The localized module.

System.Boolean isTranslated

if set to true will mark the module as translated].

Implements

IModuleController

Extension Methods

JsonExtensionsWeb.ToJson(Object)
  • View Source
Back to top by the community, for the community... #DNNCMS