diff --git a/CHANGELOG.md b/CHANGELOG.md index ae0c60cfc..540de2ee6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/metasvc-client/src/main/java/de/digitalcollections/cudami/client/identifiable/entity/work/CudamiWorksClient.java b/metasvc-client/src/main/java/de/digitalcollections/cudami/client/identifiable/entity/work/CudamiWorksClient.java index 0b4c634f3..6de1ecc33 100644 --- a/metasvc-client/src/main/java/de/digitalcollections/cudami/client/identifiable/entity/work/CudamiWorksClient.java +++ b/metasvc-client/src/main/java/de/digitalcollections/cudami/client/identifiable/entity/work/CudamiWorksClient.java @@ -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; @@ -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; @@ -16,6 +19,9 @@ public class CudamiWorksClient extends CudamiEntitiesClient { + @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"); } @@ -43,4 +49,8 @@ public List 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); + } }