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

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

有帮助吗?

解决方案

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();

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));
   }
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top