首页 > 解决方案 > 支持用于创建体验片段模板的 xfPage 组件的 OOTB sign 模型是什么?

问题描述

我想创建一个吊索模型来扩展 OOTB xfPage 组件 /libs/cq/experience-fragments/components/xfpage

我在 apps/myProjecy/cpomponent/xfPage --> 使用 sling:resourceSupertType = /libs/cq/experience-fragments/components/xfpage 创建了一个代理 xfPage 组件

我在 content/experience-fragments/myContentFolder/exp-fragment-master/variant 下有一个体验片段,它是使用 xfPage 模板创建的。

我可以在下面的模型中使用 xfPage 的实例吗?

@Model(
        adaptables = {SlingHttpServletRequest.class},     
        adapters = { ComponentExporter.class,
                ContainerExporter.class, 
                        Page.class},
        defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL,
        resourceType = "myProjecy/cpomponent/xfPage"
        )

@Exporter(name = "jackson", extensions = "json") 
@JsonSerialize(as = xfPageModel.class)

public class xfPageModel {

@Self
@Via(type = ResourceSuperType.class)
private xfPage xfPage ;
}


标签: aemsling-models

解决方案


推荐阅读