Search in sources :

Example 1 with FilterStreamDescriptor

use of org.xwiki.filter.descriptor.FilterStreamDescriptor in project xwiki-platform by xwiki.

the class InstanceInputFilterStreamFactory method initialize.

@Override
public void initialize() throws InitializationException {
    super.initialize();
    List<InstanceInputEventGenerator> eventGenerators;
    try {
        eventGenerators = this.componentManagerProvider.get().getInstanceList(InstanceInputEventGenerator.class);
    } catch (ComponentLookupException e) {
        throw new InitializationException("Failed to get registered instance of InstanceInputEventGenerator components", e);
    }
    FilterStreamDescriptor[] descriptors = new FilterStreamDescriptor[eventGenerators.size() + 1];
    descriptors[0] = this.descriptor;
    for (int i = 0; i < eventGenerators.size(); ++i) {
        descriptors[i + 1] = eventGenerators.get(i).getDescriptor();
    }
    setDescriptor(new CompositeFilterStreamDescriptor(this.descriptor.getName(), this.descriptor.getDescription(), descriptors));
}
Also used : CompositeFilterStreamDescriptor(org.xwiki.filter.descriptor.CompositeFilterStreamDescriptor) CompositeFilterStreamDescriptor(org.xwiki.filter.descriptor.CompositeFilterStreamDescriptor) FilterStreamDescriptor(org.xwiki.filter.descriptor.FilterStreamDescriptor) ComponentLookupException(org.xwiki.component.manager.ComponentLookupException) InitializationException(org.xwiki.component.phase.InitializationException) InstanceInputEventGenerator(org.xwiki.filter.instance.input.InstanceInputEventGenerator)

Example 2 with FilterStreamDescriptor

use of org.xwiki.filter.descriptor.FilterStreamDescriptor in project xwiki-platform by xwiki.

the class InstanceOutputFilterStreamFactory method initialize.

@Override
public void initialize() throws InitializationException {
    super.initialize();
    List<OutputInstanceFilterStreamFactory> factories;
    try {
        factories = this.componentManagerProvider.get().getInstanceList(OutputInstanceFilterStreamFactory.class);
    } catch (ComponentLookupException e) {
        throw new InitializationException("Failed to get registered instance of OutputInstanceFilterStreamFactory components", e);
    }
    FilterStreamDescriptor[] descriptors = new FilterStreamDescriptor[factories.size() + 1];
    descriptors[0] = this.descriptor;
    for (int i = 0; i < factories.size(); ++i) {
        descriptors[i + 1] = factories.get(i).getDescriptor();
    }
    setDescriptor(new CompositeFilterStreamDescriptor(this.descriptor.getName(), this.descriptor.getDescription(), descriptors));
}
Also used : CompositeFilterStreamDescriptor(org.xwiki.filter.descriptor.CompositeFilterStreamDescriptor) OutputInstanceFilterStreamFactory(org.xwiki.filter.instance.output.OutputInstanceFilterStreamFactory) CompositeFilterStreamDescriptor(org.xwiki.filter.descriptor.CompositeFilterStreamDescriptor) FilterStreamDescriptor(org.xwiki.filter.descriptor.FilterStreamDescriptor) ComponentLookupException(org.xwiki.component.manager.ComponentLookupException) InitializationException(org.xwiki.component.phase.InitializationException)

Aggregations

ComponentLookupException (org.xwiki.component.manager.ComponentLookupException)2 InitializationException (org.xwiki.component.phase.InitializationException)2 CompositeFilterStreamDescriptor (org.xwiki.filter.descriptor.CompositeFilterStreamDescriptor)2 FilterStreamDescriptor (org.xwiki.filter.descriptor.FilterStreamDescriptor)2 InstanceInputEventGenerator (org.xwiki.filter.instance.input.InstanceInputEventGenerator)1 OutputInstanceFilterStreamFactory (org.xwiki.filter.instance.output.OutputInstanceFilterStreamFactory)1