org.exoplatform.services.jcr.rmi.api.xml
Class SessionImportContentHandler

java.lang.Object
  extended by org.exoplatform.services.jcr.rmi.api.xml.ImportContentHandler
      extended by org.exoplatform.services.jcr.rmi.api.xml.SessionImportContentHandler
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.ErrorHandler

public class SessionImportContentHandler
extends ImportContentHandler

SAX content handler for importing XML data to a JCR Session. This utility class can be used to implement the Session.getImportContentHandler(String, int) method in terms of the Session.importXML(String, InputStream, int) method.


Constructor Summary
SessionImportContentHandler(javax.jcr.Session session, java.lang.String path, int uuidBehaviour)
          Creates a SAX content handler for importing XML data to the given session and path.
 
Method Summary
protected  void importXML(byte[] xml)
          Imports the serialized XML stream using the standard Session.importXML(String, InputStream, int) method.
 
Methods inherited from class org.exoplatform.services.jcr.rmi.api.xml.ImportContentHandler
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionImportContentHandler

public SessionImportContentHandler(javax.jcr.Session session,
                                   java.lang.String path,
                                   int uuidBehaviour)
                            throws javax.jcr.version.VersionException,
                                   javax.jcr.nodetype.ConstraintViolationException,
                                   javax.jcr.lock.LockException,
                                   javax.jcr.RepositoryException
Creates a SAX content handler for importing XML data to the given session and path.

Parameters:
session - repository session
path - import content path
uuidBehaviour - UUID behaviour mode
Throws:
javax.jcr.RepositoryException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.version.VersionException
Method Detail

importXML

protected void importXML(byte[] xml)
                  throws javax.jcr.PathNotFoundException,
                         javax.jcr.ItemExistsException,
                         javax.jcr.nodetype.ConstraintViolationException,
                         javax.jcr.version.VersionException,
                         javax.jcr.InvalidSerializedDataException,
                         javax.jcr.lock.LockException,
                         java.io.IOException,
                         javax.jcr.RepositoryException
Imports the serialized XML stream using the standard Session.importXML(String, InputStream, int) method. Imports the given XML data. This method is called by the endDocument() method after the received XML stream has been serialized.

Subclasses must implement this method to provide the actual import mechanism.

Specified by:
importXML in class ImportContentHandler
Parameters:
xml - the XML data to import
Throws:
javax.jcr.RepositoryException
java.io.IOException
javax.jcr.lock.LockException
javax.jcr.InvalidSerializedDataException
javax.jcr.version.VersionException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.ItemExistsException
javax.jcr.PathNotFoundException


Copyright © 2010 eXo Platform SAS. All Rights Reserved.