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 WikiProvider
engine
- 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
WikiPageProvider
putPageText
in interface WikiPageProvider
page
- the pagetext
- the textProviderException
- a problempublic boolean pageExists(java.lang.String page)
pageExists
in interface WikiPageProvider
page
- The page name.public java.util.Collection findPages(QueryItem[] query)
This method should really be a part of the FastSearch IF.
findPages
in interface WikiPageProvider
query
- An array of QueryItems to matchpublic WikiPage getPageInfo(java.lang.String page, int version) throws ProviderException
getPageInfo
in interface WikiPageProvider
page
- The page nameversion
- The version numberProviderException
- If something goes wrong.public java.util.Collection getAllPages() throws ProviderException
getAllPages
in interface WikiPageProvider
ProviderException
- If something goes wrong.public java.util.Collection getAllChangedSince(java.util.Date date)
getAllChangedSince
in interface WikiPageProvider
date
- The date to check frompublic int getPageCount() throws ProviderException
getPageCount
in interface WikiPageProvider
ProviderException
- If something goes wrongpublic java.util.List getVersionHistory(java.lang.String page) throws ProviderException
getVersionHistory
in interface WikiPageProvider
page
- 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 WikiPageProvider
page
- 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 WikiPageProvider
page
- 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 WikiPageProvider
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.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 WikiPageProvider
pageName
- 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 WikiPageProvider
from
- 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 WikiProvider
stSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.