Search in sources :

Example 6 with SignOffMethod

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

the class SignOffMethodService method createNewSignOffMethod.

// All CREATE operations
/**
 * Persists a new SignOffMethod object to the database.
 *
 * @param SignOffMethod SignOffMethod object with values set
 * @return the newly persisted SignOffMethod object wrapped as a
 * MetadataHateoas object
 */
@Override
public MetadataHateoas createNewSignOffMethod(SignOffMethod SignOffMethod) {
    SignOffMethod.setDeleted(false);
    SignOffMethod.setOwnedBy(SecurityContextHolder.getContext().getAuthentication().getName());
    MetadataHateoas metadataHateoas = new MetadataHateoas(SignOffMethodRepository.save(SignOffMethod));
    metadataHateoasHandler.addLinks(metadataHateoas, new Authorisation());
    return metadataHateoas;
}
Also used : Authorisation(nikita.webapp.security.Authorisation) MetadataHateoas(nikita.common.model.noark5.v4.hateoas.metadata.MetadataHateoas)

Example 7 with SignOffMethod

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

the class SignOffMethodService method findAll.

// All READ operations
/**
 * Retrieve a list of all SignOffMethod objects
 *
 * @return list of SignOffMethod objects wrapped as a MetadataHateoas object
 */
@Override
public MetadataHateoas findAll() {
    MetadataHateoas metadataHateoas = new MetadataHateoas((List<INikitaEntity>) (List) SignOffMethodRepository.findAll(), SIGN_OFF_METHOD);
    metadataHateoasHandler.addLinks(metadataHateoas, new Authorisation());
    return metadataHateoas;
}
Also used : INikitaEntity(nikita.common.model.noark5.v4.interfaces.entities.INikitaEntity) Authorisation(nikita.webapp.security.Authorisation) List(java.util.List) MetadataHateoas(nikita.common.model.noark5.v4.hateoas.metadata.MetadataHateoas)

Example 8 with SignOffMethod

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

the class SignOffMethodService method generateDefaultSignOffMethod.

/**
 * Generate a default SignOffMethod object
 *
 * @return the SignOffMethod object wrapped as a SignOffMethodHateoas object
 */
@Override
public SignOffMethod generateDefaultSignOffMethod() {
    SignOffMethod SignOffMethod = new SignOffMethod();
    SignOffMethod.setCode(TEMPLATE_SIGN_OFF_METHOD_CODE);
    SignOffMethod.setDescription(TEMPLATE_SIGN_OFF_METHOD_DESCRIPTION);
    return SignOffMethod;
}
Also used : SignOffMethod(nikita.common.model.noark5.v4.metadata.SignOffMethod)

Aggregations

MetadataHateoas (nikita.common.model.noark5.v4.hateoas.metadata.MetadataHateoas)6 Authorisation (nikita.webapp.security.Authorisation)6 List (java.util.List)3 INikitaEntity (nikita.common.model.noark5.v4.interfaces.entities.INikitaEntity)3 SignOffMethod (nikita.common.model.noark5.v4.metadata.SignOffMethod)3 NoarkEntityNotFoundException (nikita.common.util.exceptions.NoarkEntityNotFoundException)1 AfterNoarkEntityUpdatedEvent (nikita.webapp.web.events.AfterNoarkEntityUpdatedEvent)1