public interface PageManager extends WikiEventListener
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
PROP_LOCKEXPIRY
The property value for setting the amount of time before the page locks expire.
|
static java.lang.String |
PROP_PAGEPROVIDER
The property value for setting the current page provider.
|
| Modifier and Type | Method and Description |
|---|---|
void |
deletePage(Page page)
Deletes an entire page, all versions, all traces.
|
void |
deletePage(java.lang.String pageName)
Deletes a page or an attachment completely, including all versions.
|
void |
deleteVersion(Page page)
Deletes only a specific version of a WikiPage.
|
java.util.List<PageLock> |
getActiveLocks()
Returns a list of currently applicable locks.
|
java.util.Collection<Page> |
getAllPages()
Returns all pages in some random order.
|
PageLock |
getCurrentLock(Page page)
Returns the current lock owner of a page.
|
java.lang.String |
getCurrentProvider()
Returns the provider name.
|
Page |
getPage(java.lang.String pagereq)
Finds the corresponding WikiPage object based on the page name.
|
Page |
getPage(java.lang.String pagereq,
int version)
Finds the corresponding WikiPage object base on the page name and version.
|
Page |
getPageInfo(java.lang.String pageName,
int version)
Finds a WikiPage object describing a particular page and version.
|
PageSorter |
getPageSorter()
Returns the configured
PageSorter. |
java.lang.String |
getPageText(java.lang.String pageName,
int version)
Fetches the page text from the repository.
|
PageProvider |
getProvider()
Returns the page provider currently in use.
|
java.lang.String |
getProviderDescription()
Returns a human-readable description of the current provider.
|
default java.lang.String |
getPureText(Page page)
Returns the pure text of a page, no conversions.
|
java.lang.String |
getPureText(java.lang.String page,
int version)
Returns the pure text of a page, no conversions.
|
java.util.Set<Page> |
getRecentChanges()
Returns a Collection of WikiPages, sorted in time order of last change (i.e. first object is the most recently changed).
|
default java.lang.String |
getText(Page page)
Returns the un-HTMLized text of the given version of a page in the given context.
|
default java.lang.String |
getText(java.lang.String page)
Returns the un-HTMLized text of the latest version of a page.
|
java.lang.String |
getText(java.lang.String page,
int version)
Returns the un-HTMLized text of the given version of a page.
|
int |
getTotalPageCount()
Returns the total count of all pages in the repository.
|
<T extends Page> |
getVersionHistory(java.lang.String pageName)
Gets a version history of page.
|
PageLock |
lockPage(Page page,
java.lang.String user)
Locks page for editing.
|
default boolean |
pageExists(Page page)
Checks for existence of a specific page and version denoted by a WikiPage on the underlying WikiPageProvider.
|
boolean |
pageExists(java.lang.String pageName)
Returns true, if the page exists (any version) on the underlying WikiPageProvider.
|
boolean |
pageExists(java.lang.String pageName,
int version)
Checks for existence of a specific page and version on the underlying WikiPageProvider.
|
void |
putPageText(Page page,
java.lang.String content)
Puts the page text into the repository.
|
void |
saveText(Context context,
java.lang.String text)
Writes the WikiText of a page into the page repository.
|
void |
unlockPage(PageLock lock)
Marks a page free to be written again.
|
default boolean |
wikiPageExists(Page page)
Returns true, if the requested page (or an alias) exists, with the specified version in the WikiPage.
|
boolean |
wikiPageExists(java.lang.String page)
Returns true, if the requested page (or an alias) exists.
|
boolean |
wikiPageExists(java.lang.String page,
int version)
Returns true, if the requested page (or an alias) exists with the requested version.
|
actionPerformedstatic final java.lang.String PROP_PAGEPROVIDER
static final java.lang.String PROP_LOCKEXPIRY
PageProvider getProvider()
java.util.Collection<Page> getAllPages() throws ProviderException
ReferenceManager#findCreated(), which is probably a lot
faster. This method may cause repository access.ProviderException - If the backend has problems.java.lang.String getPageText(java.lang.String pageName, int version) throws ProviderException
pageName - The name of the page to fetch.version - The version to findProviderException - If the backend has issues.java.lang.String getPureText(java.lang.String page, int version)
getPageText(String, int), except that it doesn't throw ProviderException,
it logs and swallows them.page - The name of the page to fetch.version - If WikiPageProvider.LATEST_VERSION, then uses the latest version.default java.lang.String getPureText(Page page)
getPageText(String, int), except that it doesn't throw ProviderException,
it logs and swallows them.page - A handle to the WikiPagejava.lang.String getText(java.lang.String page, int version)
getPureText(String, int).page - WikiName of the page to fetchversion - Version of the page to fetchdefault java.lang.String getText(java.lang.String page)
getPureText(String, int).page - WikiName of the page to fetch.default java.lang.String getText(Page page)
This method also replaces the < and & -characters with their respective HTML entities, thus making it suitable
for inclusion on an HTML page. If you want to have the page text without any conversions, use getPureText(Page).
page - A page reference (not an attachment)getPureText(Page)void saveText(Context context, java.lang.String text) throws WikiException
jspwiki.properties file contains
the property jspwiki.approver.workflow.saveWikiPage and its value resolves to a valid user,
Group or Role, this method will
place a Decision in the approver's workflow inbox and throw a
DecisionRequiredException. If the submitting user is authenticated and the
page save is rejected, a notification will be placed in the user's decision queue.context - The current WikiContexttext - The Wiki markup for the page.WikiException - if the save operation encounters an error during the save operation. If the page-save
operation requires approval, the exception will be of type DecisionRequiredException.
Individual PageFilters, such as the SpamFilter may also throw a
RedirectException.void putPageText(Page page, java.lang.String content) throws ProviderException
page - Page to savecontent - Wikimarkup to saveProviderException - If something goes wrong in the saving phasePageLock lockPage(Page page, java.lang.String user)
page - WikiPage to lockuser - Username to use for lockingvoid unlockPage(PageLock lock)
lock - A lock acquired in lockPage(). Safe to be null.PageLock getCurrentLock(Page page)
page - The page to check the lock forjava.util.List<PageLock> getActiveLocks()
Page getPage(java.lang.String pagereq)
pagereq - The name of the page to look for.Page getPage(java.lang.String pagereq, int version)
pagereq - The name of the page to look for.version - The version number to look for. May be WikiProvider.LATEST_VERSION,
in which case it will look for the latest version (and this method then becomes
the equivalent of getPage(String).Page getPageInfo(java.lang.String pageName, int version) throws ProviderException
pageName - The name of the pageversion - A version numberProviderException - If there is something wrong with the page name or the repository<T extends Page> java.util.List<T> getVersionHistory(java.lang.String pageName)
pageName - The name of the page or attachment to fetch history forjava.lang.String getCurrentProvider()
java.lang.String getProviderDescription()
int getTotalPageCount()
java.util.Set<Page> getRecentChanges()
boolean pageExists(java.lang.String pageName) throws ProviderException
pageName - Name of the page.ProviderException - If the backend fails or the name is illegal.boolean pageExists(java.lang.String pageName, int version) throws ProviderException
pageName - Name of the pageversion - The version to checktrue if the page exists, false otherwiseProviderException - If backend fails or name is illegaldefault boolean pageExists(Page page) throws ProviderException
page - A WikiPage object describing the name and version.ProviderException - If something goes badly wrong.boolean wikiPageExists(java.lang.String page)
page - WikiName of the page.boolean wikiPageExists(java.lang.String page, int version) throws ProviderException
page - Page nameversion - Page versionProviderException - If the provider fails.default boolean wikiPageExists(Page page) throws ProviderException
page - A WikiPage object describing the name and version.ProviderException - If something goes badly wrong.void deleteVersion(Page page) throws ProviderException
page - The page to delete.ProviderException - if the page failsvoid deletePage(java.lang.String pageName) throws ProviderException
pageName - The name of the page.ProviderException - If something goes wrong.void deletePage(Page page) throws ProviderException
page - The WikiPage to deleteProviderException - If the repository operation failsPageSorter getPageSorter()
PageSorter.PageSorter.Copyright (c) 2001-2022 The Apache Software Foundation. All rights reserved.