~dhis2-academy/dhis2-academy/android

« back to all changes in this revision

Viewing changes to dhis-mobile/dhis-web-webservice/src/main/java/org/hisp/dhis/web/webservice/service/DataService.java

  • Committer: Kristian Haga Karstensen
  • Date: 2010-11-23 22:21:12 UTC
  • Revision ID: kristhk@ifi.uio.no-20101123222112-ulzyu7kpg9kmfv6l
Added some resources for getting datasets and organisation units. Not finished, but it's working a bit - data exchange format and more functionality is needed (and something needs to be changed). Also reverted DataSet in dhis-api, since we're not supposed to change things here (also breaks build of dhis-2)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.hisp.dhis.web.webservice.service;
 
2
 
 
3
import java.util.Collection;
 
4
import java.util.List;
 
5
import java.util.Set;
 
6
 
 
7
import org.hisp.dhis.dataelement.DataElement;
 
8
import org.hisp.dhis.dataset.DataSet;
 
9
import org.hisp.dhis.organisationunit.OrganisationUnit;
 
10
import org.hisp.dhis.web.webservice.model.DataSetIdentifier;
 
11
import org.hisp.dhis.web.webservice.model.OrgUnitIdentifier;
 
12
 
 
13
/**
 
14
 * Interface for DataService used in DHIS Webservice
 
15
 * 
 
16
 * @author Kristian Haga Karstensen <kristhk@ifi.uio.no>
 
17
 *
 
18
 */
 
19
 
 
20
public interface DataService {
 
21
        
 
22
        /**
 
23
         * Get a Collection of DataElements for a specific DataSet
 
24
         * @param ds - DataSet to get DataElements for
 
25
         * @return Collection of DataElements
 
26
         */
 
27
        Collection <DataElement> getDataElementsForSet(DataSet ds);
 
28
        
 
29
        /**
 
30
         * Get a Set of DataSets for the current logged in user
 
31
         * @return a Set of DataSet
 
32
         */
 
33
        Set <DataSet> getDataSetsForUser();
 
34
        
 
35
        /**
 
36
         * Get the names of the DataSets for the current logged in user
 
37
         * @return List of DataSetIdentifier-objects
 
38
         */
 
39
        List<DataSetIdentifier> getDataSetIdentifiersForUser();
 
40
        
 
41
        /**
 
42
         * Get all the root organisation units
 
43
         * @return Collection of root Org.Units
 
44
         */
 
45
        Collection<OrganisationUnit> getRootOrgUnits();
 
46
        
 
47
        /**
 
48
         * Get the children of a specified OrganisationUnit
 
49
         * @param orgUnitId - the chosen OrganisationUnit
 
50
         * @return Collection of OrganisationUnits (Children)
 
51
         */
 
52
        Collection<OrganisationUnit> getChildrenFromOrgUnit(int orgUnitId);
 
53
        
 
54
        /**
 
55
         * Gets the names and ID's of the root OrganisationUnits
 
56
         * @return List of OrgUnitIdentifiers
 
57
         */
 
58
        List<OrgUnitIdentifier> getRootOrgUnitIdentifiers();
 
59
        
 
60
        /**
 
61
         * Gets the names and ID's of the children OrganisationUnits for a given ID
 
62
         * @return List of OrgUnitIdentifiers (children of the given ID)
 
63
         */
 
64
        List<OrgUnitIdentifier> getChildrenOrgUnitIdentifiersFromOrgUnit(int orgUnitId);
 
65
}