Skip to content
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

Add missing client method refreshNewspapers for works #170

Merged
merged 1 commit into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## Unreleased

### Added

- Added missing client method `refreshNewspapers` for works

## [9.3.1](https://github.com/dbmdz/metadata-service/releases/tag/9.3.1) - 2024-08-06

### Fixed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package de.digitalcollections.cudami.client.identifiable.entity.work;

import static de.digitalcollections.cudami.client.CudamiRestClient.API_VERSION_PREFIX;

import com.fasterxml.jackson.databind.ObjectMapper;
import de.digitalcollections.cudami.client.identifiable.entity.CudamiEntitiesClient;
import de.digitalcollections.model.exception.TechnicalException;
Expand All @@ -8,6 +10,7 @@
import de.digitalcollections.model.identifiable.entity.work.Work;
import de.digitalcollections.model.list.paging.PageRequest;
import de.digitalcollections.model.list.paging.PageResponse;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.net.http.HttpClient;
import java.util.List;
import java.util.Locale;
Expand All @@ -16,6 +19,9 @@

public class CudamiWorksClient extends CudamiEntitiesClient<Work> {

@SuppressFBWarnings(value = "SS_SHOULD_BE_STATIC", justification = "non-static is fine, though")
private final String digiPressBaseEndpoint = API_VERSION_PREFIX + "/digipress";

public CudamiWorksClient(HttpClient http, String serverUrl, ObjectMapper mapper) {
super(http, serverUrl, Work.class, mapper, API_VERSION_PREFIX + "/works");
}
Expand Down Expand Up @@ -43,4 +49,8 @@ public List<Locale> getLanguagesOfManifestations(UUID uuid) throws TechnicalExce
return doGetRequestForObjectList(
String.format("%s/%s/manifestations/languages", baseEndpoint, uuid), Locale.class);
}

public void refreshNewspapers() throws TechnicalException {
doPutRequestForObject(digiPressBaseEndpoint + "/refresh", null);
}
}
Loading