Class Factory
This is a factory to create CmsBlocks, Apps etc. and related objects from DNN.
Warning
This API is obsolete and will be removed in a future release. You should migrate your code to use real services instead, like:
[PublicApi]
[Obsolete("This is obsolete in V13 but will continue to work for now, we plan to remove in v15 or 16. Use the IDynamicCodeService or the IRenderService instead.")]
public static class Factory
- Inheritance
-
objectFactory
Methods
App(int, PortalSettings, bool, bool, ILog)
Get a full app-object for accessing data of the app from outside
[Obsolete("This is obsolete in V13 but will continue to work for now, we plan to remove in v15 or 16. Use the IDynamicCodeService or the IRenderService instead.")]
public static IApp App(int appId, PortalSettings ownerPortalSettings, bool unusedButKeepForApiStability = false, bool showDrafts = false, ILog parentLog = null)
Parameters
appIdintThe AppID of the app you need
ownerPortalSettingsPortalSettingsThe owner portal - this is important when retrieving Apps from another portal.
unusedButKeepForApiStabilityboolTells the App that you'll be using page-publishing. So changes will me auto-drafted for a future release as the whole page together.
showDraftsboolShow draft items - usually false for visitors, true for editors/admins.
parentLogILogoptional logger to attach to
Returns
- IApp
An initialized App object which you can use to access App.Data
App(int, bool, bool, ILog)
Get a full app-object for accessing data of the app from outside
[Obsolete("This is obsolete in V13 but will continue to work for now, we plan to remove in v15 or 16. Use the IDynamicCodeService or the IRenderService instead.")]
public static IApp App(int appId, bool unusedButKeepForApiStability = false, bool showDrafts = false, ILog parentLog = null)
Parameters
appIdintThe AppID of the app you need
unusedButKeepForApiStabilityboolTells the App that you'll be using page-publishing. So changes will me auto-drafted for a future release as the whole page together.
showDraftsboolShow draft items - usually false for visitors, true for editors/admins.
parentLogILogoptional logger to attach to
Returns
- IApp
An initialized App object which you can use to access App.Data
App(int, int, bool, bool, ILog)
Get a full app-object for accessing data of the app from outside
[Obsolete("This is obsolete in V13 but will continue to work for now, we plan to remove in v15 or 16. Use the IDynamicCodeService or the IRenderService instead.")]
public static IApp App(int zoneId, int appId, bool unusedButKeepForApiStability = false, bool showDrafts = false, ILog parentLog = null)
Parameters
zoneIdintThe zone the app is in.
appIdintThe AppID of the app you need
unusedButKeepForApiStabilityboolTells the App that you'll be using page-publishing. So changes will me auto-drafted for a future release as the whole page together.
showDraftsboolShow draft items - usually false for visitors, true for editors/admins.
parentLogILogoptional logger to attach to
Returns
- IApp
An initialized App object which you can use to access App.Data
CmsBlock(ModuleInfo)
Get a Root CMS Block if you have the ModuleInfo object
[Obsolete("This is obsolete in V13 but will continue to work for now, we plan to remove in v15 or 16. Use the IDynamicCodeService or the IRenderService instead.")]
public static IBlockBuilder CmsBlock(ModuleInfo moduleInfo)
Parameters
moduleInfoModuleInfoA DNN ModuleInfo object
Returns
- IBlockBuilder
An initialized CMS Block, ready to use/render
CmsBlock(int, int)
Get a Root CMS Block if you know the TabId and the ModId
[Obsolete("This is obsolete in V13 but will continue to work for now, we plan to remove in v15 or 16. Use the IDynamicCodeService or the IRenderService instead.")]
public static IBlockBuilder CmsBlock(int pageId, int modId)
Parameters
Returns
- IBlockBuilder
An initialized CMS Block, ready to use/render
CmsBlock(int, int, ILog)
Get a Root CMS Block if you know the TabId and the ModId
[Obsolete("This is obsolete in V13 but will continue to work for now, we plan to remove in v15 or 16. Use the IDynamicCodeService or the IRenderService instead.")]
public static IBlockBuilder CmsBlock(int pageId, int modId, ILog parentLog)
Parameters
pageIdintThe DNN tab id (page id)
modIdintThe DNN Module id
parentLogILogThe parent log, optional
Returns
- IBlockBuilder
An initialized CMS Block, ready to use/render
CmsBlock(IModule, ILog)
Get a Root CMS Block if you have the ModuleInfo object.
[Obsolete("This is obsolete in V13 but will continue to work for now, we plan to remove in v15 or 16. Use the IDynamicCodeService or the IRenderService instead.")]
public static IBlockBuilder CmsBlock(IModule module, ILog parentLog = null)
Parameters
moduleIModuleparentLogILogoptional logger to attach to
Returns
- IBlockBuilder
An initialized CMS Block, ready to use/render
DynamicCode(IBlockBuilder)
Retrieve a helper object which provides commands like AsDynamic, AsEntity etc.
[Obsolete("This is obsolete in V13 but will continue to work for now, we plan to remove in v15 or 16. Use the IDynamicCodeService or the IRenderService instead.")]
public static IDnnDynamicCode DynamicCode(IBlockBuilder blockBuilder)
Parameters
blockBuilderIBlockBuilderCMS Block for which the helper is targeted.
Returns
- IDnnDynamicCode
A Code Helper based on IDnnDynamicCode