C# Class Rock.Model.PageService

Data access and service class for the Rock.Model.Page model object. This class inherits from the Service class.
Afficher le fichier Open project: SparkDevNetwork/Rock Class Usage Examples

Méthodes publiques

Méthode Description
CanDelete ( Page item, string &errorMessage, bool includeSecondLvl ) : bool

Determines whether the specified page can be deleted. Performs some additional checks that are missing from the auto-generated PageService.CanDelete().

CopyPage ( int pageId, int currentPersonAliasId = null ) : Guid?

Copies the page.

GetAllDescendents ( int parentPageId ) : IEnumerable

Returns an enumerable collection of Rock.Model.Page">Pages that are descendants of a

GetByLayoutId ( int layoutId ) : IOrderedQueryable

Gets an enumerable collection of Rock.Model.Page entities associated with a Rock.Model.Layout.

GetByParentPageId ( int parentPageId, string includes = null ) : IOrderedQueryable

Gets an enumerable collection of Rock.Model.Page entities by the parent Page's Id.

GetBySiteId ( int siteId ) : IOrderedQueryable

Gets an enumerable collection of Rock.Model.Page entities associated with a Rock.Model.Site.

GetGuid ( int id ) : Guid?

Gets the Guid for the Page that has the specified Id

Private Methods

Méthode Description
CloneHtmlContent ( Guid>.Dictionary blockGuidDictionary, RockContext rockContext, int currentPersonAliasId = null ) : void

Copies any HtmlContent in the original page tree over to the corresponding blocks on the copied page tree.

GenerateBlockAttributeValues ( Guid>.Dictionary pageGuidDictionary, Guid>.Dictionary blockGuidDictionary, RockContext rockContext, int currentPersonAliasId = null ) : void

This method takes the attribute values of the original blocks, and creates copies of them that point to the copied blocks. In addition, any block attribute value pointing to a page in the original page tree is now updated to point to the corresponding page in the copied page tree.

GeneratePageBlockAuths ( Guid>.Dictionary pageGuidDictionary, Guid>.Dictionary blockGuidDictionary, RockContext rockContext, int currentPersonAliasId = null ) : void

Copies any auths for the original pages and blocks over to the copied pages and blocks.

GeneratePageCopy ( Rock sourcePage, Guid>.Dictionary pageGuidDictionary, Guid>.Dictionary blockGuidDictionary, int currentPersonAliasId = null ) : Rock.Model.Page

This method generates a copy of the given page along with any descendant pages, as well as any blocks on any of those pages.

Method Details

CanDelete() public méthode

Determines whether the specified page can be deleted. Performs some additional checks that are missing from the auto-generated PageService.CanDelete().
public CanDelete ( Page item, string &errorMessage, bool includeSecondLvl ) : bool
item Page The item.
errorMessage string The error message.
includeSecondLvl bool If set to true, verifies that the item is not referenced by any second level relationships.
Résultat bool

CopyPage() public méthode

Copies the page.
public CopyPage ( int pageId, int currentPersonAliasId = null ) : Guid?
pageId int The page identifier.
currentPersonAliasId int The current person alias identifier.
Résultat Guid?

GetAllDescendents() public méthode

Returns an enumerable collection of Rock.Model.Page">Pages that are descendants of a
public GetAllDescendents ( int parentPageId ) : IEnumerable
parentPageId int A representing the Id of the
Résultat IEnumerable

GetByLayoutId() public méthode

Gets an enumerable collection of Rock.Model.Page entities associated with a Rock.Model.Layout.
public GetByLayoutId ( int layoutId ) : IOrderedQueryable
layoutId int The layout id.
Résultat IOrderedQueryable

GetByParentPageId() public méthode

Gets an enumerable collection of Rock.Model.Page entities by the parent Page's Id.
public GetByParentPageId ( int parentPageId, string includes = null ) : IOrderedQueryable
parentPageId int The Id of the Parent to search by.
includes string The includes.
Résultat IOrderedQueryable

GetBySiteId() public méthode

Gets an enumerable collection of Rock.Model.Page entities associated with a Rock.Model.Site.
public GetBySiteId ( int siteId ) : IOrderedQueryable
siteId int The site id.
Résultat IOrderedQueryable

GetGuid() public méthode

Gets the Guid for the Page that has the specified Id
public GetGuid ( int id ) : Guid?
id int The identifier.
Résultat Guid?