Class EntityController
java.lang.Object
de.uniba.minf.core.rest.controller.BaseRestController
de.uniba.minf.registry.controller.EntityController
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
@RestController
@RequestMapping("/api/v1/e")
public class EntityController
extends de.uniba.minf.core.rest.controller.BaseRestController
implements org.springframework.context.ApplicationContextAware
-
Field Summary
Fields inherited from class de.uniba.minf.core.rest.controller.BaseRestController
authInfoHelper, jsonMapper, linksHelper, messageSource -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionde.uniba.minf.core.rest.model.RestResponsedeleteEntity(String entityId, jakarta.servlet.http.HttpServletResponse resp, Locale locale) de.uniba.minf.core.rest.model.RestItemsResponsede.uniba.minf.registry.model.entity.Entityde.uniba.minf.core.rest.model.RestItemsResponsegetByDefinition(String name, boolean includeDrafts, boolean ui, String lang, jakarta.servlet.http.HttpServletRequest request, Locale locale) de.uniba.minf.core.rest.model.RestItemsResponsegetByImportId(String importId, jakarta.servlet.http.HttpServletRequest request, Locale locale) de.uniba.minf.core.rest.model.RestItemResponsegetEntry(String name, com.fasterxml.jackson.databind.JsonNode body, jakarta.servlet.http.HttpServletRequest request, Locale locale) de.uniba.minf.core.rest.model.RestResponseimportEntities(String name, String body, jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp, Locale locale) de.uniba.minf.core.rest.model.RestResponsepostEntityForm(String entityId, com.fasterxml.jackson.databind.JsonNode formData, jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp, Locale locale) de.uniba.minf.core.rest.model.RestItemsResponsesearchEntries(String name, com.fasterxml.jackson.databind.JsonNode body, jakarta.servlet.http.HttpServletRequest request, Locale locale) voidsetApplicationContext(org.springframework.context.ApplicationContext appContext) de.uniba.minf.core.rest.model.RestResponsevalidateEntities(String name, String body, jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp, Locale locale) Methods inherited from class de.uniba.minf.core.rest.controller.BaseRestController
getActualLimit, getBaseUrl, getControllerBaseUrl, getControllerBaseUrlWithSuffix, getItem, getItemLinks, getItemLinks, getItemResponse, getItems, getLinks, getLinks, handleBindException, handleException, handleRuntimeException
-
Constructor Details
-
EntityController
public EntityController()
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext appContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
get
@GetMapping public de.uniba.minf.core.rest.model.RestItemsResponse get(jakarta.servlet.http.HttpServletRequest request, Locale locale) -
get
-
getByDefinition
@GetMapping("/{name}/") public de.uniba.minf.core.rest.model.RestItemsResponse getByDefinition(@PathVariable("name") String name, @RequestParam(name="includeDrafts",defaultValue="false") boolean includeDrafts, @RequestParam(name="ui",defaultValue="false") boolean ui, @RequestParam(name="lang",required=false) String lang, jakarta.servlet.http.HttpServletRequest request, Locale locale) -
getByImportId
-
searchEntries
@PostMapping("/{name}/search") public de.uniba.minf.core.rest.model.RestItemsResponse searchEntries(@PathVariable("name") String name, @RequestBody(required=false) com.fasterxml.jackson.databind.JsonNode body, jakarta.servlet.http.HttpServletRequest request, Locale locale) throws de.uniba.minf.core.rest.exception.ApiExecutionException - Throws:
de.uniba.minf.core.rest.exception.ApiExecutionException
-
getEntry
@PostMapping("/{name}/get") public de.uniba.minf.core.rest.model.RestItemResponse getEntry(@PathVariable("name") String name, @RequestBody(required=false) com.fasterxml.jackson.databind.JsonNode body, jakarta.servlet.http.HttpServletRequest request, Locale locale) throws de.uniba.minf.core.rest.exception.ApiItemNotFoundException, de.uniba.minf.core.rest.exception.ApiExecutionException - Throws:
de.uniba.minf.core.rest.exception.ApiItemNotFoundExceptionde.uniba.minf.core.rest.exception.ApiExecutionException
-
postEntityForm
@PostMapping(value={"/","/{entityId}"}, consumes="application/json") public de.uniba.minf.core.rest.model.RestResponse postEntityForm(@PathVariable(required=false,value="entityId") String entityId, @RequestBody com.fasterxml.jackson.databind.JsonNode formData, jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp, Locale locale) throws de.uniba.minf.registry.model.validation.exception.ValidationConfigurationException, de.uniba.minf.core.rest.exception.ApiExecutionException - Throws:
de.uniba.minf.registry.model.validation.exception.ValidationConfigurationExceptionde.uniba.minf.core.rest.exception.ApiExecutionException
-
deleteEntity
-
validateEntities
@PostMapping(value="/{name}/validate", consumes="application/json") public de.uniba.minf.core.rest.model.RestResponse validateEntities(@PathVariable("name") String name, @RequestBody String body, jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp, Locale locale) throws com.fasterxml.jackson.core.JsonProcessingException, de.uniba.minf.registry.model.validation.exception.ValidationConfigurationException, UnsupportedEncodingException, URISyntaxException - Throws:
com.fasterxml.jackson.core.JsonProcessingExceptionde.uniba.minf.registry.model.validation.exception.ValidationConfigurationExceptionUnsupportedEncodingExceptionURISyntaxException
-
importEntities
@PostMapping(value="/{name}/import", consumes="application/json") public de.uniba.minf.core.rest.model.RestResponse importEntities(@PathVariable("name") String name, @RequestBody String body, jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp, Locale locale) throws de.uniba.minf.registry.model.validation.exception.ValidationConfigurationException, com.fasterxml.jackson.databind.JsonMappingException, com.fasterxml.jackson.core.JsonProcessingException, UnsupportedEncodingException, URISyntaxException - Throws:
de.uniba.minf.registry.model.validation.exception.ValidationConfigurationExceptioncom.fasterxml.jackson.databind.JsonMappingExceptioncom.fasterxml.jackson.core.JsonProcessingExceptionUnsupportedEncodingExceptionURISyntaxException
-