← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16693: remove getByUser for dashboard / chart services (not in use), also remove from generic stores. Up...

 

------------------------------------------------------------
revno: 16693
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-09-11 13:39:30 +0700
message:
  remove getByUser for dashboard / chart services (not in use), also remove from generic stores. Update getByDataDimension to use sharing criteria.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/ChartService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericIdentifiableObjectStore.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntity.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/hibernate/HibernateIdentifiableObjectStore.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/dashboard/impl/DefaultDashboardService.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/ChartService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/ChartService.java	2014-07-12 14:18:34 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/ChartService.java	2014-09-11 06:39:30 +0000
@@ -112,8 +112,6 @@
 
     int getChartCountByName( String name );
     
-    Collection<Chart> getChartsByUser( User user );
-
     int countDataSetCharts( DataSet dataSet );
 
     int countIndicatorCharts( Indicator indicator );

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericIdentifiableObjectStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericIdentifiableObjectStore.java	2014-09-09 07:32:11 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericIdentifiableObjectStore.java	2014-09-11 06:39:30 +0000
@@ -28,8 +28,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import org.hisp.dhis.user.User;
-
 import java.util.Collection;
 import java.util.Date;
 import java.util.List;
@@ -215,8 +213,6 @@
      */
     List<T> getByUidNoAcl( Collection<String> uids );
 
-    int getCountGeCreated( Date created );
-
     /**
      * Returns all objects that are equal to or newer than given date.
      *
@@ -237,7 +233,7 @@
      * Returns all objects that are equal to or newer than given date.
      * (ordered by name)
      *
-     * @param lastUpdated Date to compare to.
+     * @param created Date to compare to.
      * @return All objects equal or newer than given date.
      */
     List<T> getAllGeCreatedOrderedName( Date created );
@@ -252,7 +248,7 @@
     List<T> getAllGeLastUpdatedOrderedName( Date lastUpdated );
 
     /**
-     * Returns the number of objects that are equal to or newer than given date.
+     * Returns the number of objects that are equal to or newer than given last updated date.
      *
      * @param lastUpdated Date to compare to.
      * @return the number of objects equal or newer than given date.
@@ -260,10 +256,10 @@
     int getCountGeLastUpdated( Date lastUpdated );
 
     /**
-     * Retrieves objects associated with the given user.
+     * Returns the number of objects that are equal to or newer than given created date.
      *
-     * @param user the user.
-     * @return list of objects.
+     * @param created Date to compare to.
+     * @return the number of objects equal or newer than given date.
      */
-    List<T> getByUser( User user );
+    int getCountGeCreated( Date created );
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardService.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardService.java	2014-09-11 06:39:30 +0000
@@ -65,8 +65,6 @@
 
     Dashboard getDashboard( String uid );
 
-    List<Dashboard> getByUser( User user );
-
     int countMapDashboardItems( Map map );
 
     int countChartDashboardItems( Chart chart );

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntity.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntity.java	2014-05-23 14:58:07 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntity.java	2014-09-11 06:39:30 +0000
@@ -35,7 +35,7 @@
 /**
  * @author Chau Thu Tran
  */
-@JacksonXmlRootElement(localName = "trackedEntity", namespace = DxfNamespaces.DXF_2_0)
+@JacksonXmlRootElement( localName = "trackedEntity", namespace = DxfNamespaces.DXF_2_0 )
 public class TrackedEntity
     extends BaseNameableObject
 {

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/hibernate/HibernateIdentifiableObjectStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/hibernate/HibernateIdentifiableObjectStore.java	2014-09-09 07:32:11 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/hibernate/HibernateIdentifiableObjectStore.java	2014-09-11 06:39:30 +0000
@@ -388,22 +388,10 @@
 
     @Override
     @SuppressWarnings( "unchecked" )
-    public List<T> getByUser( User user )
-    {
-        Query query = getQuery( "from " + clazz.getName() + " c where user = :user" );
-        query.setEntity( "user", user );
-
-        return query.list();
-    }
-
-    @Override
-    @SuppressWarnings( "unchecked" )
     public List<T> getByDataDimension( boolean dataDimension )
     {
-        Query query = getQuery( "from " + clazz.getName() + " c where c.dataDimension = :dataDimension" );
-        query.setBoolean( "dataDimension", dataDimension );
-
-        return query.list();
+        return getSharingCriteria()
+            .add( Restrictions.eq( "dataDimension", dataDimension ) ).list();
     }
 
     @Override

=== 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	2014-09-08 13:02:43 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java	2014-09-11 06:39:30 +0000
@@ -888,11 +888,6 @@
         return chartStore.getAllLikeName( name, first, max );
     }
 
-    public Collection<Chart> getChartsByUser( User user )
-    {
-        return chartStore.getByUser( user );
-    }
-
     @Override
     public int countDataSetCharts( DataSet dataSet )
     {

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/impl/DefaultDashboardService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/impl/DefaultDashboardService.java	2014-09-09 07:32:11 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/impl/DefaultDashboardService.java	2014-09-11 06:39:30 +0000
@@ -279,12 +279,6 @@
     }
 
     @Override
-    public List<Dashboard> getByUser( User user )
-    {
-        return dashboardStore.getByUser( user );
-    }
-
-    @Override
     public int countMapDashboardItems( Map map )
     {
         return dashboardItemStore.countMapDashboardItems( map );