public interface PageManager extends WikiEventListener
| Modifier and Type | Field and Description |
|---|---|
static String |
PROP_LOCKEXPIRY
The property value for setting the amount of time before the page locks expire.
|
static String |
PROP_PAGEPROVIDER
The property value for setting the current page provider.
|
static String |
PROP_USECACHE
The property value for setting the cache on/off.
|
| Modifier and Type | Method and Description |
|---|---|
void |
deletePage(Page page)
Deletes an entire page, all versions, all traces.
|
void |
deletePage(String pageName)
Deletes a page or an attachment completely, including all versions.
|
void |
deleteVersion(Page page)
Deletes only a specific version of a WikiPage.
|
List<PageLock> |
getActiveLocks()
Returns a list of currently applicable locks.
|
Collection<Page> |
getAllPages()
Returns all pages in some random order.
|
PageLock |
getCurrentLock(Page page)
Returns the current lock owner of a page.
|
String |
getCurrentProvider()
Returns the provider name.
|
Page |
getPage(String pagereq)
Finds the corresponding WikiPage object based on the page name.
|
Page |
getPage(String pagereq,
int version)
Finds the corresponding WikiPage object base on the page name and version.
|
Page |
getPageInfo(String pageName,
int version)
Finds a WikiPage object describing a particular page and version.
|
PageSorter |
getPageSorter()
Returns the configured
PageSorter. |
String |
getPageText(String pageName,
int version)
Fetches the page text from the repository.
|
PageProvider |
getProvider()
Returns the page provider currently in use.
|
String |
getProviderDescription()
Returns a human-readable description of the current provider.
|
default String |
getPureText(Page page)
Returns the pure text of a page, no conversions.
|
String |
getPureText(String page,
int version)
Returns the pure text of a page, no conversions.
|
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 String |
getText(Page page)
Returns the un-HTMLized text of the given version of a page in the given context.
|
default String |
getText(String page)
Returns the un-HTMLized text of the latest version of a page.
|
String |
getText(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(String pageName)
Gets a version history of page.
|
PageLock |
lockPage(Page page,
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(String pageName)
Returns true, if the page exists (any version) on the underlying WikiPageProvider.
|
boolean |
pageExists(String pageName,
int version)
Checks for existence of a specific page and version on the underlying WikiPageProvider.
|
void |
putPageText(Page page,
String content)
Puts the page text into the repository.
|
void |
saveText(Context context,
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(String page)
Returns true, if the requested page (or an alias) exists.
|
boolean |
wikiPageExists(String page,
int version)
Returns true, if the requested page (or an alias) exists with the requested version.
|
actionPerformedstatic final String PROP_PAGEPROVIDER
static final String PROP_USECACHE
static final String PROP_LOCKEXPIRY
PageProvider getProvider()
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.String getPageText(String pageName, int version) throws ProviderException
pageName - The name of the page to fetch.version - The version to findProviderException - If the backend has issues.String getPureText(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 String getPureText(Page page)
getPageText(String, int), except that it doesn't throw ProviderException,
it logs and swallows them.page - A handle to the WikiPageString getText(String page, int version)
getPureText(String, int).page - WikiName of the page to fetchversion - Version of the page to fetchdefault String getText(String page)
getPureText(String, int).page - WikiName of the page to fetch.default 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, 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, String content) throws ProviderException
page - Page to savecontent - Wikimarkup to saveProviderException - If something goes wrong in the saving phasePageLock lockPage(Page page, 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 forList<PageLock> getActiveLocks()
Page getPage(String pagereq)
pagereq - The name of the page to look for.Page getPage(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(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> List<T> getVersionHistory(String pageName)
pageName - The name of the page or attachment to fetch history forString getCurrentProvider()
String getProviderDescription()
int getTotalPageCount()
Set<Page> getRecentChanges()
boolean pageExists(String pageName) throws ProviderException
pageName - Name of the page.ProviderException - If the backend fails or the name is illegal.boolean pageExists(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(String page)
page - WikiName of the page.boolean wikiPageExists(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(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 © 2001-2020 The Apache Software Foundation. All rights reserved.