use of nikita.webapp.web.events.AfterNoarkEntityUpdatedEvent in project nikita-noark5-core by HiOA-ABI.
the class ElectronicSignatureVerifiedService method handleUpdate.
/**
* Update a ElectronicSignatureVerified identified by its systemId
* <p>
* Copy the values you are allowed to change, code and description
*
* @param systemId The systemId of the
* electronicSignatureVerified
* object you wish to update
* @param electronicSignatureVerified The updated
* electronicSignatureVerified
* object. Note the values you
* are allowed to change are
* copied from this object. This
* object is not persisted.
* @return the updated electronicSignatureVerified
*/
@Override
public MetadataHateoas handleUpdate(String systemId, Long version, ElectronicSignatureVerified electronicSignatureVerified) {
ElectronicSignatureVerified existingElectronicSignatureVerified = getElectronicSignatureVerifiedOrThrow(systemId);
// Copy all the values you are allowed to copy ....
if (null != existingElectronicSignatureVerified.getCode()) {
existingElectronicSignatureVerified.setCode(existingElectronicSignatureVerified.getCode());
}
if (null != existingElectronicSignatureVerified.getDescription()) {
existingElectronicSignatureVerified.setDescription(existingElectronicSignatureVerified.getDescription());
}
// Note this can potentially result in a NoarkConcurrencyException
// exception
existingElectronicSignatureVerified.setVersion(version);
MetadataHateoas electronicSignatureVerifiedHateoas = new MetadataHateoas(electronicSignatureVerifiedRepository.save(existingElectronicSignatureVerified));
metadataHateoasHandler.addLinks(electronicSignatureVerifiedHateoas, new Authorisation());
applicationEventPublisher.publishEvent(new AfterNoarkEntityUpdatedEvent(this, existingElectronicSignatureVerified));
return electronicSignatureVerifiedHateoas;
}
use of nikita.webapp.web.events.AfterNoarkEntityUpdatedEvent in project nikita-noark5-core by HiOA-ABI.
the class FlowStatusService method handleUpdate.
/**
* Update a FlowStatus identified by its systemId
* <p>
* Copy the values you are allowed to change, code and description
*
* @param systemId The systemId of the flowStatus object you wish to update
* @param flowStatus The updated flowStatus object. Note the values you
* are allowed to change are copied from this object.
* This object is not persisted.
* @return the updated flowStatus
*/
@Override
public MetadataHateoas handleUpdate(String systemId, Long version, FlowStatus flowStatus) {
FlowStatus existingFlowStatus = getFlowStatusOrThrow(systemId);
// Copy all the values you are allowed to copy ....
if (null != existingFlowStatus.getCode()) {
existingFlowStatus.setCode(existingFlowStatus.getCode());
}
if (null != existingFlowStatus.getDescription()) {
existingFlowStatus.setDescription(existingFlowStatus.getDescription());
}
// Note this can potentially result in a NoarkConcurrencyException
// exception
existingFlowStatus.setVersion(version);
MetadataHateoas flowStatusHateoas = new MetadataHateoas(flowStatusRepository.save(existingFlowStatus));
metadataHateoasHandler.addLinks(flowStatusHateoas, new Authorisation());
applicationEventPublisher.publishEvent(new AfterNoarkEntityUpdatedEvent(this, existingFlowStatus));
return flowStatusHateoas;
}
use of nikita.webapp.web.events.AfterNoarkEntityUpdatedEvent in project nikita-noark5-core by HiOA-ABI.
the class FormatService method handleUpdate.
/**
* Update a Format identified by its systemId
* <p>
* Copy the values you are allowed to change, code and description
*
* @param systemId The systemId of the format object you wish to update
* @param format The updated format object. Note the values you are
* allowed to change are copied from this object. This
* object is not persisted.
* @return the updated format
*/
@Override
public MetadataHateoas handleUpdate(String systemId, Long version, Format format) {
Format existingFormat = getFormatOrThrow(systemId);
// Copy all the values you are allowed to copy ....
if (null != existingFormat.getCode()) {
existingFormat.setCode(existingFormat.getCode());
}
if (null != existingFormat.getDescription()) {
existingFormat.setDescription(existingFormat.getDescription());
}
// Note this can potentially result in a NoarkConcurrencyException
// exception
existingFormat.setVersion(version);
MetadataHateoas formatHateoas = new MetadataHateoas(formatRepository.save(existingFormat));
metadataHateoasHandler.addLinks(formatHateoas, new Authorisation());
applicationEventPublisher.publishEvent(new AfterNoarkEntityUpdatedEvent(this, existingFormat));
return formatHateoas;
}
use of nikita.webapp.web.events.AfterNoarkEntityUpdatedEvent in project nikita-noark5-core by HiOA-ABI.
the class PrecedenceStatusService method handleUpdate.
/**
* Update a PrecedenceStatus identified by its systemId
* <p>
* Copy the values you are allowed to change, code and description
*
* @param systemId The systemId of the precedenceStatus object you wish to
* update
* @param precedenceStatus The updated precedenceStatus object. Note the
* values you are allowed to change are copied
* from this object. This object is not persisted.
* @return the updated precedenceStatus
*/
@Override
public MetadataHateoas handleUpdate(String systemId, Long version, PrecedenceStatus precedenceStatus) {
PrecedenceStatus existingPrecedenceStatus = getPrecedenceStatusOrThrow(systemId);
// Copy all the values you are allowed to copy ....
if (null != existingPrecedenceStatus.getCode()) {
existingPrecedenceStatus.setCode(existingPrecedenceStatus.getCode());
}
if (null != existingPrecedenceStatus.getDescription()) {
existingPrecedenceStatus.setDescription(existingPrecedenceStatus.getDescription());
}
// Note this can potentially result in a NoarkConcurrencyException
// exception
existingPrecedenceStatus.setVersion(version);
MetadataHateoas precedenceStatusHateoas = new MetadataHateoas(precedenceStatusRepository.save(existingPrecedenceStatus));
metadataHateoasHandler.addLinks(precedenceStatusHateoas, new Authorisation());
applicationEventPublisher.publishEvent(new AfterNoarkEntityUpdatedEvent(this, existingPrecedenceStatus));
return precedenceStatusHateoas;
}
use of nikita.webapp.web.events.AfterNoarkEntityUpdatedEvent in project nikita-noark5-core by HiOA-ABI.
the class SignOffMethodService method handleUpdate.
/**
* Update a SignOffMethod identified by its systemId
* <p>
* Copy the values you are allowed to change, code and description
*
* @param SignOffMethod
* @return the updated SignOffMethod
*/
@Override
public MetadataHateoas handleUpdate(String systemId, Long version, SignOffMethod SignOffMethod) {
SignOffMethod existingSignOffMethod = getSignOffMethodOrThrow(systemId);
// Copy all the values you are allowed to copy ....
if (null != existingSignOffMethod.getCode()) {
existingSignOffMethod.setCode(existingSignOffMethod.getCode());
}
if (null != existingSignOffMethod.getDescription()) {
existingSignOffMethod.setDescription(existingSignOffMethod.getDescription());
}
// Note this can potentially result in a NoarkConcurrencyException
// exception
existingSignOffMethod.setVersion(version);
MetadataHateoas SignOffMethodHateoas = new MetadataHateoas(SignOffMethodRepository.save(existingSignOffMethod));
metadataHateoasHandler.addLinks(SignOffMethodHateoas, new Authorisation());
applicationEventPublisher.publishEvent(new AfterNoarkEntityUpdatedEvent(this, existingSignOffMethod));
return SignOffMethodHateoas;
}
Aggregations