|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.server.io.DefaultHandler
org.apache.jackrabbit.server.io.XmlHandler
public class XmlHandler
XmlHandler imports xml files and exports nodes that have
the proper XML_MIMETYPE defined with their content. The export is
performed by running a document view export for the content of the export root defined with the
specified ExportContext.
Please note that this handler is not suited for a generic system or document
view import/export of Nodes because an extra root node is always
created during import and expected during export, respectively.
| Field Summary | |
|---|---|
static String |
XML_MIMETYPE
the xml mimetype |
| Constructor Summary | |
|---|---|
XmlHandler()
Creates a new XmlHandler with default nodetype definitions
and without setting the IOManager. |
|
XmlHandler(IOManager ioManager)
Creates a new XmlHandler with default nodetype definitions:Nodetype for Collection: nt:unstructured
Nodetype for Non-Collection: nt:file
Nodetype for Non-Collection content: nt:unstructured
|
|
XmlHandler(IOManager ioManager,
String collectionNodetype,
String defaultNodetype,
String contentNodetype)
Creates a new XmlHandler |
|
| Method Summary | |
|---|---|
boolean |
canExport(ExportContext context,
boolean isCollection)
Returns true if the export root is a node and if it contains a child node with name jcr:content in case this
export is not intended for a collection. |
boolean |
canImport(ImportContext context,
boolean isCollection)
Returns true, if this handler can run a successful import based on the specified context. |
protected void |
exportData(ExportContext context,
boolean isCollection,
javax.jcr.Node contentNode)
Checks if the given content node contains a jcr:data property and spools its value to the output stream of the export context. |
protected void |
exportProperties(ExportContext context,
boolean isCollection,
javax.jcr.Node contentNode)
Retrieves mimetype, encoding and modification time from the content node. |
protected boolean |
forceCompatibleContentNodes()
Defines if content nodes should be replace if they don't have the node type given by DefaultHandler.getCollectionNodeType(). |
protected boolean |
importData(ImportContext context,
boolean isCollection,
javax.jcr.Node contentNode)
Imports the data present on the import context to the specified content node. |
protected boolean |
importProperties(ImportContext context,
boolean isCollection,
javax.jcr.Node contentNode)
Imports the properties present on the specified context to the content node. |
| Methods inherited from class org.apache.jackrabbit.server.io.DefaultHandler |
|---|
canExport, canExport, canImport, canImport, exportContent, exportContent, exportProperties, getCollectionNodeType, getContentNode, getContentNode, getContentNodeType, getIOManager, getName, getNodeType, importContent, importContent, importProperties, setIOManager |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String XML_MIMETYPE
| Constructor Detail |
|---|
public XmlHandler()
XmlHandler with default nodetype definitions
and without setting the IOManager.
IOHandler.setIOManager(IOManager)public XmlHandler(IOManager ioManager)
XmlHandler with default nodetype definitions:nt:unstructurednt:filent:unstructured
ioManager -
public XmlHandler(IOManager ioManager,
String collectionNodetype,
String defaultNodetype,
String contentNodetype)
XmlHandler
ioManager - collectionNodetype - defaultNodetype - contentNodetype - | Method Detail |
|---|
public boolean canImport(ImportContext context,
boolean isCollection)
IOHandler
canImport in interface IOHandlercanImport in class DefaultHandlerIOHandler.canImport(ImportContext, boolean)
protected boolean importData(ImportContext context,
boolean isCollection,
javax.jcr.Node contentNode)
throws IOException,
javax.jcr.RepositoryException
DefaultHandler
importData in class DefaultHandlerIOException
javax.jcr.RepositoryExceptionDefaultHandler.importData(ImportContext, boolean, Node)
protected boolean importProperties(ImportContext context,
boolean isCollection,
javax.jcr.Node contentNode)
DefaultHandler
importProperties in class DefaultHandlerDefaultHandler.importProperties(ImportContext, boolean, Node)protected boolean forceCompatibleContentNodes()
DefaultHandler.getCollectionNodeType().
forceCompatibleContentNodes in class DefaultHandlertrue, always.
public boolean canExport(ExportContext context,
boolean isCollection)
DefaultHandlerjcr:content in case this
export is not intended for a collection.
canExport in interface IOHandlercanExport in class DefaultHandlerjcr:content.IOHandler.canExport(ExportContext, boolean)
protected void exportData(ExportContext context,
boolean isCollection,
javax.jcr.Node contentNode)
throws IOException,
javax.jcr.RepositoryException
DefaultHandlerexportData method.
exportData in class DefaultHandlercontext - export contextisCollection - true if collectioncontentNode - the content node
IOException - if an I/O error occurs
javax.jcr.RepositoryExceptionDefaultHandler.exportData(ExportContext, boolean, Node)
protected void exportProperties(ExportContext context,
boolean isCollection,
javax.jcr.Node contentNode)
throws IOException
DefaultHandler
exportProperties in class DefaultHandlercontext - the export contextisCollection - true if collectioncontentNode - the content node
IOExceptionDefaultHandler.exportProperties(ExportContext, boolean, Node)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||