Class ModuleController
ModuleController provides the Business Layer for Modules.
Implements
Inherited Members
Namespace: DotNetNuke.Entities.Modules
Assembly: DotNetNuke.dll
Syntax
public class ModuleController : ServiceLocator<IModuleController, ModuleController>, IModuleController
Methods
| Improve this Doc View SourceAddModule(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. |
ClearCache(Int32)
Clears the cache.
Declaration
public void ClearCache(int tabId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | tabId | The tab id. |
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 |
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 |
System.Boolean | includeAllTabsMobules | if set to |
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 |
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 |
CreateContentItem(ModuleInfo)
ModuleController provides the Business Layer for Modules.
Declaration
public void CreateContentItem(ModuleInfo module)
Parameters
Type | Name | Description |
---|---|---|
ModuleInfo | module |
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.
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 |
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. |
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. |
DeleteModuleSettings(Int32)
ModuleController provides the Business Layer for Modules.
Declaration
public void DeleteModuleSettings(int moduleId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | moduleId |
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. |
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. |
DeleteTabModuleSettings(Int32)
ModuleController provides the Business Layer for Modules.
Declaration
public void DeleteTabModuleSettings(int tabModuleId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | tabModuleId |
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. |
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. |
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. |
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.
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. |
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. |
GetFactory()
Gets the service locator factory.
Declaration
protected override Func<IModuleController> GetFactory()
Returns
Type | Description |
---|---|
Func<IModuleController> | A factory function. |
Overrides
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. |
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. |
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. |
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.
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. |
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.
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. |
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. |
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. |
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. |
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 |
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 |
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 |
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. |
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. |
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. |
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. |
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 |
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 |
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. |
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 |
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. |
RestoreModule(ModuleInfo)
Restores the module.
Declaration
public void RestoreModule(ModuleInfo objModule)
Parameters
Type | Name | Description |
---|---|---|
ModuleInfo | objModule | The module. |
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 |
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. |
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. |
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. |
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.
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. |
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.
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 |