C# Class Roadkill.Core.Services.PageService

Provides a set of tasks for wiki page management.
Inheritance: IPageService
Afficher le fichier Open project: LocalGovDigital/pipeline Class Usage Examples

Méthodes publiques

Méthode Description
AddPage ( PageViewModel model ) : PageViewModel

Adds the page to the database.

AllPages ( bool loadPageContent = false ) : IEnumerable

Retrieves a list of all pages in the system.

AllPagesCreatedBy ( string userName ) : IEnumerable

Gets alls the pages created by a user.

AllTags ( ) : IEnumerable

Retrieves a list of all tags in the system.

ClearPageTables ( ) : void

Clears all pages and page content from the database.

DeletePage ( int pageId ) : void

Deletes a page from the database.

ExportToXml ( ) : string

Exports all pages in the database, including content, to an XML format.

FindByTag ( string tag ) : IEnumerable

Finds all pages with the given tag.

FindByTitle ( string title ) : PageViewModel

Finds a page by its title

FindHomePage ( ) : PageViewModel

Finds the first page with the tag 'homepage'. Any pages that are locked by an administrator take precedence.

GetActivity ( ) : IEnumerable

Finds all relationships related to the page.

GetBootStrapNavMenu ( IUserContext userContext ) : string

Retrieves the (usually left) menu containing the new page, settings etc. options

GetById ( int id, bool loadContent = false ) : PageViewModel

Retrieves the page by its id.

GetCurrentContent ( int pageId ) : PageContent

Retrieves the current text content for a page.

GetMarkupConverter ( ) : Roadkill.Core.Converters.MarkupConverter

Retrieves the MarkupConverter used by this IPageService.

GetMenu ( IUserContext userContext ) : string

Retrieves the (usually left) menu containing the new page, settings etc. options

GetRelByPage ( int pageid ) : IEnumerable

Finds all relationships related to the page.

PageService ( Roadkill.Core.Configuration.ApplicationSettings settings, IRepository repository, SearchService searchService, PageHistoryService historyService, IUserContext context, ListCache listCache, Roadkill.Core.Cache.PageViewModelCache pageViewModelCache, Roadkill.Core.Cache.SiteCache sitecache, IPluginFactory pluginFactory ) : System
RenameTag ( string oldTagName, string newTagName ) : void

Renames a tag by changing all pages that reference the tag to use the new tag name.

UpdateLinksToPage ( string oldTitle, string newTitle ) : void

Updates all links in pages to another page, when that page's title is changed.

UpdatePage ( PageViewModel model ) : void

Updates the provided page.

Private Methods

Méthode Description
AppendIpForDemoSite ( string username ) : string

Adds an IP address after the username for any demo site vandalism.

GetCollapsableMenuHtml ( ) : string

Adds the Adidas bar to the nav bar so it can be collapsed on mobile devices

Method Details

AddPage() public méthode

Adds the page to the database.
An databaseerror occurred while saving. An error occurred adding the page to the search index.
public AddPage ( PageViewModel model ) : PageViewModel
model Roadkill.Core.Mvc.ViewModels.PageViewModel The summary details for the page.
Résultat Roadkill.Core.Mvc.ViewModels.PageViewModel

AllPages() public méthode

Retrieves a list of all pages in the system.
An databaseerror occurred while retrieving the list.
public AllPages ( bool loadPageContent = false ) : IEnumerable
loadPageContent bool
Résultat IEnumerable

AllPagesCreatedBy() public méthode

Gets alls the pages created by a user.
An databaseerror occurred while retrieving the list.
public AllPagesCreatedBy ( string userName ) : IEnumerable
userName string Name of the user.
Résultat IEnumerable

AllTags() public méthode

Retrieves a list of all tags in the system.
An databaseerror occurred while getting the tags.
public AllTags ( ) : IEnumerable
Résultat IEnumerable

ClearPageTables() public méthode

Clears all pages and page content from the database.
An datastore error occurred while clearing the page data.
public ClearPageTables ( ) : void
Résultat void

DeletePage() public méthode

Deletes a page from the database.
An databaseerror occurred while deleting the page.
public DeletePage ( int pageId ) : void
pageId int The id of the page to remove.
Résultat void

ExportToXml() public méthode

Exports all pages in the database, including content, to an XML format.
An databaseerror occurred while getting the list. An XML serialiation occurred exporting the page content.
public ExportToXml ( ) : string
Résultat string

FindByTag() public méthode

Finds all pages with the given tag.
An database error occurred while getting the list.
public FindByTag ( string tag ) : IEnumerable
tag string The tag to search for.
Résultat IEnumerable

FindByTitle() public méthode

Finds a page by its title
An databaseerror occurred while getting the page.
public FindByTitle ( string title ) : PageViewModel
title string The page title
Résultat Roadkill.Core.Mvc.ViewModels.PageViewModel

FindHomePage() public méthode

Finds the first page with the tag 'homepage'. Any pages that are locked by an administrator take precedence.
public FindHomePage ( ) : PageViewModel
Résultat Roadkill.Core.Mvc.ViewModels.PageViewModel

GetActivity() public méthode

Finds all relationships related to the page.
An database error occurred while getting the list.
public GetActivity ( ) : IEnumerable
Résultat IEnumerable

GetBootStrapNavMenu() public méthode

Retrieves the (usually left) menu containing the new page, settings etc. options
public GetBootStrapNavMenu ( IUserContext userContext ) : string
userContext IUserContext
Résultat string

GetById() public méthode

Retrieves the page by its id.
An databaseerror occurred while getting the page.
public GetById ( int id, bool loadContent = false ) : PageViewModel
id int The id of the page
loadContent bool
Résultat Roadkill.Core.Mvc.ViewModels.PageViewModel

GetCurrentContent() public méthode

Retrieves the current text content for a page.
public GetCurrentContent ( int pageId ) : PageContent
pageId int The id of the page.
Résultat Roadkill.Core.Database.PageContent

GetMarkupConverter() public méthode

Retrieves the MarkupConverter used by this IPageService.
public GetMarkupConverter ( ) : Roadkill.Core.Converters.MarkupConverter
Résultat Roadkill.Core.Converters.MarkupConverter

GetMenu() public méthode

Retrieves the (usually left) menu containing the new page, settings etc. options
public GetMenu ( IUserContext userContext ) : string
userContext IUserContext
Résultat string

GetRelByPage() public méthode

Finds all relationships related to the page.
An database error occurred while getting the list.
public GetRelByPage ( int pageid ) : IEnumerable
pageid int
Résultat IEnumerable

PageService() public méthode

public PageService ( Roadkill.Core.Configuration.ApplicationSettings settings, IRepository repository, SearchService searchService, PageHistoryService historyService, IUserContext context, ListCache listCache, Roadkill.Core.Cache.PageViewModelCache pageViewModelCache, Roadkill.Core.Cache.SiteCache sitecache, IPluginFactory pluginFactory ) : System
settings Roadkill.Core.Configuration.ApplicationSettings
repository IRepository
searchService SearchService
historyService PageHistoryService
context IUserContext
listCache ListCache
pageViewModelCache Roadkill.Core.Cache.PageViewModelCache
sitecache Roadkill.Core.Cache.SiteCache
pluginFactory IPluginFactory
Résultat System

RenameTag() public méthode

Renames a tag by changing all pages that reference the tag to use the new tag name.
An databaseerror occurred while saving one of the pages. An error occurred updating the search index.
public RenameTag ( string oldTagName, string newTagName ) : void
oldTagName string
newTagName string
Résultat void

UpdateLinksToPage() public méthode

Updates all links in pages to another page, when that page's title is changed.
public UpdateLinksToPage ( string oldTitle, string newTitle ) : void
oldTitle string The previous page title.
newTitle string The new page title.
Résultat void

UpdatePage() public méthode

Updates the provided page.
An databaseerror occurred while updating. An error occurred adding the page to the search index.
public UpdatePage ( PageViewModel model ) : void
model Roadkill.Core.Mvc.ViewModels.PageViewModel The summary.
Résultat void