public class HttpTemplateWorkSource extends AbstractWorkSource<HttpTemplateWork> implements WorkSourceService<HttpTemplateWork,HttpTemplateWorkSource>
WorkSource
for the HTTP template.AbstractWorkSource.SpecificationContext
Modifier and Type | Field and Description |
---|---|
static String |
PROPERTY_BEAN_PREFIX
Property prefix to obtain the bean for the
HttpTemplateSection . |
static String |
PROPERTY_CHARSET
Property to specify the
Charset for outputting the template. |
static String |
PROPERTY_LINK_SECURE_PREFIX
Property prefix to obtain whether a specific link requires a secure
ServerHttpConnection . |
static String |
PROPERTY_TEMPLATE_CONTENT
Property to obtain the raw
HttpTemplate content. |
static String |
PROPERTY_TEMPLATE_FILE
Property to specify the
HttpTemplate file. |
static String |
PROPERTY_TEMPLATE_FILE_CHARSET
Property to specify the
Charset for reading in the template. |
static String |
PROPERTY_TEMPLATE_SECURE
Property to indicate if the
HttpTemplate requires a secure
ServerHttpConnection . |
static String |
PROPERTY_TEMPLATE_URI
Property to obtain the
HttpTemplate URI path. |
static String |
PROPERTY_TEMPLATE_URI_SUFFIX
Property to obtain the
HttpTemplate URI suffix on the template
URI path and various link URI paths. |
Constructor and Description |
---|
HttpTemplateWorkSource() |
Modifier and Type | Method and Description |
---|---|
static net.officefloor.plugin.web.http.template.parse.HttpTemplate |
getHttpTemplate(Reader templateContent)
Obtains the
HttpTemplate . |
static net.officefloor.plugin.web.http.template.parse.HttpTemplate |
getHttpTemplate(SourceContext context)
Obtains the
HttpTemplate . |
static Reader |
getHttpTemplateContent(SourceContext context)
Obtains the raw
HttpTemplate content. |
static String[] |
getHttpTemplateLinkNames(net.officefloor.plugin.web.http.template.parse.HttpTemplate template)
Obtains the link names for the
HttpTemplate . |
static String |
getHttpTemplateLinkUrlContinuationPath(String templateUriPath,
String linkName,
String templateUriSuffix)
Obtains the
HttpTemplate link URL continuation path. |
static String |
getHttpTemplateUrlContinuationPath(SourceProperties properties)
Obtains the
HttpTemplate URL continuation path. |
String |
getWorkSourceAlias()
Obtains the alias for the
WorkSource Class . |
Class<HttpTemplateWorkSource> |
getWorkSourceClass()
Obtains the
WorkSource Class . |
static boolean |
isHttpTemplateSectionRequireBean(net.officefloor.plugin.web.http.template.parse.HttpTemplateSection section)
Determines if the
HttpTemplateSection requires a bean. |
static boolean |
isHttpTemplateSecure(SourceProperties properties)
Determines if the
HttpTemplate is secure. |
protected void |
loadSpecification(AbstractWorkSource.SpecificationContext context)
Loads the
WorkSourceSpecification . |
void |
sourceWork(WorkTypeBuilder<HttpTemplateWork> workTypeBuilder,
WorkSourceContext context)
Sources the
WorkType by populating it via the input
WorkTypeBuilder . |
getSpecification
public static final String PROPERTY_TEMPLATE_FILE
HttpTemplate
file.public static final String PROPERTY_TEMPLATE_CONTENT
HttpTemplate
content. This is tried if
there is no template path.public static final String PROPERTY_TEMPLATE_URI
HttpTemplate
URI path.public static final String PROPERTY_TEMPLATE_URI_SUFFIX
HttpTemplate
URI suffix on the template
URI path and various link URI paths.public static final String PROPERTY_TEMPLATE_SECURE
HttpTemplate
requires a secure
ServerHttpConnection
.public static final String PROPERTY_TEMPLATE_FILE_CHARSET
Charset
for reading in the template.public static final String PROPERTY_LINK_SECURE_PREFIX
ServerHttpConnection
.public static final String PROPERTY_CHARSET
Charset
for outputting the template.public static final String PROPERTY_BEAN_PREFIX
HttpTemplateSection
.public static net.officefloor.plugin.web.http.template.parse.HttpTemplate getHttpTemplate(SourceContext context) throws IOException
HttpTemplate
.context
- SourceContext
providing details about the
HttpTemplate
.HttpTemplate
.IOException
- If fails to obtain the HttpTemplate
.public static Reader getHttpTemplateContent(SourceContext context) throws IOException
HttpTemplate
content.context
- SourceContext
providing details about the
HttpTemplate
.HttpTemplate
content.IOException
- If fails to obtain the raw HttpTemplate
content.public static net.officefloor.plugin.web.http.template.parse.HttpTemplate getHttpTemplate(Reader templateContent) throws IOException
HttpTemplate
.templateContent
- Raw HttpTemplate
content.HttpTemplate
.IOException
- If fails to obtain the HttpTemplate
.public static boolean isHttpTemplateSectionRequireBean(net.officefloor.plugin.web.http.template.parse.HttpTemplateSection section)
HttpTemplateSection
requires a bean.section
- HttpTemplateSection
.true
if the HttpTemplateSection
requires a
bean.public static String getHttpTemplateUrlContinuationPath(SourceProperties properties) throws InvalidHttpRequestUriException
HttpTemplate
URL continuation path.properties
- SourceProperties
.HttpTemplate
.InvalidHttpRequestUriException
- Should the configured HttpTemplate
path be invalid.public static String getHttpTemplateLinkUrlContinuationPath(String templateUriPath, String linkName, String templateUriSuffix) throws InvalidHttpRequestUriException
HttpTemplate
link URL continuation path.templateUriPath
- HttpTemplate
URI path.linkName
- Name of the link.templateUriSuffix
- HttpTemplate
URI suffix. May be null
for
no suffix.HttpTemplate
link URI path.InvalidHttpRequestUriException
- Should the resulting URI be invalid.public static boolean isHttpTemplateSecure(SourceProperties properties)
HttpTemplate
is secure.properties
- SourceProperties
.true
should the HttpTemplate
be secure.public static String[] getHttpTemplateLinkNames(net.officefloor.plugin.web.http.template.parse.HttpTemplate template)
HttpTemplate
.template
- HttpTemplate
.public String getWorkSourceAlias()
WorkSourceService
WorkSource
Class
.getWorkSourceAlias
in interface WorkSourceService<HttpTemplateWork,HttpTemplateWorkSource>
WorkSource
Class
.public Class<HttpTemplateWorkSource> getWorkSourceClass()
WorkSourceService
WorkSource
Class
.getWorkSourceClass
in interface WorkSourceService<HttpTemplateWork,HttpTemplateWorkSource>
WorkSource
Class
.protected void loadSpecification(AbstractWorkSource.SpecificationContext context)
AbstractWorkSource
WorkSourceSpecification
.loadSpecification
in class AbstractWorkSource<HttpTemplateWork>
context
- AbstractWorkSource.SpecificationContext
.public void sourceWork(WorkTypeBuilder<HttpTemplateWork> workTypeBuilder, WorkSourceContext context) throws Exception
WorkSource
WorkType
by populating it via the input
WorkTypeBuilder
.sourceWork
in interface WorkSource<HttpTemplateWork>
workTypeBuilder
- WorkTypeBuilder
to be populated with the
type definition
of the Work
.context
- WorkSourceContext
to source details to populate the
WorkTypeBuilder
.Exception
- If fails to populate the WorkTypeBuilder
.Copyright © 2005–2016. All rights reserved.