-
Notifications
You must be signed in to change notification settings - Fork 1
Add client ID to ROR request and switch to APIv2 #1359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
5d1d821
Add client ID to ROR request
KochTobi 498a3e3
improve logging
KochTobi 64e46b3
Introduce types for ROR API v2
KochTobi 9be083a
Provide constructors without api key
KochTobi 0ef0de9
Require non-null client id
KochTobi 2d409e7
Rename class
KochTobi 0d1e0c4
Introduce API class
KochTobi 46fc3f6
Fix stub
KochTobi 2520b42
Check input argument
KochTobi 6df0913
Extract methods
KochTobi d9417b4
Include http status code in error message
KochTobi 5754c83
Add space in error message
KochTobi 5b85bc7
Fix App Config
KochTobi dac5d60
Add check in constructor
KochTobi 8d05c08
Fix ror setup
KochTobi d26401a
inline variable
KochTobi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...ture/src/main/java/life/qbic/projectmanagement/infrastructure/organisations/RorEntry.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package life.qbic.projectmanagement.infrastructure.organisations; | ||
|
|
||
| public interface RorEntry { | ||
|
|
||
| String getId(); | ||
|
|
||
| String getDisplayedName(); | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
...re/src/main/java/life/qbic/projectmanagement/infrastructure/organisations/RorEntryV2.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| package life.qbic.projectmanagement.infrastructure.organisations; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import java.util.List; | ||
|
|
||
| public class RorEntryV2 implements RorEntry { | ||
|
|
||
| @JsonProperty("id") | ||
| String id; | ||
|
|
||
| @JsonProperty("names") | ||
| List<OrganisationName> names; | ||
|
|
||
| public static class OrganisationName { | ||
|
|
||
| @JsonProperty("lang") | ||
| String language; | ||
|
|
||
| @JsonProperty("types") | ||
| List<String> types; | ||
|
|
||
| @JsonProperty("value") | ||
| String value; | ||
|
|
||
| public String getLanguage() { | ||
| return language; | ||
| } | ||
|
|
||
| public List<String> getTypes() { | ||
| return types; | ||
| } | ||
|
|
||
| public String getValue() { | ||
| return value; | ||
| } | ||
| } | ||
|
|
||
| public String getId() { | ||
| return id; | ||
| } | ||
|
|
||
| @Override | ||
| public String getDisplayedName() { | ||
| return names.stream().filter(name -> name.getTypes().contains("ror_display")).findFirst() | ||
| .map(OrganisationName::getValue) | ||
| .orElseThrow(); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.