com.xpn.xwiki.tool.doc
Class AbstractDocumentMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
com.xpn.xwiki.tool.doc.AbstractDocumentMojo
- All Implemented Interfaces:
- org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
- AttachMojo
public abstract class AbstractDocumentMojo
- extends org.apache.maven.plugin.AbstractMojo
An abstract Mojo that knows how to load a XWikiDocument from XML and to write XML from a XWikiDocument
- Version:
- $Id: 55cf250f527cfebbe14df6bbf4ea783fff496e8f $
| Fields inherited from interface org.apache.maven.plugin.Mojo |
ROLE |
| Methods inherited from class org.apache.maven.plugin.AbstractMojo |
getLog, getPluginContext, setLog, setPluginContext |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.maven.plugin.Mojo |
execute |
sourceDocument
protected File sourceDocument
- The document to perform the update on
outputDirectory
protected File outputDirectory
- The target directory to write the document back to
AbstractDocumentMojo
public AbstractDocumentMojo()
throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
createXWikiContext
protected XWikiContext createXWikiContext()
throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
loadFromXML
protected XWikiDocument loadFromXML(File file)
throws org.apache.maven.plugin.MojoExecutionException
- Loads a XWikiDocument from a XML file
- Parameters:
file - the xml file to load
- Returns:
- the XWiki document loaded from XML
- Throws:
org.apache.maven.plugin.MojoExecutionException
writeToXML
protected void writeToXML(XWikiDocument doc,
File file)
throws org.apache.maven.plugin.MojoExecutionException
- Write a XWiki document to a XML file, without rendering and without versions.
- Parameters:
doc - the document to write XML forfile - the file to write the document to
- Throws:
org.apache.maven.plugin.MojoExecutionException
getSpaceDirectory
protected File getSpaceDirectory(File directory,
File document)
throws org.apache.maven.plugin.MojoExecutionException
- Return the space directory as a File for a given document in a given directory, creating the directories on the
fly if the do not exists
- Parameters:
document - the document to get space fordirectory - the directory in which the space will be written
- Returns:
- the space as a File
- Throws:
org.apache.maven.plugin.MojoExecutionException
Copyright © 2004-2013 XWiki. All Rights Reserved.