use of net.nemerosa.ontrack.ui.resource.Resources in project ontrack by nemerosa.
the class ProjectEntityExtensionController method getInformation.
/**
* Gets the list of information extensions for an entity
*/
@RequestMapping(value = "information/{entityType}/{id}", method = RequestMethod.GET)
public Resources<EntityInformation> getInformation(@PathVariable ProjectEntityType entityType, @PathVariable ID id) {
// Gets the entity
ProjectEntity entity = getEntity(entityType, id);
// List of informations to return
List<EntityInformation> informations = extensionManager.getExtensions(EntityInformationExtension.class).stream().map(x -> x.getInformation(entity)).filter(Optional::isPresent).map(Optional::get).collect(Collectors.toList());
// OK
return Resources.of(informations, uri(MvcUriComponentsBuilder.on(getClass()).getInformation(entityType, id)));
}
Aggregations