public interface WikiPageProvider extends WikiProvider
You can build whatever page providers based on this, just leave the unused methods do something useful.
WikiPageProvider uses Strings and ints to refer to pages. This may be a bit odd, since WikiAttachmentProviders all use Attachment instead of name/version. We will perhaps modify these in the future. In the mean time, name/version is quite sufficient.
FIXME: In reality we should have an AbstractWikiPageProvider, which would provide intelligent backups for subclasses.
LATEST_VERSION
Modifier and Type | Method and Description |
---|---|
void |
deletePage(String pageName)
Removes an entire page from the repository.
|
void |
deleteVersion(String pageName,
int version)
Removes a specific version from the repository.
|
Collection |
findPages(QueryItem[] query)
Finds pages based on the query.
|
Collection |
getAllChangedSince(Date date)
Gets a list of recent changes.
|
Collection |
getAllPages()
Returns all pages.
|
int |
getPageCount()
Gets the number of pages.
|
WikiPage |
getPageInfo(String page,
int version)
Returns info about the page.
|
String |
getPageText(String page,
int version)
Gets a specific version out of the repository.
|
List |
getVersionHistory(String page)
Returns version history.
|
void |
movePage(String from,
String to)
Move a page
|
boolean |
pageExists(String page)
Return true, if page exists.
|
boolean |
pageExists(String page,
int version)
Return true, if page with a particular version exists.
|
void |
putPageText(WikiPage page,
String text)
Attempts to save the page text for page "page".
|
getProviderInfo, initialize
void putPageText(WikiPage page, String text) throws ProviderException
page
- The WikiPage to savetext
- The text to save.ProviderException
- If something goes wrong.boolean pageExists(String page)
page
- The page name.boolean pageExists(String page, int version)
page
- The page name to check forversion
- The version to checkCollection findPages(QueryItem[] query)
This method should really be a part of the FastSearch IF.
query
- An array of QueryItems to matchWikiPage getPageInfo(String page, int version) throws ProviderException
page
- The page nameversion
- The version numberProviderException
- If something goes wrong.Collection getAllPages() throws ProviderException
ProviderException
- If something goes wrong.Collection getAllChangedSince(Date date)
date
- The date to check fromint getPageCount() throws ProviderException
ProviderException
- If something goes wrongList getVersionHistory(String page) throws ProviderException
page
- The name of the page to get the history from.ProviderException
- If something goes wrong.String getPageText(String page, int version) throws ProviderException
page
- Name of the page to fetch.version
- Version of the page to fetch.ProviderException
- If something goes wrong.void deleteVersion(String pageName, int version) throws ProviderException
pageName
- Name of the page to be removed.version
- Version of the page to be removed. May be LATEST_VERSION.ProviderException
- If the page cannot be removed for some reason.void deletePage(String pageName) throws ProviderException
The reason why this is named differently from deleteVersion() (logically, this method should be an overloaded version) is that I want to be absolutely sure I don't accidentally use the wrong method. With overloading something like that happens sometimes...
pageName
- Name of the page to be removed completely.ProviderException
- If the page could not be removed for some reason.void movePage(String from, String to) throws ProviderException
from
- Name of the page to move.to
- New name of the page.ProviderException
- If the page could not be moved for some reason.Copyright © 2001-2018 The Apache Software Foundation. All rights reserved.