public class WikiFileProvider extends java.lang.Object implements WikiPageProvider
LATEST_VERSION| Constructor and Description |
|---|
WikiFileProvider() |
| Modifier and Type | Method and Description |
|---|---|
void |
deletePage(java.lang.String pageName)
Removes an entire page from the repository.
|
void |
deleteVersion(java.lang.String pageName,
int version)
Removes a specific version from the repository.
|
java.util.Collection |
findPages(QueryItem[] query)
Finds pages based on the query.
|
java.util.Collection |
getAllChangedSince(java.util.Date date)
Gets a list of recent changes.
|
java.util.Collection |
getAllPages()
Returns all pages.
|
int |
getPageCount()
Gets the number of pages.
|
WikiPage |
getPageInfo(java.lang.String page,
int version)
Returns info about the page.
|
DBObject |
getPageObject(java.lang.String page)
Gets a page object.
|
java.lang.String |
getPageText(java.lang.String page,
int version)
Gets a specific version out of the repository.
|
java.lang.String |
getProviderInfo()
Return a valid HTML string for information.
|
java.util.List |
getVersionHistory(java.lang.String page)
Returns version history.
|
void |
initialize(WikiEngine engine,
java.util.Properties properties)
Initializes the page provider.
|
void |
movePage(java.lang.String from,
java.lang.String to)
Move a page
|
boolean |
pageExists(java.lang.String page)
Return true, if page exists.
|
void |
putPageText(WikiPage page,
java.lang.String text)
Attempts to save the page text for page "page".
|
public void initialize(WikiEngine engine, java.util.Properties properties) throws NoRequiredPropertyException, java.io.IOException, java.io.FileNotFoundException
initialize in interface WikiProviderengine - WikiEngine to own this providerproperties - A set of properties used to initialize this providerjava.io.FileNotFoundException - If the specified page directory does not exist.java.io.IOException - In case the specified page directory is a file, not a directory.NoRequiredPropertyException - If the provider needs a property which is not found in the property setpublic void putPageText(WikiPage page, java.lang.String text) throws ProviderException
WikiPageProviderputPageText in interface WikiPageProviderpage - the pagetext - the textProviderException - a problempublic boolean pageExists(java.lang.String page)
pageExists in interface WikiPageProviderpage - The page name.public java.util.Collection findPages(QueryItem[] query)
This method should really be a part of the FastSearch IF.
findPages in interface WikiPageProviderquery - An array of QueryItems to matchpublic WikiPage getPageInfo(java.lang.String page, int version) throws ProviderException
getPageInfo in interface WikiPageProviderpage - The page nameversion - The version numberProviderException - If something goes wrong.public java.util.Collection getAllPages()
throws ProviderException
getAllPages in interface WikiPageProviderProviderException - If something goes wrong.public java.util.Collection getAllChangedSince(java.util.Date date)
getAllChangedSince in interface WikiPageProviderdate - The date to check frompublic int getPageCount()
throws ProviderException
getPageCount in interface WikiPageProviderProviderException - If something goes wrongpublic java.util.List getVersionHistory(java.lang.String page)
throws ProviderException
getVersionHistory in interface WikiPageProviderpage - The name of the page to get the history from.ProviderException - If something goes wrong.public java.lang.String getPageText(java.lang.String page,
int version)
throws ProviderException
getPageText in interface WikiPageProviderpage - Name of the page to fetch.version - Version of the page to fetch.ProviderException - If something goes wrong.public DBObject getPageObject(java.lang.String page) throws ProviderException
getPageObject in interface WikiPageProviderpage - Name of the page to fetch.ProviderException - If something goes wrong.public void deleteVersion(java.lang.String pageName,
int version)
throws ProviderException
deleteVersion in interface WikiPageProviderpageName - 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.public void deletePage(java.lang.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...
deletePage in interface WikiPageProviderpageName - Name of the page to be removed completely.ProviderException - If the page could not be removed for some reason.public void movePage(java.lang.String from,
java.lang.String to)
throws ProviderException
movePage in interface WikiPageProviderfrom - Name of the page to move.to - New name of the page.ProviderException - If the page could not be moved for some reason.public java.lang.String getProviderInfo()
getProviderInfo in interface WikiProviderstSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.