1
package org.hisp.dhis.dashboard.action;
3
import java.util.ArrayList;
6
import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
7
import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
8
import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet;
10
import com.opensymphony.xwork.ActionSupport;
12
public class GetOrgUnitGroupsAction extends ActionSupport
14
// -------------------------------------------------------------------------
16
// -------------------------------------------------------------------------
18
private OrganisationUnitGroupService organisationUnitGroupService;
20
public void setOrganisationUnitGroupService( OrganisationUnitGroupService organisationUnitGroupService )
22
this.organisationUnitGroupService = organisationUnitGroupService;
25
// -------------------------------------------------------------------------
27
// -------------------------------------------------------------------------
29
private Integer orgUnitGroupSetId;
31
public void setOrgUnitGroupSetId( Integer orgUnitGroupSetId )
33
this.orgUnitGroupSetId = orgUnitGroupSetId;
36
private List<OrganisationUnitGroup> orgUnitGroups;
38
public List<OrganisationUnitGroup> getOrgUnitGroups()
43
// -------------------------------------------------------------------------
44
// Action implementation
45
// -------------------------------------------------------------------------
47
public String execute()
51
OrganisationUnitGroupSet organisationUnitGroupSet = organisationUnitGroupService.getOrganisationUnitGroupSet( orgUnitGroupSetId );
53
if(organisationUnitGroupSet != null )
55
orgUnitGroups = new ArrayList<OrganisationUnitGroup>(organisationUnitGroupSet.getOrganisationUnitGroups());