Skip to content

Commit 686eebe

Browse files
authored
Merge pull request #53 from levigo/feature/additional_workflows
Feature/additional workflows
2 parents 664d0c6 + efa988c commit 686eebe

File tree

3 files changed

+71
-4
lines changed

3 files changed

+71
-4
lines changed

.github/workflows/continuous-delivery.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ jobs:
5353

5454
## Initializes the CodeQL tools for scanning.
5555
- name: Initialize CodeQL
56-
uses: github/codeql-action/init@v1
56+
uses: github/codeql-action/init@v2
5757
with:
58-
languages: ${{ matrix.language }}
58+
languages: java
5959

6060
- name: Build with Maven
6161
run: mvn -s .m2/settings.xml -gs .m2/settings.xml -B package --file pom.xml
@@ -64,7 +64,7 @@ jobs:
6464
NEXUS_PASSWORD: ${{secrets.NEXUS_PASSWORD}}
6565

6666
- name: Perform CodeQL Analysis
67-
uses: github/codeql-action/analyze@v1
67+
uses: github/codeql-action/analyze@v2
6868

6969
- name: Create Release
7070
id: create_release
@@ -83,7 +83,7 @@ jobs:
8383
env:
8484
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8585
with:
86-
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
86+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing its ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
8787
asset_path: ./target/jadice-server-converter-client-${{ env.NEW_VERSION }}.exe
8888
asset_name: jadice-server-converter-client-${{ env.NEW_VERSION }}.exe
8989
asset_content_type: application/octet-stream
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package org.levigo.jadice.server.converterclient.configurations;
2+
3+
import com.levigo.jadice.server.Job;
4+
import com.levigo.jadice.server.documentplatform.ReshapeNode;
5+
import com.levigo.jadice.server.documentplatform.ReshapeNode.Conformance;
6+
import com.levigo.jadice.server.nodes.StreamInputNode;
7+
import com.levigo.jadice.server.nodes.StreamOutputNode;
8+
9+
public class PDFA2bReshapeConfig implements WorkflowConfiguration {
10+
11+
public void configureWorkflow(Job job) {
12+
final ReshapeNode reshapeNode = new ReshapeNode();
13+
reshapeNode.setTargetMimeType("application/pdf");
14+
reshapeNode.setConformance(Conformance.PDFA2b);
15+
16+
job.attach(new StreamInputNode()
17+
.appendSuccessor(reshapeNode)
18+
.appendSuccessor(new StreamOutputNode()));
19+
}
20+
21+
public String getDescription() {
22+
return "Convert to PDF-A/2b via jadice document platform";
23+
}
24+
25+
public String getID() {
26+
return "x2pdf-A2b (DOCP)";
27+
}
28+
29+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package org.levigo.jadice.server.converterclient.configurations;
2+
3+
import java.util.EnumSet;
4+
5+
import com.levigo.jadice.server.Job;
6+
import com.levigo.jadice.server.nodes.StreamInputNode;
7+
import com.levigo.jadice.server.nodes.StreamOutputNode;
8+
import com.levigo.jadice.server.pdfvalidation.PdfValidationNode;
9+
import com.levigo.jadice.server.pdfvalidation.PdfValidationNode.ResultType;
10+
11+
public class PDFValidationConfig implements WorkflowConfiguration {
12+
13+
public void configureWorkflow(Job job) {
14+
final PdfValidationNode pdfValidationNode = new PdfValidationNode();
15+
pdfValidationNode.setFlavourId("2b");
16+
pdfValidationNode.setDoValidationTask(true); // perform PDF/A validation
17+
pdfValidationNode.setDoFixMetadataTask(false); // do not fix metadata since it may take some additional time
18+
pdfValidationNode.setFeatureExtractionConfigIndex(1); // perform the minimal set of feature extractions since
19+
// performance is more important for this workflow
20+
pdfValidationNode.setFixupFailureAction(PdfValidationNode.FixupFailureAction.WARN);
21+
pdfValidationNode.setMaxFails(-1); // how many issues are allowed -1 = indefinite
22+
pdfValidationNode.setRecordPasses(false); // do not list the checked steps since it could be a very long list
23+
pdfValidationNode.setTargetResults(EnumSet.of(ResultType.REPORT_XML)); // only return the Report
24+
25+
job.attach(new StreamInputNode()
26+
.appendSuccessor(pdfValidationNode)
27+
.appendSuccessor(new StreamOutputNode()));
28+
}
29+
30+
public String getDescription() {
31+
return "Validate PDF with veraPDF";
32+
}
33+
34+
public String getID() {
35+
return "validatePDF (2b)";
36+
}
37+
38+
}

0 commit comments

Comments
 (0)