Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
Updater
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open-Data
Updater
Commits
f4569272
Verified
Commit
f4569272
authored
4 months ago
by
Jesper Zedlitz
Browse files
Options
Downloads
Patches
Plain Diff
fixed missing import from Apache Jena
parent
e118bf5b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
pom.xml
+5
-0
5 additions, 0 deletions
pom.xml
src/main/java/de/landsh/opendata/MetadataUpdatesCkan.java
+5
-14
5 additions, 14 deletions
src/main/java/de/landsh/opendata/MetadataUpdatesCkan.java
with
10 additions
and
14 deletions
pom.xml
+
5
−
0
View file @
f4569272
...
@@ -251,6 +251,11 @@
...
@@ -251,6 +251,11 @@
<artifactId>
jsoup
</artifactId>
<artifactId>
jsoup
</artifactId>
<version>
1.18.3
</version>
<version>
1.18.3
</version>
</dependency>
</dependency>
<dependency>
<groupId>
org.apache.jena
</groupId>
<artifactId>
jena-core
</artifactId>
<version>
5.3.0
</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.jena/jena-arq -->
<!-- https://mvnrepository.com/artifact/org.apache.jena/jena-arq -->
<dependency>
<dependency>
<groupId>
org.apache.jena
</groupId>
<groupId>
org.apache.jena
</groupId>
...
...
This diff is collapsed.
Click to expand it.
src/main/java/de/landsh/opendata/MetadataUpdatesCkan.java
+
5
−
14
View file @
f4569272
...
@@ -4,7 +4,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
...
@@ -4,7 +4,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import
com.fasterxml.jackson.dataformat.yaml.YAMLFactory
;
import
com.fasterxml.jackson.dataformat.yaml.YAMLFactory
;
import
de.landsh.opendata.ckan.ApiKey
;
import
de.landsh.opendata.ckan.ApiKey
;
import
de.landsh.opendata.ckan.CkanAPI
;
import
de.landsh.opendata.ckan.CkanAPI
;
import
org.apache.commons.lang3.StringUtils
;
import
org.json.JSONArray
;
import
org.json.JSONArray
;
import
org.json.JSONObject
;
import
org.json.JSONObject
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -20,7 +19,8 @@ import static de.landsh.opendata.OpenDataUpdatesPiveau.*;
...
@@ -20,7 +19,8 @@ import static de.landsh.opendata.OpenDataUpdatesPiveau.*;
/**
/**
* Erzeugt neue Metadaten-Einträge im Open-Data-Portal für Datensätze, deren Distributionen extern liegen.
* Erzeugt neue Metadaten-Einträge im Open-Data-Portal für Datensätze, deren Distributionen extern liegen.
* Ein Beispiel: Rückwirkend wird für jeden Monat eine Datei nach dem Muster https://example.org/daten/2023/2.txt angelegt.
* Ein Beispiel: Rückwirkend wird für jeden Monat eine Datei nach dem Muster
* <a href="https://example.org/daten/2023/2.txt">https://example.org/daten/2023/2.txt</a> angelegt.
* Es kann also am 1. März 2023 der Datensatz daten-2023-2 im Open-Data-Portal angelegt werden.
* Es kann also am 1. März 2023 der Datensatz daten-2023-2 im Open-Data-Portal angelegt werden.
*/
*/
public
class
MetadataUpdatesCkan
{
public
class
MetadataUpdatesCkan
{
...
@@ -32,9 +32,6 @@ public class MetadataUpdatesCkan {
...
@@ -32,9 +32,6 @@ public class MetadataUpdatesCkan {
ckanAPI
=
new
CkanAPI
(
baseURL
,
apiKey
);
ckanAPI
=
new
CkanAPI
(
baseURL
,
apiKey
);
}
}
public
MetadataUpdatesCkan
(
String
baseURL
,
ApiKey
apiKey
,
String
userName
,
String
password
)
{
ckanAPI
=
new
CkanAPI
(
baseURL
,
apiKey
,
userName
,
password
);
}
public
static
void
main
(
String
[]
args
)
throws
IOException
{
public
static
void
main
(
String
[]
args
)
throws
IOException
{
if
(
args
.
length
<
1
||
!
new
File
(
args
[
0
]).
exists
())
{
if
(
args
.
length
<
1
||
!
new
File
(
args
[
0
]).
exists
())
{
...
@@ -45,16 +42,10 @@ public class MetadataUpdatesCkan {
...
@@ -45,16 +42,10 @@ public class MetadataUpdatesCkan {
ObjectMapper
mapper
=
new
ObjectMapper
(
new
YAMLFactory
());
ObjectMapper
mapper
=
new
ObjectMapper
(
new
YAMLFactory
());
UpdateSettings
settings
=
mapper
.
readValue
(
new
File
(
args
[
0
]),
UpdateSettings
.
class
);
UpdateSettings
settings
=
mapper
.
readValue
(
new
File
(
args
[
0
]),
UpdateSettings
.
class
);
final
ApiKey
apiKey
=
new
ApiKey
(
settings
.
isDryRun
()
?
"DRY_RUN"
:
settings
.
getApiKey
());
final
ApiKey
apiKey
=
new
ApiKey
(
settings
.
isDryRun
()
?
"DRY_RUN"
:
settings
.
getAuthorization
());
final
MetadataUpdatesCkan
self
=
new
MetadataUpdatesCkan
(
settings
.
getBaseAddress
(),
apiKey
);
final
MetadataUpdatesCkan
self
;
if
(
StringUtils
.
isNotEmpty
(
settings
.
getHttpBasicUserName
()))
{
// CKAN is proctected with HTTP Basic authentication, e.g. a stage system
self
=
new
MetadataUpdatesCkan
(
settings
.
getCkanURL
(),
apiKey
,
settings
.
getHttpBasicUserName
(),
settings
.
getHttpBasicPassword
());
}
else
{
self
=
new
MetadataUpdatesCkan
(
settings
.
getCkanURL
(),
apiKey
);
}
self
.
dryRun
=
settings
.
isDryRun
();
self
.
dryRun
=
settings
.
isDryRun
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment