use of org.hisp.dhis.common.IdentifiableObjects in project dhis2-core by dhis2.
the class AbstractCrudController method replaceCollectionItemsJson.
@RequestMapping(value = "/{uid}/{property}", method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE)
public void replaceCollectionItemsJson(@PathVariable("uid") String pvUid, @PathVariable("property") String pvProperty, HttpServletRequest request, HttpServletResponse response) throws Exception {
List<T> objects = getEntity(pvUid);
IdentifiableObjects identifiableObjects = renderService.fromJson(request.getInputStream(), IdentifiableObjects.class);
collectionService.clearCollectionItems(objects.get(0), pvProperty);
collectionService.addCollectionItems(objects.get(0), pvProperty, Lists.newArrayList(identifiableObjects.getIdentifiableObjects()));
}
Aggregations