=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardContent.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardContent.java 2010-04-12 21:23:33 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardContent.java 2011-01-21 16:22:50 +0000 @@ -30,7 +30,6 @@ import java.util.ArrayList; import java.util.List; -import org.hisp.dhis.datamart.DataMartExport; import org.hisp.dhis.document.Document; import org.hisp.dhis.mapping.MapView; import org.hisp.dhis.olap.OlapURL; @@ -52,8 +51,6 @@ private List reports = new ArrayList(); - private List dataMartExports = new ArrayList(); - private List olapUrls = new ArrayList(); private List documents = new ArrayList(); @@ -114,20 +111,7 @@ } } } - - public void addDataMartExport( DataMartExport export ) - { - if ( !dataMartExports.contains( export ) ) - { - dataMartExports.add( 0, export ); - - while ( dataMartExports.size() > MAX_DASHBOARD_ELEMENTS ) - { - dataMartExports.remove( MAX_DASHBOARD_ELEMENTS ); - } - } - } - + public void addOlapUrl( OlapURL url ) { if ( !olapUrls.contains( url ) ) @@ -214,16 +198,6 @@ this.reports = reports; } - public List getDataMartExports() - { - return dataMartExports; - } - - public void setDataMartExports( List dataMartExports ) - { - this.dataMartExports = dataMartExports; - } - public List getOlapUrls() { return olapUrls; === modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java' --- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2011-01-18 09:41:25 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2011-01-21 16:22:50 +0000 @@ -82,6 +82,7 @@ executeSql( "DROP TABLE roworder" ); executeSql( "DROP TABLE sectionmembers" ); executeSql( "DROP TABLE reporttable_categoryoptioncombos" ); + executeSql( "DROP TABLE dashboardcontent_datamartexports" ); executeSql( "ALTER TABLE dataelementcategoryoption drop column categoryid" ); executeSql( "ALTER TABLE reporttable DROP column dimensiontype" ); executeSql( "ALTER TABLE categoryoptioncombo DROP COLUMN displayorder" ); === modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/DashboardContentDeletionHandler.java' --- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/DashboardContentDeletionHandler.java 2010-04-12 21:23:33 +0000 +++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/DashboardContentDeletionHandler.java 2011-01-21 16:22:50 +0000 @@ -27,7 +27,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import org.hisp.dhis.datamart.DataMartExport; import org.hisp.dhis.document.Document; import org.hisp.dhis.mapping.MapView; import org.hisp.dhis.olap.OlapURL; @@ -81,19 +80,7 @@ } } } - - @Override - public void deleteDataMartExport( DataMartExport dataMartExport ) - { - for ( DashboardContent content : dashboardService.getAllDashboardContent() ) - { - if ( content.getDataMartExports().remove( dataMartExport ) ) - { - dashboardService.saveDashboardContent( content ); - } - } - } - + @Override public void deleteDocument( Document document ) { === modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/dashboard/hibernate/DashboardContent.hbm.xml' --- dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/dashboard/hibernate/DashboardContent.hbm.xml 2009-06-17 22:06:54 +0000 +++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/dashboard/hibernate/DashboardContent.hbm.xml 2011-01-21 16:22:50 +0000 @@ -20,14 +20,7 @@ - - - - - - - + === removed file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/action/RemoveDataMartExportAction.java' --- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/action/RemoveDataMartExportAction.java 2010-04-12 21:23:33 +0000 +++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/action/RemoveDataMartExportAction.java 1970-01-01 00:00:00 +0000 @@ -1,105 +0,0 @@ -package org.hisp.dhis.dashboard.action; - -/* - * Copyright (c) 2004-2010, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import org.hisp.dhis.dashboard.DashboardContent; -import org.hisp.dhis.dashboard.DashboardService; -import org.hisp.dhis.datamart.DataMartExport; -import org.hisp.dhis.datamart.DataMartService; -import org.hisp.dhis.user.CurrentUserService; -import org.hisp.dhis.user.User; - -import com.opensymphony.xwork2.Action; - -/** - * @author Lars Helge Overland - * @version $Id$ - */ -public class RemoveDataMartExportAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private CurrentUserService currentUserService; - - public void setCurrentUserService( CurrentUserService currentUserService ) - { - this.currentUserService = currentUserService; - } - - private DashboardService dashboardService; - - public void setDashboardService( DashboardService dashboardService ) - { - this.dashboardService = dashboardService; - } - - private DataMartService dataMartService; - - public void setDataMartService( DataMartService dataMartService ) - { - this.dataMartService = dataMartService; - } - - // ------------------------------------------------------------------------- - // Input - // ------------------------------------------------------------------------- - - private Integer id; - - public void setId( Integer id ) - { - this.id = id; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() - { - User user = currentUserService.getCurrentUser(); - - if ( user != null ) - { - DashboardContent content = dashboardService.getDashboardContent( user ); - - DataMartExport export = dataMartService.getDataMartExport( id ); - - if ( content.getDataMartExports().remove( export ) ) - { - dashboardService.saveDashboardContent( content ); - } - } - - return SUCCESS; - } -} - === removed file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/provider/DataMartExportContentProvider.java' --- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/provider/DataMartExportContentProvider.java 2010-04-12 21:23:33 +0000 +++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/provider/DataMartExportContentProvider.java 1970-01-01 00:00:00 +0000 @@ -1,97 +0,0 @@ -package org.hisp.dhis.dashboard.provider; - -/* - * Copyright (c) 2004-2010, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.hisp.dhis.dashboard.DashboardContent; -import org.hisp.dhis.dashboard.DashboardService; -import org.hisp.dhis.datamart.DataMartExport; -import org.hisp.dhis.datamart.comparator.DataMartExportComparator; -import org.hisp.dhis.user.CurrentUserService; -import org.hisp.dhis.user.User; - -/** - * @author Lars Helge Overland - * @version $Id$ - */ -public class DataMartExportContentProvider - implements ContentProvider -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private CurrentUserService currentUserService; - - public void setCurrentUserService( CurrentUserService currentUserService ) - { - this.currentUserService = currentUserService; - } - - private DashboardService dashboardService; - - public void setDashboardService( DashboardService dashboardService ) - { - this.dashboardService = dashboardService; - } - - private String key; - - public void setKey( String key ) - { - this.key = key; - } - - // ------------------------------------------------------------------------- - // ContentProvider implementation - // ------------------------------------------------------------------------- - - public Map provide() - { - Map content = new HashMap(); - - User user = currentUserService.getCurrentUser(); - - if ( user != null ) - { - DashboardContent dashboardContent = dashboardService.getDashboardContent( user ); - - List exports = dashboardContent.getDataMartExports(); - - Collections.sort( exports, new DataMartExportComparator() ); - - content.put( key, exports ); - } - - return content; - } -} === modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/META-INF/dhis/beans.xml 2011-01-17 13:36:43 +0000 +++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/META-INF/dhis/beans.xml 2011-01-21 16:22:50 +0000 @@ -21,14 +21,7 @@ - - - - - - - + @@ -73,10 +66,6 @@ - data_mart_export - - - report_table @@ -127,14 +116,6 @@ - - - - - - === modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties 2010-10-14 08:54:26 +0000 +++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties 2011-01-21 16:22:50 +0000 @@ -8,7 +8,6 @@ rss_pregnancy= RSS Pregnancy report= Reports document= Documents -data_mart_export= Data mart exports report_table= Report tables olap_url= OLAP URLs map_view = Map views === modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/struts.xml 2009-09-07 07:24:01 +0000 +++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/struts.xml 2011-01-21 16:22:50 +0000 @@ -37,10 +37,6 @@ index.action - - index.action - - index.action === removed file 'dhis-2/dhis-web/dhis-web-datamart/src/main/java/org/hisp/dhis/datamart/action/AddDataMartExportToDashboardAction.java' --- dhis-2/dhis-web/dhis-web-datamart/src/main/java/org/hisp/dhis/datamart/action/AddDataMartExportToDashboardAction.java 2010-04-12 21:23:33 +0000 +++ dhis-2/dhis-web/dhis-web-datamart/src/main/java/org/hisp/dhis/datamart/action/AddDataMartExportToDashboardAction.java 1970-01-01 00:00:00 +0000 @@ -1,113 +0,0 @@ -package org.hisp.dhis.datamart.action; - -/* - * Copyright (c) 2004-2010, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.hisp.dhis.dashboard.DashboardContent; -import org.hisp.dhis.dashboard.DashboardService; -import org.hisp.dhis.datamart.DataMartExport; -import org.hisp.dhis.datamart.DataMartService; -import org.hisp.dhis.user.CurrentUserService; -import org.hisp.dhis.user.User; - -import com.opensymphony.xwork2.Action; - -/** - * @author Lars Helge Overland - * @version $Id$ - */ -public class AddDataMartExportToDashboardAction - implements Action -{ - private static final Log log = LogFactory.getLog( AddDataMartExportToDashboardAction.class ); - - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private CurrentUserService currentUserService; - - public void setCurrentUserService( CurrentUserService currentUserService ) - { - this.currentUserService = currentUserService; - } - - private DashboardService dashboardService; - - public void setDashboardService( DashboardService dashboardService ) - { - this.dashboardService = dashboardService; - } - - private DataMartService dataMartService; - - public void setDataMartService( DataMartService dataMartService ) - { - this.dataMartService = dataMartService; - } - - // ------------------------------------------------------------------------- - // Input - // ------------------------------------------------------------------------- - - private Integer id; - - public void setId( Integer id ) - { - this.id = id; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() - { - User user = currentUserService.getCurrentUser(); - - if ( user != null ) - { - DashboardContent content = dashboardService.getDashboardContent( user ); - - DataMartExport export = dataMartService.getDataMartExport( id ); - - content.addDataMartExport( export ); - - dashboardService.saveDashboardContent( content ); - - log.info( "Added data mart export '" + export.getName() + " ' to dashboard for user '" + user.getName() + "'" ); - } - else - { - log.warn( "Could not add data mart export to dashboard, no current user" ); - } - - return SUCCESS; - } -} === modified file 'dhis-2/dhis-web/dhis-web-datamart/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-datamart/src/main/resources/META-INF/dhis/beans.xml 2011-01-20 07:45:51 +0000 +++ dhis-2/dhis-web/dhis-web-datamart/src/main/resources/META-INF/dhis/beans.xml 2011-01-21 16:22:50 +0000 @@ -88,18 +88,7 @@ - - - - - - - + javascript/datamart.js ../dhis-web-commons/paging/paging.css - - - /dhis-web-datamart/responseSuccess.vm - plainTextError - - + getDataMartExports.action === modified file 'dhis-2/dhis-web/dhis-web-datamart/src/main/webapp/dhis-web-datamart/javascript/datamart.js' --- dhis-2/dhis-web/dhis-web-datamart/src/main/webapp/dhis-web-datamart/javascript/datamart.js 2011-01-06 09:03:29 +0000 +++ dhis-2/dhis-web/dhis-web-datamart/src/main/webapp/dhis-web-datamart/javascript/datamart.js 2011-01-21 16:22:50 +0000 @@ -318,18 +318,3 @@ return true; } - -// ----------------------------------------------------------------------------- -// Dashboard -// ----------------------------------------------------------------------------- - -function addToDashboard( id ) -{ - var dialog = window.confirm( i18n_confirm_add_to_dashboard ); - - if ( dialog ) - { - var request = new Request(); - request.send( "addDataMartExportToDashboard.action?id=" + id ); - } -} === modified file 'dhis-2/dhis-web/dhis-web-datamart/src/main/webapp/dhis-web-datamart/viewExportForm.vm' --- dhis-2/dhis-web/dhis-web-datamart/src/main/webapp/dhis-web-datamart/viewExportForm.vm 2011-01-11 13:11:31 +0000 +++ dhis-2/dhis-web/dhis-web-datamart/src/main/webapp/dhis-web-datamart/viewExportForm.vm 2011-01-21 16:22:50 +0000 @@ -12,7 +12,7 @@ - + @@ -27,7 +27,6 @@ $i18n.getString( 'export' )$i18n.getString( 'edit' )$i18n.getString( 'remove' ) - $i18n.getString( 'add_to_dashboard' )$i18n.getString( 'show_details' ) === modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml 2011-01-14 18:10:02 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml 2011-01-21 16:22:50 +0000 @@ -202,7 +202,6 @@ /dhis-web-reporting/responseSuccess.vm plainTextError - F_REPORTTABLE_ADD === modified file 'resources/sql/integritychecks.sql' --- resources/sql/integritychecks.sql 2011-01-20 11:39:27 +0000 +++ resources/sql/integritychecks.sql 2011-01-21 16:22:50 +0000 @@ -50,3 +50,10 @@ join reporttable t using(reporttableid) where t.name='Indicators'; +-- Recreate indexes on aggregated tables + +DROP INDEX aggregateddatavalue_index; +DROP INDEX aggregatedindicatorvalue_index; +CREATE INDEX aggregateddatavalue_index ON aggregateddatavalue (dataelementid, categoryoptioncomboid, periodid, organisationunitid); +CREATE INDEX aggregatedindicatorvalue_index ON aggregatedindicatorvalue (indicatorid, periodid, organisationunitid); +
$i18n.getString( "name" )