← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5198: Added getByUid methods

 

------------------------------------------------------------
revno: 5198
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-11-22 17:17:49 +0100
message:
  Added getByUid methods
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/ChartStore.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/report/ReportService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTableService.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementCategoryService.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/indicator/DefaultIndicatorService.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitGroupService.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/report/impl/DefaultReportService.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/impl/DefaultReportTableService.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/ChartStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/ChartStore.java	2010-12-13 16:32:50 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/ChartStore.java	2011-11-22 16:17:49 +0000
@@ -29,14 +29,14 @@
 
 import java.util.Collection;
 
-import org.hisp.dhis.common.GenericStore;
+import org.hisp.dhis.common.GenericIdentifiableObjectStore;
 
 /**
  * @author Lars Helge Overland
  * @version $Id$
  */
 public interface ChartStore
-    extends GenericStore<Chart>
+    extends GenericIdentifiableObjectStore<Chart>
 {
     String ID = ChartStore.class.getName();
         

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryService.java	2011-11-22 15:48:30 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryService.java	2011-11-22 16:17:49 +0000
@@ -71,10 +71,18 @@
     /**
      * Returns a DataElementCategory.
      * 
-     * @param id the id of the DataElementCTEGORY to return.
+     * @param id the id of the DataElementCategory to return.
      * @return the DataElementCategory with the given id, or null if no match.
      */
     DataElementCategory getDataElementCategory( int id );
+
+    /**
+     * Returns a DataElementCategory.
+     * 
+     * @param uid the uid of the DataElementCategory to return.
+     * @return the DataElementCategory with the given uid, or null if no match.
+     */
+    DataElementCategory getDataElementCategory( String uid );
     
     /**
      * Retrieves the DataElementCategories with the given identifiers.
@@ -133,6 +141,14 @@
      * @return the DataElementCategoryOption with the given id, or null if no match.
      */
     DataElementCategoryOption getDataElementCategoryOption( int id );
+
+    /**
+     * Returns a DataElementCategoryOption.
+     * 
+     * @param uid the id of the DataElementCategoryOption to return.
+     * @return the DataElementCategoryOption with the given uid, or null if no match.
+     */
+    DataElementCategoryOption getDataElementCategoryOption( String uid );
     
     /**
      * Retrieves the DataElementCategoryOptions with the given identifiers.
@@ -190,6 +206,14 @@
      * @return the DataElementCategoryCombo.
      */
     DataElementCategoryCombo getDataElementCategoryCombo( int id );
+
+    /**
+     * Retrieves a DataElementCategoryCombo with the given uid.
+     * 
+     * @param uid the identifier of the DataElementCategoryCombo to retrieve.
+     * @return the DataElementCategoryCombo.
+     */
+    DataElementCategoryCombo getDataElementCategoryCombo( String uid );
     
     /**
      * Retrieves the DataElementCategoryCombo with the given identifiers.

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java	2011-11-22 15:48:30 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java	2011-11-22 16:17:49 +0000
@@ -422,6 +422,8 @@
     void deleteDataElementGroupSet( DataElementGroupSet groupSet );
 
     DataElementGroupSet getDataElementGroupSet( int id );
+    
+    DataElementGroupSet getDataElementGroupSet( String uid );
 
     DataElementGroupSet getDataElementGroupSetByName( String name );
 

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorService.java	2011-11-22 15:48:30 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorService.java	2011-11-22 16:17:49 +0000
@@ -146,6 +146,8 @@
     void deleteIndicatorGroupSet( IndicatorGroupSet groupSet );
 
     IndicatorGroupSet getIndicatorGroupSet( int id );
+    
+    IndicatorGroupSet getIndicatorGroupSet( String uid );
 
     IndicatorGroupSet getIndicatorGroupSetByName( String name );
 

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupService.java	2011-11-22 15:48:30 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupService.java	2011-11-22 16:17:49 +0000
@@ -142,6 +142,15 @@
     OrganisationUnitGroupSet getOrganisationUnitGroupSet( int id );
 
     /**
+     * Returns an OrganisationUnitGroupSet.
+     * 
+     * @param uid the id of the OrganisationUnitGroupSet to return.
+     * @return the OrganisationUnitGroupSet with the given uid, or null if no
+     *         match.
+     */
+    OrganisationUnitGroupSet getOrganisationUnitGroupSet( String uid );
+
+    /**
      * Returns the OrganisationUnitGroupSets with the given identifiers.
      * 
      * @param identifiers the identifiers.

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/report/ReportService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/report/ReportService.java	2011-10-12 17:32:39 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/report/ReportService.java	2011-11-22 16:17:49 +0000
@@ -64,6 +64,14 @@
     Report getReport( int id );
 
     /**
+     * Retrieves the Report with the given uid.
+     * 
+     * @param uid the uid of the Report to retrieve.
+     * @return the Report.
+     */
+    Report getReport( String uid );
+
+    /**
      * Deletes a Report.
      * 
      * @param report the Report to delete.

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java	2011-10-12 11:48:47 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java	2011-11-22 16:17:49 +0000
@@ -38,7 +38,7 @@
 import java.util.Set;
 
 import org.apache.commons.lang.StringUtils;
-import org.hisp.dhis.common.AbstractNameableObject;
+import org.hisp.dhis.common.AbstractIdentifiableObject;
 import org.hisp.dhis.common.CombinationGenerator;
 import org.hisp.dhis.common.NameableObject;
 import org.hisp.dhis.dataelement.DataElement;
@@ -63,7 +63,7 @@
  * @version $Id$
  */
 public class ReportTable
-    extends AbstractNameableObject
+    extends AbstractIdentifiableObject
 {
     /**
      * Determines if a de-serialized file is compatible with this class.

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTableService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTableService.java	2011-10-12 17:32:39 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTableService.java	2011-11-22 16:17:49 +0000
@@ -87,6 +87,14 @@
      * @return the ReportTable.
      */
     ReportTable getReportTable( int id );
+
+    /**
+     * Retrieves the ReportTable with the given uid.
+     * 
+     * @param uid the uid of the ReportTable to retrieve.
+     * @return the ReportTable.
+     */
+    ReportTable getReportTable( String uid );
     
     /**
      * Retrieves a Collection of all ReportTables.

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementCategoryService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementCategoryService.java	2011-11-22 15:48:30 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementCategoryService.java	2011-11-22 16:17:49 +0000
@@ -119,6 +119,11 @@
         return dataElementCategoryStore.get( id );
     }
 
+    public DataElementCategory getDataElementCategory( String uid )
+    {
+        return dataElementCategoryStore.getByUid( uid );
+    }
+
     public Collection<DataElementCategory> getDataElementCategories( final Collection<Integer> identifiers )
     {
         Collection<DataElementCategory> categories = getAllDataElementCategories();
@@ -161,6 +166,11 @@
         return dataElementCategoryOptionStore.get( id );
     }
 
+    public DataElementCategoryOption getDataElementCategoryOption( String uid )
+    {
+        return dataElementCategoryOptionStore.getByUid( uid );
+    }
+
     public DataElementCategoryOption getDataElementCategoryOptionByName( String name )
     {
         return dataElementCategoryOptionStore.getByName( name );
@@ -213,6 +223,11 @@
     {
         return dataElementCategoryComboStore.get( id );
     }
+
+    public DataElementCategoryCombo getDataElementCategoryCombo( String uid )
+    {
+        return dataElementCategoryComboStore.getByUid( uid );
+    }
     
     public Collection<DataElementCategoryCombo> getDataElementCategoryCombos( final Collection<Integer> identifiers )
     {
@@ -257,7 +272,8 @@
         return dataElementCategoryOptionComboStore.get( id );
     }
 
-    public DataElementCategoryOptionCombo getDataElementCategoryOptionCombo( String uid ) {
+    public DataElementCategoryOptionCombo getDataElementCategoryOptionCombo( String uid )
+    {
         return dataElementCategoryOptionComboStore.getByUid( uid );
     }
 

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java	2011-11-22 15:48:30 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java	2011-11-22 16:17:49 +0000
@@ -79,8 +79,7 @@
 
     private GenericIdentifiableObjectStore<DataElementGroupSet> dataElementGroupSetStore;
 
-    public void setDataElementGroupSetStore(
-        GenericIdentifiableObjectStore<DataElementGroupSet> dataElementGroupSetStore )
+    public void setDataElementGroupSetStore( GenericIdentifiableObjectStore<DataElementGroupSet> dataElementGroupSetStore )
     {
         this.dataElementGroupSetStore = dataElementGroupSetStore;
     }
@@ -129,9 +128,9 @@
         return i18n( i18nService, dataElementStore.get( id ) );
     }
 
-    public DataElement getDataElement( String uuid )
+    public DataElement getDataElement( String uid )
     {
-        return i18n( i18nService, dataElementStore.getByUid( uuid ) );
+        return i18n( i18nService, dataElementStore.getByUid( uid ) );
     }
 
     public DataElement getDataElementByCode( String code )
@@ -487,6 +486,11 @@
         return i18n( i18nService, dataElementGroupSetStore.get( id ) );
     }
 
+    public DataElementGroupSet getDataElementGroupSet( String uid )
+    {
+        return i18n( i18nService, dataElementGroupSetStore.getByUid( uid ) );
+    }
+
     public DataElementGroupSet getDataElementGroupSetByName( String name )
     {
         return i18n( i18nService, dataElementGroupSetStore.getByName( name ) );

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/indicator/DefaultIndicatorService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/indicator/DefaultIndicatorService.java	2011-11-22 15:48:30 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/indicator/DefaultIndicatorService.java	2011-11-22 16:17:49 +0000
@@ -412,6 +412,11 @@
         return i18n( i18nService, indicatorGroupSetStore.get( id ) );
     }
 
+    public IndicatorGroupSet getIndicatorGroupSet( String uid )
+    {
+        return i18n( i18nService, indicatorGroupSetStore.getByUid( uid ) );
+    }
+
     public IndicatorGroupSet getIndicatorGroupSetByName( String name )
     {
         return i18n( i18nService, indicatorGroupSetStore.getByName( name ) );

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitGroupService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitGroupService.java	2011-11-22 15:48:30 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitGroupService.java	2011-11-22 16:17:49 +0000
@@ -136,6 +136,11 @@
     {
         return organisationUnitGroupSetStore.get( id );
     }
+
+    public OrganisationUnitGroupSet getOrganisationUnitGroupSet( String uid )
+    {
+        return organisationUnitGroupSetStore.getByUid( uid );
+    }
     
     public Collection<OrganisationUnitGroupSet> getOrganisationUnitGroupSets( final Collection<Integer> identifiers )
     {

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java	2011-11-12 18:43:35 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java	2011-11-22 16:17:49 +0000
@@ -1136,6 +1136,11 @@
         return chartStore.get( id );
     }
 
+    public Chart getChart( String uid )
+    {
+        return chartStore.getByUid( uid );
+    }
+
     public void deleteChart( Chart chart )
     {
         chartStore.delete( chart );

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/report/impl/DefaultReportService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/report/impl/DefaultReportService.java	2011-11-22 06:23:39 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/report/impl/DefaultReportService.java	2011-11-22 16:17:49 +0000
@@ -186,6 +186,11 @@
         return reportStore.get( id );
     }
 
+    public Report getReport( String uid )
+    {
+        return reportStore.getByUid( uid );
+    }
+
     public Report getReportByName( String name )
     {
         return reportStore.getByName( name );

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/impl/DefaultReportTableService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/impl/DefaultReportTableService.java	2011-10-12 17:32:39 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/impl/DefaultReportTableService.java	2011-11-22 16:17:49 +0000
@@ -223,6 +223,11 @@
         return reportTableStore.get( id );
     }
 
+    public ReportTable getReportTable( String uid )
+    {
+        return reportTableStore.getByUid( uid );
+    }
+
     public Collection<ReportTable> getReportTables( final Collection<Integer> identifiers )
     {
         Collection<ReportTable> objects = getAllReportTables();
@@ -245,7 +250,7 @@
     {
         return reportTableStore.getByName( name );
     }
-
+    
     public Collection<ReportTable> getReportTablesBetweenByName( String name, int first, int max )
     {
         return reportTableStore.getBetweenByName( name, first, max );