Class PageService
- Namespace
- Dynamicweb.Content
- Assembly
- Dynamicweb.dll
Provides methods for querying and persisting pages.
- Inheritance
-
Page
Service
- Implements
- Inherited Members
Constructors
PageService()
The repository implementation providing access to persistence
Methods
ClearCache()
Resets all keys to the default value for objects stored in the object cache
ClearCache(IEnumerable<int>)
Resets the specified keys to the default value for objects stored in the object cache
Parameters
keys
IEnumerable<int>Keys to reset
ClearCache(int)
Resets the specified key to the default value for objects stored in the object cache
Parameters
key
intKey to reset
ClearTrashBin(int)
Deletes the specified page form trashbin
Parameters
pageId
intThe id of the page to delete
CopyTo(CopyPageInfo)
Creates a copy of a given Page
Parameters
copyPageInfo
CopyPage Info A CopyPageInfo instance providing information about how to perform the actual copy operation
Returns
- Application
Response <Page> A response indicating the success or failure of the operation
CreateFromMaster(int, int)
Creates a new language version of the page with the specified id
Parameters
masterPageId
intThe id of the page acting as master
languageAreaId
intThe language version of the website on which to create the new page
Returns
- int
The id of the new page
DeleteAllAreaPages(Area)
Parameters
area
Area
Returns
DeletePage(int)
Deletes the specified page
Parameters
pageId
intThe id of the page to delete
ForceRefreshIndex(int)
Forces the specific item from the cache to be force-refreshed from the repository.
Parameters
id
intId of element to be refreshed
Returns
GetAncestors(int, bool)
Gets all ancestor page collection
Parameters
pageId
intThe id of the page to get ancestors
includingSelf
boolIndicates if page with given Id will be included in result
Returns
GetAreaAndPageNameByUrl(string, ref string?, ref string?)
Gets the area and page name by URL.
public string GetAreaAndPageNameByUrl(string url, ref string? internalId, ref string? internalAreaId)
Parameters
url
stringThe URL, i.e. Default.aspx?ID=123.
internalId
stringOptional parameter by reference. If passed the ID of the page will be returned.
internalAreaId
stringOptional parameter by reference. If passed the ID of the area will be returned.
Returns
- string
The name of the area and page of the given link in the format "Area name: Page name"
GetAreaNavigationTree(int)
Gets a representation of pages of the website with the specified id
Parameters
areaId
intThe id of the area for which to get its page navigation tree
Returns
GetAreaRootNavigationTree(int)
Gets a representation of a subset of the website with the pages located in the root of the website. Child nodes are added to the root nodes, but not to the tree.
Parameters
areaId
intThe id of the area for which to get its page navigation tree
Returns
GetAvailablePageDefinitions(int, int)
Gets the collection of available page definitions for specified area.
Parameters
Returns
- IEnumerable<Page
Definition > IEnumerable(Of PageDefinition).
GetAvailablePageDefinitions(int, int, string?)
Gets the collection of available page definitions for specified area.
public IEnumerable<PageDefinition> GetAvailablePageDefinitions(int areaId, int parentPageId, string? treeSection)
Parameters
Returns
- IEnumerable<Page
Definition > IEnumerable(Of PageDefinition).
GetDeletedPages(int)
Gets the collection of deleted pages in specified area
Parameters
areaId
intThe area id.
Returns
- IEnumerable<Page>
A collection of pages
GetFirstModulePageForArea(int, string)
Gets the first module page for the area with the specified id.
Parameters
areaId
intThe id of the area for which to get the page.
moduleSystemName
stringThe system name of the module.
Returns
- Page
Page.
GetFirstPageForArea(int)
Gets the first root page for the area with the specified id.
Parameters
areaId
intThe id of the area for which to get the page
Returns
- Page
The first page for the specified area
GetLanguagePages(int)
Gets all language versions of the page with the specified id
Parameters
pageId
intThe id of the page for which to get all its language versions
Returns
- Page
Collection A list of pages
GetPage(int)
Gets the page with the specified id
Parameters
pageId
intThe id of the page to get
Returns
- Page
The page with the specified id. If a page with the Id is not found,
null
is returned
GetPageByNavigationTag(int, string)
Parameters
Returns
GetPageForItem(string, string)
Gets the page for the item with the specified type and id
Parameters
itemType
stringThe itemType for which to find a page
itemId
stringThe itemId for which to find a page
Returns
- Page
A page that has an associated item with the specified item type and id
GetPageIDByMasterID(int, int)
Gets the id of the page in the specified language version that has a master page with the given id
Parameters
Returns
- int
A page id that has a master page with the specified id in the given language
GetPageNavigationTree(int)
Gets a representation of the website and its pages in a PageTree instance
Parameters
parentPageId
intThe id of the page for which to get its page navigation tree
Returns
- Page
Tree A PageTree instance
Remarks
looks up data from database
GetPageOrLanguage(int, int)
Gets the page with the specified id - if the passed areaid does not match the pageid, the language version will be returned if found
Parameters
Returns
- Page
The page with the specified id or its language version for the specified area. If a page with the Id is not found,
null
is returned. If areaid is not more than 0, exception will be thrown
GetPageTemplatesForArea(int)
Gets all page templates for the specified area
Parameters
areaId
intThe id of the area for which to get it's page templates
Returns
- Page
Collection A collection of page templates
GetPages()
Gets all pages in the system
Returns
- Page
Collection A list of all pages in the system
GetPages(int[])
Gets all the pages matching the ids in the specified array
Parameters
pageIds
int[]An array of ids for which to get the page instances
Returns
- Page
Collection A list with the pages matching the specified ids
GetPagesByAreaID(int)
Gets all the pages for the area with the specified id
Parameters
areaId
intThe id of the area for which to get all its pages
Returns
- Page
Collection A list of pages
GetPagesByParentID(int)
Gets all pages having the specified parent id
Parameters
parentId
intThe parent id for which to get all children pages
Returns
- IEnumerable<Page>
A list of pages all having a parent page with the specified id
GetPagesByTitle(string)
Gets all the pages that have the specified title
Parameters
title
stringThe title fort which to get all pages having that as their title
Returns
- Page
Collection A collection of pages with the specified titel
GetPagesForItems(IEnumerable<string>)
Gets a collection of pages having the specified item types
Parameters
itemTypes
IEnumerable<string>The item types for which to get pages
Returns
- Page
Collection A collection of pages having the specified item types
GetRootPagesForArea(int)
Gets all root pages for the area with the specified id
Parameters
areaId
intThe id of the area for which to get all its root pages
Returns
- IEnumerable<Page>
A list of pages all being root to the area with the specified id
GetTemplateParentPage(int)
Get page template folder
Parameters
areaId
intThe area id.
Returns
- Page
The page template folder
GetUpdatedLanguagePages(int)
Gets a list of pages for an area that has not been updated after their masters have been updated. The passed areaId has to be for an Area that is a language (has a master).
Parameters
areaId
intThe area id for which to get the updated language pages
Returns
Remarks
Uses the database directly
GetWebpageCount(int)
Gets total number of webpages on specified area.
Parameters
areaId
intareaId
Returns
- int
webpageCount
Move(int, int, int)
Moves the specified page to the target page and area
Parameters
pageId
intThe id of the page to move
destinationAreaId
intArea to move to.
destinationPageId
intThe id of the page to which the page should be moved
Returns
- Application
Response <Page> A response indicating the success or failure of the operation
RestorePage(int)
Restore the page with the specified id
Parameters
pageId
intThe id of the page to restore
Exceptions
SaveAsTemplate(Page, string, string)
Saves the specified page as a template
Parameters
page
PageThe page to save as a template
name
stringThe name of the new template
description
stringA description of the template
Returns
- int
The newly assigned page id for the template
SaveAsTemplate(Page, string, string, string)
Saves the specified page as a template
Parameters
page
PageThe page to save as a template
name
stringThe name of the new template
description
stringA description of the template
image
string
Returns
- int
The newly assigned page id for the template
SaveAsTemplate(Page, string, string, string, string)
Saves the specified page as a template
public int SaveAsTemplate(Page page, string name, string description, string image, string category)
Parameters
page
PageThe page to save as a template
name
stringThe name of the new template
description
stringA description of the template
image
stringThe image of the new template
category
stringA category of the template
Returns
- int
The newly assigned page id for the template
SavePage(Page)
Saves the specified page to persistance
Parameters
page
PageThe page to save
Returns
- Page
The newly saved page
UpdatePagesOrder(int, int?, IEnumerable<int>)
Updates sorting for given pages
Parameters
areaId
intThe id of the area for pages
pageId
int?The parent id for which to update sort indexes
childPageIdsOrder
IEnumerable<int>Ordered collection of pages ids
UserHasAccessToAllBackendSubpages(Page, User)
Gets a value indicating if the user has access to all subpages in the specified page in the administration
Parameters
page
PageThe page for which to determine if the user can access that and its subpages
user
UserThe user for whom to determine access
Returns
- bool
True if the user can access the page and all of its subpages, otherwise false