Package org.apache.wiki.content
Class DefaultPageRenamer
- java.lang.Object
-
- org.apache.wiki.content.DefaultPageRenamer
-
- All Implemented Interfaces:
PageRenamer
public class DefaultPageRenamer extends java.lang.Object implements PageRenamer
Provides page renaming functionality. Note that there used to be a similarly named class in 2.6, but due to unclear copyright, the class was completely rewritten from scratch for 2.8.- Since:
- 2.8
-
-
Constructor Summary
Constructors Constructor Description DefaultPageRenamer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
firePageRenameEvent(java.lang.String oldName, java.lang.String newName)
Fires a WikiPageRenameEvent to all registered listeners.java.lang.String
renamePage(Context context, java.lang.String renameFrom, java.lang.String renameTo, boolean changeReferrers)
Renames a page.
-
-
-
Constructor Detail
-
DefaultPageRenamer
public DefaultPageRenamer()
-
-
Method Detail
-
renamePage
public java.lang.String renamePage(Context context, java.lang.String renameFrom, java.lang.String renameTo, boolean changeReferrers) throws WikiException
Renames a page.- Specified by:
renamePage
in interfacePageRenamer
- Parameters:
context
- The current context.renameFrom
- The name from which to rename.renameTo
- The new name.changeReferrers
- If true, also changes all the referrers.- Returns:
- The final new name (in case it had to be modified)
- Throws:
WikiException
- If the page cannot be renamed.
-
firePageRenameEvent
public void firePageRenameEvent(java.lang.String oldName, java.lang.String newName)
Fires a WikiPageRenameEvent to all registered listeners. Currently not used internally by JSPWiki itself, but you can use it for something else.- Specified by:
firePageRenameEvent
in interfacePageRenamer
- Parameters:
oldName
- the former page namenewName
- the new page name
-
-