use of nikita.common.model.noark5.v4.metadata.RegistryEntryStatus in project nikita-noark5-core by HiOA-ABI.
the class RegistryEntryStatusService method generateDefaultRegistryEntryStatus.
/**
* Generate a default RegistryEntryStatus object
*
* @return the RegistryEntryStatus object wrapped as a RegistryEntryStatusHateoas object
*/
@Override
public RegistryEntryStatus generateDefaultRegistryEntryStatus() {
RegistryEntryStatus RegistryEntryStatus = new RegistryEntryStatus();
RegistryEntryStatus.setCode(TEMPLATE_REGISTRY_ENTRY_STATUS_CODE);
RegistryEntryStatus.setDescription(TEMPLATE_REGISTRY_ENTRY_STATUS_DESCRIPTION);
return RegistryEntryStatus;
}
use of nikita.common.model.noark5.v4.metadata.RegistryEntryStatus in project nikita-noark5-core by HiOA-ABI.
the class RegistryEntryStatusService method createNewRegistryEntryStatus.
// All CREATE operations
/**
* Persists a new RegistryEntryStatus object to the database.
*
* @param RegistryEntryStatus RegistryEntryStatus object with values set
* @return the newly persisted RegistryEntryStatus object wrapped as a
* MetadataHateoas object
*/
@Override
public MetadataHateoas createNewRegistryEntryStatus(RegistryEntryStatus RegistryEntryStatus) {
RegistryEntryStatus.setDeleted(false);
RegistryEntryStatus.setOwnedBy(SecurityContextHolder.getContext().getAuthentication().getName());
MetadataHateoas metadataHateoas = new MetadataHateoas(RegistryEntryStatusRepository.save(RegistryEntryStatus));
metadataHateoasHandler.addLinks(metadataHateoas, new Authorisation());
return metadataHateoas;
}
use of nikita.common.model.noark5.v4.metadata.RegistryEntryStatus in project nikita-noark5-core by HiOA-ABI.
the class RegistryEntryStatusService method findByCode.
/**
* retrieve all RegistryEntryStatus that have a particular code.
* <br>
* Note, this will be replaced by OData search.
*
* @param code
* @return A list of RegistryEntryStatus objects wrapped as a MetadataHateoas
* object
*/
@Override
public MetadataHateoas findByCode(String code) {
MetadataHateoas metadataHateoas = new MetadataHateoas((List<INikitaEntity>) (List) RegistryEntryStatusRepository.findByCode(code), REGISTRY_ENTRY_STATUS);
metadataHateoasHandler.addLinks(metadataHateoas, new Authorisation());
return metadataHateoas;
}
Aggregations