[ENRICHMENT][BETA] Use of community API in enrichment process AND addition to tagging result for communities through projects #359

Merged
claudio.atzori merged 22 commits from propagationapi into beta 2023-11-30 14:20:34 +01:00
4 changed files with 13 additions and 16 deletions
Showing only changes of commit 8eb70e6657 - Show all commits

View File

@ -15,8 +15,6 @@ import org.jetbrains.annotations.NotNull;
*/ */
public class QueryCommunityAPI { public class QueryCommunityAPI {
claudio.atzori marked this conversation as resolved Outdated

It is not a good idea to hardcode the service base urls. Please consider to factor it out as an input parameter: having the possibility to define the API base URL fits well with the definition of a test case where the API server application is mocked locally.

It is not a good idea to hardcode the service base urls. Please consider to factor it out as an input parameter: having the possibility to define the API base URL fits well with the definition of a test case where the API server application is mocked locally.

I have changed this. Now we have a parameter baseURL where to specify the URL for production or beta.
It is expected to be "https://services.openaire.eu/openaire/communities/" and the equivalent one for beta "https://beta.services.openaire.eu/openaire/communities/"

I have changed this. Now we have a parameter baseURL where to specify the URL for production or beta. It is expected to be "https://services.openaire.eu/openaire/communities/" and the equivalent one for beta "https://beta.services.openaire.eu/openaire/communities/"

Thanks!

Thanks!
private static String get(String geturl) throws IOException { private static String get(String geturl) throws IOException {
URL url = new URL(geturl); URL url = new URL(geturl);
HttpURLConnection conn = (HttpURLConnection) url.openConnection(); HttpURLConnection conn = (HttpURLConnection) url.openConnection();
@ -48,7 +46,6 @@ public class QueryCommunityAPI {
return get(baseURL + id + "/contentproviders"); return get(baseURL + id + "/contentproviders");
} }
public static String communityPropagationOrganization(String id, String baseURL) throws IOException { public static String communityPropagationOrganization(String id, String baseURL) throws IOException {