Package org.apache.wiki.content

# Interface PageRenamer

All Known Implementing Classes:
  `DefaultPageRenamer`

public interface 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

## Method Summary

Modifier and Type
Method
Description
`void`
`firePageRenameEvent(String oldName, String newName, org.apache.wiki.api.core.Context context)`
Fires a WikiPageRenameEvent to all registered listeners.
`String`
`renamePage(org.apache.wiki.api.core.Context context, String renameFrom, String renameTo, boolean changeReferrers)`
Renames a page.

## Method Details

### renamePage

String renamePage(org.apache.wiki.api.core.Context context, String renameFrom, String renameTo, boolean changeReferrers) throws org.apache.wiki.api.exceptions.WikiException
Renames a page.

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:
  `org.apache.wiki.api.exceptions.WikiException` - If the page cannot be renamed.

### firePageRenameEvent

void firePageRenameEvent(String oldName, String newName, org.apache.wiki.api.core.Context context)
Fires a WikiPageRenameEvent to all registered listeners. Currently not used internally by JSPWiki itself, but you can use it for something else.

Parameters:
  `oldName` - the former page name
  `newName` - the new page name
  `context` - WikiContext