Class CreateMapPagesProcessor
- All Implemented Interfaces:
ConfigurationObject
,Processor<CreateMapPagesProcessor.Input,
,CreateMapPagesProcessor.Output> ProvideAttributes
,RequireAttributes
This processor will take the defined map attribute and using the geometry defined in the map attribute's area of interest, will create an Iterable<Values> each of which contains:
- a new definition of a map attribute
- name value which is a string that roughly describes which part of the main map this sub-map is
- left value which is the name of the sub-map to the left of the current map
- right value which is the name of the sub-map to the right of the current map
- top value which is the name of the sub-map to the top of the current map
- bottom value which is the name of the sub-map to the bottom of the current map
It will also create a paging overview layer for the main map if you have set renderPagingOverview to true in !paging attribute
The iterable of values can be consumed by a !createDataSource processor and as a result be put in the report (or one of the sub-reports) table. One must be careful as this can result in truly giant reports.
See also: !paging attribute [[examples=paging,paging_with_overview_layer]]
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
The Input object for processor.static final class
Output of processor.static final record
Nested classes/interfaces inherited from class org.mapfish.print.processor.AbstractProcessor
AbstractProcessor.Context
Nested classes/interfaces inherited from interface org.mapfish.print.processor.Processor
Processor.ExecutionContext
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Name of the text attribut to be rendered in overviewPaging features.static final String
Name of features generated for paging.Fields inherited from interface org.mapfish.print.processor.Processor
MDC_APPLICATION_ID_KEY, MDC_JOB_ID_KEY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncalculatePagingDimensions
(CreateMapPagesProcessor.Input values, org.locationtech.jts.geom.Envelope aoiBBox, Rectangle paintArea) Calculates layout dimensions.Returns a new/clean instance of a parameter object.createMapDefinitions
(int[][] mapIndexes, org.locationtech.jts.geom.Envelope[][] mapsBounds, CreateMapPagesProcessor.PagingDimensions pagingD, CreateMapPagesProcessor.Input values) Creates map definitions for each page.createSingleMapDefinition
(MapAttribute.MapAttributeValues map, org.locationtech.jts.geom.Envelope mapsBound, PagingAttribute.PagingProcessorValues paging) Handles creation of a single map definition.execute
(CreateMapPagesProcessor.Input values, Processor.ExecutionContext context) Perform the process on the input attributes.protected void
extraValidation
(List<Throwable> validationErrors, Configuration configuration) Perform any extra validation a subclass may need to perform.Gets the attributes provided by the processor.getOrCreateAreaOfInterest
(MapAttribute.MapAttributeValues map, Rectangle paintArea) Handles area of interest initialization.org.geotools.feature.DefaultFeatureCollection
populateMapGrid
(int[][] mapIndexes, org.locationtech.jts.geom.Envelope[][] mapsBounds, CreateMapPagesProcessor.PagingDimensions pagingD, org.geotools.api.referencing.crs.CoordinateReferenceSystem projection, AreaOfInterest areaOfInterest, boolean renderPagingOverview) Populates the map grid and collects overview features.void
setAttribute
(String name, Attribute attribute) Set the map attribute.Methods inherited from class org.mapfish.print.processor.AbstractProcessor
getInputMapperBiMap, getInputPrefix, getOutputMapperBiMap, getOutputPrefix, getOutputType, setInputMapper, setInputPrefix, setOutputMapper, setOutputPrefix, setPrefix, toString, toString, validate
-
Field Details
-
OVERVIEW_PAGING_FEATURE_NAME
Name of features generated for paging.- See Also:
-
OVERVIEW_PAGING_ATTRIBUT_TEXT
Name of the text attribut to be rendered in overviewPaging features.- See Also:
-
-
Constructor Details
-
CreateMapPagesProcessor
protected CreateMapPagesProcessor()Constructor.
-
-
Method Details
-
extraValidation
Description copied from class:AbstractProcessor
Perform any extra validation a subclass may need to perform.- Specified by:
extraValidation
in classAbstractProcessor<CreateMapPagesProcessor.Input,
CreateMapPagesProcessor.Output> - Parameters:
validationErrors
- a list to add errors to so that all validation errors are reported as one.configuration
- the containing configuration
-
createInputParameter
Description copied from interface:Processor
Returns a new/clean instance of a parameter object. This instance's will be inspected using reflection to find its public fields and the properties will be set from theValues
object.The way the properties will be looked up is to
- take the bean property name
- map it using the input mapper, (if the input mapper does not have a mapping for the property then the unmapped property name is used)
- Look up the property value in the
Values
object using the mapped property name - set the value on the instance created by this method. If the value is null an exception
will be thrown UNLESS the
HasDefaultValue
annotation is on the field for the property.
It is important to realize that super classes will also be analyzed, so care must be had with inheritance.
- Specified by:
createInputParameter
in interfaceProcessor<CreateMapPagesProcessor.Input,
CreateMapPagesProcessor.Output>
-
execute
public final CreateMapPagesProcessor.Output execute(CreateMapPagesProcessor.Input values, Processor.ExecutionContext context) throws IOException Description copied from interface:Processor
Perform the process on the input attributes.- Specified by:
execute
in interfaceProcessor<CreateMapPagesProcessor.Input,
CreateMapPagesProcessor.Output> - Parameters:
values
- A Java object whose public fields are populated from theValues
object (which is used for transferring properties between processors).context
- The execution context for a print task.- Returns:
- A Java object whose public fields will be put into the
Values
object. The key in theValues
object is the name of the field or if there is a mapping in theProcessor.getOutputMapperBiMap()
map, the mapped name. The key is determined in a similar way as for the input object. - Throws:
IOException
-
setAttribute
Set the map attribute.- Specified by:
setAttribute
in interfaceRequireAttributes
- Parameters:
name
- the attribute nameattribute
- the attribute
-
getAttributes
Gets the attributes provided by the processor.- Specified by:
getAttributes
in interfaceProvideAttributes
- Returns:
- the attributes
-
getOrCreateAreaOfInterest
public AreaOfInterest getOrCreateAreaOfInterest(MapAttribute.MapAttributeValues map, Rectangle paintArea) Handles area of interest initialization. -
calculatePagingDimensions
public CreateMapPagesProcessor.PagingDimensions calculatePagingDimensions(CreateMapPagesProcessor.Input values, org.locationtech.jts.geom.Envelope aoiBBox, Rectangle paintArea) Calculates layout dimensions. -
populateMapGrid
public org.geotools.feature.DefaultFeatureCollection populateMapGrid(int[][] mapIndexes, org.locationtech.jts.geom.Envelope[][] mapsBounds, CreateMapPagesProcessor.PagingDimensions pagingD, org.geotools.api.referencing.crs.CoordinateReferenceSystem projection, AreaOfInterest areaOfInterest, boolean renderPagingOverview) Populates the map grid and collects overview features. -
createMapDefinitions
public List<Map<String,Object>> createMapDefinitions(int[][] mapIndexes, org.locationtech.jts.geom.Envelope[][] mapsBounds, CreateMapPagesProcessor.PagingDimensions pagingD, CreateMapPagesProcessor.Input values) Creates map definitions for each page. -
createSingleMapDefinition
public MapAttribute.MapAttributeValues createSingleMapDefinition(MapAttribute.MapAttributeValues map, org.locationtech.jts.geom.Envelope mapsBound, PagingAttribute.PagingProcessorValues paging) Handles creation of a single map definition.
-