jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting" <jukka.zitt...@gmail.com>
Subject Re: Roundtripping: Stripping JCR metadata
Date Mon, 13 Nov 2006 21:49:11 GMT

On 11/13/06, Stefan Guggisberg <stefan.guggisberg@gmail.com> wrote:
> back to your question: probably the easiest approach would be to use
> a custom ContentHandler that filters jcr:* properties and nodes.

Another good approach would be to extend the DocumentViewExportVisitor
class from the jcr-ext contrib project. A code snippet like the
following would produce a document view XML export without any jcr:*

    Node node = ...;
    ContentHandler handler = ...;
    node.accept(new DocumentViewExportVisitor(handler, true, false) {
        protected boolean includeProperty(Property property)
                throws RepositoryException {
            return !property.getName().startsWith("jcr:");

Note that the DocumentViewExportVisitor class is still experimental code.


Jukka Zitting

View raw message