Class DefaultPageManager

  • All Implemented Interfaces:
    java.util.EventListener, WikiEventListener, PageManager

    public class DefaultPageManager
    extends java.lang.Object
    implements PageManager
    Manages the WikiPages. This class functions as an unified interface towards the page providers. It handles initialization and management of the providers, and provides utility methods for accessing the contents.

    Saving a page is a two-stage Task; first the pre-save operations and then the actual save. See the descriptions of the tasks for further information.

    • Constructor Summary

      Constructor Description
      DefaultPageManager​(Engine engine, java.util.Properties props)
      Creates a new PageManager.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(WikiEvent event)
      protected boolean changeAcl​(Page page,[] oldPrincipals, newPrincipal)
      For a single wiki page, replaces all Acl entries matching a supplied array of Principals with a new Principal.
      void deletePage​(java.lang.String pageName)
      Deletes a page or an attachment completely, including all versions.
      void deletePage​(Page page)
      Deletes an entire page, all versions, all traces.
      void deleteVersion​(Page page)
      Deletes only a specific version of a WikiPage.
      protected void fireEvent​(int type, java.lang.String pagename)
      Fires a WikiPageEvent of the provided type and page name to all registered listeners.
      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.
      protected Engine getEngine()
      Returns the Engine to which this PageManager belongs to.
      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.
      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).
      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.
      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.
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait