From cc071a13cb44570b3be50b74e74a1efa934862a2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Brunner?=
Date: Thu, 3 Dec 2020 13:39:29 +0100
Subject: [PATCH] Use c2cciutils - Publish to GitHub Container Registry
---
.dependabot/config.yml | 6 ++
examples/.editorconfig => .editorconfig | 17 ++++-
.github/workflows/audit.yaml | 5 +-
.github/workflows/clean-dockerhub-tag.yaml | 20 ------
.github/workflows/clean.yaml | 27 +++++++
.github/workflows/codeql.yaml | 2 +-
.github/workflows/{ci.yaml => main.yaml} | 31 ++++----
.github/workflows/rebuild-old.yaml | 9 +--
.github/workflows/rebuild.yaml | 31 ++++----
Makefile | 2 +-
SECURITY.md | 1 +
ci/check-fonts | 18 ++---
ci/clean-dockerhub-tag | 57 ---------------
ci/config.yaml | 15 ++++
ci/docker-config.json.tmpl | 7 --
ci/publish | 40 -----------
ci/requirements.txt | 1 +
ci/test-eof-newline | 32 ---------
.../java/org/mapfish/print/FontTools.java | 32 ++++-----
.../mapfish/print/config/Configuration.java | 4 +-
.../java/org/mapfish/print/http/Utils.java | 2 +-
.../map/style/json/JsonStyleParserHelper.java | 2 +-
.../style/json/MapfishStyleParserPlugin.java | 2 +-
.../output/ResourceBundleClassLoader.java | 6 +-
.../mapfish/print/parser/RequiresTracker.java | 6 +-
.../processor/http/matcher/URIMatcher.java | 2 +-
.../processor/jasper/JasperReportBuilder.java | 4 +-
.../print/processor/map/scalebar/Label.java | 2 +-
.../map/scalebar/ScalebarGraphic.java | 2 +-
.../print/servlet/HandleReportLoadResult.java | 2 +-
.../mapfish/print/servlet/job/PrintJob.java | 10 +--
.../job/impl/ThreadPoolJobManager.java | 2 +-
.../job/impl/hibernate/package-info.java | 2 +-
.../print/servlet/job/impl/package-info.java | 2 +-
.../print/servlet/job/package-info.java | 2 +-
.../org/mapfish/print/wrapper/PObject.java | 2 +-
.../main/resources/mapfish-spring.properties | 2 +-
.../schemas/wfs/1.0.0/OGC-exception.xsd | 2 +-
.../net/opengis/schemas/wfs/1.1.0/wfs.xsd | 16 ++---
.../net/opengis/schemas/wfs/2.0/wfs.xsd | 2 +-
.../print/config/ConfigurationTest.java | 2 +-
.../processor/map/AddOverlayLayersTest.java | 4 +-
.../print/servlet/MapPrinterServletTest.java | 6 +-
docs/src/main/resources/templates/docker.html | 2 +-
.../main/resources/templates/download.html | 2 +-
.../resources/templates/jasperreports.html | 16 ++---
.../main/resources/templates/tableimages.html | 2 +-
examples/geoserver-data/csw.xml | 4 +-
.../demo/WFS_getFeature-1.0.xml | 2 +-
.../demo/WFS_getFeature-1.1.xml | 2 +-
examples/geoserver-data/plugIns/Domain.xml | 2 +-
.../geoserver-data/plugIns/GazetteerName.xml | 2 +-
examples/geoserver-data/wcs.xml | 4 +-
examples/geoserver-data/wfs.xml | 2 +-
examples/geoserver-data/wms.xml | 2 +-
.../examples/multiple_maps/countries.geojson | 2 +-
.../examples/oereb/Report_fr.properties | 8 +--
.../examples/oereb/Report_it.properties | 2 +-
.../resources/examples/oereb/requestData.json | 70 +++++++++----------
.../resource_bundle/countries.geojson | 2 +-
.../examples/simple/countries.geojson | 2 +-
secrets.yml | 6 --
spell-ignore-words.txt | 2 +
63 files changed, 238 insertions(+), 339 deletions(-)
rename examples/.editorconfig => .editorconfig (54%)
delete mode 100644 .github/workflows/clean-dockerhub-tag.yaml
create mode 100644 .github/workflows/clean.yaml
rename .github/workflows/{ci.yaml => main.yaml} (91%)
delete mode 100755 ci/clean-dockerhub-tag
create mode 100644 ci/config.yaml
delete mode 100644 ci/docker-config.json.tmpl
delete mode 100755 ci/publish
create mode 100644 ci/requirements.txt
delete mode 100755 ci/test-eof-newline
delete mode 100644 secrets.yml
create mode 100644 spell-ignore-words.txt
diff --git a/.dependabot/config.yml b/.dependabot/config.yml
index b568a3021d..46d8862516 100644
--- a/.dependabot/config.yml
+++ b/.dependabot/config.yml
@@ -70,3 +70,9 @@ update_configs:
allowed_updates:
- match:
update_type: security
+ - package_manager: python
+ directory: /ci
+ update_schedule: live
+ automerged_updates:
+ - match:
+ update_type: all
diff --git a/examples/.editorconfig b/.editorconfig
similarity index 54%
rename from examples/.editorconfig
rename to .editorconfig
index c6c8b36219..87a75a07a6 100644
--- a/examples/.editorconfig
+++ b/.editorconfig
@@ -1,9 +1,20 @@
root = true
[*]
-indent_style = space
-indent_size = 2
end_of_line = lf
+insert_final_newline = true
charset = utf-8
+indent_style = space
+indent_size = 4
trim_trailing_whitespace = true
-insert_final_newline = true
+max_line_length = 110
+quote_type = single
+
+[*.js]
+indent_size = 2
+
+[*.yaml]
+indent_size = 2
+
+[Makefile]
+indent_style = tab
diff --git a/.github/workflows/audit.yaml b/.github/workflows/audit.yaml
index 1bae7f5db6..620f528a18 100644
--- a/.github/workflows/audit.yaml
+++ b/.github/workflows/audit.yaml
@@ -6,7 +6,7 @@ on:
- cron: '30 2 * * *'
jobs:
- main:
+ audit:
runs-on: ubuntu-20.04
name: Audit
timeout-minutes: 10
@@ -21,9 +21,10 @@ jobs:
- '3.23'
- '3.24'
- '3.25'
+ - master
steps:
- - uses: actions/checkout@v1
+ - uses: actions/checkout@v2
with:
ref: ${{ matrix.branch }}
diff --git a/.github/workflows/clean-dockerhub-tag.yaml b/.github/workflows/clean-dockerhub-tag.yaml
deleted file mode 100644
index 164540a442..0000000000
--- a/.github/workflows/clean-dockerhub-tag.yaml
+++ /dev/null
@@ -1,20 +0,0 @@
----
-name: Clean docker hub tags
-
-on: delete
-
-jobs:
- clean:
- runs-on: ubuntu-20.04
- name: Clean docker hub tags
- timeout-minutes: 5
- env:
- SUMMON_PROVIDER: /usr/local/bin/gopass
- steps:
- - uses: actions/checkout@v1
- - uses: camptocamp/initialise-gopass-summon-action@v1
- with:
- ci-gpg-private-key: ${{secrets.CI_GPG_PRIVATE_KEY}}
- github-gopass-ci-token: ${{secrets.GOPASS_CI_GITHUB_TOKEN}}
- - name: Clean docker hub tags
- run: ci/clean-dockerhub-tag
diff --git a/.github/workflows/clean.yaml b/.github/workflows/clean.yaml
new file mode 100644
index 0000000000..a819b6e7d2
--- /dev/null
+++ b/.github/workflows/clean.yaml
@@ -0,0 +1,27 @@
+---
+name: Clean docker hub tags
+
+on: delete
+
+jobs:
+ clean:
+ runs-on: ubuntu-20.04
+ name: Clean docker hub tags
+ timeout-minutes: 5
+
+ steps:
+ - uses: actions/checkout@v2
+ - uses: camptocamp/initialise-gopass-summon-action@v2
+ with:
+ ci-gpg-private-key: ${{secrets.CI_GPG_PRIVATE_KEY}}
+ github-gopass-ci-token: ${{secrets.GOPASS_CI_GITHUB_TOKEN}}
+ patterns: docker
+
+ - run: |
+ sudo rm /etc/apt/sources.list.d/*.list
+ sudo apt update
+ sudo apt install --yes python3-wheel
+ - run: sudo python3 -m pip install --requirement=ci/requirements.txt
+
+ - name: Clean docker hub tags
+ run: c2cciutils-clean
diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml
index a4042255aa..9248bd2b6c 100644
--- a/.github/workflows/codeql.yaml
+++ b/.github/workflows/codeql.yaml
@@ -8,7 +8,7 @@ on:
jobs:
CodeQL-Build:
- runs-on: ubuntu-latest
+ runs-on: ubuntu-20.04
name: Code scanning
timeout-minutes: 15
diff --git a/.github/workflows/ci.yaml b/.github/workflows/main.yaml
similarity index 91%
rename from .github/workflows/ci.yaml
rename to .github/workflows/main.yaml
index f708935ac8..699f0eab79 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/main.yaml
@@ -3,7 +3,6 @@ name: Continuous integration
on:
push:
- pull_request:
jobs:
build:
@@ -13,11 +12,10 @@ jobs:
if: "!startsWith(github.event.head_commit.message, '[skip ci] ')"
env:
- SUMMON_PROVIDER: /usr/local/bin/gopass
SECRETS: ${{ secrets.SECRETS }}
steps:
- - uses: actions/checkout@v1
+ - uses: actions/checkout@v2
- name: Get tag
id: tag2
@@ -29,13 +27,11 @@ jobs:
if: "startsWith(github.ref, 'refs/tags/')"
- run: echo --${{ steps.tag2.outputs.replaced }}--
- - run: git --no-pager diff --check `git log --oneline | tail -1 | cut --fields=1 --delimiter=' '`
- - run: ci/test-eof-newline
-
- - uses: camptocamp/initialise-gopass-summon-action@v1
+ - uses: camptocamp/initialise-gopass-summon-action@v2
with:
ci-gpg-private-key: ${{secrets.CI_GPG_PRIVATE_KEY}}
github-gopass-ci-token: ${{secrets.GOPASS_CI_GITHUB_TOKEN}}
+ patterns: pypi docker
if: env.SECRETS == 'TRUE'
- run: gpg --export-secret-keys --armor D121AF2DFA8E140688BD968930C9B913FD42EF13 > CI.asc
if: env.SECRETS == 'TRUE'
@@ -43,6 +39,16 @@ jobs:
- run: echo "enablePublishing=true" > gradle.properties
if: env.SECRETS == 'TRUE'
+ - run: |
+ sudo rm /etc/apt/sources.list.d/*.list
+ sudo apt update
+ sudo apt install --yes python3-wheel
+
+ - run: sudo python3 -m pip install --requirement=ci/requirements.txt
+
+ - name: Checks
+ run: c2cciutils-checks
+
- run: make build
- run: make acceptance-tests-up
- run: make acceptance-tests-run
@@ -93,15 +99,8 @@ jobs:
path: /tmp/test_results
if: failure()
- - run: mkdir -p ~/.docker
- - name: Decrypt secrets
- run: summon --environment dockerhub bash -c 'envsubst < ci/docker-config.json.tmpl > ~/.docker/config.json'
- if: env.SECRETS == 'TRUE'
-
- - name: publish
- run: ci/publish
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ - name: Publish
+ run: c2cciutils-publish
if: env.SECRETS == 'TRUE'
- id: version
diff --git a/.github/workflows/rebuild-old.yaml b/.github/workflows/rebuild-old.yaml
index 5a1de9065b..5b9eb8eef3 100644
--- a/.github/workflows/rebuild-old.yaml
+++ b/.github/workflows/rebuild-old.yaml
@@ -18,6 +18,9 @@ jobs:
fail-fast: false
matrix:
branch:
+ - '3.20'
+ - '3.21'
+ - '3.22'
- '3.23'
steps:
@@ -48,13 +51,11 @@ jobs:
sudo apt update
sudo apt install fonts-liberation
- - run: git --no-pager diff --check `git log --oneline | tail -1 | cut --fields=1 --delimiter=' '`
- - run: ci/test-eof-newline
-
- - uses: camptocamp/initialise-gopass-summon-action@v1
+ - uses: camptocamp/initialise-gopass-summon-action@v2
with:
ci-gpg-private-key: ${{secrets.CI_GPG_PRIVATE_KEY}}
github-gopass-ci-token: ${{secrets.GOPASS_CI_GITHUB_TOKEN}}
+ patterns: docker
- run: gpg --export-secret-keys --armor D121AF2DFA8E140688BD968930C9B913FD42EF13 > CI.asc
- name: Install Cadastra fonts for OEREB example
diff --git a/.github/workflows/rebuild.yaml b/.github/workflows/rebuild.yaml
index e343efd492..4a57def7de 100644
--- a/.github/workflows/rebuild.yaml
+++ b/.github/workflows/rebuild.yaml
@@ -11,21 +11,18 @@ jobs:
timeout-minutes: 30
name: Rebuild
- env:
- SUMMON_PROVIDER: /usr/local/bin/gopass
-
strategy:
fail-fast: false
matrix:
branch:
- '3.25'
- '3.24'
- - 'master'
+ - master
steps:
- run: echo ${{ github.ref }}
- - uses: actions/checkout@v1
+ - uses: actions/checkout@v2
with:
ref: ${{ matrix.branch }}
@@ -39,16 +36,22 @@ jobs:
if: "startsWith(github.ref, 'refs/tags/')"
- run: echo --${{ steps.tag2.outputs.replaced }}--
- - run: git --no-pager diff --check `git log --oneline | tail -1 | cut --fields=1 --delimiter=' '`
- - run: ci/test-eof-newline
-
- - uses: camptocamp/initialise-gopass-summon-action@v1
+ - uses: camptocamp/initialise-gopass-summon-action@v2
with:
ci-gpg-private-key: ${{secrets.CI_GPG_PRIVATE_KEY}}
github-gopass-ci-token: ${{secrets.GOPASS_CI_GITHUB_TOKEN}}
+ patterns: docker
+
- run: gpg --export-secret-keys --armor D121AF2DFA8E140688BD968930C9B913FD42EF13 > CI.asc
- run: echo "enablePublishing=true" > gradle.properties
+
+ - run: |
+ sudo rm /etc/apt/sources.list.d/*.list
+ sudo apt update
+ sudo apt install --yes python3-wheel
+ - run: sudo python3 -m pip install --requirement=ci/requirements.txt
+
- run: make build
# Extract artifacts
@@ -79,14 +82,8 @@ jobs:
path: /tmp/test_results
if: failure()
- - run: mkdir -p ~/.docker
- - name: Decrypt secrets
- run: summon --environment dockerhub bash -c 'envsubst < ci/docker-config.json.tmpl > ~/.docker/config.json'
-
- - name: publish
- run: ci/publish
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ - name: Publish
+ run: c2cciutils-publish --branch=${{matrix.branch}}
- run: ./gradlew :core:libSourcesJar
if: "startsWith(github.ref, 'refs/tags/')"
diff --git a/Makefile b/Makefile
index be195d90d0..31267d73ee 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ GIT_HEAD_ARG = --build-arg=GIT_HEAD=$(shell git rev-parse HEAD)
.PHONY: build
build:
- # Requred and not nesseerly exists
+ # Required and not nesseerly exists
touch CI.asc
docker build $(GIT_HEAD_ARG) --target=builder --tag=mapfish_print_builder .
diff --git a/SECURITY.md b/SECURITY.md
index c0103a570d..bd822fd27d 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -11,3 +11,4 @@
| 3.23 | 31/10/2021 |
| 3.24 | 31/12/2021 |
| 3.25 | 31/12/2021 |
+| 3.26 | 31/06/2021 |
diff --git a/ci/check-fonts b/ci/check-fonts
index 8cec81e77f..e260ae945b 100755
--- a/ci/check-fonts
+++ b/ci/check-fonts
@@ -4,13 +4,13 @@ import requests
def main():
- responce = requests.get("http://localhost:8080/print/fonts")
+ response = requests.get("http://localhost:8080/print/fonts")
- assert responce.ok, responce.status_code
- assert (
- responce.headers["Content-Type"] == "application/json;charset=utf-8"
- ), responce.headers["Content-Type"]
- fonts_result = responce.json()
+ assert response.ok, response.status_code
+ assert response.headers["Content-Type"] == "application/json;charset=utf-8", response.headers[
+ "Content-Type"
+ ]
+ fonts_result = response.json()
fonts = [
"DejaVu Sans",
@@ -55,9 +55,9 @@ def main():
for font, fontconfig in fonts.items():
font_result = [f for f in fonts_result["fonts"] if f["family"] == font]
assert len(font_result) == 1
- assert font_result[0]["fontconfig"] == fontconfig, "Invalid {}: ".format(
- font
- ) + str(font_result[0]["fontconfig"])
+ assert font_result[0]["fontconfig"] == fontconfig, "Invalid {}: ".format(font) + str(
+ font_result[0]["fontconfig"]
+ )
if __name__ == "__main__":
diff --git a/ci/clean-dockerhub-tag b/ci/clean-dockerhub-tag
deleted file mode 100755
index 8dc70a1c20..0000000000
--- a/ci/clean-dockerhub-tag
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-
-import json
-import os
-import subprocess
-import sys
-
-import requests
-
-
-def clean(image: str, tag: str, token: str) -> None:
- print("Delete image '{image}:{tag}'.".format(image=image, tag=tag))
-
- response = requests.head(
- "https://hub.docker.com/v2/repositories/{image}/tags/{tag}/".format(image=image, tag=tag),
- headers={"Authorization": "JWT " + token},
- )
- if response.status_code == 404:
- return
- if not response.ok:
- print("Error checking image '{image}:{tag}' status.".format(image=image, tag=tag))
- print(response.text)
- sys.exit(2)
-
- response = requests.delete(
- "https://hub.docker.com/v2/repositories/{image}/tags/{tag}/".format(image=image, tag=tag),
- headers={"Authorization": "JWT " + token},
- )
- if not response.ok:
- print("Error on deleting tag: " + tag)
- print(response.text)
- sys.exit(2)
-
-
-def main() -> None:
- token = requests.post(
- "https://hub.docker.com/v2/users/login/",
- headers={"Content-Type": "application/json"},
- data=json.dumps(
- {
- "username": subprocess.check_output(["gopass", "gs/ci/dockerhub/username"]).decode(),
- "password": subprocess.check_output(["gopass", "gs/ci/dockerhub/password"]).decode(),
- }
- ),
- ).json()["token"]
-
- with open(os.environ["GITHUB_EVENT_PATH"]) as event_file:
- ref = json.loads(event_file.read())["ref"]
-
- ref = ref.replace("/", "_")
-
- clean("camptocamp/mapfish_print", ref, token)
-
-
-if __name__ == "__main__":
- main()
diff --git a/ci/config.yaml b/ci/config.yaml
new file mode 100644
index 0000000000..6a09fd2e2d
--- /dev/null
+++ b/ci/config.yaml
@@ -0,0 +1,15 @@
+version:
+ tag_to_version_re:
+ - from: release/([0-9]+\.[0-9]+\.[0-9]+)
+ to: \1
+
+checks:
+ codespell:
+ ignore_re:
+ - ^examples/src/test/resources/examples/.*
+ - ^examples/geoserver-data/.*
+ - ^core/src/test/java/org/mapfish/print/parser/MapfishParserTest\.java$
+ - ^core/src/test/resources/map-data/geojson/states\.json$
+ - ^core/src/test/resources/org/mapfish/print/parser/mapAttributeTest\.json$
+ - ^core/src/test/resources/map-data/openlayers/OpenLayers\.js$
+ - ^core/src/test/resources/map-data/geojson/ny-roads-3857\.json$
diff --git a/ci/docker-config.json.tmpl b/ci/docker-config.json.tmpl
deleted file mode 100644
index 45dc8ddacf..0000000000
--- a/ci/docker-config.json.tmpl
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "auths": {
- "https://index.docker.io/v1/": {
- "auth": "${TOKEN}"
- }
- }
-}
diff --git a/ci/publish b/ci/publish
deleted file mode 100755
index 205881e305..0000000000
--- a/ci/publish
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/env python3
-
-import os
-import re
-import subprocess
-
-
-def publish(docker_version):
- print("Deploying image to Docker hub for tag " + docker_version)
- image_name = "camptocamp/mapfish_print:" + docker_version
- subprocess.check_call(["docker", "tag", "camptocamp/mapfish_print", image_name])
- subprocess.check_call(["docker", "push", image_name])
-
-
-def main():
- if os.environ.get("GITHUB_EVENT_NAME") == "pull_request":
- print("Not deploying image for pull requests")
- exit(0)
-
- branch_match = re.match("^refs/heads/(.*)$", os.environ["GITHUB_REF"])
- tag_match = re.match("^refs/tags/(.*)$", os.environ["GITHUB_REF"])
- if branch_match and branch_match.group(1) == "master":
- publish("latest")
-
- elif tag_match:
- release_match = re.match("^release/(.*)$", tag_match.group(1))
- publish(release_match.group(1) if release_match else tag_match.group(1))
- if release_match:
- print("Publishing")
- subprocess.check_call(["./gradlew", "publish"])
-
- elif branch_match:
- publish(branch_match.group(1).replace("/", "_"))
-
- else:
- print("Not deploying image")
-
-
-if __name__ == "__main__":
- main()
diff --git a/ci/requirements.txt b/ci/requirements.txt
new file mode 100644
index 0000000000..13f70caa80
--- /dev/null
+++ b/ci/requirements.txt
@@ -0,0 +1 @@
+c2cciutils==1.0.dev20201202131358
diff --git a/ci/test-eof-newline b/ci/test-eof-newline
deleted file mode 100755
index 346c4ca5f3..0000000000
--- a/ci/test-eof-newline
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/usr/bin/python
-
-import os
-import subprocess
-import sys
-
-FNULL = open(os.devnull, "w")
-
-
-def main():
- exit_code = 0
- for filename in subprocess.check_output(["git", "ls-files"]).decode().split("\n"):
- if os.path.isfile(filename):
- if (
- subprocess.call(
- "git check-attr -a '{}' | grep ' text: set'".format(filename), shell=True, stdout=FNULL
- )
- == 0
- ):
- size = os.stat(filename).st_size
- if size != 0:
- with open(filename) as f:
- f.seek(size - 1)
- if ord(f.read()) != ord("\n"):
- print("No new line at end of '{}' file.".format(filename))
- exit_code = 2
-
- sys.exit(exit_code)
-
-
-if __name__ == "__main__":
- main()
diff --git a/core/src/main/java/org/mapfish/print/FontTools.java b/core/src/main/java/org/mapfish/print/FontTools.java
index b299ccadc6..867c9e0c33 100644
--- a/core/src/main/java/org/mapfish/print/FontTools.java
+++ b/core/src/main/java/org/mapfish/print/FontTools.java
@@ -54,18 +54,18 @@ public static class FontConfigDescription {
}
/**
- * Get matched font from a font familly name.
+ * Get matched font from a font family name.
*
- * @param familly the font family name.
- * @return The matched cont conig atributes.
+ * @param family the font family name.
+ * @return The matched cont config attributes.
*/
- public static List listFontConfigFonts(final String familly) {
+ public static List listFontConfigFonts(final String family) {
List descriptions = new ArrayList<>();
if (SystemUtils.IS_OS_LINUX) {
InputStreamReader inputStreamReader = null;
BufferedReader stdInput = null;
try {
- String[] commands = {"fc-list", "-b", familly};
+ String[] commands = {"fc-list", "-b", family};
Process process = Runtime.getRuntime().exec(commands);
inputStreamReader = new InputStreamReader(process.getInputStream(), "utf-8");
@@ -77,19 +77,19 @@ public static List listFontConfigFonts(final String famil
description = new FontConfigDescription();
descriptions.add(description);
} else if (description != null) {
- String[] splitted = inputLine.trim().split(": ");
- if (splitted[0].equals("family")) {
- description.family = splitted[1].substring(1, splitted[1].length() - 4)
+ String[] split = inputLine.trim().split(": ");
+ if (split[0].equals("family")) {
+ description.family = split[1].substring(1, split[1].length() - 4)
.split(Pattern.quote("\"(s) \""));
- } else if (splitted[0].equals("style")) {
- description.style = splitted[1].substring(1, splitted[1].length() - 4)
+ } else if (split[0].equals("style")) {
+ description.style = split[1].substring(1, split[1].length() - 4)
.split(Pattern.quote("\"(s) \""));
- } else if (splitted[0].equals("fullname")) {
- description.name = splitted[1].substring(1, splitted[1].length() - 4);
- } else if (splitted[0].equals("weight")) {
- int weight = Integer.parseInt(splitted[1]
- .substring(0, splitted[1].length() - 6));
- // See more informations:
+ } else if (split[0].equals("fullname")) {
+ description.name = split[1].substring(1, split[1].length() - 4);
+ } else if (split[0].equals("weight")) {
+ int weight = Integer.parseInt(split[1]
+ .substring(0, split[1].length() - 6));
+ // See more information:
// https://work.lisk.in/2020/07/18/font-weight-300.html
// https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight
// #Common_weight_name_mapping
diff --git a/core/src/main/java/org/mapfish/print/config/Configuration.java b/core/src/main/java/org/mapfish/print/config/Configuration.java
index f96ce3093f..52585c981d 100644
--- a/core/src/main/java/org/mapfish/print/config/Configuration.java
+++ b/core/src/main/java/org/mapfish/print/config/Configuration.java
@@ -208,7 +208,7 @@ public final void setCredentials(final List credentials) {
}
/**
- * Get the http proxies used by in all requests in this syste.
+ * Get the http proxies used by in all requests in this system.
*
* @see org.mapfish.print.http.ConfigFileResolvingHttpRequestFactory
*/
@@ -341,7 +341,7 @@ public final void setStyles(final Map styles) {
}
/**
- * Return the named style ot Optional.absent() if there is not a style with the given name.
+ * Return the named style of Optional.absent() if there is not a style with the given name.
*
* @param styleName the name of the style to look up
*/
diff --git a/core/src/main/java/org/mapfish/print/http/Utils.java b/core/src/main/java/org/mapfish/print/http/Utils.java
index 960cd9ba24..b547e41ba2 100644
--- a/core/src/main/java/org/mapfish/print/http/Utils.java
+++ b/core/src/main/java/org/mapfish/print/http/Utils.java
@@ -7,7 +7,7 @@
/**
- * Network utils classe.
+ * Network utils class.
*/
public final class Utils {
private Utils() {
diff --git a/core/src/main/java/org/mapfish/print/map/style/json/JsonStyleParserHelper.java b/core/src/main/java/org/mapfish/print/map/style/json/JsonStyleParserHelper.java
index c7515a66a3..63ebdc9608 100644
--- a/core/src/main/java/org/mapfish/print/map/style/json/JsonStyleParserHelper.java
+++ b/core/src/main/java/org/mapfish/print/map/style/json/JsonStyleParserHelper.java
@@ -488,7 +488,7 @@ private List getFontExpressions(final Expression fontFamily, final E
}
}
if (weight != -1) {
- LOGGER.debug("Search eqivalent font for '{}' with weight {}", font, weight);
+ LOGGER.debug("Search equivalent font for '{}' with weight {}", font, weight);
}
}
boolean match = false;
diff --git a/core/src/main/java/org/mapfish/print/map/style/json/MapfishStyleParserPlugin.java b/core/src/main/java/org/mapfish/print/map/style/json/MapfishStyleParserPlugin.java
index 63606e956e..9cd42332c4 100644
--- a/core/src/main/java/org/mapfish/print/map/style/json/MapfishStyleParserPlugin.java
+++ b/core/src/main/java/org/mapfish/print/map/style/json/MapfishStyleParserPlugin.java
@@ -281,7 +281,7 @@
* should be joined together.
*
* Options: arcs, bevel, miter, miter-clip, round, see the SGV documentation about stroke-linejoin
- * For more informations.
+ * For more information.
* Default is miter
*
*
diff --git a/core/src/main/java/org/mapfish/print/output/ResourceBundleClassLoader.java b/core/src/main/java/org/mapfish/print/output/ResourceBundleClassLoader.java
index defe69e175..e40e197931 100644
--- a/core/src/main/java/org/mapfish/print/output/ResourceBundleClassLoader.java
+++ b/core/src/main/java/org/mapfish/print/output/ResourceBundleClassLoader.java
@@ -35,9 +35,9 @@ protected URL findResource(final String resource) {
public InputStream getResourceAsStream(final String resource) {
try {
final InputStream is = super.getResourceAsStream(resource);
- byte[] ba = new byte[is.available()];
- is.read(ba);
- return new ByteArrayInputStream(new String(ba, "utf-8").getBytes("iso-8859-1"));
+ byte[] bytes = new byte[is.available()];
+ is.read(bytes);
+ return new ByteArrayInputStream(new String(bytes, "utf-8").getBytes("iso-8859-1"));
} catch (IOException e) {
throw new RuntimeException(e);
}
diff --git a/core/src/main/java/org/mapfish/print/parser/RequiresTracker.java b/core/src/main/java/org/mapfish/print/parser/RequiresTracker.java
index b922a68c56..c48213f008 100644
--- a/core/src/main/java/org/mapfish/print/parser/RequiresTracker.java
+++ b/core/src/main/java/org/mapfish/print/parser/RequiresTracker.java
@@ -49,9 +49,9 @@ public void markAsVisited(final Field field) {
this.dependantsInJson.add(field);
}
- final Field dependant = this.requirementToDependantMap.get(field.getName());
- if (dependant != null) {
- this.dependantToRequirementsMap.remove(dependant, field.getName());
+ final Field dependent = this.requirementToDependantMap.get(field.getName());
+ if (dependent != null) {
+ this.dependantToRequirementsMap.remove(dependent, field.getName());
}
}
diff --git a/core/src/main/java/org/mapfish/print/processor/http/matcher/URIMatcher.java b/core/src/main/java/org/mapfish/print/processor/http/matcher/URIMatcher.java
index 6527ad066e..e20d6d6890 100644
--- a/core/src/main/java/org/mapfish/print/processor/http/matcher/URIMatcher.java
+++ b/core/src/main/java/org/mapfish/print/processor/http/matcher/URIMatcher.java
@@ -14,7 +14,7 @@ public interface URIMatcher extends ConfigurationObject {
* Check if the uri is matching.
*
* @param matchInfo the matching information to check
- * @return true if the uri is matching or false otherwis
+ * @return true if the uri is matching or false otherwise
*/
boolean matches(MatchInfo matchInfo)
throws UnknownHostException, SocketException, MalformedURLException;
diff --git a/core/src/main/java/org/mapfish/print/processor/jasper/JasperReportBuilder.java b/core/src/main/java/org/mapfish/print/processor/jasper/JasperReportBuilder.java
index b72525cebe..5b1ebcdf7e 100644
--- a/core/src/main/java/org/mapfish/print/processor/jasper/JasperReportBuilder.java
+++ b/core/src/main/java/org/mapfish/print/processor/jasper/JasperReportBuilder.java
@@ -96,9 +96,9 @@ File compileJasperReport(final File buildFile, final File jasperFile) throws JRE
LOGGER.error("The report '{}' isn't valid.", jasperFile.getAbsolutePath());
throw e;
} finally {
- final long compileTime = TimeUnit.MILLISECONDS.convert(
+ final long compile time = TimeUnit.MILLISECONDS.convert(
compileJasperReport.stop(), TimeUnit.NANOSECONDS);
- LOGGER.info("Report '{}' built in {}ms.", jasperFile.getAbsolutePath(), compileTime);
+ LOGGER.info("Report '{}' built in {}ms.", jasperFile.getAbsolutePath(), compile time);
}
java.nio.file.Files.move(
diff --git a/core/src/main/java/org/mapfish/print/processor/map/scalebar/Label.java b/core/src/main/java/org/mapfish/print/processor/map/scalebar/Label.java
index 1cca2c2b63..dfd00722ac 100644
--- a/core/src/main/java/org/mapfish/print/processor/map/scalebar/Label.java
+++ b/core/src/main/java/org/mapfish/print/processor/map/scalebar/Label.java
@@ -38,7 +38,7 @@ public Label(final float graphicOffset, final TextLayout labelLayout, final Grap
this.graphicOffset = graphicOffset;
this.labelLayout = labelLayout;
Rectangle bounds = this.labelLayout.getPixelBounds(graphics2D.getFontRenderContext(), 0, 0);
- // Not sure on the impact when tha label are rotated
+ // Not sure on the impact when the label are rotated
assert graphics2D.getTransform().getScaleX() == graphics2D.getTransform().getScaleY();
this.width = (float) (bounds.getWidth() / graphics2D.getTransform().getScaleX());
this.height = (float) (bounds.getHeight() / graphics2D.getTransform().getScaleY());
diff --git a/core/src/main/java/org/mapfish/print/processor/map/scalebar/ScalebarGraphic.java b/core/src/main/java/org/mapfish/print/processor/map/scalebar/ScalebarGraphic.java
index 6e0dff5bd2..4bc9bf03bc 100644
--- a/core/src/main/java/org/mapfish/print/processor/map/scalebar/ScalebarGraphic.java
+++ b/core/src/main/java/org/mapfish/print/processor/map/scalebar/ScalebarGraphic.java
@@ -380,7 +380,7 @@ private static int getPadding(final ScaleBarRenderSettings settings) {
* @param mapContext The context of the map for which the scalebar is created.
* @param scalebarParams The scalebar parameters.
* @param tempFolder The directory in which the graphic file is created.
- * @param template The template that containts the scalebar processor
+ * @param template The template that contains the scalebar processor
*/
public final URI render(
final MapfishMapContext mapContext,
diff --git a/core/src/main/java/org/mapfish/print/servlet/HandleReportLoadResult.java b/core/src/main/java/org/mapfish/print/servlet/HandleReportLoadResult.java
index a0fde9b47f..18edbe20c8 100644
--- a/core/src/main/java/org/mapfish/print/servlet/HandleReportLoadResult.java
+++ b/core/src/main/java/org/mapfish/print/servlet/HandleReportLoadResult.java
@@ -35,7 +35,7 @@ public interface HandleReportLoadResult {
* Called when a print succeeded.
*
* @param successfulPrintResult the result
- * @param httpServletResponse the http reponse
+ * @param httpServletResponse the http response
* @param reportURI the uri to the report
* @param loader the loader for loading the report.
*/
diff --git a/core/src/main/java/org/mapfish/print/servlet/job/PrintJob.java b/core/src/main/java/org/mapfish/print/servlet/job/PrintJob.java
index b1ed4a3fa0..0f942a7cfb 100644
--- a/core/src/main/java/org/mapfish/print/servlet/job/PrintJob.java
+++ b/core/src/main/java/org/mapfish/print/servlet/job/PrintJob.java
@@ -278,10 +278,10 @@ private void sendEmail(
multipart.addBodyPart(html);
if (config.getStorage() == null) {
- final MimeBodyPart attachement = new MimeBodyPart();
- attachement.attachFile(getReportFile(), mimeType, null);
- attachement.setFileName(fileName + "." + fileExtension);
- multipart.addBodyPart(attachement);
+ final MimeBodyPart attachment = new MimeBodyPart();
+ attachment.attachFile(getReportFile(), mimeType, null);
+ attachment.setFileName(fileName + "." + fileExtension);
+ multipart.addBodyPart(attachment);
}
message.setContent(multipart);
@@ -333,7 +333,7 @@ protected PasswordAuthentication getPasswordAuthentication() {
* set on {@link org.springframework.security.core.context.SecurityContextHolder} when the thread starts
* executing.
*
- * @param securityContext the conext object
+ * @param securityContext the context object
*/
public final void setSecurityContext(final SecurityContext securityContext) {
this.securityContext = SecurityContextHolder.createEmptyContext();
diff --git a/core/src/main/java/org/mapfish/print/servlet/job/impl/ThreadPoolJobManager.java b/core/src/main/java/org/mapfish/print/servlet/job/impl/ThreadPoolJobManager.java
index 45a18516d0..1b0bd93f99 100644
--- a/core/src/main/java/org/mapfish/print/servlet/job/impl/ThreadPoolJobManager.java
+++ b/core/src/main/java/org/mapfish/print/servlet/job/impl/ThreadPoolJobManager.java
@@ -458,7 +458,7 @@ private boolean updateRegistry() {
"task cancelled (timeout)", true);
}
notifyIfStopped();
- } catch (NoSuchReferenceException e) { // shouldnt'// really happen
+ } catch (NoSuchReferenceException e) { // shouldn't really happen
throw ExceptionUtils.getRuntimeException(e);
}
}
diff --git a/core/src/main/java/org/mapfish/print/servlet/job/impl/hibernate/package-info.java b/core/src/main/java/org/mapfish/print/servlet/job/impl/hibernate/package-info.java
index 1b371bc33a..8e7cf7ceeb 100644
--- a/core/src/main/java/org/mapfish/print/servlet/job/impl/hibernate/package-info.java
+++ b/core/src/main/java/org/mapfish/print/servlet/job/impl/hibernate/package-info.java
@@ -1,5 +1,5 @@
/**
* This package contains interfaces and implementations for executing print jobs in separate threads from the
- * requesting threads. Typically the requests will be queued and a limitted number will be executed at once.
+ * requesting threads. Typically the requests will be queued and a limited number will be executed at once.
*/
package org.mapfish.print.servlet.job.impl.hibernate;
diff --git a/core/src/main/java/org/mapfish/print/servlet/job/impl/package-info.java b/core/src/main/java/org/mapfish/print/servlet/job/impl/package-info.java
index da3f3dc2bf..3e567c1f46 100644
--- a/core/src/main/java/org/mapfish/print/servlet/job/impl/package-info.java
+++ b/core/src/main/java/org/mapfish/print/servlet/job/impl/package-info.java
@@ -1,5 +1,5 @@
/**
* This package contains interfaces and implementations for executing print jobs in separate threads from the
- * requesting threads. Typically the requests will be queued and a limitted number will be executed at once.
+ * requesting threads. Typically the requests will be queued and a limited number will be executed at once.
*/
package org.mapfish.print.servlet.job.impl;
diff --git a/core/src/main/java/org/mapfish/print/servlet/job/package-info.java b/core/src/main/java/org/mapfish/print/servlet/job/package-info.java
index 446749a605..9040ff6a35 100644
--- a/core/src/main/java/org/mapfish/print/servlet/job/package-info.java
+++ b/core/src/main/java/org/mapfish/print/servlet/job/package-info.java
@@ -1,5 +1,5 @@
/**
* This package contains interfaces and implementations for executing print jobs in separate threads from the
- * requesting threads. Typically the requests will be queued and a limitted number will be executed at once.
+ * requesting threads. Typically the requests will be queued and a limited number will be executed at once.
*/
package org.mapfish.print.servlet.job;
diff --git a/core/src/main/java/org/mapfish/print/wrapper/PObject.java b/core/src/main/java/org/mapfish/print/wrapper/PObject.java
index ccc1b8fb14..bcae97e1f7 100644
--- a/core/src/main/java/org/mapfish/print/wrapper/PObject.java
+++ b/core/src/main/java/org/mapfish/print/wrapper/PObject.java
@@ -118,7 +118,7 @@ public interface PObject {
Float optFloat(String key);
/**
- * Get a property as a float or Default vaule.
+ * Get a property as a float or Default value.
*
* @param key the property name
* @param defaultValue default value
diff --git a/core/src/main/resources/mapfish-spring.properties b/core/src/main/resources/mapfish-spring.properties
index adfdfcf9ba..15810f32bb 100644
--- a/core/src/main/resources/mapfish-spring.properties
+++ b/core/src/main/resources/mapfish-spring.properties
@@ -1,4 +1,4 @@
-# All the properties in the file are default values that can be overriden by setting -DpropertyName=Value
+# All the properties in the file are default values that can be overridden by setting -DpropertyName=Value
# in the CATALINA_OPTS environment variable.
# the directory in which temporary files but also the finished reports are stored.
diff --git a/core/src/main/resources/net/opengis/schemas/wfs/1.0.0/OGC-exception.xsd b/core/src/main/resources/net/opengis/schemas/wfs/1.0.0/OGC-exception.xsd
index ffbb9bb599..535ed11cca 100644
--- a/core/src/main/resources/net/opengis/schemas/wfs/1.0.0/OGC-exception.xsd
+++ b/core/src/main/resources/net/opengis/schemas/wfs/1.0.0/OGC-exception.xsd
@@ -65,7 +65,7 @@
offending component of the request. Otherwise the
service may try to use other means to locate the
exception such as line numbers or byte offset from the
- begining of the request, etc ...
+ beginning of the request, etc ...
diff --git a/core/src/main/resources/net/opengis/schemas/wfs/1.1.0/wfs.xsd b/core/src/main/resources/net/opengis/schemas/wfs/1.1.0/wfs.xsd
index dafd5fccf1..c7f8172740 100644
--- a/core/src/main/resources/net/opengis/schemas/wfs/1.1.0/wfs.xsd
+++ b/core/src/main/resources/net/opengis/schemas/wfs/1.1.0/wfs.xsd
@@ -60,7 +60,7 @@
WFS specification that a request conforms to. All requests in
this schema conform to V1.1 of the WFS specification.
For WFS implementations that support more than one version of
- a WFS sepcification ... if the version attribute is not
+ a WFS specification ... if the version attribute is not
specified then the service should assume that the request
conforms to greatest available specification version.
@@ -282,7 +282,7 @@
or transaction request. The SRS may be indicated
using either the EPSG form (EPSG:posc code) or
the URL form defined in subclause 4.3.2 of
- refernce[2].
+ reference[2].
@@ -777,7 +777,7 @@
The typeName attribute is a list of one or more
feature type names that indicate which types
of feature instances should be included in the
- reponse set. Specifying more than one typename
+ response set. Specifying more than one typename
indicates that a join operation is being performed.
All the names in the typeName list must be valid
types that belong to this query's feature content
@@ -882,7 +882,7 @@
The numberOfFeatures attribute should contain a
count of the number of features in the response.
- That is a count of all features elements dervied
+ That is a count of all features elements derived
from gml:AbstractFeatureType.
@@ -1435,7 +1435,7 @@
The UseExsiting value indicates that WFS should not
generate a new feature identifier for the feature
- being inserted into the repositry. Instead, the WFS
+ being inserted into the repository. Instead, the WFS
should use the identifier encoded if the feature.
If a duplicate exists then the WFS should raise an
exception.
@@ -1447,7 +1447,7 @@
The ReplaceDuplicate value indicates that WFS should
not generate a new feature identifier for the feature
- being inserted into the repositry. Instead, the WFS
+ being inserted into the repository. Instead, the WFS
should use the identifier encoded if the feature.
If a duplicate exists then the WFS should replace the
existing feature instance with the one encoded in the
@@ -1460,7 +1460,7 @@
The GenerateNew value indicates that WFS should
generate a new unique feature identifier for the
- feature being inserted into the repositry.
+ feature being inserted into the repository.
@@ -1674,7 +1674,7 @@
-
+
diff --git a/core/src/main/resources/net/opengis/schemas/wfs/2.0/wfs.xsd b/core/src/main/resources/net/opengis/schemas/wfs/2.0/wfs.xsd
index e3dc5c2cb0..3312fe2340 100644
--- a/core/src/main/resources/net/opengis/schemas/wfs/2.0/wfs.xsd
+++ b/core/src/main/resources/net/opengis/schemas/wfs/2.0/wfs.xsd
@@ -742,7 +742,7 @@
-
+
diff --git a/core/src/test/java/org/mapfish/print/config/ConfigurationTest.java b/core/src/test/java/org/mapfish/print/config/ConfigurationTest.java
index 5326544e21..2189415a22 100644
--- a/core/src/test/java/org/mapfish/print/config/ConfigurationTest.java
+++ b/core/src/test/java/org/mapfish/print/config/ConfigurationTest.java
@@ -320,7 +320,7 @@ public void testJdbcDrivers() {
assertEquals(1, errors.size()); // no templates error
- config.setJdbcDrivers(Collections.singleton("non.existant.driver.Driver"));
+ config.setJdbcDrivers(Collections.singleton("non.existent.driver.Driver"));
errors = config.validate();
assertEquals(2, errors.size());
diff --git a/core/src/test/java/org/mapfish/print/processor/map/AddOverlayLayersTest.java b/core/src/test/java/org/mapfish/print/processor/map/AddOverlayLayersTest.java
index c2ba7898a5..770af2124f 100644
--- a/core/src/test/java/org/mapfish/print/processor/map/AddOverlayLayersTest.java
+++ b/core/src/test/java/org/mapfish/print/processor/map/AddOverlayLayersTest.java
@@ -73,12 +73,12 @@ public void testExecute() throws Exception {
private void assertImage(
Values values, int numberOfLayers, String graphicsValueKey, String imageName,
- int width, int height, int tollerance) throws IOException, TranscoderException {
+ int width, int height, int tolerance) throws IOException, TranscoderException {
@SuppressWarnings("unchecked")
List layerGraphics = (List) values.getObject(graphicsValueKey, List.class);
assertEquals(numberOfLayers, layerGraphics.size());
new ImageSimilarity(getFile(BASE_DIR + imageName))
- .assertSimilarity(layerGraphics, width, height, tollerance);
+ .assertSimilarity(layerGraphics, width, height, tolerance);
}
}
diff --git a/core/src/test/java/org/mapfish/print/servlet/MapPrinterServletTest.java b/core/src/test/java/org/mapfish/print/servlet/MapPrinterServletTest.java
index 1f86b2cdcd..19be94c9aa 100644
--- a/core/src/test/java/org/mapfish/print/servlet/MapPrinterServletTest.java
+++ b/core/src/test/java/org/mapfish/print/servlet/MapPrinterServletTest.java
@@ -305,9 +305,9 @@ public void testCreateReport_Email() throws Exception {
assertEquals("text/html; charset=utf-8", body.getContentType());
assertEquals("Please find the requested document in attachment", body.getContent());
- final BodyPart attachement = multipart.getBodyPart(1);
- assertEquals("image/png; name=test-report.png", attachement.getContentType());
- final InputStream content = (InputStream) attachement.getContent();
+ final BodyPart attachment = multipart.getBodyPart(1);
+ assertEquals("image/png; name=test-report.png", attachment.getContentType());
+ final InputStream content = (InputStream) attachment.getContent();
new ImageSimilarity(getFile(MapPrinterServletTest.class, "expectedSimpleImage.png"))
.assertSimilarity(IOUtils.toByteArray(content), 1);
}
diff --git a/docs/src/main/resources/templates/docker.html b/docs/src/main/resources/templates/docker.html
index 57c030960b..2d97c8fd6b 100644
--- a/docs/src/main/resources/templates/docker.html
+++ b/docs/src/main/resources/templates/docker.html
@@ -16,7 +16,7 @@
/usr/local/tomcat/webapps/ROOT/print-apps
.
- You can mount additionnal font in
+ You can mount additional font in
core/docker/usr/share/fonts/truetype//
,
and verity that she is correctly installed by opening the view
[base URL]/print/fonts.
diff --git a/docs/src/main/resources/templates/download.html b/docs/src/main/resources/templates/download.html
index b7e752edb6..2eda36e914 100644
--- a/docs/src/main/resources/templates/download.html
+++ b/docs/src/main/resources/templates/download.html
@@ -20,7 +20,7 @@ Command Line Distribution