Class TabVersionBuilder
Implements
Inherited Members
Namespace: DotNetNuke.Entities.Tabs.TabVersions
Assembly: DotNetNuke.dll
Syntax
public class TabVersionBuilder : ServiceLocator<ITabVersionBuilder, TabVersionBuilder>, ITabVersionBuilder
Constructors
| Improve this Doc View SourceTabVersionBuilder()
Initializes a new instance of the TabVersionBuilder class.
Declaration
public TabVersionBuilder()
Methods
| Improve this Doc View SourceCreateNewVersion(Int32, Int32, Int32)
Creates a new Tab Version.
Declaration
public TabVersion CreateNewVersion(int portalid, int tabId, int createdByUserId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | portalid | |
| System.Int32 | tabId | Tab Id whose version will be added. |
| System.Int32 | createdByUserId | User Id which creates the version. |
Returns
| Type | Description |
|---|---|
| TabVersion | TabVersion filled with the new version data. |
CreateNewVersion(Int32, Int32)
Creates a new Tab Version checking current portal settings.
Declaration
public TabVersion CreateNewVersion(int tabId, int createdByUserId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | tabId | Tab Id whose version will be added. |
| System.Int32 | createdByUserId | User Id which creates the version. |
Returns
| Type | Description |
|---|---|
| TabVersion | TabVersion filled with the new version data. |
Remarks
This method will need the Portal Id from the current context.
DeleteVersion(Int32, Int32, Int32)
Deletes an existing Tab Version.
Declaration
public void DeleteVersion(int tabId, int createdByUserId, int version)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | tabId | The Tab Id to be queried. |
| System.Int32 | createdByUserId | User Id which deletes the version. |
| System.Int32 | version | Version Number of the version to be deleted. |
Discard(Int32, Int32)
Discards a Tab Version. If the tab only has an unpublished version, the page will keep but with no content and not published.
Declaration
public void Discard(int tabId, int createdByUserId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | tabId | Tab Id whose version will be discarded. |
| System.Int32 | createdByUserId | User Id which discards the version. |
GetCurrentModules(Int32)
Get all Modules Info associated with the last published version of the page.
Declaration
public IEnumerable<ModuleInfo> GetCurrentModules(int tabId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | tabId | Tab Id w. |
Returns
| Type | Description |
|---|---|
| IEnumerable<ModuleInfo> | List of ModuleInfo objects. |
GetCurrentVersion(Int32, Boolean)
Get the current pusblished version of the page.
Declaration
public TabVersion GetCurrentVersion(int tabId, bool ignoreCache = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | tabId | The Tab Id to be queried. |
| System.Boolean | ignoreCache | If true, the method will not use the Caching Storage. |
Returns
| Type | Description |
|---|---|
| TabVersion | TabVersion filled with the current version data. |
Remarks
If Tab has not a published version yet, it will return null.
GetFactory()
Gets the service locator factory.
Declaration
protected override Func<ITabVersionBuilder> GetFactory()
Returns
| Type | Description |
|---|---|
| Func<ITabVersionBuilder> | A factory function. |
Overrides
GetModuleContentLatestVersion(ModuleInfo)
Get the latest version or 1 if module is not versionable.
Declaration
public int GetModuleContentLatestVersion(ModuleInfo module)
Parameters
| Type | Name | Description |
|---|---|---|
| ModuleInfo | module | The ModuleInfo to be queried. |
Returns
| Type | Description |
|---|---|
| System.Int32 | The latest version of the module. |
GetUnPublishedVersion(Int32)
Get the unpublished version or Null if Tab has not any unpublished version.
Declaration
public TabVersion GetUnPublishedVersion(int tabId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | tabId |
Returns
| Type | Description |
|---|---|
| TabVersion | TabVersion filled with the unpublished version data. |
Remarks
If Tab has not an unpublished version yet, it will return null.
GetUnPublishedVersionModules(Int32)
Get all ModuleInfo objects associated with the unpublished version of a page.
Declaration
public IEnumerable<ModuleInfo> GetUnPublishedVersionModules(int tabId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | tabId |
Returns
| Type | Description |
|---|---|
| IEnumerable<ModuleInfo> | List of ModuleInfo objects. |
GetVersionModules(Int32, Int32)
Get all Modules Info associated with an specific version.
Declaration
public IEnumerable<ModuleInfo> GetVersionModules(int tabId, int version)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | tabId | Tab Id to be checked. |
| System.Int32 | version |
Returns
| Type | Description |
|---|---|
| IEnumerable<ModuleInfo> | List of ModuleInfo objects. |
Publish(Int32, Int32, Int32)
Publish a Tab Version.
Declaration
public void Publish(int portalId, int tabId, int createdByUserId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | portalId | Portal Id where the version is. |
| System.Int32 | tabId | Tab Id whose version will be published. |
| System.Int32 | createdByUserId | User Id which publishes the version. |
RollBackVesion(Int32, Int32, Int32)
Rolls back an existing version.
Declaration
public TabVersion RollBackVesion(int tabId, int createdByUserId, int version)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | tabId | The Tab Id to be queried. |
| System.Int32 | createdByUserId | User Id which rolls back the version. |
| System.Int32 | version |
Returns
| Type | Description |
|---|---|
| TabVersion | The newly published version. |
SetupFirstVersionForExistingTab(Int32, Int32)
Setup a first version for existing tab with modules. This method is used to create version 1 for pages created when versioning was not enabled.
Declaration
public void SetupFirstVersionForExistingTab(int portalId, int tabId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | portalId | portalId. |
| System.Int32 | tabId | tabId. |