From dcc5dfba6b98c3ee120080fd0b6cfb3da8b16886 Mon Sep 17 00:00:00 2001 From: lukaskabc Date: Thu, 12 Sep 2024 12:59:25 +0200 Subject: [PATCH] [PR #295] rollback VocabularyController changes --- .../termit/rest/VocabularyController.java | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/src/main/java/cz/cvut/kbss/termit/rest/VocabularyController.java b/src/main/java/cz/cvut/kbss/termit/rest/VocabularyController.java index 3b5d52a56..c03272516 100644 --- a/src/main/java/cz/cvut/kbss/termit/rest/VocabularyController.java +++ b/src/main/java/cz/cvut/kbss/termit/rest/VocabularyController.java @@ -262,7 +262,6 @@ public List getHistory( return vocabularyService.getChanges(vocabulary); } - @Operation(security = {@SecurityRequirement(name = "bearer-key")}, description = "Gets summary info about changes made to the content of the vocabulary (term creation, editing).") @ApiResponses({ @@ -325,7 +324,6 @@ public void runTextAnalysisOnAllTerms(@Parameter(description = ApiDoc.ID_LOCAL_N example = ApiDoc.ID_NAMESPACE_EXAMPLE) @RequestParam(name = QueryParams.NAMESPACE, required = false) Optional namespace) { - LOG.warn("Called legacy endpoint intended for internal use or testing only! (/vocabularies/{}/terms/text-analysis)", localName); vocabularyService.runTextAnalysisOnAllTerms(getById(localName, namespace)); } @@ -341,7 +339,6 @@ public void runTextAnalysisOnAllTerms(@Parameter(description = ApiDoc.ID_LOCAL_N @ResponseStatus(HttpStatus.ACCEPTED) @PreAuthorize("hasRole('" + SecurityConstants.ROLE_ADMIN + "')") public void runTextAnalysisOnAllVocabularies() { - LOG.warn("Called legacy endpoint intended for internal use or testing only! (/vocabularies/text-analysis)"); vocabularyService.runTextAnalysisOnAllVocabularies(); } @@ -384,11 +381,11 @@ public void removeVocabulary(@Parameter(description = ApiDoc.ID_LOCAL_NAME_DESCR @GetMapping(value = "/{localName}/relations") public List relations(@Parameter(description = ApiDoc.ID_LOCAL_NAME_DESCRIPTION, example = ApiDoc.ID_LOCAL_NAME_EXAMPLE) - @PathVariable String localName, + @PathVariable String localName, @Parameter(description = ApiDoc.ID_NAMESPACE_DESCRIPTION, - example = ApiDoc.ID_NAMESPACE_EXAMPLE) - @RequestParam(name = QueryParams.NAMESPACE, - required = false) Optional namespace) { + example = ApiDoc.ID_NAMESPACE_EXAMPLE) + @RequestParam(name = QueryParams.NAMESPACE, + required = false) Optional namespace) { final URI identifier = resolveIdentifier(namespace.orElse(config.getNamespace().getVocabulary()), localName); final Vocabulary vocabulary = vocabularyService.findRequired(identifier); @@ -404,11 +401,11 @@ public List relations(@Parameter(description = ApiDoc.ID_LOCAL_NA @GetMapping(value = "/{localName}/terms/relations") public List termsRelations(@Parameter(description = ApiDoc.ID_LOCAL_NAME_DESCRIPTION, example = ApiDoc.ID_LOCAL_NAME_EXAMPLE) - @PathVariable String localName, + @PathVariable String localName, @Parameter(description = ApiDoc.ID_NAMESPACE_DESCRIPTION, - example = ApiDoc.ID_NAMESPACE_EXAMPLE) - @RequestParam(name = QueryParams.NAMESPACE, - required = false) Optional namespace) { + example = ApiDoc.ID_NAMESPACE_EXAMPLE) + @RequestParam(name = QueryParams.NAMESPACE, + required = false) Optional namespace) { final URI identifier = resolveIdentifier(namespace.orElse(config.getNamespace().getVocabulary()), localName); final Vocabulary vocabulary = vocabularyService.findRequired(identifier); @@ -587,15 +584,10 @@ public AccessLevel getAccessLevel(@Parameter(description = ApiDoc.ID_LOCAL_NAME_ * A couple of constants for the {@link VocabularyController} API documentation. */ public static final class ApiDoc { - public static final String ID_LOCAL_NAME_DESCRIPTION = "Locally (in the context of the specified namespace/default vocabulary namespace) unique part of the vocabulary identifier."; - public static final String ID_LOCAL_NAME_EXAMPLE = "datovy-mpp-3.4"; - public static final String ID_NAMESPACE_DESCRIPTION = "Identifier namespace. Allows to override the default vocabulary identifier namespace."; - public static final String ID_NAMESPACE_EXAMPLE = "http://onto.fel.cvut.cz/ontologies/slovnik/"; - public static final String ID_NOT_FOUND_DESCRIPTION = "Vocabulary with the specified identifier not found."; private ApiDoc() {