简体   繁体   English

在Adobe CQ5中导入产品

[英]Importing Product in Adobe CQ5

I have a question on how we can import/synchronise products from our back-office to CQ5 front end. 我对如何从后台导入/同步产品到CQ5前端有疑问。

The architecture to be is pretty simple - custom back-office managing all the products( basically it will be the source of truth). 要使用的架构非常简单-定制后台管理所有产品(基本上它将成为事实的来源)。 CQ5 driven web-site to show search results(driven by Adobe SearchAndPromote) and product details. CQ5驱动的网站显示搜索结果(由Adobe SearchAndPromote驱动)和产品详细信息。 Purchase transactions will be handled outside of CQ5. 采购交易将在CQ5之外处理。

I went through http://dev.day.com/docs/en/cq/current/ecommerce/eCommerce-framework.html and I think have some idea in which direction we should move, but I would like someone to confirm that my understanding is correct. 我浏览了http://dev.day.com/docs/en/cq/current/ecommerce/eCommerce-framework.html ,我认为我们应该朝哪个方向发展,但是我希望有人确认我的理解是正确的。

1) I need to create scheduled job running on Author node that would call back-office and import products as json feed. 1)我需要创建在Author节点上运行的计划作业,该作业将调用后台并将产品作为json feed导入。 I use annotation based @Service(Runnable.class) - Is there a way to set it so it rund on Author node only? 我使用基于注释的@Service(Runnable.class)-有没有办法设置它,使其仅在Author节点上运行?

2) Create custom service(called my service above) that will actually create all the nodes in crx. 2)创建自定义服务(上面称为我的服务),该服务实际上将在crx中创建所有节点。 If I have desktop and mobile versions of the site do I need to create all those dones twice? 如果我拥有该网站的桌面版和移动版,是否需要两次创建所有这些工作? Are there any tips on easier way to create those? 有什么技巧可以更轻松地创建它们吗?

3) Let CQ5 replicate those products to publish nodes. 3)让CQ5复制这些产品以发布节点。

Is there a easier way? 有没有更简单的方法? I mean if I was using more standard web-app I would have one controller to show product details, two templates(one for mobile, one for desktop) and a service that would call back-office and return details for requested product. 我的意思是,如果我使用的是更标准的Web应用程序,则将有一个控制器来显示产品详细信息,两个模板(一个用于移动设备,一个用于台式机)和一个服务会调用后台并返回所请求产品的详细信息。 But Sling world is very different, and I want to check if I understand it correctly. 但是Sling的世界有很大的不同,我想检查一下我是否正确理解了。

Cheers. 干杯。

Here are some answers: 以下是一些答案:

1) Here is a good article about different configs for different runmodes: http://helpx.adobe.com/cq/kb/RunModeSetUp.html you can create configs for pub and auth runmodes with certain flag your code will look for which will tell whether to execute import or not. 1)这是一篇关于不同运行模式的不同配置的好文章: http ://helpx.adobe.com/cq/kb/RunModeSetUp.html您可以使用某些标志创建发布和身份验证运行模式的配置,您的代码将寻找这些标志告诉是否执行导入。

2) It depends. 2)视情况而定。 CQ tends to have copies of content for mobile site so it may make sense to do copies of nodes for mobile site but only in case you those nodes are pages (cq:Page and cq:PageContent) you create based on imported data. CQ倾向于具有移动站点内容的副本,因此为移动站点制作节点的副本可能是有意义的,但前提是这些节点是基于导入数据创建的页面(cq:Page和cq:PageContent)。 Otherwise you just need to save imported data somewhere and obtain it at some moment (via JCR queries or methods like .getNode()). 否则,您只需要将导入的数据保存在某处并在某个时候获取即可(通过JCR查询或.getNode()之类的方法)。 In this case of course it makes sense not to copy your data. 在这种情况下,当然不要复制您的数据。

3) It depends here as well. 3)这也取决于这里。 I would consider following forces you may have: should imported data be editable? 我会考虑以下因素:导入的数据是否应该可编辑? how frequent are updates? 更新频率如何? how massive are updates? 有多少更新? how critical is consistency across pubs? 各间酒吧的一致性有多重要? In case updates are not massive, not frequent and consistency matters import to auth followed by replication can work. 如果更新的规模不大,不频繁且一致性事项导入auth,然后进行复制,则可以正常工作。 Also it may be the case if you need to be able to edit imported data. 如果您需要能够编辑导入的数据,也可能是这种情况。 In case updates are massive and/or frequent and consistency across pubs do not matter much (you can afford that some people may see different results from different pubs during import) I'd suggest run import on all pubs at the same time since massive replication of imported data may affect regular page/images replications. 如果大量更新和/或频繁更新,并且各间酒吧的一致性没什么大不了(您可以承受,在导入期间某些人可能会从不同的酒吧看到不同的结果),由于大量复制,我建议同时在所有酒吧上运行导入导入的数据可能会影响常规的页面/图像复制。

Thanks, Max. 谢谢,马克斯。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM