本文整理汇总了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);
}
}
示例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;
}
示例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;
}
示例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);
}