~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/GetOrgUnitsAction.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 org.hisp.dhis.organisationunit.OrganisationUnit;
 
4
import org.hisp.dhis.organisationunit.OrganisationUnitService;
 
5
 
 
6
import com.opensymphony.xwork.ActionSupport;
 
7
 
 
8
public class GetOrgUnitsAction extends ActionSupport
 
9
{
 
10
    // -------------------------------------------------------------------------
 
11
    // Dependencies
 
12
    // -------------------------------------------------------------------------
 
13
 
 
14
    private OrganisationUnitService organisationUnitService;
 
15
 
 
16
    public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
 
17
    {
 
18
        this.organisationUnitService = organisationUnitService;
 
19
    }
 
20
 
 
21
    // -------------------------------------------------------------------------
 
22
    // Getters & Setters
 
23
    // -------------------------------------------------------------------------
 
24
 
 
25
    private Integer orgUnitId;
 
26
 
 
27
    public void setOrgUnitId( Integer orgUnitId )
 
28
    {
 
29
        this.orgUnitId = orgUnitId;
 
30
    }
 
31
        
 
32
    private OrganisationUnit orgUnit;
 
33
    
 
34
    public OrganisationUnit getOrgUnit()
 
35
    {
 
36
        return orgUnit;
 
37
    }
 
38
 
 
39
    // -------------------------------------------------------------------------
 
40
    // Action implementation
 
41
    // -------------------------------------------------------------------------
 
42
 
 
43
    public String execute() throws Exception
 
44
    {
 
45
        /* OrganisationUnit */
 
46
        if(orgUnitId != null)
 
47
        {
 
48
            orgUnit = organisationUnitService.getOrganisationUnit( orgUnitId );            
 
49
        }   
 
50
 
 
51
        return SUCCESS;
 
52
    }
 
53
 
 
54
}