Search in sources :

Example 1 with HtmlTag

use of com.enonic.xp.portal.postprocess.HtmlTag in project xp by enonic.

the class PostProcessEvaluator method processContributions.

private HtmlBlocks processContributions(final HtmlBlocks htmlBlocks) {
    final HtmlBlocks.Builder processedHtmlBlocks = HtmlBlocks.builder();
    for (HtmlBlock htmlBlock : htmlBlocks) {
        if (isTagMarker(htmlBlock)) {
            final HtmlTag htmlTag = ((TagMarker) htmlBlock).getTag();
            final StaticHtml injectionHtml = evalPostProcessInjection(htmlTag);
            if (injectionHtml != null) {
                processedHtmlBlocks.add(injectionHtml);
            }
        } else {
            processedHtmlBlocks.add(htmlBlock);
        }
    }
    return processedHtmlBlocks.build();
}
Also used : StaticHtml(com.enonic.xp.portal.impl.parser.StaticHtml) HtmlBlocks(com.enonic.xp.portal.impl.parser.HtmlBlocks) HtmlTag(com.enonic.xp.portal.postprocess.HtmlTag) HtmlBlock(com.enonic.xp.portal.impl.parser.HtmlBlock) TagMarker(com.enonic.xp.portal.impl.parser.TagMarker)

Example 2 with HtmlTag

use of com.enonic.xp.portal.postprocess.HtmlTag in project xp by enonic.

the class PortalResponseMapper method serializePageContributions.

private void serializePageContributions(final MapGenerator gen) {
    gen.map("pageContributions");
    for (final HtmlTag tag : HtmlTag.values()) {
        final ImmutableList<String> contributions = response.getContributions(tag);
        if (contributions.isEmpty()) {
            continue;
        }
        gen.array(tag.id());
        contributions.forEach(gen::value);
        gen.end();
    }
    gen.end();
}
Also used : HtmlTag(com.enonic.xp.portal.postprocess.HtmlTag)

Aggregations

HtmlTag (com.enonic.xp.portal.postprocess.HtmlTag)2 HtmlBlock (com.enonic.xp.portal.impl.parser.HtmlBlock)1 HtmlBlocks (com.enonic.xp.portal.impl.parser.HtmlBlocks)1 StaticHtml (com.enonic.xp.portal.impl.parser.StaticHtml)1 TagMarker (com.enonic.xp.portal.impl.parser.TagMarker)1