Java Doc for PageManager.java in  » Wiki-Engine » JSPWiki » com » ecyrd » jspwiki » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Wiki Engine » JSPWiki » com.ecyrd.jspwiki 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.ecyrd.jspwiki.modules.ModuleManager
      com.ecyrd.jspwiki.PageManager

PageManager
public class PageManager extends ModuleManager implements WikiEventListener(Code)
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.
author:
   Janne Jalkanen
since:
   2.0

Inner Class :public static class PreSaveWikiPageTask extends Task
Inner Class :public static class SaveWikiPageTask extends Task

Field Summary
final public static  StringFACT_CURRENT_TEXT
     Fact name for storing the current text.
final public static  StringFACT_DIFF_TEXT
     Fact name for storing a diff text.
final public static  StringFACT_IS_AUTHENTICATED
    
final public static  StringFACT_PAGE_NAME
     Fact name for storing the page name.
final public static  StringFACT_PROPOSED_TEXT
     Fact name for storing the proposed (edited) text.
final public static  StringPRESAVE_TASK_MESSAGE_KEY
    
final public static  StringPRESAVE_WIKI_CONTEXT
    
final public static  StringPROP_LOCKEXPIRY
     The property value for setting the amount of time before the page locks expire.
final public static  StringPROP_PAGEPROVIDER
     The property value for setting the current page provider.
final public static  StringPROP_USECACHE
     The property value for setting the cache on/off.
final public static  StringSAVE_APPROVER
    
final public static  StringSAVE_DECISION_MESSAGE_KEY
    
final public static  StringSAVE_REJECT_MESSAGE_KEY
    
final public static  StringSAVE_TASK_MESSAGE_KEY
    
static  Loggerlog
    
protected  HashMapm_pageLocks
    

Constructor Summary
public  PageManager(WikiEngine engine, Properties props)
     Creates a new PageManager.

Method Summary
public  voidactionPerformed(WikiEvent event)
     Listens for com.ecyrd.jspwiki.event.WikiSecurityEvent.PROFILE_NAME_CHANGED events.
protected  booleanchangeAcl(WikiPage page, Principal[] oldPrincipals, Principal newPrincipal)
     For a single wiki page, replaces all Acl entries matching a supplied array of Principals with a new Principal.
public  voiddeletePage(WikiPage page)
     Deletes an entire page, all versions, all traces.
public  voiddeleteVersion(WikiPage page)
     Deletes only a specific version of a WikiPage.
final protected  voidfireEvent(int type, String pagename)
     Fires a WikiPageEvent of the provided type and page name to all registered listeners.
public  ListgetActiveLocks()
     Returns a list of currently applicable locks.
public  CollectiongetAllPages()
     Returns all pages in some random order.
public  PageLockgetCurrentLock(WikiPage page)
     Returns the current lock owner of a page.
public  WikiEnginegetEngine()
     Returns the WikiEngine to which this PageManager belongs to.
public  WikiPagegetPageInfo(String pageName, int version)
     Finds a WikiPage object describing a particular page and version.
public  StringgetPageText(String pageName, int version)
     Fetches the page text from the repository.
public  WikiPageProvidergetProvider()
     Returns the page provider currently in use.
public  StringgetProviderDescription()
     Returns a human-readable description of the current provider.
public  intgetTotalPageCount()
     Returns the total count of all pages in the repository.
public  ListgetVersionHistory(String pageName)
     Gets a version history of page.
public  PageLocklockPage(WikiPage page, String user)
     Locks page for editing.
public  Collectionmodules()
    
public  booleanpageExists(String pageName)
     Returns true, if the page exists (any version).
Parameters:
  pageName - Name of the page.
public  booleanpageExists(String pageName, int version)
     Checks for existence of a specific page and version.
public  voidputPageText(WikiPage page, String content)
     Puts the page text into the repository.
public  voidunlockPage(PageLock lock)
     Marks a page free to be written again.

Field Detail
FACT_CURRENT_TEXT
final public static String FACT_CURRENT_TEXT(Code)
Fact name for storing the current text. Value is .



FACT_DIFF_TEXT
final public static String FACT_DIFF_TEXT(Code)
Fact name for storing a diff text. Value is .



FACT_IS_AUTHENTICATED
final public static String FACT_IS_AUTHENTICATED(Code)



FACT_PAGE_NAME
final public static String FACT_PAGE_NAME(Code)
Fact name for storing the page name. Value is .



FACT_PROPOSED_TEXT
final public static String FACT_PROPOSED_TEXT(Code)
Fact name for storing the proposed (edited) text. Value is .



PRESAVE_TASK_MESSAGE_KEY
final public static String PRESAVE_TASK_MESSAGE_KEY(Code)



PRESAVE_WIKI_CONTEXT
final public static String PRESAVE_WIKI_CONTEXT(Code)



PROP_LOCKEXPIRY
final public static String PROP_LOCKEXPIRY(Code)
The property value for setting the amount of time before the page locks expire. Value is .



PROP_PAGEPROVIDER
final public static String PROP_PAGEPROVIDER(Code)
The property value for setting the current page provider. Value is .



PROP_USECACHE
final public static String PROP_USECACHE(Code)
The property value for setting the cache on/off. Value is .



SAVE_APPROVER
final public static String SAVE_APPROVER(Code)



SAVE_DECISION_MESSAGE_KEY
final public static String SAVE_DECISION_MESSAGE_KEY(Code)



SAVE_REJECT_MESSAGE_KEY
final public static String SAVE_REJECT_MESSAGE_KEY(Code)



SAVE_TASK_MESSAGE_KEY
final public static String SAVE_TASK_MESSAGE_KEY(Code)



log
static Logger log(Code)



m_pageLocks
protected HashMap m_pageLocks(Code)




Constructor Detail
PageManager
public PageManager(WikiEngine engine, Properties props) throws WikiException(Code)
Creates a new PageManager.
Parameters:
  engine - WikiEngine instance
Parameters:
  props - Properties to use for initialization
throws:
  WikiException - If anything goes wrong, you get this.




Method Detail
actionPerformed
public void actionPerformed(WikiEvent event)(Code)
Listens for com.ecyrd.jspwiki.event.WikiSecurityEvent.PROFILE_NAME_CHANGED events. If a user profile's name changes, each page ACL is inspected. If an entry contains a name that has changed, it is replaced with the new one. No events are emitted as a consequence of this method, because the page contents are still the same; it is only the representations of the names within the ACL that are changing.
Parameters:
  event - The event



changeAcl
protected boolean changeAcl(WikiPage page, Principal[] oldPrincipals, Principal newPrincipal)(Code)
For a single wiki page, replaces all Acl entries matching a supplied array of Principals with a new Principal.
Parameters:
  page - the wiki page whose Acl is to be modified
Parameters:
  oldPrincipals - an array of Principals to replace; all AclEntry objects whoseAclEntry.getPrincipal method returns one of these Principals will be replaced
Parameters:
  newPrincipal - the Principal that should receive the old Principals' permissions true if the Acl was actually changed; false otherwise



deletePage
public void deletePage(WikiPage page) throws ProviderException(Code)
Deletes an entire page, all versions, all traces.
Parameters:
  page - The WikiPage to delete
throws:
  ProviderException - If the repository operation fails



deleteVersion
public void deleteVersion(WikiPage page) throws ProviderException(Code)
Deletes only a specific version of a WikiPage.
Parameters:
  page - The page to delete.
throws:
  ProviderException - if the page fails



fireEvent
final protected void fireEvent(int type, String pagename)(Code)
Fires a WikiPageEvent of the provided type and page name to all registered listeners.
See Also:   com.ecyrd.jspwiki.event.WikiPageEvent
Parameters:
  type - the event type to be fired
Parameters:
  pagename - the wiki page name as a String



getActiveLocks
public List getActiveLocks()(Code)
Returns a list of currently applicable locks. Note that by the time you get the list, the locks may have already expired, so use this only for informational purposes. List of PageLock objects, detailing the locks. If no locks exist, returnsan empty list.
since:
   2.0.22.



getAllPages
public Collection getAllPages() throws ProviderException(Code)
Returns all pages in some random order. If you need just the page names, please see ReferenceManager.findCreated , which is probably a lot faster. This method may cause repository access. A Collection of WikiPage objects.
throws:
  ProviderException - If the backend has problems.



getCurrentLock
public PageLock getCurrentLock(WikiPage page)(Code)
Returns the current lock owner of a page. If the page is not locked, will return null.
Parameters:
  page - The page to check the lock for Current lock, or null, if there is no lock



getEngine
public WikiEngine getEngine()(Code)
Returns the WikiEngine to which this PageManager belongs to. The WikiEngine object.



getPageInfo
public WikiPage getPageInfo(String pageName, int version) throws ProviderException(Code)
Finds a WikiPage object describing a particular page and version.
Parameters:
  pageName - The name of the page
Parameters:
  version - A version number A WikiPage object, or null, if the page does not exist
throws:
  ProviderException - If there is something wrong with the page name or the repository



getPageText
public String getPageText(String pageName, int version) throws ProviderException(Code)
Fetches the page text from the repository. This method also does some sanity checks, like checking for the pageName validity, etc. Also, if the page repository has been modified externally, it is smart enough to handle such occurrences.
Parameters:
  pageName - The name of the page to fetch.
Parameters:
  version - The version to find The page content as a raw string
throws:
  ProviderException - If the backend has issues.



getProvider
public WikiPageProvider getProvider()(Code)
Returns the page provider currently in use. A WikiPageProvider instance.



getProviderDescription
public String getProviderDescription()(Code)
Returns a human-readable description of the current provider. A human-readable description.



getTotalPageCount
public int getTotalPageCount()(Code)
Returns the total count of all pages in the repository. This method is equivalent of calling getAllPages().size(), but it swallows the ProviderException and returns -1 instead of any problems. The number of pages, or -1, if there is an error.



getVersionHistory
public List getVersionHistory(String pageName) throws ProviderException(Code)
Gets a version history of page. Each element in the returned List is a WikiPage.
Parameters:
  pageName - The name of the page to fetch history for If the page does not exist, returns null, otherwise a Listof WikiPages.
throws:
  ProviderException - If the repository fails.



lockPage
public PageLock lockPage(WikiPage page, String user)(Code)
Locks page for editing. Note, however, that the PageManager will in no way prevent you from actually editing this page; the lock is just for information.
Parameters:
  page - WikiPage to lock
Parameters:
  user - Username to use for locking null, if page could not be locked.



modules
public Collection modules()(Code)



pageExists
public boolean pageExists(String pageName) throws ProviderException(Code)
Returns true, if the page exists (any version).
Parameters:
  pageName - Name of the page. A boolean value describing the existence of a page
throws:
  ProviderException - If the backend fails or the name is illegal.



pageExists
public boolean pageExists(String pageName, int version) throws ProviderException(Code)
Checks for existence of a specific page and version.
since:
   2.3.29
Parameters:
  pageName - Name of the page
Parameters:
  version - The version to check true if the page exists, false otherwise
throws:
  ProviderException - If backend fails or name is illegal



putPageText
public void putPageText(WikiPage page, String content) throws ProviderException(Code)
Puts the page text into the repository. Note that this method does NOT update JSPWiki internal data structures, and therefore you should always use WikiEngine.saveText()
Parameters:
  page - Page to save
Parameters:
  content - Wikimarkup to save
throws:
  ProviderException - If something goes wrong in the saving phase



unlockPage
public void unlockPage(PageLock lock)(Code)
Marks a page free to be written again. If there has not been a lock, will fail quietly.
Parameters:
  lock - A lock acquired in lockPage(). Safe to be null.



Fields inherited from com.ecyrd.jspwiki.modules.ModuleManager
final public static String LOAD_INCOMPATIBLE_MODULES(Code)(Java Doc)
final public static String PLUGIN_RESOURCE_LOCATION(Code)(Java Doc)
protected WikiEngine m_engine(Code)(Java Doc)

Methods inherited from com.ecyrd.jspwiki.modules.ModuleManager
public boolean checkCompatibility(WikiModuleInfo info)(Code)(Java Doc)
abstract public Collection modules()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.