Search in sources :

Example 1 with ToXmlContentHandler

use of org.apache.jackrabbit.commons.xml.ToXmlContentHandler in project jackrabbit-oak by apache.

the class SessionImpl method exportSystemView.

@Override
public void exportSystemView(String absPath, OutputStream out, boolean skipBinary, boolean noRecurse) throws IOException, RepositoryException {
    try {
        ContentHandler handler = new ToXmlContentHandler(checkNotNull(out));
        export(checkNotNull(absPath), new SystemViewExporter(this, handler, !noRecurse, !skipBinary));
    } catch (SAXException e) {
        Exception exception = e.getException();
        if (exception instanceof RepositoryException) {
            throw (RepositoryException) exception;
        } else if (exception instanceof IOException) {
            throw (IOException) exception;
        } else {
            throw new RepositoryException("Error serializing system view XML", e);
        }
    }
}
Also used : SystemViewExporter(org.apache.jackrabbit.commons.xml.SystemViewExporter) ToXmlContentHandler(org.apache.jackrabbit.commons.xml.ToXmlContentHandler) RepositoryException(javax.jcr.RepositoryException) IOException(java.io.IOException) ContentHandler(org.xml.sax.ContentHandler) ParsingContentHandler(org.apache.jackrabbit.commons.xml.ParsingContentHandler) ToXmlContentHandler(org.apache.jackrabbit.commons.xml.ToXmlContentHandler) ConstraintViolationException(javax.jcr.nodetype.ConstraintViolationException) InvalidSerializedDataException(javax.jcr.InvalidSerializedDataException) ItemNotFoundException(javax.jcr.ItemNotFoundException) SAXException(org.xml.sax.SAXException) AccessControlException(java.security.AccessControlException) AccessDeniedException(javax.jcr.AccessDeniedException) PathNotFoundException(javax.jcr.PathNotFoundException) RepositoryException(javax.jcr.RepositoryException) IOException(java.io.IOException) UnsupportedRepositoryOperationException(javax.jcr.UnsupportedRepositoryOperationException) SAXException(org.xml.sax.SAXException)

Example 2 with ToXmlContentHandler

use of org.apache.jackrabbit.commons.xml.ToXmlContentHandler in project jackrabbit-oak by apache.

the class SessionImpl method exportDocumentView.

@Override
public void exportDocumentView(String absPath, OutputStream out, boolean skipBinary, boolean noRecurse) throws IOException, RepositoryException {
    try {
        ContentHandler handler = new ToXmlContentHandler(checkNotNull(out));
        export(checkNotNull(absPath), new DocumentViewExporter(this, handler, !noRecurse, !skipBinary));
    } catch (SAXException e) {
        Exception exception = e.getException();
        if (exception instanceof RepositoryException) {
            throw (RepositoryException) exception;
        } else if (exception instanceof IOException) {
            throw (IOException) exception;
        } else {
            throw new RepositoryException("Error serializing document view XML", e);
        }
    }
}
Also used : DocumentViewExporter(org.apache.jackrabbit.commons.xml.DocumentViewExporter) ToXmlContentHandler(org.apache.jackrabbit.commons.xml.ToXmlContentHandler) RepositoryException(javax.jcr.RepositoryException) IOException(java.io.IOException) ContentHandler(org.xml.sax.ContentHandler) ParsingContentHandler(org.apache.jackrabbit.commons.xml.ParsingContentHandler) ToXmlContentHandler(org.apache.jackrabbit.commons.xml.ToXmlContentHandler) ConstraintViolationException(javax.jcr.nodetype.ConstraintViolationException) InvalidSerializedDataException(javax.jcr.InvalidSerializedDataException) ItemNotFoundException(javax.jcr.ItemNotFoundException) SAXException(org.xml.sax.SAXException) AccessControlException(java.security.AccessControlException) AccessDeniedException(javax.jcr.AccessDeniedException) PathNotFoundException(javax.jcr.PathNotFoundException) RepositoryException(javax.jcr.RepositoryException) IOException(java.io.IOException) UnsupportedRepositoryOperationException(javax.jcr.UnsupportedRepositoryOperationException) SAXException(org.xml.sax.SAXException)

Example 3 with ToXmlContentHandler

use of org.apache.jackrabbit.commons.xml.ToXmlContentHandler in project jackrabbit by apache.

the class AbstractSession method exportDocumentView.

/**
 * Calls {@link Session#exportDocumentView(String, ContentHandler, boolean, boolean)}
 * with the given arguments and a {@link ContentHandler} that serializes
 * SAX events to the given output stream.
 *
 * @param absPath passed through
 * @param out output stream to which the SAX events are serialized
 * @param skipBinary passed through
 * @param noRecurse passed through
 * @throws IOException if the SAX serialization failed
 * @throws RepositoryException if another error occurs
 */
public void exportDocumentView(String absPath, OutputStream out, boolean skipBinary, boolean noRecurse) throws IOException, RepositoryException {
    try {
        ContentHandler handler = new ToXmlContentHandler(out);
        exportDocumentView(absPath, handler, skipBinary, noRecurse);
    } catch (SAXException e) {
        Exception exception = e.getException();
        if (exception instanceof RepositoryException) {
            throw (RepositoryException) exception;
        } else if (exception instanceof IOException) {
            throw (IOException) exception;
        } else {
            throw new RepositoryException("Error serializing document view XML", e);
        }
    }
}
Also used : ToXmlContentHandler(org.apache.jackrabbit.commons.xml.ToXmlContentHandler) RepositoryException(javax.jcr.RepositoryException) IOException(java.io.IOException) ContentHandler(org.xml.sax.ContentHandler) ParsingContentHandler(org.apache.jackrabbit.commons.xml.ParsingContentHandler) ToXmlContentHandler(org.apache.jackrabbit.commons.xml.ToXmlContentHandler) PathNotFoundException(javax.jcr.PathNotFoundException) RepositoryException(javax.jcr.RepositoryException) InvalidSerializedDataException(javax.jcr.InvalidSerializedDataException) NamespaceException(javax.jcr.NamespaceException) IOException(java.io.IOException) SAXException(org.xml.sax.SAXException) SAXException(org.xml.sax.SAXException)

Example 4 with ToXmlContentHandler

use of org.apache.jackrabbit.commons.xml.ToXmlContentHandler in project jackrabbit by apache.

the class AbstractSession method exportSystemView.

/**
 * Calls {@link Session#exportSystemView(String, ContentHandler, boolean, boolean)}
 * with the given arguments and a {@link ContentHandler} that serializes
 * SAX events to the given output stream.
 *
 * @param absPath passed through
 * @param out output stream to which the SAX events are serialized
 * @param skipBinary passed through
 * @param noRecurse passed through
 * @throws IOException if the SAX serialization failed
 * @throws RepositoryException if another error occurs
 */
public void exportSystemView(String absPath, OutputStream out, boolean skipBinary, boolean noRecurse) throws IOException, RepositoryException {
    try {
        ContentHandler handler = new ToXmlContentHandler(out);
        exportSystemView(absPath, handler, skipBinary, noRecurse);
    } catch (SAXException e) {
        Exception exception = e.getException();
        if (exception instanceof RepositoryException) {
            throw (RepositoryException) exception;
        } else if (exception instanceof IOException) {
            throw (IOException) exception;
        } else {
            throw new RepositoryException("Error serializing system view XML", e);
        }
    }
}
Also used : ToXmlContentHandler(org.apache.jackrabbit.commons.xml.ToXmlContentHandler) RepositoryException(javax.jcr.RepositoryException) IOException(java.io.IOException) ContentHandler(org.xml.sax.ContentHandler) ParsingContentHandler(org.apache.jackrabbit.commons.xml.ParsingContentHandler) ToXmlContentHandler(org.apache.jackrabbit.commons.xml.ToXmlContentHandler) PathNotFoundException(javax.jcr.PathNotFoundException) RepositoryException(javax.jcr.RepositoryException) InvalidSerializedDataException(javax.jcr.InvalidSerializedDataException) NamespaceException(javax.jcr.NamespaceException) IOException(java.io.IOException) SAXException(org.xml.sax.SAXException) SAXException(org.xml.sax.SAXException)

Aggregations

IOException (java.io.IOException)4 InvalidSerializedDataException (javax.jcr.InvalidSerializedDataException)4 PathNotFoundException (javax.jcr.PathNotFoundException)4 RepositoryException (javax.jcr.RepositoryException)4 ParsingContentHandler (org.apache.jackrabbit.commons.xml.ParsingContentHandler)4 ToXmlContentHandler (org.apache.jackrabbit.commons.xml.ToXmlContentHandler)4 ContentHandler (org.xml.sax.ContentHandler)4 SAXException (org.xml.sax.SAXException)4 AccessControlException (java.security.AccessControlException)2 AccessDeniedException (javax.jcr.AccessDeniedException)2 ItemNotFoundException (javax.jcr.ItemNotFoundException)2 NamespaceException (javax.jcr.NamespaceException)2 UnsupportedRepositoryOperationException (javax.jcr.UnsupportedRepositoryOperationException)2 ConstraintViolationException (javax.jcr.nodetype.ConstraintViolationException)2 DocumentViewExporter (org.apache.jackrabbit.commons.xml.DocumentViewExporter)1 SystemViewExporter (org.apache.jackrabbit.commons.xml.SystemViewExporter)1