Search in sources :

Example 6 with DocumentMedium

use of nikita.model.noark5.v4.metadata.DocumentMedium in project nikita-noark5-core by HiOA-ABI.

the class DocumentMediumController method findAll.

// API - All GET Requests (CRUD - READ)
// Retrieves all documentMedium
// GET [contextPath][api]/metadata/dokumentmedium/
@ApiOperation(value = "Retrieves all DocumentMedium ", response = DocumentMedium.class)
@ApiResponses(value = { @ApiResponse(code = 200, message = "DocumentMedium codes found", response = DocumentMedium.class), @ApiResponse(code = 404, message = "No DocumentMedium found"), @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(method = RequestMethod.GET, value = DOCUMENT_MEDIUM)
public ResponseEntity<MetadataHateoas> findAll(HttpServletRequest request) {
    //ArrayList <DocumentMedium> documentMediumList = (ArrayList<DocumentMedium>) documentMediumService.findAll2();
    MetadataHateoas metadataHateoas = new MetadataHateoas(new ArrayList<>(documentMediumService.findAll2()), DOCUMENT_MEDIUM);
    metadataHateoasHandler.addLinks(metadataHateoas, request, new Authorisation());
    return ResponseEntity.status(HttpStatus.OK).allow(CommonUtils.WebUtils.getMethodsForRequestOrThrow(request.getServletPath())).body(metadataHateoas);
}
Also used : Authorisation(no.arkivlab.hioa.nikita.webapp.security.Authorisation) MetadataHateoas(nikita.model.noark5.v4.hateoas.metadata.MetadataHateoas) 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)5 Timed (com.codahale.metrics.annotation.Timed)5 ApiOperation (io.swagger.annotations.ApiOperation)5 ApiResponses (io.swagger.annotations.ApiResponses)5 MetadataHateoas (nikita.model.noark5.v4.hateoas.metadata.MetadataHateoas)5 DocumentMedium (nikita.model.noark5.v4.metadata.DocumentMedium)4 Authorisation (no.arkivlab.hioa.nikita.webapp.security.Authorisation)4 Date (java.util.Date)1 IDocumentMedium (nikita.model.noark5.v4.interfaces.IDocumentMedium)1