You can use the following sample code to assist you in extracting rule results from Supplement objects.

  
	// Get properties
	PropertyMap supPropMap = sup.getProperties();
	String sProp=null;
	// Check if object is merchandising or
	// content spotlighting result
	if ((supPropMap.get("DGraph.SeeAlsoMerchId") != null) &&
		(supPropMap.get("Style") != null) &&
		(supPropMap.get("Zone") != null)) {
		boolean hasMerch = true;
		// Get record list
		ERecList recs = sup.getERecs();
		for (int j=0; j < recs.Size(); j++) {
			// Get record
			ERec rec = (ERec)recs.get(j);
			// Get record Properties
			PropertyMap recPropsMap = rec.getProperties();
			// Get value of property (e.g. Name) from current record 
			sProp =(String)recPropsMap.get("Name");
		}
	// Set target link using first Navigation Reference
	NavigationRefsList nrl = sup.getNavigationRefs();
	DimValList dvl = (DimValList)nrl.get(0);
	// Loop over dimension values to build new target query
	StringBuffer sbNavParam = new StringBuffer ();
	for (int j=0; j < dvl.size(); j++) {
		DimVal dv = (DimVal)dvl.get(j)		
		// Add delimiter and id
		sbNavParam.append(dv.getId());
		sbNavParam.append(" ");
	// Get specific rule properties
	String style = (String)supPropMap.get("Style");
	String title = (String)supPropMap.get("Title");
	String zone = (String)supPropMap.get("Zone");
	// This is an example of a custom Property Template
	// defined in the Style 
	String customText = (String)supPropMap.get("CustomText");
		Test output in JSP page
		%><b>%=sProp %></b><br><%
		%>Navigation:<%=sbNavParam.toString()%><br><%
		%>Style:<%=style%><br><%
		%>Title:<%=title%><br><%
		%>Zone:<%=zone%><br><%
		%>Text:<%=customText%><br><%
	}
}
%>


Copyright © Legal Notices