确定由endeca触发的规则 [英] Determine Rules triggered by endeca

查看:71
本文介绍了确定由endeca触发的规则的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在应用程序中通过规则管理器"设置了各种endeca规则,这些规则在呈现页面时触发.

We have various endeca rules set up through Rules Manager in our application which are triggered while rendering the page.

是否可以通过Java/JSP代码确定针对页面触发了哪个规则?

Is it possible to determine which rule was triggered for a page through Java/JSP code?

推荐答案

执行此操作的正确方法是使用Content Assembler API(endeca_content.jar).您需要创建一个内容查询并检索该内容对象:

The proper way to do this is with the Content Assembler API (endeca_content.jar). You need to create a content query and retrive the content object:

ContentItem content = results.getContent();
content.getName();

还可以通过导航对象中的SupplementList对象来使用导航API:标题键将表示触发的规则的名称.但是,您是以任何有意义的方式使用页面构建器时,正确的方法是使用Content Assemble API.

It is also possible to use the navigation API, using the SupplementList object from the navigation object: The title key will represent the name of the rule triggered. However, is you are using page builder in any meaningful way the proper approach is to use the Content Assemble API.

SupplementList sl = nav.getSupplements();
for (Object object : sl) {
   Supplement s = (Supplement) object;
   PropertyMap map = s.getProperties();
   Set keys = map.keySet();
   for (Object key : keys) {
    logger.info("Sup prop: " + key + " \t" + map.get(key));
   }
}

这篇关于确定由endeca触发的规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆