Class AbstractWebTemplate
- java.lang.Object
-
- net.officefloor.web.template.build.AbstractWebTemplate
-
- All Implemented Interfaces:
PropertyConfigurable,WebTemplate
public abstract class AbstractWebTemplate extends java.lang.Object implements WebTemplate
AbstractWebTemplate.- Author:
- Daniel Sagenschneider
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringapplicationPathApplication path for theWebTemplate.protected java.lang.StringcharsetNameName of theCharset.protected java.lang.StringcontentTypeContent-Typefor theWebTemplate.protected booleanisSecureIndicates if theWebTemplateis secure.protected charlinkSeparatorCharacterLink separator character.protected java.lang.StringlogicClassNameName of the logicClassfor theWebTemplate.protected java.lang.StringredirectValuesFunctionNameName ofMethodon the logicClassto return the values for path parameters in redirecting to thisWebTemplate.protected java.util.List<java.lang.String>renderHttpMethodNamesRenderHttpMethodnames.protected java.util.Map<java.lang.String,java.lang.Boolean>secureLinksSecure links.protected AbstractWebTemplatesuperTemplateSuperWebTemplate.protected WebTemplateSectionSourcewebTemplateSectionSource
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractWebTemplate(WebTemplateSectionSource webTemplateSectionSource, boolean isSecure, java.lang.String applicationPath, PropertyList properties, SourceIssues sourceIssues)Instantiate.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description WebTemplateExtensionBuilderaddExtension(java.lang.String webTemplateExtensionClassName)Adds aWebTemplateExtensionfor thisWebTemplate.voidaddProperty(java.lang.String name, java.lang.String value)Adds aPropertyto configure the item.WebTemplateaddRenderHttpMethod(java.lang.String httpMethodName)Adds aHttpMethodthat will render theWebTemplate.protected abstract PropertyListcreatePropertyList()Creates a newPropertyList.java.lang.StringgetApplicationPath()Obtains the application path.HttpSecurableBuildergetHttpSecurer()Obtains theHttpSecurableBuilderto configure access controls to thisWebTemplate.WebTemplateSectionSourcegetWebTemplateSectionSource()Obtains theWebTemplateSectionSource.PropertyListloadProperties(boolean isPathParameters)Loads the properties.WebTemplatesetCharset(java.lang.String charsetName)Allow overriding the defaultCharsetto render theWebTemplate.WebTemplatesetContentType(java.lang.String contentType)Specifies theContent-Typeoutput by thisWebTemplate.WebTemplatesetLinkSecure(java.lang.String linkName, boolean isSecure)Indicate whether a secure connection is required for the link.WebTemplatesetLinkSeparatorCharacter(char separator)Allows overriding the default separator character between the path and link.WebTemplatesetLogicClass(java.lang.String logicClassName)Specifies the logicClass.WebTemplatesetRedirectValuesFunction(java.lang.String functionName)Specifies theMethodname on the logicClassto provide the values for redirect path parameters to thisWebTemplate.WebTemplatesetSuperTemplate(WebTemplate superTemplate)Specifies the super (parent)WebTemplate.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.officefloor.web.template.build.WebTemplate
addGovernance, getOutput, getRender
-
-
-
-
Field Detail
-
webTemplateSectionSource
protected final WebTemplateSectionSource webTemplateSectionSource
-
isSecure
protected final boolean isSecure
Indicates if theWebTemplateis secure.
-
applicationPath
protected final java.lang.String applicationPath
Application path for theWebTemplate.
-
logicClassName
protected java.lang.String logicClassName
Name of the logicClassfor theWebTemplate.
-
redirectValuesFunctionName
protected java.lang.String redirectValuesFunctionName
Name ofMethodon the logicClassto return the values for path parameters in redirecting to thisWebTemplate.
-
secureLinks
protected java.util.Map<java.lang.String,java.lang.Boolean> secureLinks
Secure links.
-
linkSeparatorCharacter
protected char linkSeparatorCharacter
Link separator character.
-
contentType
protected java.lang.String contentType
Content-Typefor theWebTemplate.
-
charsetName
protected java.lang.String charsetName
Name of theCharset.
-
renderHttpMethodNames
protected final java.util.List<java.lang.String> renderHttpMethodNames
RenderHttpMethodnames.
-
superTemplate
protected AbstractWebTemplate superTemplate
SuperWebTemplate.
-
-
Constructor Detail
-
AbstractWebTemplate
protected AbstractWebTemplate(WebTemplateSectionSource webTemplateSectionSource, boolean isSecure, java.lang.String applicationPath, PropertyList properties, SourceIssues sourceIssues)
Instantiate.- Parameters:
webTemplateSectionSource-WebTemplateSectionSourceinstance to use.isSecure- Indicates if requires secureServerHttpConnectionto render theWebTemplate.applicationPath- Application path for theWebTemplate.properties-PropertyList.sourceIssues-SourceIssues.
-
-
Method Detail
-
createPropertyList
protected abstract PropertyList createPropertyList()
Creates a newPropertyList.- Returns:
- New
PropertyList.
-
getApplicationPath
public java.lang.String getApplicationPath()
Obtains the application path.- Returns:
- Application path.
-
getWebTemplateSectionSource
public WebTemplateSectionSource getWebTemplateSectionSource()
Obtains theWebTemplateSectionSource.- Returns:
WebTemplateSectionSource.
-
loadProperties
public PropertyList loadProperties(boolean isPathParameters)
Loads the properties.- Parameters:
isPathParameters- Indicates if path parameters.- Returns:
PropertyList.
-
addProperty
public void addProperty(java.lang.String name, java.lang.String value)Description copied from interface:PropertyConfigurableAdds aPropertyto configure the item.- Specified by:
addPropertyin interfacePropertyConfigurable- Parameters:
name- Name ofProperty.value- Value ofProperty.
-
setLogicClass
public WebTemplate setLogicClass(java.lang.String logicClassName)
Description copied from interface:WebTemplateSpecifies the logicClass.- Specified by:
setLogicClassin interfaceWebTemplate- Parameters:
logicClassName- Name of the logicClass.- Returns:
this.
-
setRedirectValuesFunction
public WebTemplate setRedirectValuesFunction(java.lang.String functionName)
Description copied from interface:WebTemplateSpecifies the
Methodname on the logicClassto provide the values for redirect path parameters to thisWebTemplate. The returned type from theMethodwill be used to source values for parameters in constructing the path to thisWebTemplate.Should the path to the template be static (i.e. has no path parameters), no
Methodneed be specified.- Specified by:
setRedirectValuesFunctionin interfaceWebTemplate- Parameters:
functionName- LogicClassMethodname.- Returns:
this.
-
setContentType
public WebTemplate setContentType(java.lang.String contentType)
Description copied from interface:WebTemplateSpecifies theContent-Typeoutput by thisWebTemplate.- Specified by:
setContentTypein interfaceWebTemplate- Parameters:
contentType-Content-Typeoutput by thisWebTemplate.- Returns:
this.
-
setCharset
public WebTemplate setCharset(java.lang.String charsetName)
Description copied from interface:WebTemplateAllow overriding the defaultCharsetto render theWebTemplate.- Specified by:
setCharsetin interfaceWebTemplate- Parameters:
charsetName- Name ofCharsetto render theWebTemplate.- Returns:
this.
-
setLinkSeparatorCharacter
public WebTemplate setLinkSeparatorCharacter(char separator)
Description copied from interface:WebTemplateAllows overriding the default separator character between the path and link.- Specified by:
setLinkSeparatorCharacterin interfaceWebTemplate- Parameters:
separator- Separator to use to separate path and link.- Returns:
this.
-
setLinkSecure
public WebTemplate setLinkSecure(java.lang.String linkName, boolean isSecure)
Description copied from interface:WebTemplateIndicate whether a secure connection is required for the link. This overrides the default template secure setting for the link.
Example use could be the landing page may be insecure but the login form submission link on the page is to be secure.
- Specified by:
setLinkSecurein interfaceWebTemplate- Parameters:
linkName- Name of link to secure.isSecure-trueshould the link require a secureServerHttpConnection.- Returns:
this.
-
getHttpSecurer
public HttpSecurableBuilder getHttpSecurer()
Description copied from interface:WebTemplateObtains the
HttpSecurableBuilderto configure access controls to thisWebTemplate.Calling this method without providing configuration requires only authentication to access the
WebTemplate.- Specified by:
getHttpSecurerin interfaceWebTemplate- Returns:
HttpSecurableBuilder.
-
addRenderHttpMethod
public WebTemplate addRenderHttpMethod(java.lang.String httpMethodName)
Description copied from interface:WebTemplateAdds a
HttpMethodthat will render theWebTemplate. Should theHttpMethodnot be in this list, a redirect will occur toHttpMethod.HttpMethodEnum.GET.Note that
HttpMethod.HttpMethodEnum.GETis added by default.- Specified by:
addRenderHttpMethodin interfaceWebTemplate- Parameters:
httpMethodName- Name of theHttpMethodthat will render theWebTemplate.- Returns:
this.
-
setSuperTemplate
public WebTemplate setSuperTemplate(WebTemplate superTemplate)
Description copied from interface:WebTemplateSpecifies the super (parent)WebTemplate.- Specified by:
setSuperTemplatein interfaceWebTemplate- Parameters:
superTemplate- SuperWebTemplate.- Returns:
this.
-
addExtension
public WebTemplateExtensionBuilder addExtension(java.lang.String webTemplateExtensionClassName)
Description copied from interface:WebTemplateAdds aWebTemplateExtensionfor thisWebTemplate.- Specified by:
addExtensionin interfaceWebTemplate- Parameters:
webTemplateExtensionClassName-WebTemplateExtensionClassname.- Returns:
WebTemplateExtensionBuilderto build theWebTemplateExtension.
-
-