use of no.arkivlab.hioa.nikita.webapp.web.events.AfterNoarkEntityUpdatedEvent in project nikita-noark5-core by HiOA-ABI.
the class CaseFileHateoasController method updateCaseFile.
// Update a CaseFile with given values
// PUT [contextPath][api]/casehandling/saksmappe/{systemId}
@ApiOperation(value = "Updates a CaseFile identified by a given systemId", notes = "Returns the newly updated caseFile", response = CaseFileHateoas.class)
@ApiResponses(value = { @ApiResponse(code = 200, message = "CaseFile " + API_MESSAGE_OBJECT_ALREADY_PERSISTED, response = CaseFileHateoas.class), @ApiResponse(code = 201, message = "CaseFile " + API_MESSAGE_OBJECT_SUCCESSFULLY_CREATED, response = CaseFileHateoas.class), @ApiResponse(code = 401, message = API_MESSAGE_UNAUTHENTICATED_USER), @ApiResponse(code = 403, message = API_MESSAGE_UNAUTHORISED_FOR_USER), @ApiResponse(code = 404, message = API_MESSAGE_PARENT_DOES_NOT_EXIST + " of type CaseFile"), @ApiResponse(code = 409, message = API_MESSAGE_CONFLICT), @ApiResponse(code = 500, message = API_MESSAGE_INTERNAL_SERVER_ERROR) })
@Counted
@Timed
@RequestMapping(value = SLASH + LEFT_PARENTHESIS + SYSTEM_ID + RIGHT_PARENTHESIS, method = RequestMethod.PUT, consumes = { NOARK5_V4_CONTENT_TYPE_JSON })
public ResponseEntity<CaseFileHateoas> updateCaseFile(final UriComponentsBuilder uriBuilder, HttpServletRequest request, final HttpServletResponse response, @ApiParam(name = "systemID", value = "systemId of caseFile to update", required = true) @PathVariable("systemID") final String systemID, @ApiParam(name = "CaseFile", value = "Incoming caseFile object", required = true) @RequestBody CaseFile caseFile) throws NikitaException {
validateForUpdate(caseFile);
CaseFile updatedCaseFile = caseFileService.handleUpdate(systemID, parseETAG(request.getHeader(ETAG)), caseFile);
CaseFileHateoas caseFileHateoas = new CaseFileHateoas(updatedCaseFile);
caseFileHateoasHandler.addLinks(caseFileHateoas, request, new Authorisation());
applicationEventPublisher.publishEvent(new AfterNoarkEntityUpdatedEvent(this, updatedCaseFile));
return ResponseEntity.status(HttpStatus.CREATED).allow(CommonUtils.WebUtils.getMethodsForRequestOrThrow(request.getServletPath())).eTag(updatedCaseFile.getVersion().toString()).body(caseFileHateoas);
}
use of no.arkivlab.hioa.nikita.webapp.web.events.AfterNoarkEntityUpdatedEvent in project nikita-noark5-core by HiOA-ABI.
the class CorrespondencePartHateoasController method updateCorrespondencePartInternal.
// Update a CorrespondencePartInternal with given values
// PUT [contextPath][api]/casehandling/korrespondansepartintern/{systemId}
@ApiOperation(value = "Updates a CorrespondencePartInternal identified by a given systemId", notes = "Returns the newly updated correspondencePartInternal", response = CorrespondencePartInternalHateoas.class)
@ApiResponses(value = { @ApiResponse(code = 200, message = "CorrespondencePartInternal " + API_MESSAGE_OBJECT_ALREADY_PERSISTED, response = CorrespondencePartInternalHateoas.class), @ApiResponse(code = 201, message = "CorrespondencePartInternal " + API_MESSAGE_OBJECT_SUCCESSFULLY_CREATED, response = CorrespondencePartInternalHateoas.class), @ApiResponse(code = 401, message = API_MESSAGE_UNAUTHENTICATED_USER), @ApiResponse(code = 403, message = API_MESSAGE_UNAUTHORISED_FOR_USER), @ApiResponse(code = 404, message = API_MESSAGE_PARENT_DOES_NOT_EXIST + " of type CorrespondencePartInternal"), @ApiResponse(code = 409, message = API_MESSAGE_CONFLICT), @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.PUT, consumes = { NOARK5_V4_CONTENT_TYPE_JSON })
public ResponseEntity<CorrespondencePartInternalHateoas> updateCorrespondencePartInternal(final UriComponentsBuilder uriBuilder, HttpServletRequest request, final HttpServletResponse response, @ApiParam(name = "systemID", value = "systemId of correspondencePartInternal to update", required = true) @PathVariable("systemID") final String systemID, @ApiParam(name = "CorrespondencePartInternal", value = "Incoming correspondencePartInternal object", required = true) @RequestBody CorrespondencePartInternal correspondencePartInternal) throws NikitaException {
validateForUpdate(correspondencePartInternal);
CorrespondencePartInternal updatedCorrespondencePartInternal = correspondencePartService.updateCorrespondencePartInternal(systemID, parseETAG(request.getHeader(ETAG)), correspondencePartInternal);
CorrespondencePartInternalHateoas correspondencePartInternalHateoas = new CorrespondencePartInternalHateoas(updatedCorrespondencePartInternal);
correspondencePartHateoasHandler.addLinks(correspondencePartInternalHateoas, request, new Authorisation());
applicationEventPublisher.publishEvent(new AfterNoarkEntityUpdatedEvent(this, updatedCorrespondencePartInternal));
return ResponseEntity.status(HttpStatus.CREATED).allow(CommonUtils.WebUtils.getMethodsForRequestOrThrow(request.getServletPath())).eTag(updatedCorrespondencePartInternal.getVersion().toString()).body(correspondencePartInternalHateoas);
}
use of no.arkivlab.hioa.nikita.webapp.web.events.AfterNoarkEntityUpdatedEvent in project nikita-noark5-core by HiOA-ABI.
the class CorrespondencePartHateoasController method updateCorrespondencePartPerson.
// Update a CorrespondencePartPerson with given values
// PUT [contextPath][api]/casehandling/korrespondansepartperson/{systemId}
@ApiOperation(value = "Updates a CorrespondencePartPerson identified by a given systemId", notes = "Returns the newly updated correspondencePartPerson", response = CorrespondencePartPersonHateoas.class)
@ApiResponses(value = { @ApiResponse(code = 200, message = "CorrespondencePartPerson " + API_MESSAGE_OBJECT_ALREADY_PERSISTED, response = CorrespondencePartPersonHateoas.class), @ApiResponse(code = 201, message = "CorrespondencePartPerson " + API_MESSAGE_OBJECT_SUCCESSFULLY_CREATED, response = CorrespondencePartPersonHateoas.class), @ApiResponse(code = 401, message = API_MESSAGE_UNAUTHENTICATED_USER), @ApiResponse(code = 403, message = API_MESSAGE_UNAUTHORISED_FOR_USER), @ApiResponse(code = 404, message = API_MESSAGE_PARENT_DOES_NOT_EXIST + " of type CorrespondencePartPerson"), @ApiResponse(code = 409, message = API_MESSAGE_CONFLICT), @ApiResponse(code = 500, message = API_MESSAGE_INTERNAL_SERVER_ERROR) })
@Counted
@Timed
@RequestMapping(value = CORRESPONDENCE_PART_PERSON + SLASH + LEFT_PARENTHESIS + SYSTEM_ID + RIGHT_PARENTHESIS, method = RequestMethod.PUT, consumes = { NOARK5_V4_CONTENT_TYPE_JSON })
public ResponseEntity<CorrespondencePartPersonHateoas> updateCorrespondencePartPerson(final UriComponentsBuilder uriBuilder, HttpServletRequest request, final HttpServletResponse response, @ApiParam(name = "systemID", value = "systemId of correspondencePartPerson to update", required = true) @PathVariable("systemID") final String systemID, @ApiParam(name = "CorrespondencePartPerson", value = "Incoming correspondencePartPerson object", required = true) @RequestBody CorrespondencePartPerson correspondencePartPerson) throws NikitaException {
validateForUpdate(correspondencePartPerson);
CorrespondencePartPerson updatedCorrespondencePartPerson = correspondencePartService.updateCorrespondencePartPerson(systemID, parseETAG(request.getHeader(ETAG)), correspondencePartPerson);
CorrespondencePartPersonHateoas correspondencePartPersonHateoas = new CorrespondencePartPersonHateoas(updatedCorrespondencePartPerson);
correspondencePartHateoasHandler.addLinks(correspondencePartPersonHateoas, request, new Authorisation());
applicationEventPublisher.publishEvent(new AfterNoarkEntityUpdatedEvent(this, updatedCorrespondencePartPerson));
return ResponseEntity.status(HttpStatus.CREATED).allow(CommonUtils.WebUtils.getMethodsForRequestOrThrow(request.getServletPath())).eTag(updatedCorrespondencePartPerson.getVersion().toString()).body(correspondencePartPersonHateoas);
}
use of no.arkivlab.hioa.nikita.webapp.web.events.AfterNoarkEntityUpdatedEvent in project nikita-noark5-core by HiOA-ABI.
the class CorrespondencePartHateoasController method updateCorrespondencePartUnit.
// Update a CorrespondencePartUnit with given values
// PUT [contextPath][api]/casehandling/korrespondansepartenhet/{systemId}
@ApiOperation(value = "Updates a CorrespondencePartUnit identified by a given systemId", notes = "Returns the newly updated correspondencePartUnit", response = CorrespondencePartUnitHateoas.class)
@ApiResponses(value = { @ApiResponse(code = 200, message = "CorrespondencePartUnit " + API_MESSAGE_OBJECT_ALREADY_PERSISTED, response = CorrespondencePartUnitHateoas.class), @ApiResponse(code = 201, message = "CorrespondencePartUnit " + API_MESSAGE_OBJECT_SUCCESSFULLY_CREATED, response = CorrespondencePartUnitHateoas.class), @ApiResponse(code = 401, message = API_MESSAGE_UNAUTHENTICATED_USER), @ApiResponse(code = 403, message = API_MESSAGE_UNAUTHORISED_FOR_USER), @ApiResponse(code = 404, message = API_MESSAGE_PARENT_DOES_NOT_EXIST + " of type CorrespondencePartUnit"), @ApiResponse(code = 409, message = API_MESSAGE_CONFLICT), @ApiResponse(code = 500, message = API_MESSAGE_INTERNAL_SERVER_ERROR) })
@Counted
@Timed
@RequestMapping(value = CORRESPONDENCE_PART_UNIT + SLASH + LEFT_PARENTHESIS + SYSTEM_ID + RIGHT_PARENTHESIS, method = RequestMethod.PUT, consumes = { NOARK5_V4_CONTENT_TYPE_JSON })
public ResponseEntity<CorrespondencePartUnitHateoas> updateCorrespondencePartUnit(final UriComponentsBuilder uriBuilder, HttpServletRequest request, final HttpServletResponse response, @ApiParam(name = "systemID", value = "systemId of correspondencePartUnit to update", required = true) @PathVariable("systemID") final String systemID, @ApiParam(name = "CorrespondencePartUnit", value = "Incoming correspondencePartUnit object", required = true) @RequestBody CorrespondencePartUnit correspondencePartUnit) throws NikitaException {
validateForUpdate(correspondencePartUnit);
CorrespondencePartUnit updatedCorrespondencePartUnit = correspondencePartService.updateCorrespondencePartUnit(systemID, parseETAG(request.getHeader(ETAG)), correspondencePartUnit);
CorrespondencePartUnitHateoas correspondencePartUnitHateoas = new CorrespondencePartUnitHateoas(updatedCorrespondencePartUnit);
correspondencePartHateoasHandler.addLinks(correspondencePartUnitHateoas, request, new Authorisation());
applicationEventPublisher.publishEvent(new AfterNoarkEntityUpdatedEvent(this, updatedCorrespondencePartUnit));
return ResponseEntity.status(HttpStatus.CREATED).allow(CommonUtils.WebUtils.getMethodsForRequestOrThrow(request.getServletPath())).eTag(updatedCorrespondencePartUnit.getVersion().toString()).body(correspondencePartUnitHateoas);
}
use of no.arkivlab.hioa.nikita.webapp.web.events.AfterNoarkEntityUpdatedEvent in project nikita-noark5-core by HiOA-ABI.
the class RegistryEntryHateoasController method updateRegistryEntry.
// Update a RegistryEntry with given values
// PUT [contextPath][api]/casehandling/journalpost/{systemId}
@ApiOperation(value = "Updates a RegistryEntry identified by a given systemId", notes = "Returns the newly updated registryEntry", response = RegistryEntryHateoas.class)
@ApiResponses(value = { @ApiResponse(code = 200, message = "RegistryEntry " + API_MESSAGE_OBJECT_ALREADY_PERSISTED, response = RegistryEntryHateoas.class), @ApiResponse(code = 201, message = "RegistryEntry " + API_MESSAGE_OBJECT_SUCCESSFULLY_CREATED, response = RegistryEntryHateoas.class), @ApiResponse(code = 401, message = API_MESSAGE_UNAUTHENTICATED_USER), @ApiResponse(code = 403, message = API_MESSAGE_UNAUTHORISED_FOR_USER), @ApiResponse(code = 404, message = API_MESSAGE_PARENT_DOES_NOT_EXIST + " of type RegistryEntry"), @ApiResponse(code = 409, message = API_MESSAGE_CONFLICT), @ApiResponse(code = 500, message = API_MESSAGE_INTERNAL_SERVER_ERROR) })
@Counted
@Timed
@RequestMapping(value = SLASH + LEFT_PARENTHESIS + SYSTEM_ID + RIGHT_PARENTHESIS, method = RequestMethod.PUT, consumes = { NOARK5_V4_CONTENT_TYPE_JSON })
public ResponseEntity<RegistryEntryHateoas> updateRegistryEntry(final UriComponentsBuilder uriBuilder, HttpServletRequest request, final HttpServletResponse response, @ApiParam(name = "systemID", value = "systemId of registryEntry to update", required = true) @PathVariable("systemID") final String systemID, @ApiParam(name = "RegistryEntry", value = "Incoming registryEntry object", required = true) @RequestBody RegistryEntry registryEntry) throws NikitaException {
validateForUpdate(registryEntry);
RegistryEntry updatedRegistryEntry = registryEntryService.handleUpdate(systemID, parseETAG(request.getHeader(ETAG)), registryEntry);
RegistryEntryHateoas registryEntryHateoas = new RegistryEntryHateoas(updatedRegistryEntry);
registryEntryHateoasHandler.addLinks(registryEntryHateoas, request, new Authorisation());
applicationEventPublisher.publishEvent(new AfterNoarkEntityUpdatedEvent(this, updatedRegistryEntry));
return ResponseEntity.status(HttpStatus.CREATED).allow(CommonUtils.WebUtils.getMethodsForRequestOrThrow(request.getServletPath())).eTag(updatedRegistryEntry.getVersion().toString()).body(registryEntryHateoas);
}
Aggregations