info.magnolia.importexport.filters
Class MetadataUuidFilter

java.lang.Object
  extended by org.xml.sax.helpers.XMLFilterImpl
      extended by info.magnolia.importexport.filters.MetadataUuidFilter
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler, XMLFilter, XMLReader

public class MetadataUuidFilter
extends org.xml.sax.helpers.XMLFilterImpl

A simple filter that strips jcr:uuid properties in MetaData nodes. Needed due to MAGNOLIA-1650 uuids in MetaData nodes are changed during import. It also supports removal of non-standards namespaces, by setting the removeUnwantedNamespaces flag in the constructor.

Version:
$Revision: $ ($Author: $)
Author:
fgiust

Constructor Summary
MetadataUuidFilter(XMLReader parent)
          Deprecated.  
MetadataUuidFilter(XMLReader parent, boolean removeUnwantedNamespaces)
          Instantiates a new MetadataUuidFilter filter.
 
Method Summary
 void characters(char[] ch, int start, int length)
          
 void endElement(String uri, String localName, String qName)
          
 void endPrefixMapping(String prefix)
          
 void startElement(String uri, String localName, String qName, Attributes atts)
          
 void startPrefixMapping(String prefix, String uri)
          Skip unwanted name spaces, see MAGNOLIA-2756.
 
Methods inherited from class org.xml.sax.helpers.XMLFilterImpl
endDocument, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, ignorableWhitespace, notationDecl, parse, parse, processingInstruction, resolveEntity, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, setProperty, skippedEntity, startDocument, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetadataUuidFilter

public MetadataUuidFilter(XMLReader parent)
Deprecated. 

Instantiates a new MetadataUuidFilter filter.

Parameters:
parent - wrapped XMLReader

MetadataUuidFilter

public MetadataUuidFilter(XMLReader parent,
                          boolean removeUnwantedNamespaces)
Instantiates a new MetadataUuidFilter filter.

Parameters:
parent - wrapped XMLReader
removeUnwantedNamespaces - if set, non standard JCR name spaces will be removed
Method Detail

endPrefixMapping

public void endPrefixMapping(String prefix)
                      throws SAXException

Specified by:
endPrefixMapping in interface ContentHandler
Overrides:
endPrefixMapping in class org.xml.sax.helpers.XMLFilterImpl
Throws:
SAXException

startPrefixMapping

public void startPrefixMapping(String prefix,
                               String uri)
                        throws SAXException
Skip unwanted name spaces, see MAGNOLIA-2756.

Specified by:
startPrefixMapping in interface ContentHandler
Overrides:
startPrefixMapping in class org.xml.sax.helpers.XMLFilterImpl
Throws:
SAXException

endElement

public void endElement(String uri,
                       String localName,
                       String qName)
                throws SAXException

Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.XMLFilterImpl
Throws:
SAXException

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws SAXException

Specified by:
characters in interface ContentHandler
Overrides:
characters in class org.xml.sax.helpers.XMLFilterImpl
Throws:
SAXException

startElement

public void startElement(String uri,
                         String localName,
                         String qName,
                         Attributes atts)
                  throws SAXException

Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.XMLFilterImpl
Throws:
SAXException


Copyright © 2003-2012 Magnolia International Ltd.. All Rights Reserved.