Search in sources :

Example 16 with CorrespondencePartInternal

use of nikita.model.noark5.v4.casehandling.secondary.CorrespondencePartInternal in project nikita-noark5-core by HiOA-ABI.

the class CorrespondencePartHateoasController method findOneCorrespondencePartInternalBySystemId.

// Get a CorrespondencePartInternal identified by systemID
// GET [contextPath][api]/casehandling/korrespondansepartintern/{systemId}
@ApiOperation(value = "Retrieves a single CorrespondencePartInternal entity given a systemId", response = CorrespondencePartInternal.class)
@ApiResponses(value = { @ApiResponse(code = 200, message = "CorrespondencePartInternal returned", response = CorrespondencePartInternal.class), @ApiResponse(code = 401, message = API_MESSAGE_UNAUTHENTICATED_USER), @ApiResponse(code = 403, message = API_MESSAGE_UNAUTHORISED_FOR_USER), @ApiResponse(code = 500, message = API_MESSAGE_INTERNAL_SERVER_ERROR) })
@Counted
@Timed
@RequestMapping(value = CORRESPONDENCE_PART_INTERNAL + SLASH + LEFT_PARENTHESIS + SYSTEM_ID + RIGHT_PARENTHESIS, method = RequestMethod.GET)
public ResponseEntity<CorrespondencePartInternalHateoas> findOneCorrespondencePartInternalBySystemId(final UriComponentsBuilder uriBuilder, HttpServletRequest request, final HttpServletResponse response, @ApiParam(name = "systemID", value = "systemID of the correspondencePartInternal to retrieve", required = true) @PathVariable("systemID") final String correspondencePartInternalSystemId) {
    CorrespondencePartInternal correspondencePartInternal = (CorrespondencePartInternal) correspondencePartService.findBySystemIdOrderBySystemId(correspondencePartInternalSystemId);
    CorrespondencePartInternalHateoas correspondencePartInternalHateoas = new CorrespondencePartInternalHateoas(correspondencePartInternal);
    correspondencePartHateoasHandler.addLinks(correspondencePartInternalHateoas, request, new Authorisation());
    return ResponseEntity.status(HttpStatus.OK).allow(CommonUtils.WebUtils.getMethodsForRequestOrThrow(request.getServletPath())).eTag(correspondencePartInternal.getVersion().toString()).body(correspondencePartInternalHateoas);
}
Also used : Authorisation(no.arkivlab.hioa.nikita.webapp.security.Authorisation) CorrespondencePartInternalHateoas(nikita.model.noark5.v4.hateoas.casehandling.CorrespondencePartInternalHateoas) CorrespondencePartInternal(nikita.model.noark5.v4.casehandling.secondary.CorrespondencePartInternal) Counted(com.codahale.metrics.annotation.Counted) Timed(com.codahale.metrics.annotation.Timed) ApiOperation(io.swagger.annotations.ApiOperation) ApiResponses(io.swagger.annotations.ApiResponses)

Aggregations

Counted (com.codahale.metrics.annotation.Counted)6 ApiOperation (io.swagger.annotations.ApiOperation)6 ApiResponses (io.swagger.annotations.ApiResponses)6 CorrespondencePartInternal (nikita.common.model.noark5.v4.casehandling.secondary.CorrespondencePartInternal)6 CorrespondencePartInternal (nikita.model.noark5.v4.casehandling.secondary.CorrespondencePartInternal)6 Timed (com.codahale.metrics.annotation.Timed)3 Authorisation (nikita.webapp.security.Authorisation)3 Authorisation (no.arkivlab.hioa.nikita.webapp.security.Authorisation)3 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)2 CorrespondencePartInternalHateoas (nikita.common.model.noark5.v4.hateoas.casehandling.CorrespondencePartInternalHateoas)2 CorrespondencePartInternalHateoas (nikita.model.noark5.v4.hateoas.casehandling.CorrespondencePartInternalHateoas)2 ArrayList (java.util.ArrayList)1 Record (nikita.common.model.noark5.v4.Record)1 RegistryEntry (nikita.common.model.noark5.v4.casehandling.RegistryEntry)1 CorrespondencePartType (nikita.common.model.noark5.v4.metadata.CorrespondencePartType)1 NikitaException (nikita.common.util.exceptions.NikitaException)1 NikitaMalformedInputDataException (nikita.common.util.exceptions.NikitaMalformedInputDataException)1 RegistryEntry (nikita.model.noark5.v4.casehandling.RegistryEntry)1 CorrespondencePartType (nikita.model.noark5.v4.metadata.CorrespondencePartType)1 NikitaException (nikita.util.exceptions.NikitaException)1