Skip to content

Commit

Permalink
Re added POST method for keyword and depreciated the GET api.
Browse files Browse the repository at this point in the history
  • Loading branch information
ianwallen committed Jan 3, 2024
1 parent 697acdf commit 1775f71
Showing 1 changed file with 77 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ public Object searchKeywords(
)
@RequestMapping(
path = "/keyword",
method = RequestMethod.GET,
method = RequestMethod.POST,
produces = {
MediaType.APPLICATION_XML_VALUE,
MediaType.APPLICATION_JSON_VALUE
Expand All @@ -337,7 +337,7 @@ public Object searchKeywords(
})
@ResponseBody
@ResponseStatus(HttpStatus.OK)
public Object getKeywordById(
public Object getKeyword(
@Parameter(
description = "Keyword identifier or list of keyword identifiers comma separated.",
required = true)
Expand Down Expand Up @@ -509,6 +509,81 @@ public Object getKeywordById(
}
}

/**
* Gets the keyword by id.
*
* @param uri the uri
* @param sThesaurusName the s thesaurus name
* @param langs the langs
* @param keywordOnly the keyword only
* @param transformation the transformation
* @param allRequestParams the all request params
* @param request the request
* @return the keyword by id
* @throws Exception the exception
*/
@io.swagger.v3.oas.annotations.Operation(
summary = "Get keyword by id",
description = "Retrieve XML representation of keyword(s) from same thesaurus" +
"using different transformations. " +
"'to-iso19139-keyword' is the default and return an ISO19139 snippet." +
"'to-iso19139-keyword-as-xlink' return an XLinked element. Custom transformation " +
"can be create on a per schema basis." +
"Depreciated: use POST method instead as it support larger parameters",
deprecated = true
)
@RequestMapping(
path = "/keyword",
method = RequestMethod.GET,
produces = {
MediaType.APPLICATION_XML_VALUE,
MediaType.APPLICATION_JSON_VALUE
})
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "XML snippet with requested keywords."),
})
@ResponseBody
@ResponseStatus(HttpStatus.OK)
@Deprecated()
public Object getKeywordById(
@Parameter(
description = "Keyword identifier or list of keyword identifiers comma separated.",
required = true)
@RequestParam(name = "id")
String uri,
@Parameter(
description = "Thesaurus to look info for the keyword(s).",
required = true)
@RequestParam(name = "thesaurus")
String sThesaurusName,
@Parameter(
description = "Languages.",
required = false)
@RequestParam(name = "lang", required = false)
String[] langs,
@Parameter(
description = "Only print the keyword, no thesaurus information.",
required = false)
@RequestParam(required = false, defaultValue = "false")
boolean keywordOnly,
@Parameter(
description = "XSL template to use (ISO19139 keyword by default, see convert.xsl).",
required = false)
@RequestParam(required = false)
String transformation,
@Parameter(
description = "langMap, that converts the values in the 'lang' parameter to how they will be actually represented in the record. {'fre':'fra'} or {'fre':'fr'}. Missing/empty means to convert to iso 2 letter.",
required = false)
@RequestParam (name = "langMap", required = false)
String langMapJson,
@Parameter(hidden = true)
@RequestParam
Map<String, String> allRequestParams,
@Parameter(hidden = true)
HttpServletRequest request
) throws Exception {
return getKeyword(uri,sThesaurusName,langs, keywordOnly, transformation,langMapJson,allRequestParams, request);
}

/**
* Gets the thesaurus.
Expand Down

0 comments on commit 1775f71

Please sign in to comment.