Skip to content

Commit

Permalink
[PR #295] rollback VocabularyController changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaskabc authored and ledsoft committed Sep 13, 2024
1 parent f238fac commit dcc5dfb
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions src/main/java/cz/cvut/kbss/termit/rest/VocabularyController.java
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ public List<AbstractChangeRecord> 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({
Expand Down Expand Up @@ -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<String> namespace) {
LOG.warn("Called legacy endpoint intended for internal use or testing only! (/vocabularies/{}/terms/text-analysis)", localName);
vocabularyService.runTextAnalysisOnAllTerms(getById(localName, namespace));
}

Expand All @@ -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();
}

Expand Down Expand Up @@ -384,11 +381,11 @@ public void removeVocabulary(@Parameter(description = ApiDoc.ID_LOCAL_NAME_DESCR
@GetMapping(value = "/{localName}/relations")
public List<RdfsStatement> 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<String> namespace) {
example = ApiDoc.ID_NAMESPACE_EXAMPLE)
@RequestParam(name = QueryParams.NAMESPACE,
required = false) Optional<String> namespace) {
final URI identifier = resolveIdentifier(namespace.orElse(config.getNamespace().getVocabulary()), localName);
final Vocabulary vocabulary = vocabularyService.findRequired(identifier);

Expand All @@ -404,11 +401,11 @@ public List<RdfsStatement> relations(@Parameter(description = ApiDoc.ID_LOCAL_NA
@GetMapping(value = "/{localName}/terms/relations")
public List<RdfsStatement> 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<String> namespace) {
example = ApiDoc.ID_NAMESPACE_EXAMPLE)
@RequestParam(name = QueryParams.NAMESPACE,
required = false) Optional<String> namespace) {
final URI identifier = resolveIdentifier(namespace.orElse(config.getNamespace().getVocabulary()), localName);
final Vocabulary vocabulary = vocabularyService.findRequired(identifier);

Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit dcc5dfb

Please sign in to comment.