Skip to content

Commit 575ee3c

Browse files
committed
1 parent aed6de7 commit 575ee3c

File tree

60 files changed

+326
-319
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+326
-319
lines changed

.editorconfig

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,25 @@
1414
# limitations under the License.
1515
#
1616

17-
root=true
17+
root = true
1818

1919
[*]
20-
charset=utf-8
21-
end_of_line=lf
22-
insert_final_newline=true
23-
trim_trailing_whitespace=true
24-
indent_style=space
25-
indent_size=4
26-
continuation_indent_size=8
20+
charset = utf-8
21+
end_of_line = lf
22+
indent_size = 4
23+
indent_style = space
24+
insert_final_newline = true
25+
trim_trailing_whitespace = true
2726

28-
[{*.yml,*.yaml}]
29-
indent_style=space
30-
indent_size=2
27+
[*.bat]
28+
end_of_line = crlf
29+
trim_trailing_whitespace = false
3130

32-
[*.gradle]
33-
indent_style=space
34-
indent_size=2
31+
[*.{gradle,yml}]
32+
indent_size = 2
3533

36-
[*.bat]
37-
end_of_line=crlf
34+
[metafacture-io/src/test/resources/org/metafacture/io/compressed.txt]
35+
insert_final_newline = false
3836

3937
[metafacture-runner/src/main/dist/config/java-options.conf]
40-
end_of_line=crlf
38+
end_of_line = crlf

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*.js text
2929
*.fom text
3030

31-
# Platform-specific scripts should always use
31+
# Platform-specific scripts should always use
3232
# their native end-of-line markers:
3333
*.bat text eol=crlf
3434
*.sh text eol=lf

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/).
3737
Explain the problem and include additional details to help maintainers reproduce the problem:
3838

3939
* **Use a clear and descriptive title** for the issue to identify the problem.
40-
* **Describe the exact steps which reproduce the problem** in as many details as possible. For example, start by explaining how you are running Metafacture (e.g. running flux.sh/flux.bat or as a Java library). When listing steps, **don't just say what you did, but explain how you did it**. For example, if you're describing the behavior of a specific Morph/Fix function, provide the actual workflow (Flux/Java) and the full Morph file you're using (see also next point).
40+
* **Describe the exact steps which reproduce the problem** in as many details as possible. For example, start by explaining how you are running Metafacture (e.g. running flux.sh/flux.bat or as a Java library). When listing steps, **don't just say what you did, but explain how you did it**. For example, if you're describing the behavior of a specific Morph/Fix function, provide the actual workflow (Flux/Java) and the full Morph file you're using (see also next point).
4141
* **Provide specific examples to demonstrate the steps**. Include links to files or GitHub projects, or copy/pasteable snippets, which you use in those examples. If you're providing snippets in the issue, use [Markdown code blocks](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code). The ideal example would be a stripped-down runnable use case using some sample data showing the problematic behavior.
4242
* **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior.
4343
* **Explain which behavior you expected to see instead and why.**

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Originally, Metafacture was developed as part of the [Culturegraph](http://cultu
1515
You can either use Metafacture as a stand-alone application or include it as a Java library in your own projects.
1616

1717
## Metafacture as a stand-alone application
18-
18+
1919
If you are only interested in running Flux scripts without doing any Java programming this is the way to go. The instructions assume that you are using a *nix-like shell.
2020

2121
1. Download the latest distribution package from the [metafacture-core/releases](https://github.com/metafacture/metafacture-core/releases) page. Make sure that you do download a distribution package and _not_ a source code package (the file name should include *-dist*).

build.gradle

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import java.util.regex.Matcher
1818

1919
plugins {
2020
id 'org.ajoberstar.grgit' version '2.3.0'
21+
id 'org.ec4j.editorconfig' version '0.0.3'
2122
id 'org.sonarqube' version '2.6.2'
2223
id 'io.codearte.nexus-staging' version '0.11.0'
2324
}
@@ -38,11 +39,25 @@ project(':metafacture-runner') {
3839
apply plugin: 'java'
3940
}
4041

42+
editorconfig {
43+
excludes = [
44+
'**/*.beacon',
45+
'**/*.bgzf',
46+
'**/*.bz2',
47+
'**/*.bzip2',
48+
'**/*.gzip',
49+
'**/*.xz',
50+
'gradlew*'
51+
]
52+
}
53+
4154
subprojects {
4255
apply plugin: 'signing'
4356
apply plugin: 'maven'
4457
apply plugin: 'jacoco'
4558

59+
check.dependsOn(editorconfigCheck)
60+
4661
sourceCompatibility = 1.8
4762
targetCompatibility = 1.8
4863

metafacture-biblio/src/main/java/org/metafacture/biblio/OaiPmhOpener.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424

2525
/**
2626
* Opens an OAI-PMH stream and passes a reader to the receiver.
27-
*
27+
*
2828
* @author Pascal Christoph (dr0i)
29-
*
29+
*
3030
*/
3131
@Description("Opens an OAI-PMH stream and passes a reader to the receiver. Mandatory arguments are: BASE_URL, DATE_FROM, DATE_UNTIL, METADATA_PREFIX, SET_SPEC .")
3232
@In(String.class)
@@ -55,7 +55,7 @@ public OaiPmhOpener() {
5555

5656
/**
5757
* Sets the encoding to use. The default setting is UTF-8.
58-
*
58+
*
5959
* @param encoding new default encoding
6060
*/
6161
public void setEncoding(final String encoding) {
@@ -65,7 +65,7 @@ public void setEncoding(final String encoding) {
6565
/**
6666
* Sets the beginning of the retrieving of updated data. The form is
6767
* YYYY-MM-DD .
68-
*
68+
*
6969
* @param dateFrom The form is YYYY-MM-DD .
7070
*/
7171
public void setDateFrom(final String dateFrom) {
@@ -74,7 +74,7 @@ public void setDateFrom(final String dateFrom) {
7474

7575
/**
7676
* Sets the end of the retrieving of updated data. The form is YYYY-MM-DD .
77-
*
77+
*
7878
* @param dateUntil The form is YYYY-MM-DD .
7979
*/
8080
public void setDateUntil(final String dateUntil) {
@@ -83,7 +83,7 @@ public void setDateUntil(final String dateUntil) {
8383

8484
/**
8585
* Sets the OAI-PM metadata prefix .
86-
*
86+
*
8787
* @param metadataPrefix the OAI-PM metadata prefix
8888
*/
8989
public void setMetadataPrefix(final String metadataPrefix) {
@@ -92,7 +92,7 @@ public void setMetadataPrefix(final String metadataPrefix) {
9292

9393
/**
9494
* Sets the OAI-PM set specification .
95-
*
95+
*
9696
* @param setSpec th OAI-PM set specification
9797
*/
9898
public void setSetSpec(final String setSpec) {

metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public void setXmlEncoding(String xmlEncoding) {
102102

103103
/**
104104
* Formats the resulting xml, by indentation.
105-
*
105+
*
106106
* @param formatted
107107
* True, if formatting is activated.
108108
*/
@@ -257,4 +257,4 @@ private void sendAndClearData() {
257257
getReceiver().process(builder.toString());
258258
builder.delete(0, builder.length());
259259
}
260-
}
260+
}

metafacture-biblio/src/main/java/org/metafacture/biblio/pica/PicaConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ public static PicaConstants from(boolean isNormalized, char ch) {
5353
}
5454
return NO_MARKER;
5555
}
56-
}
56+
}

metafacture-commons/src/main/java/org/metafacture/commons/XmlUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public static String escape(final String unescaped, final boolean escapeUnicode)
104104
.mapToObj(value -> escapeCodePoint(value, escapeUnicode))
105105
.collect(joining());
106106
}
107-
107+
108108
private static String escapeCodePoint(final int codePoint, final boolean escapeUnicode) {
109109
final String entity = entityFor(codePoint);
110110
if (entity != null) {

metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/ObjectThreader.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Copyright 2019 Pascal Christoph (hbz), and others.
2-
*
2+
*
33
* Licensed under the Apache License, Version 2.0 the "License";
44
* you may not use this file except in compliance with the License.
55
* You may obtain a copy of the License at
@@ -33,12 +33,12 @@
3333
* receivers are coupled with an
3434
* {@link org.metafacture.flowcontrol.ObjectPipeDecoupler}, so each added
3535
* receiver runs in its own thread.
36-
*
36+
*
3737
* @param <T> Object type
3838
*
3939
* @author Pascal Christoph (dr0i)
4040
* @author Fabian Steeg (fsteeg)
41-
*
41+
*
4242
*/
4343
@In(Object.class)
4444
@Out(Object.class)

metafacture-html/src/main/java/org/metafacture/html/HtmlDecoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
/**
4343
* Decode HTML to metadata events. Each input document represents one record.
44-
*
44+
*
4545
* @author Fabian Steeg (fsteeg)
4646
*
4747
*/

metafacture-html/src/test/java/org/metafacture/html/ElementExtractorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public final class ElementExtractorTest {
3838
private static final StringReader IN = new StringReader("<html>"
3939
+ "<script data-test='site-head-data'>{\"code\":\"hey\"}</script>"
4040
+ "<script data-test='model-linked-data'>{\"code\":\"yo\"}");
41-
41+
4242
private static final String OUT = "{\"code\":\"yo\"}";
4343

4444
private ElementExtractor elementExtractor;

metafacture-json/src/main/resources/flux-commands.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
# limitations under the License.
1515
#
1616
encode-json org.metafacture.json.JsonEncoder
17-
decode-json org.metafacture.json.JsonDecoder
17+
decode-json org.metafacture.json.JsonDecoder

metafacture-runner/src/main/dist/config/jndi/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
Place your JNDI properties files in this directory. By default
2-
metafacture-runner uses [simpleJNDI](http://code.google.com/p/osjava/wiki/SimpleJNDI)
1+
Place your JNDI properties files in this directory. By default
2+
metafacture-runner uses [simpleJNDI](http://code.google.com/p/osjava/wiki/SimpleJNDI)
33
as JNDI provider.
44

55
# Examples
66

77
One of the most common use cases of JNDI is to provide data sources for
88
JDBC. However, JNDI can be used to pass other variables into a program
99
as well. The following to examples demonstrate how to define data sources
10-
and other values.
10+
and other values.
1111

1212
More elaborate examples can be found in the simpleJDNI documentation which
1313
is part of the [binary download package](http://code.google.com/p/osjava/downloads/detail?name=simple-jndi-0.11.4.1.zip&can=2&q=)
1414
of simpleJNDI.
1515

1616
## Data sources
1717

18-
To register a data source with the name `MySqlDB`, create a property
18+
To register a data source with the name `MySqlDB`, create a property
1919
file named `MySqlDB.properties` with the following contents:
2020

2121
```
@@ -36,5 +36,5 @@ enabled = true
3636
enabled.type = java.lang.Boolean
3737
```
3838

39-
If this file is saved as `debug.properties`, the value of enabled can
40-
be accessed as follows: `debug.enabled`.
39+
If this file is saved as `debug.properties`, the value of enabled can
40+
be accessed as follows: `debug.enabled`.

metafacture-runner/src/main/dist/config/log4j.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
<appender-ref ref="stdout" />
1515
</root>
1616

17-
</log4j:configuration>
17+
</log4j:configuration>

metafacture-runner/src/main/dist/examples/beacon/combine/combine-beacon.flux

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ stream-to-triples|
99
sort-triples(by="subject")|
1010
collect-triples|
1111
encode-formeta(style="multiline")|
12-
write("stdout");
12+
write("stdout");

metafacture-runner/src/main/dist/examples/beacon/combine/read-beacon.flux

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ fileName|
44
open-file(encoding="UTF-8")|
55
read-beacon(metadatafilter="name|isil")|
66
encode-formeta(style="multiline")|
7-
write("stdout");
7+
write("stdout");

metafacture-runner/src/main/dist/examples/beacon/create/extract.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
<regexp match="$[type]"/>
5656
</postprocess>
5757
</choose>
58-
5958
</combine>
6059

6160
</rules>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#BLA BLA
1+
#BLA BLA

metafacture-runner/src/main/dist/examples/count/gnd/count-gnd-types.flux

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ morph(FLUX_DIR + "gnd-type.xml")|
88
stream-to-triples|
99
count-triples(countBy="object")|
1010
template("${s}\t${o}")|
11-
write("stdout");
11+
write("stdout");

metafacture-runner/src/main/dist/examples/count/gnd/gnd-type.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
<substring start="1" end="2" />
99
</data>
1010

11-
12-
1311
</rules>
1412

1513
<maps>

metafacture-runner/src/main/dist/examples/filter/morph/filter-morph.flux

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ as-lines|
88
decode-pica|
99
filter(FLUX_DIR + "filter-morph.xml")|
1010
encode-formeta(style="verbose")|
11-
write("stdout");
11+
write("stdout");

metafacture-runner/src/main/dist/examples/gnd/references2/extract.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@
196196

197197
<entity name="gnd">
198198
<data source="@name" name="name"/>
199-
199+
200200
<data source="[email protected]" name="satzart">
201201
<substring end="2" />
202202
</data>

metafacture-runner/src/main/dist/examples/marc21-to-edm/MARC21-EDM.flux

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ file|
88
open-file|
99
//"1025374754"|
1010
//id|
11-
//template("https://portal.dnb.de/opac.htm?method=requestMarcXml&idn=${o}")|
11+
//template("https://portal.dnb.de/opac.htm?method=requestMarcXml&idn=${o}")|
1212
//open-http|
1313
decode-xml|
1414
handle-marcxml|

0 commit comments

Comments
 (0)