java implementation for dms-exchange

Java library for the dms-exchange-specification

License

License

Categories

Categories

Java Languages
GroupId

GroupId

de.galan
ArtifactId

ArtifactId

dms-exchange-java
Last Version

Last Version

1.0.3
Release Date

Release Date

Type

Type

jar
Description

Description

java implementation for dms-exchange
Java library for the dms-exchange-specification
Project URL

Project URL

https://github.com/galan/dms-exchange-java
Source Code Management

Source Code Management

https://github.com/galan/dms-exchange-java

Download dms-exchange-java

How to add to project

<!-- https://jarcasting.com/artifacts/de.galan/dms-exchange-java/ -->
<dependency>
    <groupId>de.galan</groupId>
    <artifactId>dms-exchange-java</artifactId>
    <version>1.0.3</version>
</dependency>
// https://jarcasting.com/artifacts/de.galan/dms-exchange-java/
implementation 'de.galan:dms-exchange-java:1.0.3'
// https://jarcasting.com/artifacts/de.galan/dms-exchange-java/
implementation ("de.galan:dms-exchange-java:1.0.3")
'de.galan:dms-exchange-java:jar:1.0.3'
<dependency org="de.galan" name="dms-exchange-java" rev="1.0.3">
  <artifact name="dms-exchange-java" type="jar" />
</dependency>
@Grapes(
@Grab(group='de.galan', module='dms-exchange-java', version='1.0.3')
)
libraryDependencies += "de.galan" % "dms-exchange-java" % "1.0.3"
[de.galan/dms-exchange-java "1.0.3"]

Dependencies

compile (4)

Group / Artifact Type Version
de.galan : verjson jar 0.8.1
org.apache.commons : commons-compress jar 1.9
org.apache.logging.log4j : log4j-core Optional jar 2.8
org.apache.logging.log4j : log4j-api jar 2.8

test (2)

Group / Artifact Type Version
junit : junit jar 4.12
org.assertj : assertj-core jar 3.6.2

Project Modules

There are no modules declared in this project.

Build Status Maven Central License

This java-library is the reference-implementation for the dms-exchange-specification. It covers the following use-cases:

  • Creating new export-archives and adding document-containers
  • Reading existing document-container from existing export-archives

The library can be used in any existing dms/software to enable support for the dms-exchange-specification. It is licenced under the conditions of the Apache License 2.0 (see LICENCE file).

Usage

Creating an export-archive

Create the writer using one of the convenience construction methods from DmsExchange:

DmsWriter writer = DmsExchange.createWriter("/path/to/archive.tgz");

Feed the writer with documents:

writer.add(...);

As last step, close the writer (AutoClosable can be used):

writer.close();

Other writer also support writing to OutputStreams or splitting files depending on conditions, such as amount of document or filesize.

Reading an export-archive

Create the reader using one of the convenience construction methods from DmsExchange:

DmsReader reader = DmsExchange.createReader("/path/to/archive.tgz");

Read the documents using a single consumer:

reader.readDocuments(document -> /* eg. import to your system */);

Document

Documents are simple java beans, they can be instantiated using new, fields are accessed using the according setter/getter accessor methods. Fluent setters are also available.

Example of creating a minimal Document with some fields:

// Source keeps same, use a constant
private static final Source SOURCE = new Source("dms-name", null, "https://www.example.com", "[email protected]");

Document doc = new Document().source(SOURCE);
DocumentFile docfile = new DocumentFile("car-insurance-2014.pdf");
docfile.addRevision(new Revision(/*documentfile creation-time*/).data(byte[] or InputStream or File));
doc.addDocumentFile(docfile);
// use a setter
doc.setNote("Keep an eye on this");
// or the fluent methods
doc.note("Keep an eye on this").labels("important", "invoice").project("insurance");

Compatiblity

dms-exchange-java supports the dms-exchange-specification version 1.0.0.

When newer versions of dms-exchange-specification will be released, this library is designed to be backward compatible.

Integration with Maven

Just add the following dependency:

<dependency>
	<groupId>de.galan</groupId>
	<artifactId>dms-exchange-java</artifactId>
	<version>1.0.2</version>
</dependency>

Versions

Version
1.0.3
1.0.2