use of api.support.ControlledVocabularyPreparation in project mod-inventory by folio-org.
the class ApiTestSuite method createInstanceTypes.
private static void createInstanceTypes() throws MalformedURLException, InterruptedException, ExecutionException, TimeoutException {
OkapiHttpClient client = createOkapiHttpClient();
URL instanceTypes = new URL(String.format("%s/instance-types", storageOkapiUrl()));
ControlledVocabularyPreparation instanceTypesPreparation = new ControlledVocabularyPreparation(client, instanceTypes, "instanceTypes");
textInstanceTypeId = instanceTypesPreparation.createOrReferenceTerm("text", "txt", "rdacontent");
}
use of api.support.ControlledVocabularyPreparation in project mod-inventory by folio-org.
the class ApiTestSuite method createIdentifierTypes.
private static void createIdentifierTypes() throws MalformedURLException, InterruptedException, ExecutionException, TimeoutException {
OkapiHttpClient client = createOkapiHttpClient();
URL identifierTypesUrl = new URL(String.format("%s/identifier-types", storageOkapiUrl()));
ControlledVocabularyPreparation identifierTypesPreparation = new ControlledVocabularyPreparation(client, identifierTypesUrl, "identifierTypes");
isbnIdentifierTypeId = identifierTypesPreparation.createOrReferenceTerm("ISBN");
asinIdentifierTypeId = identifierTypesPreparation.createOrReferenceTerm("ASIN");
}
use of api.support.ControlledVocabularyPreparation in project mod-inventory by folio-org.
the class ApiTestSuite method createContributorNameTypes.
private static void createContributorNameTypes() throws MalformedURLException, InterruptedException, ExecutionException, TimeoutException {
OkapiHttpClient client = createOkapiHttpClient();
URL contributorNameTypes = new URL(String.format("%s/contributor-name-types", storageOkapiUrl()));
ControlledVocabularyPreparation contributorNameTypesPreparation = new ControlledVocabularyPreparation(client, contributorNameTypes, "contributorNameTypes");
personalContributorNameTypeId = contributorNameTypesPreparation.createOrReferenceTerm("Personal name");
}
use of api.support.ControlledVocabularyPreparation in project mod-inventory by folio-org.
the class ApiTestSuite method createMaterialTypes.
private static void createMaterialTypes() throws MalformedURLException, InterruptedException, ExecutionException, TimeoutException {
OkapiHttpClient client = createOkapiHttpClient();
URL materialTypesUrl = new URL(String.format("%s/material-types", storageOkapiUrl()));
ControlledVocabularyPreparation materialTypePreparation = new ControlledVocabularyPreparation(client, materialTypesUrl, "mtypes");
bookMaterialTypeId = materialTypePreparation.createOrReferenceTerm("Book");
dvdMaterialTypeId = materialTypePreparation.createOrReferenceTerm("DVD");
}
use of api.support.ControlledVocabularyPreparation in project mod-inventory by folio-org.
the class ReferenceRecordClientExamples method before.
@Before
public void before() throws InterruptedException, ExecutionException, TimeoutException, MalformedURLException {
OkapiHttpClient okapiHttpClient = ExternalStorageSuite.createOkapiHttpClient();
URL materialTypesUrl = new URL(String.format("%s/%s", ExternalStorageSuite.getStorageAddress(), "/material-types"));
CollectionResourceClient collectionResourceClient = new CollectionResourceClient(okapiHttpClient, materialTypesUrl);
referenceClient = new ReferenceRecordClient(collectionResourceClient, "mtypes");
CompletableFuture<Void> allDeleted = new CompletableFuture<>();
collectionResourceClient.delete(response -> {
if (response.getStatusCode() == 204) {
allDeleted.complete(null);
} else {
allDeleted.completeExceptionally(new Exception(response.getBody()));
}
});
waitForCompletion(allDeleted);
preparation = new ControlledVocabularyPreparation(okapiHttpClient, materialTypesUrl, "mtypes");
}
Aggregations