Java Doc for WikiEngine.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.WikiEngine

All known Subclasses:   com.ecyrd.jspwiki.TestEngine,
WikiEngine
public class WikiEngine (Code)
Provides Wiki services to the JSP page.

This is the main interface through which everything should go.

Using this class: Always get yourself an instance from JSP page by using the WikiEngine.getInstance() method. Never create a new WikiEngine() from scratch, unless you're writing tests.

There's basically only a single WikiEngine for each web application, and you should always get it using the WikiEngine.getInstance() method.
author:
   Janne Jalkanen



Field Summary
final public static  StringPREFS_COOKIE_NAME
     The name of the cookie that gets stored to the user browser.
final public static  StringPROP_ACL_MANAGER_IMPL
     The name of the property containing the ACLManager implementing class. The value is .
final public static  StringPROP_APPNAME
    
final public static  StringPROP_BASEURL
     The name for the base URL to use in all references.
final public static  StringPROP_BEAUTIFYTITLE
     Property name for the "spaces in titles" -hack.
final public static  StringPROP_ENCODING
     Define the used encoding.
final public static  StringPROP_FRONTPAGE
     Property name for the default front page.
final public static  StringPROP_INTERWIKIREF
     Property start for any interwiki reference.
final public static  StringPROP_MATCHPLURALS
     Property name for the "match english plurals" -hack.
final public static  StringPROP_REFSTYLE
     The name for the property which allows you to set the current reference style.
final public static  StringPROP_RUNFILTERS
     If this property is set to false, all filters are disabled when translating.
final public static  StringPROP_STOREUSERNAME
     If true, then the user name will be stored with the page data.
final public static  StringPROP_TEMPLATEDIR
     Property name for the template that is used.
final public static  StringPROP_URLCONSTRUCTOR
    
final public static  StringPROP_WORKDIR
     Property name for where the jspwiki work directory should be. If not specified, reverts to ${java.tmpdir}.

Constructor Summary
public  WikiEngine(Properties properties)
     Instantiate the WikiEngine using a given set of properties.
protected  WikiEngine(ServletContext context, String appid, Properties props)
     Instantiate using this method when you're running as a servlet and WikiEngine will figure out where to look for the property file. Do not use this method - use WikiEngine.getInstance() instead.
Parameters:
  context - A ServletContext.
Parameters:
  appid - An Application ID.

Method Summary
final public synchronized  voidaddWikiEventListener(WikiEventListener listener)
     Registers a WikiEventListener with this instance.
public  StringbeautifyTitle(String title)
     Beautifies the title of the page by appending spaces in suitable places, if the user has so decreed in the properties when constructing this WikiEngine.
public  StringbeautifyTitleNoBreak(String title)
     Beautifies the title of the page by appending non-breaking spaces in suitable places.
public  WikiContextcreateContext(HttpServletRequest request, String requestContext)
     Shortcut to create a WikiContext from a supplied HTTP request, using a default wiki context.
public  StringdecodeName(String pagerequest)
     Decodes a URL-encoded request back to regular life.
public  voiddeletePage(String pageName)
     Deletes a page or an attachment completely, including all versions.
public  voiddeleteVersion(WikiPage page)
     Deletes a specific version of a page or an attachment.
public  StringencodeName(String pagename)
     Turns a WikiName into something that can be called through using an URL.
since:
   1.4.1
Parameters:
  pagename - A name.
public  CollectionfindPages(String query)
     Parses an incoming search request, then does a search.
final protected  voidfireEvent(int type)
     Fires a WikiEngineEvent to all registered listeners.
public  AclManagergetAclManager()
     Returns the AclManager employed by this WikiEngine.
public  AdminBeanManagergetAdminBeanManager()
     Returns the current AdminBeanManager.
public  CollectiongetAllInlinedImagePatterns()
     Returns a collection of all image types that get inlined.
public  CollectiongetAllInterWikiLinks()
     Returns a collection of all supported InterWiki links.
public  StringgetApplicationName()
     Returns the name of the application.
public  AttachmentManagergetAttachmentManager()
     Returns the current AttachmentManager, which is responsible for storing and managing attachments.
since:
   1.9.31.
public  StringgetAttachmentURL(String attName)
     Returns the basic attachment URL.Please use WikiContext.getURL() or WikiEngine.getURL() instead.
public  ObjectgetAttribute(String key)
     Gets an attribute from the engine.
public  AuthenticationManagergetAuthenticationManager()
     Returns the currently used authentication manager.
public  AuthorizationManagergetAuthorizationManager()
     Returns the currently used authorization manager.
public  StringgetBaseURL()
     Returns the base URL, telling where this Wiki actually lives.
public  CommandResolvergetCommandResolver()
     Returns the CommandResolver for this wiki engine.
public  StringgetContentEncoding()
     Returns the IANA name of the character set encoding we're supposed to be using right now.
public  StringgetCurrentProvider()
     Returns the provider name.
public  StringgetCurrentProviderInfo()
     Return information about current provider.
public  WatchDoggetCurrentWatchDog()
     Returns a WatchDog for current thread.
public  StringgetDiff(WikiContext context, int version1, int version2)
     Returns a diff of two versions of a page.

Note that the API was changed in 2.6 to provide a WikiContext object!
Parameters:
  context - The WikiContext of the page you wish to get a diff from
Parameters:
  version1 - Version number of the old page.

public  DifferenceManagergetDifferenceManager()
     Returns the DifferenceManager so that texts can be compared.
public  StringgetEditURL(String pageName)
     Returns the basic URL to an editor.
public  EditorManagergetEditorManager()
     Returns the current EditorManager instance.
public  FilterManagergetFilterManager()
     Returns the manager responsible for the filters.
public  StringgetFinalPageName(String page)
     Returns the correct page name, or null, if no such page can be found.
public  StringgetFrontPage()
     Returns the default front page, if no page is used.
public  StringgetGlobalRSSURL()
     Returns the URL of the global RSS file.
public  GroupManagergetGroupManager()
     Returns the GroupManager employed by this WikiEngine.
public  StringgetHTML(WikiContext context, WikiPage page)
     Returns the converted HTML of the page using a different context than the default context.
Parameters:
  context - A WikiContext in which you wish to render this page in.
Parameters:
  page - WikiPage reference.
public  StringgetHTML(String page)
     Returns the converted HTML of the page.
Parameters:
  page - WikiName of the page to convert.
public  StringgetHTML(String pagename, int version)
     Returns the converted HTML of the page's specific version.
public static synchronized  WikiEnginegetInstance(ServletConfig config)
     Gets a WikiEngine related to this servlet.
public static synchronized  WikiEnginegetInstance(ServletConfig config, Properties props)
     Gets a WikiEngine related to the servlet.
public static synchronized  WikiEnginegetInstance(ServletContext context, Properties props)
     Gets a WikiEngine related to the servlet.
public  StringgetInterWikiURL(String wikiName)
     Returns an URL to some other Wiki that we know.
Parameters:
  wikiName - The name of the other wiki.
public  InternationalizationManagergetInternationalizationManager()
     Returns the current i18n manager. The current Intertan...
public  WikiPagegetPage(String pagereq)
     Finds the corresponding WikiPage object based on the page name.
public  WikiPagegetPage(String pagereq, int version)
     Finds the corresponding WikiPage object base on the page name and version.
Parameters:
  pagereq - The name of the page to look for.
Parameters:
  version - The version number to look for.
public  intgetPageCount()
    
public  PageManagergetPageManager()
     Returns the current PageManager which is responsible for storing and managing WikiPages.
public  PageRenamergetPageRenamer()
     Returns the PageRenamer employed by this WikiEngine.
public  PluginManagergetPluginManager()
     Returns the current plugin manager.
public  StringgetPluginSearchPath()
     Don't use.
public  ProgressManagergetProgressManager()
    
public  StringgetPureText(String page, int version)
     Returns the pure text of a page, no conversions.
public  StringgetPureText(WikiPage page)
     Returns the pure text of a page, no conversions.
public  RSSGeneratorgetRSSGenerator()
    
public  CollectiongetRecentChanges()
     Returns a Collection of WikiPages, sorted in time order of last change (i.e.
public  StringgetRedirectURL(WikiContext context)
     Figure out to which page we are really going to.
public  ReferenceManagergetReferenceManager()
     Returns this object's ReferenceManager.
public  RenderingManagergetRenderingManager()
     Returns the current rendering manager for this wiki application.
public static  StringgetRequiredProperty(Properties props, String key)
     Throws an exception if a property is not found.
Parameters:
  props - A set of properties to search the key in.
Parameters:
  key - The key to look for.
public  StringgetRootPath()
     Returns the root path.
public  SearchManagergetSearchManager()
     Returns the manager responsible for searching the Wiki.
public  ServletContextgetServletContext()
     Returns the ServletContext that this particular WikiEngine was initialized with.
public  StringgetSpecialPageReference(String original)
    

If the page is a special page, then returns a direct URL to that page.

public  DategetStartTime()
     Returns the moment when this engine was started.
since:
   2.0.15.
public  StringgetTemplateDir()
     Returns the current template directory.
public  TemplateManagergetTemplateManager()
     Returns the current TemplateManager.
public  StringgetText(String page)
     Returns the un-HTMLized text of the latest version of a page. This method also replaces the < and & -characters with their respective HTML entities, thus making it suitable for inclusion on an HTML page.
public  StringgetText(String page, int version)
     Returns the un-HTMLized text of the given version of a page. This method also replaces the < and & -characters with their respective HTML entities, thus making it suitable for inclusion on an HTML page.
public  StringgetText(WikiContext context, WikiPage page)
     Returns the un-HTMLized text of the given version of a page in the given context.
public  StringgetURL(String context, String pageName, String params, boolean absolute)
     Returns an URL if a WikiContext is not available.
Parameters:
  context - The WikiContext (VIEW, EDIT, etc...)
Parameters:
  pageName - Name of the page, as usual
Parameters:
  params - List of parameters.
public  URLConstructorgetURLConstructor()
    
public  UserManagergetUserManager()
     Returns the UserManager employed by this WikiEngine.
public  StringgetVariable(WikiContext context, String name)
     Shortcut to getVariableManager().getValue().
public  VariableManagergetVariableManager()
     Returns the current variable manager.
public  ListgetVersionHistory(String page)
     Returns a Collection of WikiPages containing the version history of a page.
public  StringgetViewURL(String pageName)
    

Returns the basic absolute URL to a page, without any modifications.

public  PropertiesgetWikiProperties()
     Returns the set of properties that the WikiEngine was initialized with.
public  StringgetWorkDir()
     Returns the JSPWiki working directory set with "jspwiki.workDir".
public  WorkflowManagergetWorkflowManager()
     Returns the com.ecyrd.jspwiki.workflow.WorkflowManager associated with this WikiEngine.
public  voidinitReferenceManager()
     Initializes the reference manager.
public  booleanpageExists(String page)
     Returns true, if the requested page (or an alias) exists.
public  booleanpageExists(String page, int version)
     Returns true, if the requested page (or an alias) exists with the requested version.
public  booleanpageExists(WikiPage page)
     Returns true, if the requested page (or an alias) exists, with the specified version in the WikiPage.
Parameters:
  page - A WikiPage object describing the name and version.
public  ObjectremoveAttribute(String key)
     Removes an attribute.
Parameters:
  key - The key of the attribute to remove.
final public synchronized  voidremoveWikiEventListener(WikiEventListener listener)
     Un-registers a WikiEventListener with this instance.
public  StringrenamePage(WikiContext context, String renameFrom, String renameTo, boolean changeReferrers)
     Renames, or moves, a wiki page.
public  StringsafeGetParameter(ServletRequest request, String name)
     This is a safe version of the Servlet.Request.getParameter() routine.
public  StringsafeGetQueryString(HttpServletRequest request)
     Returns the query string (the portion after the question mark).
Parameters:
  request - The HTTP request to parse.
public  voidsaveText(WikiContext context, String text)
     Writes the WikiText of a page into the page repository.
protected  CollectionscanWikiLinks(WikiPage page, String pagedata)
     Reads a WikiPageful of data from a String and returns all links internal to this Wiki in a Collection.
public  voidsetAttribute(String key, Object value)
     Adds an attribute to the engine for the duration of this engine.
protected  voidshutdown()
     Protected method that signals that the WikiEngine will be shut down by the servlet container.
public  StringtextToHTML(WikiContext context, String pagedata)
     Converts raw page data to HTML.
public  StringtextToHTML(WikiContext context, String pagedata, StringTransmutator localLinkHook, StringTransmutator extLinkHook)
     Just convert WikiText to HTML.
public  StringtextToHTML(WikiContext context, String pagedata, StringTransmutator localLinkHook, StringTransmutator extLinkHook, StringTransmutator attLinkHook)
     Just convert WikiText to HTML.
public  voidupdateReferences(WikiPage page)
     Updates all references for the given page.

Field Detail
PREFS_COOKIE_NAME
final public static String PREFS_COOKIE_NAME(Code)
The name of the cookie that gets stored to the user browser.



PROP_ACL_MANAGER_IMPL
final public static String PROP_ACL_MANAGER_IMPL(Code)
The name of the property containing the ACLManager implementing class. The value is .



PROP_APPNAME
final public static String PROP_APPNAME(Code)
Property for application name



PROP_BASEURL
final public static String PROP_BASEURL(Code)
The name for the base URL to use in all references.



PROP_BEAUTIFYTITLE
final public static String PROP_BEAUTIFYTITLE(Code)
Property name for the "spaces in titles" -hack.



PROP_ENCODING
final public static String PROP_ENCODING(Code)
Define the used encoding. Currently supported are ISO-8859-1 and UTF-8



PROP_FRONTPAGE
final public static String PROP_FRONTPAGE(Code)
Property name for the default front page.



PROP_INTERWIKIREF
final public static String PROP_INTERWIKIREF(Code)
Property start for any interwiki reference.



PROP_MATCHPLURALS
final public static String PROP_MATCHPLURALS(Code)
Property name for the "match english plurals" -hack.



PROP_REFSTYLE
final public static String PROP_REFSTYLE(Code)
The name for the property which allows you to set the current reference style. The value is .



PROP_RUNFILTERS
final public static String PROP_RUNFILTERS(Code)
If this property is set to false, all filters are disabled when translating.



PROP_STOREUSERNAME
final public static String PROP_STOREUSERNAME(Code)
If true, then the user name will be stored with the page data.



PROP_TEMPLATEDIR
final public static String PROP_TEMPLATEDIR(Code)
Property name for the template that is used.



PROP_URLCONSTRUCTOR
final public static String PROP_URLCONSTRUCTOR(Code)
Property name for setting the url generator instance



PROP_WORKDIR
final public static String PROP_WORKDIR(Code)
Property name for where the jspwiki work directory should be. If not specified, reverts to ${java.tmpdir}.




Constructor Detail
WikiEngine
public WikiEngine(Properties properties) throws WikiException(Code)
Instantiate the WikiEngine using a given set of properties. Use this constructor for testing purposes only.
Parameters:
  properties - A set of properties to use to initialize this WikiEngine.
throws:
  WikiException - If the initialization fails.



WikiEngine
protected WikiEngine(ServletContext context, String appid, Properties props) throws WikiException(Code)
Instantiate using this method when you're running as a servlet and WikiEngine will figure out where to look for the property file. Do not use this method - use WikiEngine.getInstance() instead.
Parameters:
  context - A ServletContext.
Parameters:
  appid - An Application ID. This application is an unique random string whichis used to recognize this WikiEngine.
Parameters:
  props - The WikiEngine configuration.
throws:
  WikiException - If the WikiEngine construction fails.




Method Detail
addWikiEventListener
final public synchronized void addWikiEventListener(WikiEventListener listener)(Code)
Registers a WikiEventListener with this instance.
Parameters:
  listener - the event listener



beautifyTitle
public String beautifyTitle(String title)(Code)
Beautifies the title of the page by appending spaces in suitable places, if the user has so decreed in the properties when constructing this WikiEngine. However, attachment names are only beautified by the name.
Parameters:
  title - The title to beautify A beautified title (or, if beautification is off,returns the title without modification)
since:
   1.7.11



beautifyTitleNoBreak
public String beautifyTitleNoBreak(String title)(Code)
Beautifies the title of the page by appending non-breaking spaces in suitable places. This is really suitable only for HTML output, as it uses the &nbsp; -character.
Parameters:
  title - The title to beautify A beautified title.
since:
   2.1.127



createContext
public WikiContext createContext(HttpServletRequest request, String requestContext)(Code)
Shortcut to create a WikiContext from a supplied HTTP request, using a default wiki context.
Parameters:
  request - the HTTP request
Parameters:
  requestContext - the default context to use a new WikiContext object.
See Also:   com.ecyrd.jspwiki.ui.CommandResolver
See Also:   com.ecyrd.jspwiki.ui.Command
since:
   2.1.15.



decodeName
public String decodeName(String pagerequest)(Code)
Decodes a URL-encoded request back to regular life. This properly heeds the encoding as defined in the settings file.
Parameters:
  pagerequest - The URL-encoded string to decode A decoded string.
See Also:   WikiEngine.encodeName(String)



deletePage
public void deletePage(String pageName) throws ProviderException(Code)
Deletes a page or an attachment completely, including all versions. If the page does not exist, does nothing.
Parameters:
  pageName - The name of the page.
throws:
  ProviderException - If something goes wrong.



deleteVersion
public void deleteVersion(WikiPage page) throws ProviderException(Code)
Deletes a specific version of a page or an attachment.
Parameters:
  page - The page object.
throws:
  ProviderException - If something goes wrong.



encodeName
public String encodeName(String pagename)(Code)
Turns a WikiName into something that can be called through using an URL.
since:
   1.4.1
Parameters:
  pagename - A name. Can be actually any string. A properly encoded name.
See Also:   WikiEngine.decodeName(String)



findPages
public Collection findPages(String query) throws ProviderException, IOException(Code)
Parses an incoming search request, then does a search.

The query is dependent on the actual chosen search provider - each one of them has a language of its own.
Parameters:
  query - The query string A Collection of SearchResult objects.
throws:
  ProviderException - If the searching failed
throws:
  IOException - If the searching failed




fireEvent
final protected void fireEvent(int type)(Code)
Fires a WikiEngineEvent to all registered listeners.
Parameters:
  type - the event type



getAclManager
public AclManager getAclManager()(Code)
Returns the AclManager employed by this WikiEngine. The AclManager is lazily initialized.

The AclManager implementing class may be set by the System property WikiEngine.PROP_ACL_MANAGER_IMPL .


since:
   2.3 The current AclManager.



getAdminBeanManager
public AdminBeanManager getAdminBeanManager()(Code)
Returns the current AdminBeanManager. The current AdminBeanManager
since:
   2.6



getAllInlinedImagePatterns
public Collection getAllInlinedImagePatterns()(Code)
Returns a collection of all image types that get inlined. A Collection of Strings with a regexp pattern.



getAllInterWikiLinks
public Collection getAllInterWikiLinks()(Code)
Returns a collection of all supported InterWiki links. A Collection of Strings.



getApplicationName
public String getApplicationName()(Code)
Returns the name of the application. A string describing the name of this application.



getAttachmentManager
public AttachmentManager getAttachmentManager()(Code)
Returns the current AttachmentManager, which is responsible for storing and managing attachments.
since:
   1.9.31. The current AttachmentManager instance



getAttachmentURL
public String getAttachmentURL(String attName)(Code)
Returns the basic attachment URL.Please use WikiContext.getURL() or WikiEngine.getURL() instead.
See Also:   WikiEngine.getURL(String,String,String,boolean)
See Also:   WikiContext.getURL(StringString)
since:
   2.0.42.
Parameters:
  attName - Attachment name



getAttribute
public Object getAttribute(String key)(Code)
Gets an attribute from the engine.
Parameters:
  key - the attribute name the value



getAuthenticationManager
public AuthenticationManager getAuthenticationManager()(Code)
Returns the currently used authentication manager. The current AuthenticationManager instance.



getAuthorizationManager
public AuthorizationManager getAuthorizationManager()(Code)
Returns the currently used authorization manager. The current AuthorizationManager instance



getBaseURL
public String getBaseURL()(Code)
Returns the base URL, telling where this Wiki actually lives.
since:
   1.6.1 The Base URL.



getCommandResolver
public CommandResolver getCommandResolver()(Code)
Returns the CommandResolver for this wiki engine. the resolver



getContentEncoding
public String getContentEncoding()(Code)
Returns the IANA name of the character set encoding we're supposed to be using right now.
since:
   1.5.3 The content encoding (either UTF-8 or ISO-8859-1).



getCurrentProvider
public String getCurrentProvider()(Code)
Returns the provider name. The full class name of the current page provider.



getCurrentProviderInfo
public String getCurrentProviderInfo()(Code)
Return information about current provider. This method just calls the corresponding PageManager method, which in turn calls the provider method. A textual description of the current provider.
since:
   1.6.4



getCurrentWatchDog
public WatchDog getCurrentWatchDog()(Code)
Returns a WatchDog for current thread. The current thread WatchDog.
since:
   2.4.92



getDiff
public String getDiff(WikiContext context, int version1, int version2)(Code)
Returns a diff of two versions of a page.

Note that the API was changed in 2.6 to provide a WikiContext object!
Parameters:
  context - The WikiContext of the page you wish to get a diff from
Parameters:
  version1 - Version number of the old page. IfWikiPageProvider.LATEST_VERSION (-1), then uses current page.
Parameters:
  version2 - Version number of the new page. IfWikiPageProvider.LATEST_VERSION (-1), then uses current page. A HTML-ized difference between two pages. If there is no difference,returns an empty string.




getDifferenceManager
public DifferenceManager getDifferenceManager()(Code)
Returns the DifferenceManager so that texts can be compared. the difference manager



getEditURL
public String getEditURL(String pageName)(Code)
Returns the basic URL to an editor. Please use WikiContext.getURL() or WikiEngine.getURL() instead.
See Also:   WikiEngine.getURL(String,String,String,boolean)
See Also:   WikiContext.getURL(StringString)
since:
   2.0.3



getEditorManager
public EditorManager getEditorManager()(Code)
Returns the current EditorManager instance. The current EditorManager.



getFilterManager
public FilterManager getFilterManager()(Code)
Returns the manager responsible for the filters.
since:
   2.1.88 The current FilterManager instance



getFinalPageName
public String getFinalPageName(String page) throws ProviderException(Code)
Returns the correct page name, or null, if no such page can be found. Aliases are considered. This method simply delegates to com.ecyrd.jspwiki.ui.CommandResolver.getFinalPageName(String) .
since:
   2.0
Parameters:
  page - Page name. The rewritten page name, or null, if the page does not exist.
throws:
  ProviderException - If something goes wrong in the backend.



getFrontPage
public String getFrontPage()(Code)
Returns the default front page, if no page is used. The front page name.



getGlobalRSSURL
public String getGlobalRSSURL()(Code)
Returns the URL of the global RSS file. May be null, if the RSS file generation is not operational.
since:
   1.7.10 The global RSS url



getGroupManager
public GroupManager getGroupManager()(Code)
Returns the GroupManager employed by this WikiEngine.
since:
   2.3 The current GroupManager instance



getHTML
public String getHTML(WikiContext context, WikiPage page)(Code)
Returns the converted HTML of the page using a different context than the default context.
Parameters:
  context - A WikiContext in which you wish to render this page in.
Parameters:
  page - WikiPage reference. HTML-rendered version of the page.



getHTML
public String getHTML(String page)(Code)
Returns the converted HTML of the page.
Parameters:
  page - WikiName of the page to convert. HTML-rendered version of the page.



getHTML
public String getHTML(String pagename, int version)(Code)
Returns the converted HTML of the page's specific version. The version must be a positive integer, otherwise the current version is returned.
Parameters:
  pagename - WikiName of the page to convert.
Parameters:
  version - Version number to fetch HTML-rendered page text.



getInstance
public static synchronized WikiEngine getInstance(ServletConfig config) throws InternalWikiException(Code)
Gets a WikiEngine related to this servlet. Since this method is only called from JSP pages (and JspInit()) to be specific, we throw a RuntimeException if things don't work.
Parameters:
  config - The ServletConfig object for this servlet. A WikiEngine instance.
throws:
  InternalWikiException - in case something fails. Thisis a RuntimeException, so be prepared for it.



getInstance
public static synchronized WikiEngine getInstance(ServletConfig config, Properties props)(Code)
Gets a WikiEngine related to the servlet. Works like getInstance(ServletConfig), but does not force the Properties object. This method is just an optional way of initializing a WikiEngine for embedded JSPWiki applications; normally, you should use getInstance(ServletConfig).
Parameters:
  config - The ServletConfig of the webapp servlet/JSP calling this method.
Parameters:
  props - A set of properties, or null, if we are to load JSPWiki's defaultjspwiki.properties (this is the usual case). One well-behaving WikiEngine instance.



getInstance
public static synchronized WikiEngine getInstance(ServletContext context, Properties props) throws InternalWikiException(Code)
Gets a WikiEngine related to the servlet. Works just like getInstance( ServletConfig )
Parameters:
  context - The ServletContext of the webapp servlet/JSP calling this method.
Parameters:
  props - A set of properties, or null, if we are to load JSPWiki's defaultjspwiki.properties (this is the usual case). One fully functional, properly behaving WikiEngine.
throws:
  InternalWikiException - If the WikiEngine instantiation fails.



getInterWikiURL
public String getInterWikiURL(String wikiName)(Code)
Returns an URL to some other Wiki that we know.
Parameters:
  wikiName - The name of the other wiki. null, if no such reference was found.



getInternationalizationManager
public InternationalizationManager getInternationalizationManager()(Code)
Returns the current i18n manager. The current Intertan... Interante... Internatatializ... Whatever.



getPage
public WikiPage getPage(String pagereq)(Code)
Finds the corresponding WikiPage object based on the page name. It always finds the latest version of a page.
Parameters:
  pagereq - The name of the page to look for. A WikiPage object, or null, if the page by the name could not be found.



getPage
public WikiPage getPage(String pagereq, int version)(Code)
Finds the corresponding WikiPage object base on the page name and version.
Parameters:
  pagereq - The name of the page to look for.
Parameters:
  version - The version number to look for. May be WikiProvider.LATEST_VERSION,in which case it will look for the latest version (and this method then becomesthe equivalent of getPage(String). A WikiPage object, or null, if the page could not be found; or if thereis no such version of the page.
since:
   1.6.7.



getPageCount
public int getPageCount()(Code)
Returns the number of pages in this Wiki The total number of pages.



getPageManager
public PageManager getPageManager()(Code)
Returns the current PageManager which is responsible for storing and managing WikiPages. The current PageManager instance.



getPageRenamer
public PageRenamer getPageRenamer()(Code)
Returns the PageRenamer employed by this WikiEngine.
since:
   2.5.141 The current PageRenamer instance.



getPluginManager
public PluginManager getPluginManager()(Code)
Returns the current plugin manager.
since:
   1.6.1 The current PluginManager instance



getPluginSearchPath
public String getPluginSearchPath()(Code)
Don't use.
since:
   1.8.0



getProgressManager
public ProgressManager getProgressManager()(Code)
Returns the progress manager we're using A ProgressManager
since:
   2.6



getPureText
public String getPureText(String page, int version)(Code)
Returns the pure text of a page, no conversions. Use this if you are writing something that depends on the parsing of the page. Note that you should always check for page existence through pageExists() before attempting to fetch the page contents.
Parameters:
  page - The name of the page to fetch.
Parameters:
  version - If WikiPageProvider.LATEST_VERSION, then uses thelatest version. The page contents. If the page does not exist,returns an empty string.



getPureText
public String getPureText(WikiPage page)(Code)
Returns the pure text of a page, no conversions. Use this if you are writing something that depends on the parsing the page. Note that you should always check for page existence through pageExists() before attempting to fetch the page contents.
Parameters:
  page - A handle to the WikiPage String of WikiText.
since:
   2.1.13.



getRSSGenerator
public RSSGenerator getRSSGenerator()(Code)

since:
   2.1.165 the RSS generator



getRecentChanges
public Collection getRecentChanges()(Code)
Returns a Collection of WikiPages, sorted in time order of last change (i.e. first object is the most recently changed). This method also includes attachments. Collection of WikiPage objects. In reality, the returnedcollection is a Set, but due to API compatibility reasons,we're not changing the signature soon...



getRedirectURL
public String getRedirectURL(WikiContext context)(Code)
Figure out to which page we are really going to. Considers special page names from the jspwiki.properties, and possible aliases. This method delgates requests to com.ecyrd.jspwiki.WikiContext.getRedirectURL .
Parameters:
  context - The Wiki Context in which the request is being made. A complete URL to the new page to redirect to
since:
   2.2



getReferenceManager
public ReferenceManager getReferenceManager()(Code)
Returns this object's ReferenceManager. The current ReferenceManager instance.
since:
   1.6.1



getRenderingManager
public RenderingManager getRenderingManager()(Code)
Returns the current rendering manager for this wiki application.
since:
   2.3.27 A RenderingManager object.



getRequiredProperty
public static String getRequiredProperty(Properties props, String key) throws NoRequiredPropertyException(Code)
Throws an exception if a property is not found.
Parameters:
  props - A set of properties to search the key in.
Parameters:
  key - The key to look for. The required property
throws:
  NoRequiredPropertyException - If the search key is notin the property set.



getRootPath
public String getRootPath()(Code)
Returns the root path. The root path is where the WikiEngine is located in the file system.
since:
   2.2 A path to where the Wiki is installed in the local filesystem.



getSearchManager
public SearchManager getSearchManager()(Code)
Returns the manager responsible for searching the Wiki.
since:
   2.2.21 The current SearchManager instance



getServletContext
public ServletContext getServletContext()(Code)
Returns the ServletContext that this particular WikiEngine was initialized with. It may return null, if the WikiEngine is not running inside a servlet container!
since:
   1.7.10 ServletContext of the WikiEngine, or null.



getSpecialPageReference
public String getSpecialPageReference(String original)(Code)

If the page is a special page, then returns a direct URL to that page. Otherwise returns null. This method delegates requests to com.ecyrd.jspwiki.ui.CommandResolver.getSpecialPageReference(String) .

Special pages are defined in jspwiki.properties using the jspwiki.specialPage setting. They're typically used to give Wiki page names to e.g. custom JSP pages.


Parameters:
  original - The page to check A reference to the page, or null, if there's no special page.



getStartTime
public Date getStartTime()(Code)
Returns the moment when this engine was started.
since:
   2.0.15. The start time of this wiki.



getTemplateDir
public String getTemplateDir()(Code)
Returns the current template directory.
since:
   1.9.20 The template directory as initialized by the engine.



getTemplateManager
public TemplateManager getTemplateManager()(Code)
Returns the current TemplateManager. A TemplateManager instance.



getText
public String getText(String page)(Code)
Returns the un-HTMLized text of the latest version of a page. This method also replaces the < and & -characters with their respective HTML entities, thus making it suitable for inclusion on an HTML page. If you want to have the page text without any conversions, use getPureText().
Parameters:
  page - WikiName of the page to fetch. WikiText.



getText
public String getText(String page, int version)(Code)
Returns the un-HTMLized text of the given version of a page. This method also replaces the < and & -characters with their respective HTML entities, thus making it suitable for inclusion on an HTML page. If you want to have the page text without any conversions, use getPureText().
Parameters:
  page - WikiName of the page to fetch
Parameters:
  version - Version of the page to fetch WikiText.



getText
public String getText(WikiContext context, WikiPage page)(Code)
Returns the un-HTMLized text of the given version of a page in the given context. USE THIS METHOD if you don't know what doing.

This method also replaces the < and & -characters with their respective HTML entities, thus making it suitable for inclusion on an HTML page. If you want to have the page text without any conversions, use getPureText().
since:
   1.9.15.
Parameters:
  context - The WikiContext
Parameters:
  page - A page reference (not an attachment) The page content as HTMLized String.
See Also:   WikiEngine.getPureText(WikiPage)




getURL
public String getURL(String context, String pageName, String params, boolean absolute)(Code)
Returns an URL if a WikiContext is not available.
Parameters:
  context - The WikiContext (VIEW, EDIT, etc...)
Parameters:
  pageName - Name of the page, as usual
Parameters:
  params - List of parameters. May be null, if no parameters.
Parameters:
  absolute - If true, will generate an absolute URL regardless of properties setting. An URL (absolute or relative).



getURLConstructor
public URLConstructor getURLConstructor()(Code)

since:
   2.2.6 the URL constructor



getUserManager
public UserManager getUserManager()(Code)
Returns the UserManager employed by this WikiEngine.
since:
   2.3 The current UserManager instance.



getVariable
public String getVariable(WikiContext context, String name)(Code)
Shortcut to getVariableManager().getValue(). However, this method does not throw a NoSuchVariableException, but returns null in case the variable does not exist.
Parameters:
  context - WikiContext to look the variable in
Parameters:
  name - Name of the variable to look for Variable value, or null, if there is no such variable.
since:
   2.2



getVariableManager
public VariableManager getVariableManager()(Code)
Returns the current variable manager. The current VariableManager.



getVersionHistory
public List getVersionHistory(String page)(Code)
Returns a Collection of WikiPages containing the version history of a page.
Parameters:
  page - Name of the page to look for an ordered List of WikiPages, each corresponding to a differentrevision of the page.



getViewURL
public String getViewURL(String pageName)(Code)

Returns the basic absolute URL to a page, without any modifications. You may add any parameters to this.

Since 2.3.90 it is safe to call this method with null pageName, in which case it will default to the front page.


since:
   2.0.3
Parameters:
  pageName - The name of the page. May be null, in which case defaults to the front page. An absolute URL to the page.



getWikiProperties
public Properties getWikiProperties()(Code)
Returns the set of properties that the WikiEngine was initialized with. Note that this method returns a direct reference, so it's possible to manipulate the properties. However, this is not advised unless you really know what you're doing. The wiki properties



getWorkDir
public String getWorkDir()(Code)
Returns the JSPWiki working directory set with "jspwiki.workDir".
since:
   2.1.100 The working directory.



getWorkflowManager
public WorkflowManager getWorkflowManager()(Code)
Returns the com.ecyrd.jspwiki.workflow.WorkflowManager associated with this WikiEngine. If the WIkiEngine has not been initialized, this method will return null. the task queue



initReferenceManager
public void initReferenceManager() throws WikiException(Code)
Initializes the reference manager. Scans all existing WikiPages for internal links and adds them to the ReferenceManager object.
throws:
  WikiException - If the reference manager initialization fails.



pageExists
public boolean pageExists(String page)(Code)
Returns true, if the requested page (or an alias) exists. Will consider any version as existing. Will also consider attachments.
Parameters:
  page - WikiName of the page. true, if page (or attachment) exists.



pageExists
public boolean pageExists(String page, int version) throws ProviderException(Code)
Returns true, if the requested page (or an alias) exists with the requested version.
Parameters:
  page - Page name
Parameters:
  version - Page version True, if page (or alias, or attachment) exists
throws:
  ProviderException - If the provider fails.



pageExists
public boolean pageExists(WikiPage page) throws ProviderException(Code)
Returns true, if the requested page (or an alias) exists, with the specified version in the WikiPage.
Parameters:
  page - A WikiPage object describing the name and version. true, if the page (or alias, or attachment) exists.
throws:
  ProviderException - If something goes badly wrong.
since:
   2.0



removeAttribute
public Object removeAttribute(String key)(Code)
Removes an attribute.
Parameters:
  key - The key of the attribute to remove. The previous attribute, if it existed.



removeWikiEventListener
final public synchronized void removeWikiEventListener(WikiEventListener listener)(Code)
Un-registers a WikiEventListener with this instance.
Parameters:
  listener - the event listener



renamePage
public String renamePage(WikiContext context, String renameFrom, String renameTo, boolean changeReferrers) throws WikiException(Code)
Renames, or moves, a wiki page. Can also alter referring wiki links to point to the renamed page.
Parameters:
  context - The context during which this rename takesplace.
Parameters:
  renameFrom - Name of the source page.
Parameters:
  renameTo - Name of the destination page.
Parameters:
  changeReferrers - If true, then changes any referring linksto point to the renamed page. The name of the page that the source was renamed to.
throws:
  WikiException - In the case of an error, such as the destinationpage already existing.



safeGetParameter
public String safeGetParameter(ServletRequest request, String name)(Code)
This is a safe version of the Servlet.Request.getParameter() routine. Unfortunately, the default version always assumes that the incoming character set is ISO-8859-1, even though it was something else. This means that we need to make a new string using the correct encoding.

For more information, see: JGuru FAQ.

Incidentally, this is almost the same as encodeName(), below. I am not yet entirely sure if it's safe to merge the code.
since:
   1.5.3




safeGetQueryString
public String safeGetQueryString(HttpServletRequest request)(Code)
Returns the query string (the portion after the question mark).
Parameters:
  request - The HTTP request to parse. The query string. If the query string is null,returns an empty string.
since:
   2.1.3



saveText
public void saveText(WikiContext context, String text) throws WikiException(Code)
Writes the WikiText of a page into the page repository. If the jspwiki.properties file contains the property jspwiki.approver.workflow.saveWikiPage and its value resolves to a valid user, com.ecyrd.jspwiki.auth.authorize.Group or com.ecyrd.jspwiki.auth.authorize.Role , this method will place a com.ecyrd.jspwiki.workflow.Decision in the approver's workflow inbox and throw a com.ecyrd.jspwiki.workflow.DecisionRequiredException . If the submitting user is authenticated and the page save is rejected, a notification will be placed in the user's decision queue.
since:
   2.1.28
Parameters:
  context - The current WikiContext
Parameters:
  text - The Wiki markup for the page.
throws:
  WikiException - if the save operation encounters an error during thesave operation. If the page-save operation requires approval, the exception willbe of type com.ecyrd.jspwiki.workflow.DecisionRequiredException. IndividualPageFilters, such as the com.ecyrd.jspwiki.filters.SpamFilter may alsothrow a com.ecyrd.jspwiki.filters.RedirectException.



scanWikiLinks
protected Collection scanWikiLinks(WikiPage page, String pagedata)(Code)
Reads a WikiPageful of data from a String and returns all links internal to this Wiki in a Collection.
Parameters:
  page - The WikiPage to scan
Parameters:
  pagedata - The page contents a Collection of Strings



setAttribute
public void setAttribute(String key, Object value)(Code)
Adds an attribute to the engine for the duration of this engine. The value is not persisted.
since:
   2.4.91
Parameters:
  key - the attribute name
Parameters:
  value - the value



shutdown
protected void shutdown()(Code)
Protected method that signals that the WikiEngine will be shut down by the servlet container. It is called by WikiServlet.destroy . When this method is called, it fires a "shutdown" WikiEngineEvent to all registered listeners.



textToHTML
public String textToHTML(WikiContext context, String pagedata)(Code)
Converts raw page data to HTML.
Parameters:
  pagedata - Raw page data to convert to HTML
Parameters:
  context - The WikiContext in which the page is to be rendered Rendered page text



textToHTML
public String textToHTML(WikiContext context, String pagedata, StringTransmutator localLinkHook, StringTransmutator extLinkHook)(Code)
Just convert WikiText to HTML.
Parameters:
  context - The WikiContext in which to do the conversion
Parameters:
  pagedata - The data to render
Parameters:
  localLinkHook - Is called whenever a wiki link is found
Parameters:
  extLinkHook - Is called whenever an external link is found HTML-rendered page text.



textToHTML
public String textToHTML(WikiContext context, String pagedata, StringTransmutator localLinkHook, StringTransmutator extLinkHook, StringTransmutator attLinkHook)(Code)
Just convert WikiText to HTML.
Parameters:
  context - The WikiContext in which to do the conversion
Parameters:
  pagedata - The data to render
Parameters:
  localLinkHook - Is called whenever a wiki link is found
Parameters:
  extLinkHook - Is called whenever an external link is found
Parameters:
  attLinkHook - Is called whenever an attachment link is found HTML-rendered page text.



updateReferences
public void updateReferences(WikiPage page)(Code)
Updates all references for the given page.
Parameters:
  page - wiki page for which references should be updated



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.