Search in sources :

Example 1 with OnlyActiveFilter

use of nl.nn.adapterframework.configuration.filters.OnlyActiveFilter in project iaf by ibissource.

the class ConfigurationDigester method parseAndResolveEntitiesAndProperties.

/**
 * Performs an Identity-transform, which resolves entities with content from files found on the ClassPath.
 * Resolve all non-attribute properties
 */
public void parseAndResolveEntitiesAndProperties(ContentHandler digester, Configuration configuration, Resource resource, Properties appConstants) throws IOException, SAXException, TransformerConfigurationException {
    ContentHandler handler;
    XmlWriter loadedHiddenWriter = new XmlWriter();
    handler = new PrettyPrintFilter(loadedHiddenWriter);
    handler = new AttributePropertyResolver(handler, appConstants, getPropsToHide(appConstants));
    handler = new XmlTee(digester, handler);
    handler = getStub4TesttoolContentHandler(handler, appConstants);
    handler = getConfigurationCanonicalizer(handler);
    handler = new OnlyActiveFilter(handler, appConstants);
    handler = new ElementPropertyResolver(handler, appConstants);
    XmlWriter originalConfigWriter = new XmlWriter();
    handler = new XmlTee(handler, originalConfigWriter);
    XmlUtils.parseXml(resource, handler);
    configuration.setOriginalConfiguration(originalConfigWriter.toString());
    configuration.setLoadedConfiguration(loadedHiddenWriter.toString());
}
Also used : XmlTee(nl.nn.adapterframework.stream.xml.XmlTee) AttributePropertyResolver(nl.nn.adapterframework.xml.AttributePropertyResolver) ElementPropertyResolver(nl.nn.adapterframework.xml.ElementPropertyResolver) OnlyActiveFilter(nl.nn.adapterframework.configuration.filters.OnlyActiveFilter) ContentHandler(org.xml.sax.ContentHandler) XmlWriter(nl.nn.adapterframework.xml.XmlWriter) PrettyPrintFilter(nl.nn.adapterframework.xml.PrettyPrintFilter)

Example 2 with OnlyActiveFilter

use of nl.nn.adapterframework.configuration.filters.OnlyActiveFilter in project iaf by ibissource.

the class OnlyActiveFilterTest method testToWriter.

public void testToWriter(String source, String expected) throws Exception {
    StringWriter target = new StringWriter();
    XmlWriter xmlWriter = new XmlWriter(target);
    OnlyActiveFilter filter = new OnlyActiveFilter(xmlWriter);
    XmlUtils.parseXml(source, filter);
    String actual = new String(target.toString());
    assertEquals(expected, actual);
}
Also used : StringWriter(java.io.StringWriter) OnlyActiveFilter(nl.nn.adapterframework.configuration.filters.OnlyActiveFilter) XmlWriter(nl.nn.adapterframework.xml.XmlWriter)

Aggregations

OnlyActiveFilter (nl.nn.adapterframework.configuration.filters.OnlyActiveFilter)2 XmlWriter (nl.nn.adapterframework.xml.XmlWriter)2 StringWriter (java.io.StringWriter)1 XmlTee (nl.nn.adapterframework.stream.xml.XmlTee)1 AttributePropertyResolver (nl.nn.adapterframework.xml.AttributePropertyResolver)1 ElementPropertyResolver (nl.nn.adapterframework.xml.ElementPropertyResolver)1 PrettyPrintFilter (nl.nn.adapterframework.xml.PrettyPrintFilter)1 ContentHandler (org.xml.sax.ContentHandler)1