Search in sources :

Example 51 with TypeReport

use of org.hisp.dhis.feedback.TypeReport in project dhis2-core by dhis2.

the class AbstractCrudController method addCollectionItems.

private WebMessage addCollectionItems(String pvProperty, T object, IdentifiableObjects items) throws Exception {
    preUpdateItems(object, items);
    TypeReport deletions = collectionService.delCollectionItems(object, pvProperty, items.getDeletions());
    TypeReport additions = collectionService.addCollectionItems(object, pvProperty, items.getAdditions());
    postUpdateItems(object, items);
    return typeReport(deletions.mergeAllowEmpty(additions));
}
Also used : TypeReport(org.hisp.dhis.feedback.TypeReport)

Example 52 with TypeReport

use of org.hisp.dhis.feedback.TypeReport in project dhis2-core by dhis2.

the class AbstractCrudController method deleteCollectionItems.

private WebMessage deleteCollectionItems(String pvProperty, T object, IdentifiableObjects items) throws Exception {
    preUpdateItems(object, items);
    TypeReport report = collectionService.delCollectionItems(object, pvProperty, items.getIdentifiableObjects());
    postUpdateItems(object, items);
    return typeReport(report);
}
Also used : TypeReport(org.hisp.dhis.feedback.TypeReport)

Aggregations

TypeReport (org.hisp.dhis.feedback.TypeReport)52 ObjectReport (org.hisp.dhis.feedback.ObjectReport)28 IdentifiableObject (org.hisp.dhis.common.IdentifiableObject)24 ErrorReport (org.hisp.dhis.feedback.ErrorReport)15 PreheatErrorReport (org.hisp.dhis.preheat.PreheatErrorReport)13 List (java.util.List)7 Test (org.junit.jupiter.api.Test)7 Transactional (org.springframework.transaction.annotation.Transactional)6 ArrayList (java.util.ArrayList)5 ObjectBundleCommitReport (org.hisp.dhis.dxf2.metadata.objectbundle.feedback.ObjectBundleCommitReport)5 ObjectBundleValidationReport (org.hisp.dhis.dxf2.metadata.objectbundle.feedback.ObjectBundleValidationReport)5 User (org.hisp.dhis.user.User)5 HashMap (java.util.HashMap)4 IdentifiableObjectManager (org.hisp.dhis.common.IdentifiableObjectManager)4 DataElement (org.hisp.dhis.dataelement.DataElement)4 SchemaService (org.hisp.dhis.schema.SchemaService)4 Service (org.springframework.stereotype.Service)4 AllArgsConstructor (lombok.AllArgsConstructor)3 Session (org.hibernate.Session)3 MergeParams (org.hisp.dhis.schema.MergeParams)3