|
|||||||||||
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
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(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 fo 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 |
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, canImport, exportContent, exportContent, getCollectionNodeType, getContentNode, getContentNode, getContentNodeType, getIOManager, getName, getNodeType, importContent, importContent |
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(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
context
- isCollection
- contentNode
-
IOException
RepositoryException
DefaultHandler.importData(ImportContext, boolean, Node)
protected boolean importProperties(ImportContext context, boolean isCollection, Node contentNode)
DefaultHandler
importProperties
in class DefaultHandler
context
- isCollection
- contentNode
-
DefaultHandler.importProperties(ImportContext, boolean, Node)
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
- isCollection
- contentNode
-
IOException
RepositoryException
DefaultHandler.exportData(ExportContext, boolean, Node)
protected void exportProperties(ExportContext context, boolean isCollection, Node contentNode) throws IOException
DefaultHandler
exportProperties
in class DefaultHandler
context
- isCollection
- contentNode
-
IOException
DefaultHandler.exportProperties(ExportContext, boolean, Node)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |