public class Template extends java.lang.Object implements ConfigurationObject, HasConfiguration
| Constructor and Description |
|---|
Template() |
| Modifier and Type | Method and Description |
|---|---|
AccessAssertion |
getAccessAssertion() |
java.util.Map<java.lang.String,Attribute> |
getAttributes() |
Configuration |
getConfiguration() |
java.lang.String |
getJdbcPassword() |
java.lang.String |
getJdbcUrl() |
java.lang.String |
getJdbcUser() |
java.lang.String |
getOutputFilename() |
PDFConfig |
getPdfConfig()
Get the merged configuration between this template and the configuration's template.
|
ProcessorDependencyGraph |
getProcessorGraph()
Get the processor graph to use for executing all the processors for the template.
|
java.util.List<Processor> |
getProcessors() |
java.lang.String |
getReportTemplate() |
com.google.common.base.Optional<org.geotools.styling.Style> |
getStyle(java.lang.String styleName,
MapfishMapContext mapContext)
Look for a style in the named styles provided in the configuration.
|
java.lang.String |
getTableDataKey() |
void |
printClientConfig(org.json.JSONWriter json)
Print out the template information that the client needs for performing a request.
|
void |
setAccess(java.util.List<java.lang.String> access)
The roles required to access this template.
|
void |
setAttributes(java.util.Map<java.lang.String,Attribute> attributes)
Set the attributes for this template.
|
void |
setConfiguration(Configuration configuration)
Set the configuration that the object belongs to.
|
void |
setJdbcPassword(java.lang.String jdbcPassword) |
void |
setJdbcUrl(java.lang.String jdbcUrl) |
void |
setJdbcUser(java.lang.String jdbcUser) |
void |
setOutputFilename(java.lang.String outputFilename)
The default output file name of the report (takes precedence over
Configuration.setOutputFilename(String)). |
void |
setPdfConfig(PDFConfig pdfConfig)
Configure various properties related to the reports generated as PDFs.
|
void |
setProcessors(java.util.List<Processor> processors)
Set the normal processors.
|
void |
setReportTemplate(java.lang.String reportTemplate) |
void |
setStyles(java.util.Map<java.lang.String,java.lang.String> styles)
Set the named styles defined in the configuration for this.
|
void |
setTableData(java.lang.String tableData)
Set the key of the data that is the datasource for the main table in the report.
|
void |
validate(java.util.List<java.lang.Throwable> validationErrors,
Configuration config)
validate that the configuration was correct.
|
public final void setOutputFilename(java.lang.String outputFilename)
Configuration.setOutputFilename(String)). This can be overridden by the outputFilename
parameter in the request JSON.
This can be a string and can also have a date section in the string that will be filled when the report is created for example a section with ${<dateFormatString>} will be replaced with the current date formatted in the way defined by the <dateFormatString> string. The format rules are the rules in java.text.SimpleDateFormat (do a google search if the link above is broken).
Example: outputFilename: print-${dd-MM-yyyy} should output: print-22-11-2014.pdf
Note: the suffix will be appended to the end of the name.
outputFilename - default output file name of the report.public final java.lang.String getOutputFilename()
public PDFConfig getPdfConfig()
public final void printClientConfig(org.json.JSONWriter json)
throws org.json.JSONException
json - the writer to write the information to.org.json.JSONExceptionpublic final void setPdfConfig(PDFConfig pdfConfig)
pdfConfig - the pdf configurationpublic final java.util.Map<java.lang.String,Attribute> getAttributes()
public final void setAttributes(java.util.Map<java.lang.String,Attribute> attributes)
attributes - the attribute mappublic final java.lang.String getReportTemplate()
public final void setReportTemplate(java.lang.String reportTemplate)
public final java.util.List<Processor> getProcessors()
public final void setProcessors(java.util.List<Processor> processors)
processors - the processors to set.public final void setTableData(java.lang.String tableData)
tableData - the key of the data that is the datasource for the main table in the report.public final java.lang.String getTableDataKey()
public final java.lang.String getJdbcUrl()
public final void setJdbcUrl(java.lang.String jdbcUrl)
public final java.lang.String getJdbcUser()
public final void setJdbcUser(java.lang.String jdbcUser)
public final java.lang.String getJdbcPassword()
public final void setJdbcPassword(java.lang.String jdbcPassword)
public final ProcessorDependencyGraph getProcessorGraph()
public final void setStyles(java.util.Map<java.lang.String,java.lang.String> styles)
styles - set the styles specific for this template.@Nonnull
public final com.google.common.base.Optional<org.geotools.styling.Style> getStyle(java.lang.String styleName,
MapfishMapContext mapContext)
styleName - the name of the style to look for.mapContext - information about the map projection, bounds, size, etc...public final void setConfiguration(Configuration configuration)
HasConfigurationsetConfiguration in interface HasConfigurationconfiguration - the configuration objectpublic final Configuration getConfiguration()
public final void validate(java.util.List<java.lang.Throwable> validationErrors,
Configuration config)
ConfigurationObjectvalidate in interface ConfigurationObjectvalidationErrors - a list to add any detected errors to.config - the containing configurationpublic final void setAccess(java.util.List<java.lang.String> access)
Any user without the required role will get an error when trying to access the template and the template will not be visible in the capabilities requests.
access - the roles needed to access thispublic final AccessAssertion getAccessAssertion()