~mortenoh/+junk/dhis2-detailed-import-export

« back to all changes in this revision

Viewing changes to local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/action/GetOrgUnitGroupsAction.java

  • Committer: larshelge at gmail
  • Date: 2009-03-03 16:46:36 UTC
  • Revision ID: larshelge@gmail.com-20090303164636-2sjlrquo7ib1gf7r
Initial check-in

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.hisp.dhis.dashboard.action;
 
2
 
 
3
import java.util.ArrayList;
 
4
import java.util.List;
 
5
 
 
6
import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
 
7
import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
 
8
import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet;
 
9
 
 
10
import com.opensymphony.xwork.ActionSupport;
 
11
 
 
12
public class GetOrgUnitGroupsAction extends ActionSupport
 
13
{
 
14
    // -------------------------------------------------------------------------
 
15
    // Dependencies
 
16
    // -------------------------------------------------------------------------
 
17
 
 
18
    private OrganisationUnitGroupService organisationUnitGroupService;
 
19
    
 
20
    public void setOrganisationUnitGroupService( OrganisationUnitGroupService organisationUnitGroupService )
 
21
    {
 
22
        this.organisationUnitGroupService = organisationUnitGroupService;
 
23
    }
 
24
 
 
25
    // -------------------------------------------------------------------------
 
26
    // Getters & Setters
 
27
    // -------------------------------------------------------------------------
 
28
    
 
29
    private Integer orgUnitGroupSetId;
 
30
    
 
31
    public void setOrgUnitGroupSetId( Integer orgUnitGroupSetId )
 
32
    {
 
33
        this.orgUnitGroupSetId = orgUnitGroupSetId;
 
34
    }
 
35
    
 
36
    private List<OrganisationUnitGroup> orgUnitGroups;
 
37
    
 
38
    public List<OrganisationUnitGroup> getOrgUnitGroups()
 
39
    {
 
40
        return orgUnitGroups;
 
41
    }
 
42
    
 
43
    // -------------------------------------------------------------------------
 
44
    // Action implementation
 
45
    // -------------------------------------------------------------------------
 
46
 
 
47
    public String execute()
 
48
        throws Exception
 
49
    {
 
50
 
 
51
        OrganisationUnitGroupSet organisationUnitGroupSet = organisationUnitGroupService.getOrganisationUnitGroupSet( orgUnitGroupSetId );
 
52
        
 
53
        if(organisationUnitGroupSet != null )
 
54
        {
 
55
            orgUnitGroups = new ArrayList<OrganisationUnitGroup>(organisationUnitGroupSet.getOrganisationUnitGroups());            
 
56
        }
 
57
        
 
58
        return SUCCESS;
 
59
    }
 
60
 
 
61
}