Configuration

This section lists the available configuration components that can be used in the YAML configuration file.

Example config.yaml

throwErrorOnExtraParameters: true

certificateStore: !certificateStore
  ...

credentials:
  - !credential
    ...

proxies:
  - !proxy
    ...

templates:
  A4 Landscape: !template
    ...

!acceptAll

Configuration

reject

!alwaysAllowedAssertion

!andAssertion

Configuration

predicates
Set all the Predicates/AccessAssertion that have to all pass in order for this assertion to pass.

An exception is thrown if this method is called more than once.

!certificateStore

A configuration object for configuring a custom certificate/trust store.

It is a uri to a java jks keystore file along with the password for unlocking the store.

Configuration

configuration
Description copied from interface: HasConfiguration
password
uri

!configuration

Configuration

access
The roles required to access this configuration/app. If empty or not set then it is a public app. If there are many roles then a user must have one of the roles in order to access the configuration/app.

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 any of the templates and no templates will be listed in the capabilities requests.

allowedReferers
The matchers used to authorize the incoming requests in function of the referrer. For example:
 allowedReferers:
- !hostnameMatch
host: example.com
allowSubDomains: true

By default, the referrer is not checked

certificateStore
configurationFile
credentials
Http credentials to be used when making http requests.

If a proxy needs credentials you don't need to configure it here because the proxy configuration object also has options for declaring the credentials.

defaultStyle
defaultToSvg
If true then all vector layers (and other parts of the system that can be either SVG or Bitmap, like scalebar) will be rendered as SVG (unless layer specifically indicates useSvg as false).

The default is false.

fileLoaderManager
forceFailOnError
jdbcDrivers
Set the JDBC drivers that are required to connect to the databases in the configuration. JDBC drivers are needed (for example) when database sources are used in templates. For example if in one of the template you have:
     jdbcUrl: "jdbc:postgresql://localhost:5432/morges_dpfe"

then you need to add:

     jdbcDrivers: [org.postgresql.Driver]

or

     jdbcDrivers:
- org.postgresql.Driver
opaqueTileErrorColor
outputFilename
The default output file name of the report. This can be overridden by Template.setOutputFilename(String) and 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 ${} will be replaced with the current date formatted in the way defined by the 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.

pdfConfig
proxies
Configuration for proxying http requests. Each proxy can be configured with authentication and with the uris that they apply to.

See HttpProxy for details on how to configure them.

resourceBundle
smtp
styles
templates
throwErrorOnExtraParameters
transparentTileErrorColor

!credential

Represents a set of credentials to use for an http request. These can be configured in the Configuration yaml file.

Note: proxies are also HttpCredentials and when searching for credentials, the proxies will also be searched for credentials.

Configuration

matchers
password
The password for authenticating with the credentials.

This is optional

username
The username for authenticating with the credentials.

This is optional

!dnsMatch

Allows to check that a given URL matches a DNS address (textual format). The actual comparison is performed on numerical IP addresses. The configured DNS host address is transformed into numerical IP addresses during application startup. The urls to be compared are transformed during the print processing.

Example 1: Accept any www.camptocamp.com url

     - !dnsMatch
host: www.camptocamp.com

Example 2: Accept any www.camptocamp.com url (port == -1 accepts any port)

     - !dnsMatch
host: www.camptocamp.com
port: -1

Example 3: Accept any www.camptocamp.com url on port 80 only

     - !dnsMatch
host: www.camptocamp.com
port: 80
Example 4: Accept www.camptocamp.com urls with paths that start with /print/.

If the regular expression give does not start with / then it will be added because all paths start with /

     - !dnsMatch
host: www.camptocamp.com
pathRegex: /print/.+

Example

 http_processors 

Configuration

host
pathRegex
The regular expression used to verify the path of the uri as is expected. All paths start with /.

The regular expression used are the ones supported by java: http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html

port
reject

!hostnameMatch

Allows to check that a given URL matches a hostname literally (textual match).

Example 1: Accept any www.camptocamp.com url

     - !hostnameMatch
host: www.camptocamp.com

Example 2: Accept any www.camptocamp.com url (port == -1 accepts any port)

     - !hostnameMatch
host: www.camptocamp.com
port: -1

Example 3: Accept any www.camptocamp.com url on port 80 only

     - !hostnameMatch
host: www.camptocamp.com
port: 80
Example 4: Accept www.camptocamp.com urls with paths that start with /print/.

If the regular expression give does not start with / then it will be added because all paths start with /

     - !hostnameMatch
host: www.camptocamp.com
pathRegex: /print/.+

Configuration

allowSubDomains
host
pathRegex
The regular expression used to verify the path of the uri as is expected. All paths start with /.

The regular expression used are the ones supported by java: http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html

port
reject

!ipMatch

Compares ip address string and mask string by using InetAddress comparison.

Example 1: accept any uri whose host matches the ip of www.camptocamp.com

     - !ipMatch
ip: www.camptocamp.com

Example 2: accept any uri whose host ip starts with 192.1

     - !ipMatch
ip: 192.1.0.0
mask: 255.255.0.0

Example 3: accept any uri whose host ip starts with 192.1 and restricts to port 80

     - !ipMatch
ip: 192.1.0.0
mask: 255.255.0.0
port: 80

Example 4: accept any uri whose host ip starts with 192.1 and and allows any port (-1 is any port)

     - !ipMatch
ip: 192.1.0.0
mask: 255.255.0.0
port: -1

Example 5: accept any uri whose host ip starts with 192.1 and restricts to paths that start with /print/

     - !ipMatch
ip: 192.1.0.0
mask: 255.255.0.0
pathRegex: /print/.+

Example

 http_processors 

Configuration

ip
mask
pathRegex
The regular expression used to verify the path of the uri as is expected. All paths start with /.

The regular expression used are the ones supported by java: http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html

port
reject

!localMatch

Allows to check that a given URL is served by one of the local network interface or one of its aliases.

Example 1: Accept any localhost url

     - localMatch {}

Example 2: Accept any localhost url (port == -1 accepts any port)

     - localMatch
port: -1

Example 3: Accept any localhost url on port 80 only

     - localMatch
port: 80

Example 4: Accept localhost urls with paths that start with /print/.

If the regular expression given does not start with / then it will be added because all paths start with /.

     - localMatch
pathRegex: /print/.+

Example

 http_processors 

Configuration

pathRegex
The regular expression used to verify the path of the uri as is expected. All paths start with /.

The regular expression used are the ones supported by java: http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html

port
reject

!mergeSource

Describes the objects used as sources for a merged data source (see !mergeDataSources processor).

Configuration

fields
The names of each field in the DataSource. See MergeDataSourceProcessor.SourceType for instructions on how to declare the fields
key
type
The type of source. See MergeDataSourceProcessor.SourceType for the options.

!pdfConfig

A Configuration object for containing metadata that will be embedded in the PDF and parameters to use when encoding the PDF.

Naturally this only applies to reports that are exported as PDFs.

Configuration

author
compressed
creator
keywords
subject
title

!proxy

This configuration object configures the proxies to be used by the system. This is configured as one of the root elements of the config.yaml

Example - Proxy all requests except localhost and www.camptocamp.org:

 proxies:
- !proxy
scheme: http
host: proxy.host.com
port: 8888
username: username
password: xyzpassword
matchers:
- !localMatch
reject: true
- !dnsMatch
host: www.camptocamp.org
reject: true
- !acceptAll {}

Configuration

host
The host of the proxy. Can be a hostname or ip address.

This is required.

matchers
password
The password for authenticating with the proxy.

This is optional

port
The host of the proxy. Can be a hostname or ip address.

This is optional. The default value is 80.

scheme
The scheme (http, https) of the proxy.

This is optional, default is http if no username and https if there is a password

username
The username for authenticating with the proxy.

This is optional

!roleAccessAssertion

Configuration

requiredRoles
Set the roles required to allow access. If not roles then the user must be logged in but does not have to have any particular role.

This method may only be called once, any subsequent calls will result in errors.

!s3reportStorage

Configuration for storing the reports in a S3 compatible storage.

By default, authentication is done using the DefaultAWSCredentialsProviderChain which uses Environment Variables, Java System Properties, Credential profiles file, ...

Configuration

accessKey
bucket
endpointUrl
prefix
region
retentionDays
The number of day the reports must be kept.

Passed this delay, they will be deleted and the links included in the corresponding emails will become invalid. Defaults to 7 days.

secretKey

!smtpConfig

Email sending configuration.

This configuration is needed only if reports are to be sent to the user by email.

Configuration

body
The default email body.

This can be changed by the smtp.body property in the request.

If you have setup a storage, you must put a "{url}" marker where the URL to fetch the report should be put.

errorBody
The default email body in case of error.

This can be changed by the smtp.body property in the request.

The error message can be places in the text using a "{message}" marker.

errorSubject
The default email subject in case of error.

This can be changed by the smtp.errorSubject property in the request.
fromAddress
host
password
port
ssl
True for enabling SSL.

Cannot be enabled at the same time as starttls
starttls
storage
The report storage facility to use.

By default, attaches the report in an email. But, for big files, this is not practical. This can be used to configure a storage.
subject
The default email subject.

This can be changed by the smtp.subject property in the request.
username

!template

Configuration

access
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.

attributes
configuration
Description copied from interface: HasConfiguration
jdbcDrivers
jdbcPassword
jdbcUrl
jdbcUser
mapExport
outputFilename
The default output file name of the report (takes precedence over 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 ${} will be replaced with the current date formatted in the way defined by the 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.

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.

pdfConfig
processors
reportTemplate
styles
tableData

!updatePdfConfigUpdate

The object that defines how to update the PDFConfig (see !updatePdfConfig processor).

Configuration

format
The replacement format. It is a printf style format. The documentation is in the Formatter class (just google/bing java.util.Formatter).

Example: "Report for %s"

valueKey
The key to use to look up the value in the values object. It can be a path that can reach into nested objects.

Examples 1 a simple lookup key: "key" Example 2 a path. First part (before .) is the lookup key, the second part is the field name to load: "key.fieldName"

!urlImage

Interprets text in a table cell as an image URL.

See also: Configuration of tables with HTML images

Configuration

urlExtractor
Sets the RegExp pattern to use for extracting the url from the text. By default, the whole string is used.

For example: .*&img src="([^"]+)".*

urlGroup

!zoomLevels

Encapsulates a sorted set of scale denominators representing the allowed scales.

The scales are sorted from largest to smallest and the index starts at 0, where 0 is the largest scale (most zoomed out).

   map: !map
zoomLevels: !zoomLevels
scales: [5000, 10000, 25000, 50000, 100000, 500000]

Configuration

scales