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
appId
intThe AppID of the app you need
ownerPortalSettings
PortalSettingsThe owner portal - this is important when retrieving Apps from another portal.
unusedButKeepForApiStability
boolTells the App that you'll be using page-publishing. So changes will me auto-drafted for a future release as the whole page together.
showDrafts
boolShow draft items - usually false for visitors, true for editors/admins.
parentLog
ILogoptional 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
appId
intThe AppID of the app you need
unusedButKeepForApiStability
boolTells the App that you'll be using page-publishing. So changes will me auto-drafted for a future release as the whole page together.
showDrafts
boolShow draft items - usually false for visitors, true for editors/admins.
parentLog
ILogoptional 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
zoneId
intThe zone the app is in.
appId
intThe AppID of the app you need
unusedButKeepForApiStability
boolTells the App that you'll be using page-publishing. So changes will me auto-drafted for a future release as the whole page together.
showDrafts
boolShow draft items - usually false for visitors, true for editors/admins.
parentLog
ILogoptional 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
moduleInfo
ModuleInfoA 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
pageId
intThe DNN tab id (page id)
modId
intThe DNN Module id
parentLog
ILogThe 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
module
IModuleparentLog
ILogoptional 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
blockBuilder
IBlockBuilderCMS Block for which the helper is targeted.
Returns
- IDnnDynamicCode
A Code Helper based on IDnnDynamicCode