Class Template
- All Implemented Interfaces:
ConfigurationObject,HasConfiguration
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal AccessAssertionfinal ConfigurationReturns the JDBC drivers.final StringGets the JDBC password.final StringReturns JDBC url.final StringReturns the JDBC driver.final StringGet the merged configuration between this template and the configuration's template.final ProcessorDependencyGraphGet the processor graph to use for executing all the processors for the template.final Stringfinal Optional<org.geotools.api.style.Style> Look for a style in the named styles provided in the configuration.final StringReturns table data key.final booleanfinal booleanisPdfA()final voidprintClientConfig(org.json.JSONWriter json) Print out the template information that the client needs for performing a request.final voidThe roles required to access this template.final voidsetAttributes(Map<String, Attribute> attributes) Set the attributes for this template.final voidsetConfiguration(Configuration configuration) Set the configuration that the object belongs to.final voidsetJdbcDrivers(Set<String> jdbcDrivers) Sets the JDBC drivers.final voidsetJdbcPassword(String jdbcPassword) Sets the JDBC password.final voidsetJdbcUrl(String jdbcUrl) Sets the JDBC url.final voidsetJdbcUser(String jdbcUser) Sets the JDBC user.final voidsetMapExport(boolean mapExport) Sets the map export.final voidsetOutputFilename(String outputFilename) The default output file name of the report (takes precedence overConfiguration.setOutputFilename(String)).voidsetPdfA(boolean pdfA) If set to true (defaults to false), the generated maps, scalebar and north arrow will not contain any transparent images.final voidsetPdfConfig(PDFConfig pdfConfig) Configure various properties related to the reports generated as PDFs.final voidsetProcessors(List<Processor> processors) Set the normal processors.final voidsetReportTemplate(String reportTemplate) Sets the report template.final voidSet the named styles defined in the configuration for this.final voidsetTableData(String tableData) Set the key of the data that is the datasource for the main table in the report.final voidvalidate(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.pdfNote: 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:HasConfigurationSet the configuration that the object belongs to.- Specified by:
setConfigurationin interfaceHasConfiguration- Parameters:
configuration- the configuration object
-
validate
Description copied from interface:ConfigurationObjectvalidate that the configuration was correct.- Specified by:
validatein 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
-