Class Template
- All Implemented Interfaces:
ConfigurationObject
,HasConfiguration
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal AccessAssertion
final Configuration
Returns the JDBC drivers.final String
Gets the JDBC password.final String
Returns JDBC url.final String
Returns the JDBC driver.final String
Get the merged configuration between this template and the configuration's template.final ProcessorDependencyGraph
Get the processor graph to use for executing all the processors for the template.final String
final Optional<org.geotools.api.style.Style>
Look for a style in the named styles provided in the configuration.final String
Returns table data key.final boolean
final boolean
isPdfA()
final void
printClientConfig
(org.json.JSONWriter json) Print out the template information that the client needs for performing a request.final void
The roles required to access this template.final void
setAttributes
(Map<String, Attribute> attributes) Set the attributes for this template.final void
setConfiguration
(Configuration configuration) Set the configuration that the object belongs to.final void
setJdbcDrivers
(Set<String> jdbcDrivers) Sets the JDBC drivers.final void
setJdbcPassword
(String jdbcPassword) Sets the JDBC password.final void
setJdbcUrl
(String jdbcUrl) Sets the JDBC url.final void
setJdbcUser
(String jdbcUser) Sets the JDBC user.final void
setMapExport
(boolean mapExport) Sets the map export.final void
setOutputFilename
(String outputFilename) The default output file name of the report (takes precedence overConfiguration.setOutputFilename(String)
).void
setPdfA
(boolean pdfA) If set to true (defaults to false), the generated maps, scalebar and north arrow will not contain any transparent images.final void
setPdfConfig
(PDFConfig pdfConfig) Configure various properties related to the reports generated as PDFs.final void
setProcessors
(List<Processor> processors) Set the normal processors.final void
setReportTemplate
(String reportTemplate) Sets the report template.final void
Set the named styles defined in the configuration for this.final void
setTableData
(String tableData) Set the key of the data that is the datasource for the main table in the report.final void
validate
(List<Throwable> validationErrors, Configuration config) validate that the configuration was correct.
-
Constructor Details
-
Template
public Template()
-
-
Method Details
-
getOutputFilename
-
setOutputFilename
The default output file name of the report (takes precedence overConfiguration.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.
- Parameters:
outputFilename
- default output file name of the report.
-
getPdfConfig
Get the merged configuration between this template and the configuration's template. The settings in the template take priority over the configurations settings but if not set in the template then the default will be the configuration's options. -
setPdfConfig
Configure various properties related to the reports generated as PDFs.- Parameters:
pdfConfig
- the pdf configuration
-
printClientConfig
public final void printClientConfig(org.json.JSONWriter json) throws org.json.JSONException Print out the template information that the client needs for performing a request.- Parameters:
json
- the writer to write the information to.- Throws:
org.json.JSONException
-
getAttributes
-
setAttributes
Set the attributes for this template.- Parameters:
attributes
- the attribute map
-
getReportTemplate
-
setReportTemplate
Sets the report template. -
getProcessors
-
setProcessors
Set the normal processors.- Parameters:
processors
- the processors to set.
-
setTableData
Set the key of the data that is the datasource for the main table in the report.- Parameters:
tableData
- the key of the data that is the datasource for the main table in the report.
-
getTableDataKey
Returns table data key. -
getJdbcUrl
Returns JDBC url. -
setJdbcUrl
Sets the JDBC url. -
getJdbcDrivers
Returns the JDBC drivers. -
setJdbcDrivers
Sets the JDBC drivers. -
getJdbcUser
Returns the JDBC driver. -
setJdbcUser
Sets the JDBC user. -
getJdbcPassword
Gets the JDBC password. -
setJdbcPassword
Sets the JDBC password. -
getProcessorGraph
Get the processor graph to use for executing all the processors for the template.- Returns:
- the processor graph.
-
setStyles
Set the named styles defined in the configuration for this.- Parameters:
styles
- set the styles specific for this template.
-
getStyle
Look for a style in the named styles provided in the configuration.- Parameters:
styleName
- the name of the style to look for.
-
getConfiguration
-
setConfiguration
Description copied from interface:HasConfiguration
Set the configuration that the object belongs to.- Specified by:
setConfiguration
in interfaceHasConfiguration
- Parameters:
configuration
- the configuration object
-
validate
Description copied from interface:ConfigurationObject
validate that the configuration was correct.- Specified by:
validate
in interfaceConfigurationObject
- Parameters:
validationErrors
- a list to add any detected errors to.config
- the containing configuration
-
setAccess
The roles required to access this template. If empty or not set then it is a public template. If there are many roles then a user must have one of the roles in order to access the template.The security (how authentication/authorization is done) is configured in the /WEB-INF/classes/mapfish-spring-security.xml
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.
- Parameters:
access
- the roles needed to access this
-
getAccessAssertion
-
isMapExport
public final boolean isMapExport() -
setMapExport
public final void setMapExport(boolean mapExport) Sets the map export. -
isPdfA
public final boolean isPdfA() -
setPdfA
public void setPdfA(boolean pdfA) If set to true (defaults to false), the generated maps, scalebar and north arrow will not contain any transparent images.This is needed in case you want to output PDF/A-1a reports.
In pdfA mode, all layers are merged into a single JPEG layer at the requested resolution: WMTS tiles will be downscaled and vector layers will be rendered as bitmaps.
- Parameters:
pdfA
- the value
-