Skip to content

Commit

Permalink
Add missing client method refreshNewspapers for works
Browse files Browse the repository at this point in the history
  • Loading branch information
morpheus-87 committed Aug 9, 2024
1 parent 9fdf323 commit 6ecf59d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
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);
}
}

0 comments on commit 6ecf59d

Please sign in to comment.