Nucleus .Net Core CMS

Managers.IPageManager Interface

Namespace: Nucleus.Abstractions.Managers
Assembly: Nucleus.Abstractions.dll
Provides functions to manage database data for Models.Pages.

Remarks

Get an instance of this class from dependency injection by including a parameter in your class constructor.

Methods

CreateNew (Site) Method

CreateNew (Site site)
Create a new Models.Page with default values.
Parameters
Name Type
site Nucleus.Abstractions.Models.Site
Remarks
The new Models.Page is not saved to the database until you call Save.

Get (Guid) Method

Get (Guid id)
Retrieve an existing Models.Page from the database.
Parameters
Name Type
id Guid

Get (Site,String) Method

Get (Site site, String path)
Retrieve an existing page from the database, specified by site and path.
Parameters
Name Type
site Nucleus.Abstractions.Models.Site
path String

Get (PageModule) Method

Get (PageModule pageModule)
Retrive an existing page from the database. The returned page is the "owner" of the specified module.
Parameters
Name Type
pageModule Nucleus.Abstractions.Models.PageModule

ListModules (Page) Method

ListModules (Page page)
List all Models.PageModules that are part of the page.
Parameters
Name Type
page Nucleus.Abstractions.Models.Page

Delete (Page) Method

Delete (Page page)
Delete the specifed Models.Page from the database.
Parameters
Name Type
page Nucleus.Abstractions.Models.Page

List (Site) Method

List (Site site)
List all Models.Pages within the specified site.
Parameters
Name Type
site Nucleus.Abstractions.Models.Site

ListSitePages (Site) Method

ListSitePages (Site site)
List all Models.Pages within the specified site.
Parameters
Name Type
site Nucleus.Abstractions.Models.Site
Remarks
This function returns a simple/not fully populated list of pages and is intended for use when populating drop-down lists, etc.

Search (Site,String,IEnumerable<Role>,PagingSettings) Method

Search (Site site, String searchTerm, IEnumerable<Role> userRoles, PagingSettings pagingSettings)
Return a list of all Models.Pages for the site which match the specified search term.
Parameters
Name Type
site Nucleus.Abstractions.Models.Site
searchTerm String
userRoles System.Collections.Generic.IEnumerable<Nucleus.Abstractions.Models.Role>
pagingSettings Nucleus.Abstractions.Models.Paging.PagingSettings

CreatePermissions (Site,Page,Role) Method

CreatePermissions (Site site, Page page, Role role)
Add default permissions to the specifed Models.Page for the specified Models.Role.
Remarks
The new permissions are not saved unless you call Save.

ListPermissions (Page) Method

ListPermissions (Page page)
List all permissions for the specified Models.Page, sorted by Models.Role name and Models.PermissionTypeSortOrder.
Parameters
Name Type
page Nucleus.Abstractions.Models.Page

ListPagePermissionTypes

ListPagePermissionTypes ()
Return a list of available permission types, sorted by SortOrder

Save (Site,Page) Method

Save (Site site, Page page)
Create or update a Models.Page, including its Permissions and Routes.

MoveDown (Site,Guid) Method

MoveDown (Site site, Guid pageId)
Update the SortOrder of the page module specifed by id by swapping it with the next-highest SortOrder.
Parameters
Name Type
site Nucleus.Abstractions.Models.Site
pageId Guid

MoveUp (Site,Guid) Method

MoveUp (Site site, Guid pageId)
Update the SortOrder of the page module specifed by id by swapping it with the previous SortOrder.
Parameters
Name Type
site Nucleus.Abstractions.Models.Site
pageId Guid

GetAdminMenu (Site,Page,ClaimsPrincipal,Int32) Method

GetAdminMenu (Site site, Page parentPage, ClaimsPrincipal user, Int32 levels)
Retrieve a "tree" representation of site pages, ignoring permissions and the disabled and show in menu flags.
Remarks
This function is intended for page selection controls in admin/control panel pages, where all pages must be available regardless of settings.

GetAdminMenu (Site,Page,ClaimsPrincipal,Nullable<Guid>) Method

GetAdminMenu (Site site, Page parentPage, ClaimsPrincipal user, Nullable<Guid> selectedPageId)
Retrieve a "tree" representation of site pages, ignoring permissions and the disabled and show in menu flags.
Parameters
Name Type
site Nucleus.Abstractions.Models.Site
parentPage Nucleus.Abstractions.Models.Page
user System.Security.Claims.ClaimsPrincipal
selectedPageId System.Nullable<System.Guid>
Remarks
This function is intended for page selection controls in admin/control panel pages, where all pages must be available regardless of settings. This overload reads page levels "down to" the specifed selectedPageId.

GetAdminMenu (Site,Page,ClaimsPrincipal,Int32,Boolean,Boolean,Boolean) Method

GetAdminMenu (Site site, Page parentPage, ClaimsPrincipal user, Int32 levels, Boolean ignoreDisabled, Boolean ignorePermissions, Boolean ignoreShowInMenu)
Retrieve a "tree" representation of site pages, with control over whether to ignore permissions, disabled flag and the show in menu flag flags.
Parameters
Name Type
site Nucleus.Abstractions.Models.Site
parentPage Nucleus.Abstractions.Models.Page
user System.Security.Claims.ClaimsPrincipal
levels Int32
ignoreDisabled Boolean
ignorePermissions Boolean
ignoreShowInMenu Boolean

GetMenu (Site,Page,ClaimsPrincipal,Boolean) Method

GetMenu (Site site, Page parentPage, ClaimsPrincipal user, Boolean ignoreSettings)
Retrieve a "tree" representation of site pages which the specified user has view permissions for.

CopyPermissionsToDescendants (Site,Page,ClaimsPrincipal,CopyPermissionOperation) Method

CopyPermissionsToDescendants (Site site, Page page, ClaimsPrincipal user, CopyPermissionOperation operation)
Copy permissions from the specified page to its descendants.
Parameters
Name Type
site Nucleus.Abstractions.Models.Site
page Nucleus.Abstractions.Models.Page
user System.Security.Claims.ClaimsPrincipal
operation Nucleus.Abstractions.Managers.CopyPermissionOperation

If operation is Replace overwrite all permissions of descendant pages. if operation is Merge, merge the descendant pages permissions with the specified page permissions.