}
@Override
protected void doService(ToolPageContext page) throws IOException, ServletException {
Search search = new Search(page);
SearchResultRenderer resultRenderer = new SearchResultRenderer(page, search) {
@Override
public void renderBeforeItem(Object item) throws IOException {
Reference enhancement = new Reference();
RichTextReference rt = enhancement.as(RichTextReference.class);
State state = State.getInstance(item);
enhancement.setObject(item);
rt.setLabel(state.getLabel());
rt.setPreview(page.getPreviewThumbnailUrl(item));
page.writeStart("a",
"data-enhancement", ObjectUtils.toJson(enhancement.getState().getSimpleValues()),
"href", "#");
}
@Override
public void renderAfterItem(Object item) throws IOException {
page.writeEnd();
}
};
resultRenderer.render();
}