|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 Node
s 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,
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. Please note, that subclasses that define a different structure of the content node should create their own exportData method. |
protected void |
exportProperties(ExportContext context,
boolean isCollection,
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,
Node contentNode)
Imports the data present on the import context to the specified content node. |
protected boolean |
importProperties(ImportContext context,
boolean isCollection,
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, detect, 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:unstructured
nt:file
nt: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 IOHandler
canImport
in class DefaultHandler
IOHandler.canImport(ImportContext, boolean)
protected boolean importData(ImportContext context, boolean isCollection, Node contentNode) throws IOException, RepositoryException
DefaultHandler
importData
in class DefaultHandler
IOException
RepositoryException
DefaultHandler.importData(ImportContext, boolean, Node)
protected boolean importProperties(ImportContext context, boolean isCollection, Node contentNode)
DefaultHandler
importProperties
in class DefaultHandler
DefaultHandler.importProperties(ImportContext, boolean, Node)
protected boolean forceCompatibleContentNodes()
DefaultHandler.getCollectionNodeType()
.
forceCompatibleContentNodes
in class DefaultHandler
true
, always.public boolean canExport(ExportContext context, boolean isCollection)
DefaultHandler
jcr:content
in case this
export is not intended for a collection.
canExport
in interface IOHandler
canExport
in class DefaultHandler
jcr:content
.IOHandler.canExport(ExportContext, boolean)
protected void exportData(ExportContext context, boolean isCollection, Node contentNode) throws IOException, RepositoryException
DefaultHandler
exportData
method.
exportData
in class DefaultHandler
context
- export contextisCollection
- true
if collectioncontentNode
- the content node
IOException
- if an I/O error occurs
RepositoryException
DefaultHandler.exportData(ExportContext, boolean, Node)
protected void exportProperties(ExportContext context, boolean isCollection, Node contentNode) throws IOException
DefaultHandler
exportProperties
in class DefaultHandler
context
- the export contextisCollection
- true
if collectioncontentNode
- the content node
IOException
DefaultHandler.exportProperties(ExportContext, boolean, Node)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |