当前位置: 首页>>代码示例>>Java>>正文


Java AggregationState类代码示例

本文整理汇总了Java中info.magnolia.cms.core.AggregationState的典型用法代码示例。如果您正苦于以下问题:Java AggregationState类的具体用法?Java AggregationState怎么用?Java AggregationState使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AggregationState类属于info.magnolia.cms.core包,在下文中一共展示了AggregationState类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onRender

import info.magnolia.cms.core.AggregationState; //导入依赖的package包/类
@Override
protected void onRender(Node content, RenderableDefinition definition, RenderingContext renderingContext,
                        Map<String, Object> context, String templateScript) throws RenderException {

    final AppendableWriter out;
    try {
        out = renderingContext.getAppendable();
        AggregationState aggregationState = (AggregationState) context.get("state");
        Node node = aggregationState.getCurrentContentNode();
        Locale locale = aggregationState.getLocale();
        context.put("content", new ChainedContentMap(node, locale));
        Context combinedContext = Context.newBuilder(context)
                .resolver(JavaBeanValueResolver.INSTANCE, FieldValueResolver.INSTANCE, MapValueResolver.INSTANCE)
                .build();
        try {
            Template template = handlebars.compile(templateScript);
            template.apply(combinedContext, out);
        } finally {
            combinedContext.destroy();
        }
    } catch (IOException e) {
        LOGGER.error("Cannot render template", e);
    }
}
 
开发者ID:magnoliales,项目名称:magnolia-handlebars,代码行数:25,代码来源:HandlebarsRenderer.java

示例2: FoundationTemplatingFunctions

import info.magnolia.cms.core.AggregationState; //导入依赖的package包/类
@Inject
public FoundationTemplatingFunctions(Provider<AggregationState> aggregationStateProvider, FoundationTemplatingModule module,
                                     SiteManager siteManager, TemplateTypeHelper templateTypeFunctions, Provider<I18nContentSupport> i18nContentSupport) {
    super(aggregationStateProvider, templateTypeFunctions, i18nContentSupport);
    this.module = module;
    this.siteManager = siteManager;
}
 
开发者ID:gtenham,项目名称:magnolia-templating,代码行数:8,代码来源:FoundationTemplatingFunctions.java

示例3: SiteManagerImpl

import info.magnolia.cms.core.AggregationState; //导入依赖的package包/类
@Inject
public SiteManagerImpl(FoundationTemplatingModule module, Provider<AggregationState> aggregationStateProvider, TemplatingFunctions templatingFunctions) {
    this.module = module;
    this.aggregationStateProvider = aggregationStateProvider;
    this.templatingFunctions = templatingFunctions;
}
 
开发者ID:gtenham,项目名称:magnolia-templating,代码行数:7,代码来源:SiteManagerImpl.java

示例4: initWebContext

import info.magnolia.cms.core.AggregationState; //导入依赖的package包/类
private void initWebContext() {
    WebContext webContext = mock(WebContext.class);
    AggregationState aggregationState = mock(AggregationState.class);
    when(webContext.getAggregationState()).thenReturn(aggregationState);
    MgnlContext.setInstance(webContext);
}
 
开发者ID:aperto,项目名称:magnolia-vanity-url,代码行数:7,代码来源:VirtualVanityUriMappingTest.java


注:本文中的info.magnolia.cms.core.AggregationState类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。