Merge pull request #2380 from eikek/custom-processing-data

Custom processing data
This commit is contained in:
mergify[bot]
2023-11-15 19:28:03 +00:00
committed by GitHub
16 changed files with 62 additions and 25 deletions

View File

@ -16,7 +16,7 @@ Since Docspell is free software, the tools must also be free.
# Considered Options
* [Apache POI](https://poi.apache.org) together with
[this](https://search.maven.org/artifact/fr.opensagres.xdocreport/org.apache.poi.xwpf.converter.pdf/1.0.6/jar)
[this](https://central.sonatype.com/artifact/fr.opensagres.xdocreport/org.apache.poi.xwpf.converter.pdf/1.0.6)
library
* [pandoc](https://pandoc.org/) external command
* [abiword](https://www.abisource.com/) external command

View File

@ -7,6 +7,7 @@ import docspell.addons.out.NewItem.{Meta => ItemMeta}
import docspell.common._
import docspell.common.Timestamp
import docspell.common.bc.{AttachmentAction, BackendCommand, ItemAction}
import io.circe.Json
import io.circe.syntax._
object AddonOutputExample extends Helper {
@ -53,7 +54,8 @@ object AddonOutputExample extends Helper {
metadata = FileMeta(
language = Some(Language.English),
skipDuplicate = Some(true),
attachmentsOnly = Some(false)
attachmentsOnly = Some(false),
customData = None
),
file = "new-file1.docx"
),
@ -61,7 +63,8 @@ object AddonOutputExample extends Helper {
metadata = FileMeta(
language = Some(Language.German),
skipDuplicate = Some(true),
attachmentsOnly = Some(false)
attachmentsOnly = Some(false),
customData = None
),
file = "new-file2.pdf"
)
@ -77,7 +80,8 @@ object AddonOutputExample extends Helper {
source = "the-addon-x".some,
skipDuplicate = true.some,
tags = List("tag1", "tag2").some,
attachmentsOnly = None
attachmentsOnly = None,
customData = Some(Json.obj("my-id" -> Json.fromInt(42)))
).some,
files = List("a-file.pdf", "another.jpg")
)

View File

@ -2,6 +2,7 @@ package docspell.website
import cats.syntax.option._
import docspell.common.{Language, ProcessItemArgs}
import io.circe.Json
import io.circe.syntax._
object ItemArgsExample extends Helper {
@ -18,7 +19,8 @@ object ItemArgsExample extends Helper {
fileFilter = None,
tags = List("given-tag-1").some,
reprocess = false,
attachmentsOnly = None
attachmentsOnly = None,
customData = Some(Json.obj("my-id" -> Json.fromInt(42)))
)
val exampleJson = example.asJson.spaces2

View File

@ -5,6 +5,7 @@ import docspell.common.MetaProposal.Candidate
import docspell.common._
import docspell.joex.process.ItemData
import docspell.store.records.{RAttachment, RAttachmentMeta, RItem}
import io.circe.Json
import io.circe.syntax._
object ItemDataExample extends Helper {
@ -67,7 +68,8 @@ object ItemDataExample extends Helper {
givenMeta = givenProposals,
tags = List("tag-1"),
classifyProposals = MetaProposalList.empty,
classifyTags = List("invoice")
classifyTags = List("invoice"),
customData = Some(Json.obj("my-id" -> Json.fromInt(42)))
)
val exampleJson = example.asJson.spaces2