target.add(container, clearAllBookmarksLink);
}
};
if(node.getDepth() == 0) {
clearBookmarkLink.add(new CssClassAppender("clearBookmark"));
} else {
clearBookmarkLink.setEnabled(true);
}
item.add(clearBookmarkLink);
PageParameters pageParameters = node.getPageParameters();
final AbstractLink link = Links.newBookmarkablePageLink(ID_BOOKMARKED_PAGE_LINK, pageParameters, pageClass);
ObjectSpecification objectSpec = null;
RootOid oid = node.getOidNoVer();
if(oid != null) {
ObjectSpecId objectSpecId = oid.getObjectSpecId();
objectSpec = getSpecificationLoader().lookupBySpecId(objectSpecId);
}
final ResourceReference imageResource = imageCache.resourceReferenceForSpec(objectSpec);
final Image image = new Image(ID_BOOKMARKED_PAGE_ICON, imageResource) {
private static final long serialVersionUID = 1L;
@Override
protected boolean shouldAddAntiCacheParameter() {
return false;
}
};
link.addOrReplace(image);
String title = node.getTitle();
final Label label = new Label(ID_BOOKMARKED_PAGE_TITLE, title);
link.add(label);
item.add(link);
if(bookmarkedPagesModel.isCurrent(pageParameters)) {
item.add(new CssClassAppender("currentBookmark"));
}
item.add(new CssClassAppender("bookmarkDepth" + node.getDepth()));
} catch(ObjectNotFoundException ex) {
// ignore
// this is a partial fix for an infinite redirect loop.
// should be a bit smarter here, though; see ISIS-596.
}