info.magnolia.importexport.filters
Class UselessNameFilter

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

public class UselessNameFilter
extends SkipNodePropertyFilter

A filter that can be used to remove optional "name" attributes in template, dialogs or paragraph nodes. The name attribute was required in magnolia 2, magnolia 3 makes use of the name of the containing node. This filter can be used to cleanup old configurations that survived to copy and paste. Not enabled by default, you need to modify DataTransporter in order to use it (see the comments in DataTransporter.importXmlStream())

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

Nested Class Summary
 
Nested classes/interfaces inherited from class info.magnolia.importexport.filters.SkipNodePropertyFilter
SkipNodePropertyFilter.BufferedElement
 
Field Summary
 
Fields inherited from class info.magnolia.importexport.filters.SkipNodePropertyFilter
invalue, lastNodeName, log, skipProperty
 
Constructor Summary
UselessNameFilter(XMLReader parent)
          Instantiates a new filter.
 
Method Summary
protected  boolean filter(String propertyValue, String parentNodeName)
          Implement this method to specificy if a given property (given its value and the parent node name) should be removed.
protected  String getFilteredPropertyName()
          Implement this method to specify the name of the property you want to filter.
 
Methods inherited from class info.magnolia.importexport.filters.SkipNodePropertyFilter
characters, endElement, startElement
 
Methods inherited from class org.xml.sax.helpers.XMLFilterImpl
endDocument, endPrefixMapping, 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, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UselessNameFilter

public UselessNameFilter(XMLReader parent)
Instantiates a new filter.

Parameters:
parent - wrapped XMLReader
Method Detail

getFilteredPropertyName

protected String getFilteredPropertyName()
Description copied from class: SkipNodePropertyFilter
Implement this method to specify the name of the property you want to filter.

Specified by:
getFilteredPropertyName in class SkipNodePropertyFilter
Returns:
filtered property name

filter

protected boolean filter(String propertyValue,
                         String parentNodeName)
Description copied from class: SkipNodePropertyFilter
Implement this method to specificy if a given property (given its value and the parent node name) should be removed.

Specified by:
filter in class SkipNodePropertyFilter
Parameters:
propertyValue - property value
parentNodeName - parent node name
Returns:
true if this property should be removed


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