简体   繁体   English

每次更新相关内容片段时自动将 AEM 体验片段导出到 Adobe Target

[英]Exporting AEM experience fragments to Adobe Target automatically every time a related Content Fragment is updated

I have this unique requirement where each time a particular Content Fragment is updated in AEM, all the Experience Fragments referencing that particular Content Fragment need to be automatically exported to Adobe Target.我有一个独特的要求,每次在 AEM 中更新特定内容片段时,引用该特定内容片段的所有体验片段都需要自动导出到 Adobe Target。

Thinking about using SQL2 query to retrieve XFs referencing a particular CF and then incorporating this into a workflow process.考虑使用 SQL2 查询来检索引用特定 CF 的 XF,然后将其合并到工作流程中。 Also, wondering if I can leverage aem OOTB workflow process called "Export to Target" in this.另外,想知道我是否可以在其中利用称为“导出到目标”的 aem OOTB 工作流程。 Not really sure of how to call this "Export to Target" process on each Experience Fragment that we need to export to Target or is this possible at all?不太确定如何在我们需要导出到 Target 的每个体验片段上调用此“导出到 Target”过程,或者这是否可能?

Wondering if anyone has ever come across this requirement and succeeded.想知道是否有人遇到过这个要求并成功了。 Highly appreciate any tips or suggestions in this regard.非常感谢这方面的任何提示或建议。 Many Thanks in advance.提前谢谢了。

Whenever a Content Fragment is created or updated an OSGi event is triggered.每当创建或更新内容片段时,都会触发 OSGi 事件。 All events are logged under http://localhost:4502/system/console/events.所有事件都记录在 http://localhost:4502/system/console/events 下。 You could write a EventListener or EventHandler , get the path of the event, get the Resource and adapt it to com.adobe.cq.dam.cfm.ContentFragment .您可以编写一个EventListener 或 EventHandler ,获取事件的路径,获取 Resource 并将其调整为com.adobe.cq.dam.cfm.ContentFragment The topic for these events is "com/day/cq/dam" or in this constant .这些事件的主题是“com/day/cq/dam”或这个常量

From the adapted Class or Resource you can get informations about the model and if it's the model you want to process.从改编的 Class 或资源中,您可以获得有关 model 的信息,以及它是否是您要处理的 model。

To find all references I would also create an oak index and use SQL2 query to find all references.要查找所有引用,我还会创建一个oak 索引并使用 SQL2 查询来查找所有引用。

The query would be something like this:查询将是这样的:

select [jcr:path], [jcr:score], * from [nt:base] as a where contains(*, '"/content/dam/myReferencedModel"') 

If you have all referencing XF's you can kick off any workflow via WorkflowService :如果你有所有引用 XF,你可以通过WorkflowService启动任何工作流:

    @Reference
    private WorkflowService workflowService;

        WorkflowSession wfSession = workflowService.getWorkflowSession(session);
        WorkflowModel wfModel = wfSession.getModel("/var/workflow/models/mymodel");
        WorkflowData wfData = wfSession.newWorkflowData("JCR_PATH", "/payload");
        wfSession.startWorkflow(wfModel, wfData);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 识别与 csv 中更新的特定字段值相关的 AEM 内容片段 - Identifying AEM Content Fragments related to a particular field value updated in a csv AEM (Adobe Experience Manager) 索引 PDF 搜索结果 - AEM (Adobe Experience Manager) Indexed PDF Search Results Adobe AEM | 未在内容文件夹中创建组件 - Adobe AEM | Component is not being created in content folder Adobe Target,基于URL的用户体验包含 - Adobe Target, placing user in experience based on URL contains Adobe Experience Manager(AEM)6.2 / 6.3使用什么版本的Apache Sling? - What version of Apache Sling does Adobe Experience Manager (AEM) 6.2/6.3 use? 是否可以集成Angular.js(Angular 1)和AEM(Adobe Experience Manager 6.2) - Is it possible to integrate Angular.js (Angular 1) and AEM (Adobe Experience Manager 6.2) 如何使用Adobe Experience Manager的QueryBuilder获取节点的内容 - How to get content the content of a node using the QueryBuilder of Adobe Experience Manager adobe体验管理器如何将XML内容呈现到网页中? - How does adobe experience manager render XML content into a webpage? 使用Adobe CC应用程序为AEM创建交互式内容是否有优势? - Are there advantages to using Adobe CC apps to create interactive content for AEM? 为什么要将 AEM 中的页眉和页脚定义为体验片段,而不是使其成为页眉或页脚组件? - Why should the header and footer in AEM be defined as experience fragment rather than making them a header or a footer component?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM