Class MasterTemplateBuilder
- java.lang.Object
-
- com.antiaction.common.templateengine.TemplateBuilderBase
-
- dk.netarkivet.heritrix3.monitor.resources.MasterTemplateBuilder
-
- Direct Known Subclasses:
ConfigTemplateBuilder
,H3ScriptTemplateBuilder
public class MasterTemplateBuilder extends com.antiaction.common.templateengine.TemplateBuilderBase
Class to handle the generation of HTML using a template engine. Extends a template engine class which uses some reflection magic.
-
-
Field Summary
Fields Modifier and Type Field Description com.antiaction.common.templateengine.TemplatePlaceHolder
contentPlace
Hook into the template to insert main content.protected java.lang.String
environment
Get and cache the environment name used for this installation.com.antiaction.common.templateengine.TemplatePlaceHolder
environmentPlace
Hook into the template to insert environment content.com.antiaction.common.templateengine.TemplatePlaceHolder
headingPlace
Hook into the template to insert heading content.com.antiaction.common.templateengine.TemplatePlaceHolder
languagesPlace
Hook into the template to insert language selection content.com.antiaction.common.templateengine.TemplatePlaceHolder
menuPlace
Hook into the template to insert menu content.com.antiaction.common.templateengine.TemplatePlaceHolder
refreshPlace
Hook into the template to insert refresh content.com.antiaction.common.templateengine.TemplatePlaceHolder
titlePlace
Hook into the template to insert title content.protected java.lang.String
version
Get and cache the versions string from the jar manifest file.com.antiaction.common.templateengine.TemplatePlaceHolder
versionPlace
Hook into the template to insert version content.
-
Constructor Summary
Constructors Constructor Description MasterTemplateBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringBuilder
buildMenu(java.lang.StringBuilder menuSb, javax.servlet.http.HttpServletRequest req, java.util.Locale locale, Heritrix3JobMonitor h3Job)
Construct menu HTML based on the HTTP request, requested locale and optional h3 job monitor.MasterTemplateBuilder
insertContent(java.lang.String title, java.lang.String menu, java.lang.String languages, java.lang.String heading, java.lang.String content, java.lang.String refresh)
Insert content into the different placeholders defined as template engine attributes above.
-
-
-
Field Detail
-
version
protected final java.lang.String version
Get and cache the versions string from the jar manifest file.
-
environment
protected final java.lang.String environment
Get and cache the environment name used for this installation.
-
titlePlace
public com.antiaction.common.templateengine.TemplatePlaceHolder titlePlace
Hook into the template to insert title content.
-
menuPlace
public com.antiaction.common.templateengine.TemplatePlaceHolder menuPlace
Hook into the template to insert menu content.
-
languagesPlace
public com.antiaction.common.templateengine.TemplatePlaceHolder languagesPlace
Hook into the template to insert language selection content.
-
headingPlace
public com.antiaction.common.templateengine.TemplatePlaceHolder headingPlace
Hook into the template to insert heading content.
-
contentPlace
public com.antiaction.common.templateengine.TemplatePlaceHolder contentPlace
Hook into the template to insert main content.
-
versionPlace
public com.antiaction.common.templateengine.TemplatePlaceHolder versionPlace
Hook into the template to insert version content.
-
environmentPlace
public com.antiaction.common.templateengine.TemplatePlaceHolder environmentPlace
Hook into the template to insert environment content.
-
refreshPlace
public com.antiaction.common.templateengine.TemplatePlaceHolder refreshPlace
Hook into the template to insert refresh content.
-
-
Constructor Detail
-
MasterTemplateBuilder
public MasterTemplateBuilder()
-
-
Method Detail
-
buildMenu
public java.lang.StringBuilder buildMenu(java.lang.StringBuilder menuSb, javax.servlet.http.HttpServletRequest req, java.util.Locale locale, Heritrix3JobMonitor h3Job) throws java.io.IOException
Construct menu HTML based on the HTTP request, requested locale and optional h3 job monitor.- Parameters:
menuSb
-StringBuilder
used to construct the menu HTMLreq
- HTTP request objectlocale
-Locale
of the requested response language to useh3Job
- H3 job monitor to use if the menu need to show a job sub sub menu item- Returns:
- constructed menu HTML
- Throws:
java.io.IOException
- if an I/O exception occurs during construction
-
insertContent
public MasterTemplateBuilder insertContent(java.lang.String title, java.lang.String menu, java.lang.String languages, java.lang.String heading, java.lang.String content, java.lang.String refresh)
Insert content into the different placeholders defined as template engine attributes above.- Parameters:
title
- title textmenu
- menu HTMLlanguages
- language selection HTMLheading
- heading HTMLcontent
- main content textrefresh
- refresh meta header text- Returns:
- a reference to this object so more methods can be called on it immediately
-
-