use of nikita.common.model.noark5.v4.metadata.FileType in project nikita-noark5-core by HiOA-ABI.
the class FileTypeService method findByCode.
/**
* retrieve all FileType that have a particular code.
* <br>
* Note, this will be replaced by OData search.
*
* @param code The code of the object you wish to retrieve
* @return A list of FileType objects wrapped as a MetadataHateoas
* object
*/
@Override
public MetadataHateoas findByCode(String code) {
MetadataHateoas metadataHateoas = new MetadataHateoas((List<INikitaEntity>) (List) fileTypeRepository.findByCode(code), FILE_TYPE);
metadataHateoasHandler.addLinks(metadataHateoas, new Authorisation());
return metadataHateoas;
}
use of nikita.common.model.noark5.v4.metadata.FileType in project nikita-noark5-core by HiOA-ABI.
the class FileTypeService method generateDefaultFileType.
/**
* Generate a default FileType object
*
* @return the FileType object wrapped as a FileTypeHateoas object
*/
@Override
public FileType generateDefaultFileType() {
FileType fileType = new FileType();
fileType.setCode(TEMPLATE_FILE_TYPE_CODE);
fileType.setDescription(TEMPLATE_FILE_TYPE_DESCRIPTION);
return fileType;
}
use of nikita.common.model.noark5.v4.metadata.FileType in project nikita-noark5-core by HiOA-ABI.
the class FileTypeService method find.
// find by systemId
/**
* Retrieve a single FileType object identified by systemId
*
* @param systemId systemId of the FileType you wish to retrieve
* @return single FileType object wrapped as a MetadataHateoas object
*/
@Override
public MetadataHateoas find(String systemId) {
MetadataHateoas metadataHateoas = new MetadataHateoas(fileTypeRepository.findBySystemId(systemId));
metadataHateoasHandler.addLinks(metadataHateoas, new Authorisation());
return metadataHateoas;
}
Aggregations