use of org.hisp.dhis.organisationunit.OrganisationUnitGroupSet in project dhis2-core by dhis2.
the class DefaultDimensionService method getAllDimensions.
@Override
public List<DimensionalObject> getAllDimensions() {
Collection<DataElementCategory> dcs = idObjectManager.getDataDimensions(DataElementCategory.class);
Collection<CategoryOptionGroupSet> cogs = idObjectManager.getDataDimensions(CategoryOptionGroupSet.class);
Collection<DataElementGroupSet> degs = idObjectManager.getDataDimensions(DataElementGroupSet.class);
Collection<OrganisationUnitGroupSet> ougs = idObjectManager.getDataDimensions(OrganisationUnitGroupSet.class);
final List<DimensionalObject> dimensions = new ArrayList<>();
dimensions.addAll(dcs);
dimensions.addAll(cogs);
dimensions.addAll(degs);
dimensions.addAll(ougs);
User user = currentUserService.getCurrentUser();
return getCanReadObjects(user, dimensions);
}
use of org.hisp.dhis.organisationunit.OrganisationUnitGroupSet in project dhis2-core by dhis2.
the class MergeServiceTest method mergeOrgUnitGroup.
@Test
public void mergeOrgUnitGroup() {
OrganisationUnit organisationUnitA = createOrganisationUnit('A');
OrganisationUnit organisationUnitB = createOrganisationUnit('B');
OrganisationUnit organisationUnitC = createOrganisationUnit('C');
OrganisationUnit organisationUnitD = createOrganisationUnit('D');
OrganisationUnitGroup organisationUnitGroupA = createOrganisationUnitGroup('A');
OrganisationUnitGroup organisationUnitGroupB = createOrganisationUnitGroup('B');
organisationUnitGroupA.getMembers().add(organisationUnitA);
organisationUnitGroupA.getMembers().add(organisationUnitB);
organisationUnitGroupA.getMembers().add(organisationUnitC);
organisationUnitGroupA.getMembers().add(organisationUnitD);
OrganisationUnitGroupSet organisationUnitGroupSetA = createOrganisationUnitGroupSet('A');
organisationUnitGroupSetA.addOrganisationUnitGroup(organisationUnitGroupA);
mergeService.merge(new MergeParams<>(organisationUnitGroupA, organisationUnitGroupB).setMergeMode(MergeMode.REPLACE));
assertFalse(organisationUnitGroupB.getMembers().isEmpty());
assertEquals(4, organisationUnitGroupB.getMembers().size());
assertNotNull(organisationUnitGroupB.getGroupSets());
assertFalse(organisationUnitGroupB.getGroupSets().isEmpty());
}
use of org.hisp.dhis.organisationunit.OrganisationUnitGroupSet in project dhis2-core by dhis2.
the class GetOrgUnitDistributionChartAction method execute.
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@Override
public String execute() {
OrganisationUnitGroupSet groupSet = organisationUnitGroupService.getOrganisationUnitGroupSet(groupSetId);
OrganisationUnit unit = selectionTreeManager.getReloadedSelectedOrganisationUnit();
chart = distributionService.getOrganisationUnitDistributionChart(groupSet, unit);
return SUCCESS;
}
use of org.hisp.dhis.organisationunit.OrganisationUnitGroupSet in project dhis2-core by dhis2.
the class DhisConvenienceTest method createOrganisationUnitGroupSet.
/**
* @param uniqueCharacter A unique character to identify the object.
*/
public static OrganisationUnitGroupSet createOrganisationUnitGroupSet(char uniqueCharacter) {
OrganisationUnitGroupSet groupSet = new OrganisationUnitGroupSet();
groupSet.setAutoFields();
groupSet.setName("OrganisationUnitGroupSet" + uniqueCharacter);
groupSet.setDescription("Description" + uniqueCharacter);
groupSet.setCompulsory(true);
return groupSet;
}
Aggregations