import java.io.StringWriter;
import java.util.Collection;
import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
import java.util.logging.Level;
import java.util.logging.Logger;
import freenet.clients.http.PageMaker;
import freenet.clients.http.PageNode;
import freenet.clients.http.ToadletContext;
+import freenet.support.HTMLNode;
/**
* Base class for all {@link Page}s that are rendered with {@link Template}s and
for (String styleSheet : getStyleSheets()) {
pageNode.addCustomStyleSheet(styleSheet);
}
+ for (Map<String, String> linkNodeParameters : getAdditionalLinkNodes(request)) {
+ HTMLNode linkNode = pageNode.headNode.addChild("link");
+ for (Entry<String, String> parameter : linkNodeParameters.entrySet()) {
+ linkNode.addAttribute(parameter.getKey(), parameter.getValue());
+ }
+ }
String shortcutIcon = getShortcutIcon();
if (shortcutIcon != null) {
pageNode.addForwardLink("icon", shortcutIcon);
return null;
}
+ /**
+ * Returns additional <link> nodes for the HTML’s <head> node.
+ *
+ * @param request
+ * The request for which to return the link nodes
+ * @return All link nodes that should be added to the HTML head
+ */
+ protected List<Map<String, String>> getAdditionalLinkNodes(Request request) {
+ return Collections.emptyList();
+ }
+
//
// INTERFACE LinkEnabledCallback
//