diff options
author | emusic <emina.music@egiz.gv.at> | 2020-01-17 14:39:04 +0100 |
---|---|---|
committer | emusic <emina.music@egiz.gv.at> | 2020-01-17 14:39:04 +0100 |
commit | cc3e985f2ed5c78b04f494feb2abdb534479a06e (patch) | |
tree | d14a1402cd1a20f5f46fe902f4459ce44cb76888 /pdf-as-lib/src/main/java/at/gv/egiz | |
parent | ddda14ba127c1f96763523cef707a1dda1b7cca0 (diff) | |
download | pdf-as-4-cc3e985f2ed5c78b04f494feb2abdb534479a06e.tar.gz pdf-as-4-cc3e985f2ed5c78b04f494feb2abdb534479a06e.tar.bz2 pdf-as-4-cc3e985f2ed5c78b04f494feb2abdb534479a06e.zip |
changes in qr placeholder search - additional information removed, location of dictionary used for storing qr info
Diffstat (limited to 'pdf-as-lib/src/main/java/at/gv/egiz')
3 files changed, 34 insertions, 36 deletions
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/placeholder/PlaceholderExtractor.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/placeholder/PlaceholderExtractor.java index 62a26a16..4c352b90 100644 --- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/placeholder/PlaceholderExtractor.java +++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/placeholder/PlaceholderExtractor.java @@ -4,6 +4,5 @@ import at.gv.egiz.pdfas.common.exceptions.PdfAsException; import at.gv.egiz.pdfas.lib.impl.status.PDFObject; public interface PlaceholderExtractor { - public SignaturePlaceholderData extract(PDFObject doc, - String placeholderId, int matchMode) throws PdfAsException; + SignaturePlaceholderData extract(PDFObject doc, String placeholderId, int matchMode) throws PdfAsException; } diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/placeholder/PlaceholderFilter.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/placeholder/PlaceholderFilter.java index 51cd3ff2..5919ee5d 100644 --- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/placeholder/PlaceholderFilter.java +++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/placeholder/PlaceholderFilter.java @@ -36,18 +36,22 @@ import at.gv.egiz.pdfas.lib.impl.status.OperationStatus; public class PlaceholderFilter implements IConfigurationConstants, PlaceholderExtractorConstants { - public static SignaturePlaceholderData checkPlaceholderSignature( - OperationStatus status, ISettings settings) throws PdfAsException, + public static SignaturePlaceholderData checkPlaceholderSignatureLocation( + OperationStatus status, ISettings settings, String signatureLocation) throws PdfAsException, IOException { + String placeholderID; + if (status.getPlaceholderConfiguration().isGlobalPlaceholderEnabled()) { - PlaceholderExtractor extractor = status.getBackend() - .getPlaceholderExtractor(); + PlaceholderExtractor extractor = status.getBackend().getPlaceholderExtractor(); - String placeholderID = PlaceholderWebConfiguration.getValue(PLACEHOLDER_WEB_ID); - if(placeholderID == null) - { - placeholderID = settings.getValue(PLACEHOLDER_ID); + if(signatureLocation!=null) { + placeholderID = signatureLocation; + } else { + placeholderID = PlaceholderWebConfiguration.getValue(PLACEHOLDER_WEB_ID); + if(placeholderID == null) { + placeholderID = settings.getValue(PLACEHOLDER_ID); + } } String placeholderModeString = settings.getValue(PLACEHOLDER_MODE); @@ -55,7 +59,6 @@ public class PlaceholderFilter implements IConfigurationConstants, if (placeholderModeString != null) { try { placeholderMode = Integer.parseInt(placeholderModeString); - if (placeholderMode < PLACEHOLDER_MODE_MIN || placeholderMode > PLACEHOLDER_MODE_MAX) { throw new PdfAsErrorCarrier(new PDFASError( @@ -66,39 +69,36 @@ public class PlaceholderFilter implements IConfigurationConstants, PDFASError.ERROR_INVALID_PLACEHOLDER_MODE, e)); } } - SignaturePlaceholderData signaturePlaceholderData = extractor - .extract(status.getPdfObject(), placeholderID, placeholderMode); - + SignaturePlaceholderData signaturePlaceholderData = extractor.extract(status.getPdfObject(), placeholderID, placeholderMode); return signaturePlaceholderData; + } else if (status.getPlaceholderConfiguration().isProfileConfigurationEnabled(status.getRequestedSignature().getSignatureProfileID())) { //filter for local placeholder in selected profiles - PlaceholderExtractor extractor = status.getBackend() - .getPlaceholderExtractor(); + PlaceholderExtractor extractor = status.getBackend().getPlaceholderExtractor(); int placeholderMode = PLACEHOLDER_MATCH_MODE_SORTED; - String placeholderID =status.getPlaceholderConfiguration().getProfilePlaceholderID(status.getRequestedSignature().getSignatureProfileID()); - if(placeholderID != null) - { + placeholderID = status.getPlaceholderConfiguration().getProfilePlaceholderID(status.getRequestedSignature().getSignatureProfileID()); + if(placeholderID != null) { placeholderMode = PLACEHOLDER_MATCH_MODE_MODERATE; } String placeholderModeString = settings.getValue(PLACEHOLDER_MODE); - if (placeholderModeString != null) { - try { - placeholderMode = Integer.parseInt(placeholderModeString); - if (placeholderMode < PLACEHOLDER_MODE_MIN - || placeholderMode > PLACEHOLDER_MODE_MAX) { - throw new PdfAsErrorCarrier(new PDFASError( - PDFASError.ERROR_INVALID_PLACEHOLDER_MODE)); - } - } catch (NumberFormatException e) { + if (placeholderModeString != null) { + try { + placeholderMode = Integer.parseInt(placeholderModeString); + if (placeholderMode < PLACEHOLDER_MODE_MIN + || placeholderMode > PLACEHOLDER_MODE_MAX) { throw new PdfAsErrorCarrier(new PDFASError( - PDFASError.ERROR_INVALID_PLACEHOLDER_MODE, e)); + PDFASError.ERROR_INVALID_PLACEHOLDER_MODE)); } + } catch (NumberFormatException e) { + throw new PdfAsErrorCarrier(new PDFASError( + PDFASError.ERROR_INVALID_PLACEHOLDER_MODE, e)); } - SignaturePlaceholderData signaturePlaceholderData = extractor - .extract(status.getPdfObject(), placeholderID, placeholderMode); - - return signaturePlaceholderData; } + SignaturePlaceholderData signaturePlaceholderData = extractor.extract(status.getPdfObject(), placeholderID, placeholderMode); + return signaturePlaceholderData; + } return null; - }}
\ No newline at end of file + } + +}
\ No newline at end of file diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/placeholder/SignaturePlaceholderData.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/placeholder/SignaturePlaceholderData.java index 3dbedee5..cf0ad149 100644 --- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/placeholder/SignaturePlaceholderData.java +++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/placeholder/SignaturePlaceholderData.java @@ -54,8 +54,7 @@ import at.knowcenter.wag.egov.egiz.pdf.TablePos; * @author exthex * */ -public class -SignaturePlaceholderData { +public class SignaturePlaceholderData { public static final String ID_KEY = "id"; |