如何在AEM 6.0中使用cq:editConfig属性

如何在AEM 6.0中使用cq:editConfig属性,aem,Aem,在AEM 6.0中,我有一个组件,它有一个文本字段和一个视频文件上传器。我想从content finder启用此视频的拖放功能。我使用对话框进行的正常上载工作正常,但此拖放操作不起作用。我搜索并发现我可以通过使用cq:editConfig来实现这一点。有人能告诉我怎么做吗?将cq:dropTargets定义为cq:editConfig节点的子节点,以配置可以从内容查找器的资产接受拖放的拖放目标列表 在您的案例中,对于视频,您可以参考编辑配置如下所示的foundation/components/v

在AEM 6.0中,我有一个组件,它有一个文本字段和一个视频文件上传器。我想从content finder启用此视频的拖放功能。我使用对话框进行的正常上载工作正常,但此拖放操作不起作用。我搜索并发现我可以通过使用cq:editConfig来实现这一点。有人能告诉我怎么做吗?

cq:dropTargets
定义为
cq:editConfig
节点的子节点,以配置可以从内容查找器的资产接受拖放的拖放目标列表

在您的案例中,对于视频,您可以参考编辑配置如下所示的
foundation/components/video

<cq:editConfig jcr:primaryType="cq:EditConfig" cq:layout="editbar">
    <cq:dropTargets jcr:primaryType="nt:unstructured">
        <video jcr:primaryType="cq:DropTargetConfig" propertyName="./asset">
            <parameters jcr:primaryType="nt:unstructured" 
                sling:resourceType="foundation/components/video"/>
        </video>
    </cq:dropTargets>
</cq:editConfig>

另外,请确保在用于视频文件上载组件的
html5smartfile
小部件上指定
ddGroups
ddAccept
属性


请参阅获取有关配置编辑配置及其子节点的详细信息。

您必须小心,因为将组件类型更改为放置目标中指定的类型可能会产生意外的副作用

为了避免这种情况发生,您可以使用以下格式区分组件类型和目标类型:

<cq:dropTargets jcr:primaryType="nt:unstructured">
    <video
        jcr:primaryType="cq:DropTargetConfig"
        accept="[video/.*]"
        propertyName="./asset">
        <parameters
            jcr:primaryType="nt:unstructured"
            sling:resourceType="myfolder/components/videoandtext">
            <video
                jcr:primaryType="nt:unstructured"
                sling:resourceType="foundation/components/video"
                />
        </parameters>
    </video>
</cq:dropTargets>


请参见此处了解更多信息:

您还可以告诉我们从何处获得cq属性的xml表示。我仍在使用CRXDe结构。您可以使用节点路径的
.XML
扩展,即
http://localhost:4502/libs/foundation/components/video/cq:editConfig.xml
将为您提供上述XML。类似地,您可以使用
.json
扩展来获得相同的json表示。但是,JSON表示将只包含当前节点属性,而不包含整个子节点,在这种情况下,请使用
infinity
选择器和
JSON
扩展名。i、 e.,
http://localhost:4502/libs/foundation/components/video/cq:editConfig.infinity.json