문제

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