use of com.enonic.xp.content.processor.ContentProcessor in project xp by enonic.
the class UpdateContentCommand method runContentProcessors.
private Content runContentProcessors(final Content originalContent, Content editedContent, final ContentType contentType) {
for (final ContentProcessor contentProcessor : this.contentProcessors) {
if (contentProcessor.supports(contentType)) {
final ProcessUpdateResult result = contentProcessor.processUpdate(ProcessUpdateParams.create().contentType(contentType).mediaInfo(mediaInfo).createAttachments(params.getCreateAttachments()).originalContent(originalContent).editedContent(editedContent).modifier(getCurrentUser()).build());
editedContent = updateContentWithProcessedData(editedContent, result);
}
}
return editedContent;
}
use of com.enonic.xp.content.processor.ContentProcessor in project xp by enonic.
the class CreateContentCommand method runContentProcessors.
private CreateContentParams runContentProcessors(final CreateContentParams createContentParams, final ContentType contentType) {
CreateContentParams processedParams = createContentParams;
for (final ContentProcessor contentProcessor : this.contentProcessors) {
if (contentProcessor.supports(contentType)) {
final ProcessCreateResult result = contentProcessor.processCreate(new ProcessCreateParams(processedParams, mediaInfo));
processedParams = CreateContentParams.create(result.getCreateContentParams()).build();
}
}
return processedParams;
}
Aggregations