Package org.mapfish.print.servlet
Class ServletMapPrinterFactory
- java.lang.Object
-
- org.mapfish.print.servlet.ServletMapPrinterFactory
-
- All Implemented Interfaces:
MapPrinterFactory
public class ServletMapPrinterFactory extends java.lang.Object implements MapPrinterFactory
AMapPrinterFactory
that reads configuration from files and uses servlet's methods for resolving the paths to the files.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_CONFIGURATION_FILE_KEY
The name of the default app.
-
Constructor Summary
Constructors Constructor Description ServletMapPrinterFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MapPrinter
create(java.lang.String app)
Creates the appropriate map printer.java.util.Set<java.lang.String>
getAppIds()
Return the set of app ids that are available.void
setAppsRootDirectory(java.lang.String directory)
Set a single directory that contains one or more subdirectories, each one that contains a config.yaml file will be considered a print app.void
setConfigurationFiles(java.util.Map<java.lang.String,java.lang.String> configurationFiles)
The setter for setting configuration file.
-
-
-
Field Detail
-
DEFAULT_CONFIGURATION_FILE_KEY
@Nonnull public static final java.lang.String DEFAULT_CONFIGURATION_FILE_KEY
The name of the default app. This is always required to be one of the apps that are registered.- See Also:
- Constant Field Values
-
-
Method Detail
-
create
public final MapPrinter create(@Nullable java.lang.String app) throws NoSuchAppException
Description copied from interface:MapPrinterFactory
Creates the appropriate map printer.- Specified by:
create
in interfaceMapPrinterFactory
- Parameters:
app
- an identifier that controls which configuration to use.- Throws:
NoSuchAppException
-
getAppIds
public final java.util.Set<java.lang.String> getAppIds()
Description copied from interface:MapPrinterFactory
Return the set of app ids that are available.- Specified by:
getAppIds
in interfaceMapPrinterFactory
-
setConfigurationFiles
public final void setConfigurationFiles(java.util.Map<java.lang.String,java.lang.String> configurationFiles) throws java.net.URISyntaxException
The setter for setting configuration file. It will convert the value to a URI.- Parameters:
configurationFiles
- the configuration file map.- Throws:
java.net.URISyntaxException
-
setAppsRootDirectory
public final void setAppsRootDirectory(java.lang.String directory) throws java.net.URISyntaxException, java.io.IOException
Set a single directory that contains one or more subdirectories, each one that contains a config.yaml file will be considered a print app.This can be called multiple times and each directory will add to the apps found in the other directories. However the appId is based on the directory names so if there are 2 directories with the same name the second will overwrite the first encounter.
- Parameters:
directory
- the root directory containing the sub-app-directories. This must resolve to a file with the- Throws:
java.net.URISyntaxException
java.io.IOException
-
-