Search in sources :

Example 91 with INikitaEntity

use of nikita.common.model.noark5.v4.interfaces.entities.INikitaEntity in project nikita-noark5-core by HiOA-ABI.

the class RecordHateoasController method findAllRecord.

// Retrieve all Records
// GET [contextPath][api]/arkivstruktur/registrering
// http://rel.kxml.no/noark5/v4/api/arkivstruktur/registrering/
@ApiOperation(value = "Retrieves multiple Record entities limited by ownership rights", notes = "The field skip tells how many Record rows of the result set to ignore (starting at 0), " + "while top tells how many rows after skip to return. Note if the value of top is greater than " + "system value nikita-noark5-core.pagination.maxPageSize, then " + "nikita-noark5-core.pagination.maxPageSize is used.", response = RecordHateoas.class)
@ApiResponses(value = { @ApiResponse(code = 200, message = "RecordHateoas found", response = RecordHateoas.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(method = RequestMethod.GET)
public ResponseEntity<RecordHateoas> findAllRecord(final UriComponentsBuilder uriBuilder, HttpServletRequest request, final HttpServletResponse response, @RequestParam(name = "top", required = false) Integer top, @RequestParam(name = "skip", required = false) Integer skip) {
    RecordHateoas recordHateoas = new RecordHateoas((ArrayList<INikitaEntity>) (ArrayList) recordService.findRecordByOwnerPaginated(top, skip));
    recordHateoasHandler.addLinks(recordHateoas, request, new Authorisation());
    return ResponseEntity.status(HttpStatus.OK).allow(CommonUtils.WebUtils.getMethodsForRequestOrThrow(request.getServletPath())).body(recordHateoas);
}
Also used : INikitaEntity(nikita.model.noark5.v4.interfaces.entities.INikitaEntity) Authorisation(no.arkivlab.hioa.nikita.webapp.security.Authorisation) ArrayList(java.util.ArrayList) Counted(com.codahale.metrics.annotation.Counted) Timed(com.codahale.metrics.annotation.Timed) ApiOperation(io.swagger.annotations.ApiOperation) ApiResponses(io.swagger.annotations.ApiResponses)

Example 92 with INikitaEntity

use of nikita.common.model.noark5.v4.interfaces.entities.INikitaEntity in project nikita-noark5-core by HiOA-ABI.

the class SeriesHateoasController method findAllSeries.

// Retrieve all Series (paginated)
// GET [contextPath][api]/arkivstruktur/arkivdel/{systemId}/klassifikasjonssystem/
@ApiOperation(value = "Retrieves multiple Series entities limited by ownership rights", notes = "The field skip" + "tells how many Series rows of the result set to ignore (starting at 0), while  top tells how many rows" + " after skip to return. Note if the value of top is greater than system value " + " nikita-noark5-core.pagination.maxPageSize, then nikita-noark5-core.pagination.maxPageSize is used. ", response = SeriesHateoas.class)
@ApiResponses(value = { @ApiResponse(code = 200, message = "Series list found", response = SeriesHateoas.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(method = RequestMethod.GET)
public ResponseEntity<SeriesHateoas> findAllSeries(HttpServletRequest request, @RequestParam(name = "top", required = false) Integer top, @RequestParam(name = "skip", required = false) Integer skip) {
    SeriesHateoas seriesHateoas = new SeriesHateoas((ArrayList<INikitaEntity>) (ArrayList) seriesService.findSeriesByOwnerPaginated(top, skip));
    seriesHateoasHandler.addLinksOnRead(seriesHateoas, request, new Authorisation());
    return ResponseEntity.status(HttpStatus.OK).allow(CommonUtils.WebUtils.getMethodsForRequestOrThrow(request.getServletPath())).body(seriesHateoas);
}
Also used : INikitaEntity(nikita.model.noark5.v4.interfaces.entities.INikitaEntity) Authorisation(no.arkivlab.hioa.nikita.webapp.security.Authorisation) ArrayList(java.util.ArrayList) Counted(com.codahale.metrics.annotation.Counted) Timed(com.codahale.metrics.annotation.Timed)

Example 93 with INikitaEntity

use of nikita.common.model.noark5.v4.interfaces.entities.INikitaEntity in project nikita-noark5-core by HiOA-ABI.

the class SeriesHateoasController method findAllCaseFileAssociatedWithCaseFile.

// Retrieve all CaseFiles associated with a Series (paginated)
// GET [contextPath][api]/arkivstruktur/arkivdel/{systemId}/saksmappe/
// GET [contextPath][api]/arkivstruktur/arkivdel/{systemId}/saksmappe/?top=5&skip=1
@ApiOperation(value = "Retrieves a list of CaseFiles associated with a Series", notes = "The field skip" + "tells how many CaseFile rows of the result set to ignore (starting at 0), while  top tells how many rows" + " after skip to return. Note if the value of top is greater than system value " + " nikita-noark5-core.pagination.maxPageSize, then nikita-noark5-core.pagination.maxPageSize is used. ", response = CaseFileHateoas.class)
@ApiResponses(value = { @ApiResponse(code = 200, message = "CaseFile list found", response = CaseFileHateoas.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 = SLASH + LEFT_PARENTHESIS + SYSTEM_ID + RIGHT_PARENTHESIS + SLASH + CASE_FILE, method = RequestMethod.GET)
public ResponseEntity<CaseFileHateoas> findAllCaseFileAssociatedWithCaseFile(HttpServletRequest request, @ApiParam(name = "systemID", value = "systemID of the series to retrieve", required = true) @PathVariable("systemID") final String systemID) {
    seriesService.findAllCaseFileBySeries(systemID);
    CaseFileHateoas caseFileHateoas = new CaseFileHateoas((ArrayList<INikitaEntity>) (ArrayList) seriesService.findAllCaseFileBySeries(systemID));
    caseFileHateoasHandler.addLinksOnRead(caseFileHateoas, request, new Authorisation());
    return ResponseEntity.status(HttpStatus.OK).allow(CommonUtils.WebUtils.getMethodsForRequestOrThrow(request.getServletPath())).body(caseFileHateoas);
}
Also used : CaseFileHateoas(nikita.model.noark5.v4.hateoas.casehandling.CaseFileHateoas) INikitaEntity(nikita.model.noark5.v4.interfaces.entities.INikitaEntity) Authorisation(no.arkivlab.hioa.nikita.webapp.security.Authorisation) ArrayList(java.util.ArrayList) Counted(com.codahale.metrics.annotation.Counted) Timed(com.codahale.metrics.annotation.Timed)

Example 94 with INikitaEntity

use of nikita.common.model.noark5.v4.interfaces.entities.INikitaEntity in project nikita-noark5-core by HiOA-ABI.

the class AdministrativeUnitController method findAll.

// API - All GET Requests (CRUD - READ)
// Retrieves all administrativeUnit
// GET [contextPath][api]/admin/administrativtenhet/
@ApiOperation(value = "Retrieves all AdministrativeUnit ", response = AdministrativeUnit.class)
@ApiResponses(value = { @ApiResponse(code = 200, message = "AdministrativeUnit found", response = AdministrativeUnit.class), @ApiResponse(code = 404, message = "No AdministrativeUnit 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 = ADMINISTRATIVE_UNIT)
public ResponseEntity<AdministrativeUnitHateoas> findAll(HttpServletRequest request) {
    AdministrativeUnitHateoas adminHateoas = new AdministrativeUnitHateoas((ArrayList<INikitaEntity>) (ArrayList) administrativeUnitService.findAll());
    administrativeUnitHateoasHandler.addLinks(adminHateoas, request, new Authorisation());
    return ResponseEntity.status(HttpStatus.OK).allow(CommonUtils.WebUtils.getMethodsForRequestOrThrow(request.getServletPath())).body(adminHateoas);
}
Also used : INikitaEntity(nikita.model.noark5.v4.interfaces.entities.INikitaEntity) Authorisation(no.arkivlab.hioa.nikita.webapp.security.Authorisation) ArrayList(java.util.ArrayList) AdministrativeUnitHateoas(nikita.model.noark5.v4.hateoas.admin.AdministrativeUnitHateoas) Counted(com.codahale.metrics.annotation.Counted) Timed(com.codahale.metrics.annotation.Timed) ApiOperation(io.swagger.annotations.ApiOperation) ApiResponses(io.swagger.annotations.ApiResponses)

Example 95 with INikitaEntity

use of nikita.common.model.noark5.v4.interfaces.entities.INikitaEntity in project nikita-noark5-core by HiOA-ABI.

the class RegistryEntryHateoasController method findAllRegistryEntry.

// Get all registryEntry
// GET [contextPath][api]/casehandling/journalpost/
// http://rel.kxml.no/noark5/v4/api/sakarkiv/journalpost/
@ApiOperation(value = "Retrieves multiple RegistryEntry entities limited by ownership rights", notes = "The field skip" + "tells how many RegistryEntry rows of the result set to ignore (starting at 0), while  top tells how many rows" + " after skip to return. Note if the value of top is greater than system value " + " nikita-noark5-core.pagination.maxPageSize, then nikita-noark5-core.pagination.maxPageSize is used. ", response = RegistryEntryHateoas.class)
@ApiResponses(value = { @ApiResponse(code = 200, message = "RegistryEntry found", response = RegistryEntryHateoas.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(method = RequestMethod.GET)
public ResponseEntity<RegistryEntryHateoas> findAllRegistryEntry(HttpServletRequest request, @RequestParam(name = "top", required = false) Integer top, @RequestParam(name = "skip", required = false) Integer skip) {
    RegistryEntryHateoas registryEntryHateoas = new RegistryEntryHateoas((ArrayList<INikitaEntity>) (ArrayList) registryEntryService.findRegistryEntryByOwnerPaginated(top, skip));
    registryEntryHateoasHandler.addLinks(registryEntryHateoas, request, new Authorisation());
    return ResponseEntity.status(HttpStatus.OK).allow(CommonUtils.WebUtils.getMethodsForRequestOrThrow(request.getServletPath())).body(registryEntryHateoas);
}
Also used : INikitaEntity(nikita.model.noark5.v4.interfaces.entities.INikitaEntity) Authorisation(no.arkivlab.hioa.nikita.webapp.security.Authorisation) ArrayList(java.util.ArrayList) Counted(com.codahale.metrics.annotation.Counted) Timed(com.codahale.metrics.annotation.Timed) ApiOperation(io.swagger.annotations.ApiOperation) ApiResponses(io.swagger.annotations.ApiResponses)

Aggregations

INikitaEntity (nikita.common.model.noark5.v4.interfaces.entities.INikitaEntity)80 Authorisation (nikita.webapp.security.Authorisation)78 List (java.util.List)77 MetadataHateoas (nikita.common.model.noark5.v4.hateoas.metadata.MetadataHateoas)54 Counted (com.codahale.metrics.annotation.Counted)40 ApiOperation (io.swagger.annotations.ApiOperation)34 ApiResponses (io.swagger.annotations.ApiResponses)34 ArrayList (java.util.ArrayList)20 INikitaEntity (nikita.model.noark5.v4.interfaces.entities.INikitaEntity)19 Timed (com.codahale.metrics.annotation.Timed)16 Authorisation (no.arkivlab.hioa.nikita.webapp.security.Authorisation)16 Fonds (nikita.common.model.noark5.v4.Fonds)6 NoarkEntityNotFoundException (nikita.common.util.exceptions.NoarkEntityNotFoundException)5 CaseFileHateoas (nikita.common.model.noark5.v4.hateoas.casehandling.CaseFileHateoas)4 DocumentDescription (nikita.common.model.noark5.v4.DocumentDescription)3 Record (nikita.common.model.noark5.v4.Record)3 Fonds (nikita.model.noark5.v4.Fonds)3 FondsCreator (nikita.common.model.noark5.v4.FondsCreator)2 CaseFile (nikita.common.model.noark5.v4.casehandling.CaseFile)2 DocumentObjectHateoas (nikita.common.model.noark5.v4.hateoas.DocumentObjectHateoas)2