// Setup aggregator
ProcessingPipeline processingPipeline = context.getProcessingPipeline();
processingPipeline.setGenerator("<aggregator>", null, Parameters.EMPTY_PARAMETERS, Parameters.EMPTY_PARAMETERS);
ContentAggregator aggregator = (ContentAggregator)processingPipeline.getGenerator();
aggregator.setRootElement(
this.element.resolve(context, objectModel),
this.nsURI.resolve(context, objectModel),
this.nsPrefix.resolve(context, objectModel)
);
// Get actual parts, potentially filtered by the view
Part[] actualParts;
String cocoonView = env.getView();
if (cocoonView == null) {
// Keep all parts
actualParts = this.allParts;
} else {
// Are there some parts that match this view ?
actualParts = (Part[])this.viewParts.get(cocoonView);
// If not, keep all parts
if (actualParts == null) {
actualParts = this.allParts;
}
}
// Add parts
for (int i = 0; i < actualParts.length; i++) {
Part part = actualParts[i];
if (part != null) {
aggregator.addPart(
part.source.resolve(context, objectModel),
part.element.resolve(context, objectModel),
part.nsURI.resolve(context, objectModel),
part.stripRoot.resolve(context, objectModel),
part.nsPrefix.resolve(context, objectModel)