=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/report/Report.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/report/Report.java 2011-01-20 08:46:49 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/report/Report.java 2011-02-01 11:03:47 +0000 @@ -40,17 +40,10 @@ public class Report extends IdentifiableObject { - public static final String TYPE_BIRT = "birt"; - public static final String TYPE_JASPER = "jasper"; - public static final String TYPE_DEFAULT = TYPE_JASPER; public static final String TEMPLATE_DIR = "templates"; - private String design; - private String designContent; - - private String type; - + private Set reportTables = new HashSet(); private transient String url; @@ -63,11 +56,10 @@ { } - public Report( String name, String design, String type, Set reportTable ) + public Report( String name, String designContent, Set reportTable ) { this.name = name; - this.design = design; - this.type = type; + this.designContent = designContent; this.reportTables = reportTable; } @@ -79,12 +71,7 @@ { return reportTables != null; } - - public String getReportType() - { - return type != null && type.trim().length() > 0 ? type : TYPE_DEFAULT; - } - + // ------------------------------------------------------------------------- // Equals and hashCode // ------------------------------------------------------------------------- @@ -128,16 +115,6 @@ // Getters and setters // ------------------------------------------------------------------------- - public String getDesign() - { - return design; - } - - public void setDesign( String design ) - { - this.design = design; - } - public String getDesignContent() { return designContent; @@ -148,16 +125,6 @@ this.designContent = designContent; } - public String getType() - { - return type; - } - - public void setType( String type ) - { - this.type = type; - } - public Set getReportTables() { return reportTables; === modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ReportConverter.java' --- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ReportConverter.java 2010-07-30 12:59:39 +0000 +++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ReportConverter.java 2011-02-01 11:03:47 +0000 @@ -51,9 +51,7 @@ private static final String FIELD_ID = "id"; private static final String FIELD_NAME = "name"; - private static final String FIELD_DESIGN = "design"; private static final String FIELD_DESIGN_CONTENT = "designContent"; - private static final String FIELD_TYPE = "type"; /** * Constructor for write operations. @@ -92,9 +90,7 @@ writer.writeElement( FIELD_ID, String.valueOf( report.getId() ) ); writer.writeElement( FIELD_NAME, report.getName() ); - writer.writeElement( FIELD_DESIGN, report.getDesign() ); writer.writeElement( FIELD_DESIGN_CONTENT, report.getDesignContent() ); - writer.writeElement( FIELD_TYPE, report.getType() ); writer.closeElement(); } @@ -114,9 +110,7 @@ report.setId( Integer.parseInt( values.get( FIELD_ID ) ) ); report.setName( values.get( FIELD_NAME ) ); - report.setDesign( values.get( FIELD_DESIGN ) ); report.setDesignContent( values.get( FIELD_DESIGN_CONTENT ) ); - report.setType( values.get( FIELD_TYPE ) ); importObject( report, params ); } === modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/ReportImporter.java' --- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/ReportImporter.java 2010-07-28 13:44:59 +0000 +++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/ReportImporter.java 2011-02-01 11:03:47 +0000 @@ -66,9 +66,7 @@ protected void importMatching( Report object, Report match ) { match.setName( match.getName() ); - match.setDesign( object.getDesign() ); match.setDesignContent( object.getDesignContent() ); - match.setType( object.getType() ); reportService.saveReport( match ); } @@ -86,18 +84,10 @@ { return false; } - if ( !isSimiliar( object.getDesign(), existing.getDesign() ) || ( isNotNull( object.getDesign(), existing.getDesign() ) && !object.getDesign().equals( existing.getDesign() ) ) ) - { - return false; - } if ( !isSimiliar( object.getDesignContent(), existing.getDesignContent() ) || ( isNotNull( object.getDesignContent(), existing.getDesignContent() ) && !object.getDesignContent().equals( existing.getDesignContent() ) ) ) { return false; } - if ( !isSimiliar( object.getType(), existing.getType() ) || ( isNotNull( object.getType(), existing.getType() ) && !object.getType().equals( existing.getType() ) ) ) - { - return false; - } return true; } === modified file 'dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/SystemSettingManager.java' --- dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/SystemSettingManager.java 2011-01-07 11:37:47 +0000 +++ dhis-2/dhis-services/dhis-service-options/src/main/java/org/hisp/dhis/options/SystemSettingManager.java 2011-02-01 11:03:47 +0000 @@ -46,7 +46,6 @@ final String KEY_FORUM_INTEGRATION = "forumIntegration"; final String KEY_OMIT_INDICATORS_ZERO_NUMERATOR_DATAMART = "omitIndicatorsZeroNumeratorDataMart"; final String KEY_REPORT_TEMPLATE_DIRECTORY = "reportTemplateDirectory"; - final String KEY_REPORT_FRAMEWORK = "reportFramework"; final String KEY_MAX_NUMBER_OF_ATTEMPTS = "maxAttempts"; final String KEY_TIMEFRAME_MINUTES = "lockoutTimeframe"; final String KEY_GIS_LONGITUDE = "longitude"; === removed file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/report/ReportManager.java' --- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/report/ReportManager.java 2010-04-12 21:23:33 +0000 +++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/report/ReportManager.java 1970-01-01 00:00:00 +0000 @@ -1,49 +0,0 @@ -package org.hisp.dhis.report; - -/* - * 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.Map; - -import org.hisp.dhis.external.configuration.NoConfigurationFoundException; -import org.hisp.dhis.report.manager.ReportConfiguration; - -/** - * @author Lars Helge Overland - * @version $Id$ - */ -public interface ReportManager -{ - String ID = ReportManager.class.getName(); - - void setConfiguration( ReportConfiguration configuration ); - - ReportConfiguration getConfiguration() - throws NoConfigurationFoundException; - - Map getReportConnectionMap(); -} === removed directory 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/report/manager' === removed file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/report/manager/DefaultReportManager.java' --- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/report/manager/DefaultReportManager.java 2010-11-10 13:45:42 +0000 +++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/report/manager/DefaultReportManager.java 1970-01-01 00:00:00 +0000 @@ -1,170 +0,0 @@ -package org.hisp.dhis.report.manager; - -/* - * 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.io.InputStream; -import java.io.OutputStream; -import java.util.HashMap; -import java.util.Map; - -import org.hibernate.cfg.Configuration; -import org.hisp.dhis.external.configuration.ConfigurationManager; -import org.hisp.dhis.external.configuration.NoConfigurationFoundException; -import org.hisp.dhis.external.location.LocationManager; -import org.hisp.dhis.external.location.LocationManagerException; -import org.hisp.dhis.hibernate.HibernateConfigurationProvider; -import org.hisp.dhis.report.ReportManager; -import org.hisp.dhis.system.util.CodecUtils; - -/** - * @author Lars Helge Overland - * @version $Id$ - */ -public class DefaultReportManager - implements ReportManager -{ - private static final String BIRT_HOME_SYSTEM_PROPERTY = "birt.home"; - private static final String BIRT_DIR_SYSTEM_PROPERTY = "birt.context.path"; - - private static final String START_TAG_DRIVER = ""; - private static final String START_TAG_URL = ""; - private static final String START_TAG_USER_NAME = ""; - private static final String START_TAG_PASSWORD = ""; - private static final String END_TAG_DRIVER = ""; - private static final String END_TAG_URL = ""; - private static final String END_TAG_USER_NAME = ""; - private static final String END_TAG_PASSWORD = ""; - - // ------------------------------------------------------------------------- - // Properties - // ------------------------------------------------------------------------- - - private String reportConfigDir; - - public void setReportConfigDir( String reportConfigDir ) - { - this.reportConfigDir = reportConfigDir; - } - - private String reportConfigFile; - - public void setReportConfigFile( String reportConfigFile ) - { - this.reportConfigFile = reportConfigFile; - } - - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private HibernateConfigurationProvider hibernateConfigurationProvider; - - public void setHibernateConfigurationProvider( HibernateConfigurationProvider hibernateConfigurationProvider ) - { - this.hibernateConfigurationProvider = hibernateConfigurationProvider; - } - - private LocationManager locationManager; - - public void setLocationManager( LocationManager locationManager ) - { - this.locationManager = locationManager; - } - - private ConfigurationManager configurationManager; - - public void setConfigurationManager( ConfigurationManager configurationManager ) - { - this.configurationManager = configurationManager; - } - - // ------------------------------------------------------------------------- - // ReportManager implementation - // ------------------------------------------------------------------------- - - public void setConfiguration( ReportConfiguration configuration ) - { - try - { - OutputStream out = locationManager.getOutputStream( reportConfigFile, reportConfigDir ); - - configurationManager.setConfiguration( configuration, out ); - } - catch ( LocationManagerException ex ) - { - throw new RuntimeException( "Failed to set configuration", ex ); - } - } - - public ReportConfiguration getConfiguration() - throws NoConfigurationFoundException - { - // --------------------------------------------------------------------- - // Look for system property - // --------------------------------------------------------------------- - - String home = System.getProperty( BIRT_HOME_SYSTEM_PROPERTY ); - String dir = System.getProperty( BIRT_DIR_SYSTEM_PROPERTY ); - - if ( home != null && dir != null ) - { - return new ReportConfiguration( home, dir ); - } - - // --------------------------------------------------------------------- - // Look for configuration file - // --------------------------------------------------------------------- - - try - { - InputStream in = locationManager.getInputStream( reportConfigFile, reportConfigDir ); - - return configurationManager.getConfiguration( in, ReportConfiguration.class ); - } - catch ( LocationManagerException ex ) - { - throw new NoConfigurationFoundException( "No configuration file found" ); - } - } - - public Map getReportConnectionMap() - { - Configuration config = hibernateConfigurationProvider.getConfiguration(); - - String encryptedPassword = CodecUtils.encryptBase64( config.getProperty( "hibernate.connection.password" ) ); - - Map map = new HashMap(); - - map.put( new String[] { START_TAG_DRIVER, END_TAG_DRIVER }, START_TAG_DRIVER + config.getProperty( "hibernate.connection.driver_class" ) + END_TAG_DRIVER ); - map.put( new String[] { START_TAG_URL, END_TAG_URL }, START_TAG_URL + config.getProperty( "hibernate.connection.url" ) + END_TAG_URL ); - map.put( new String[] { START_TAG_USER_NAME, END_TAG_USER_NAME }, START_TAG_USER_NAME + config.getProperty( "hibernate.connection.username" ) + END_TAG_USER_NAME ); - map.put( new String[] { START_TAG_PASSWORD, END_TAG_PASSWORD }, START_TAG_PASSWORD + encryptedPassword + END_TAG_PASSWORD ); - - return map; - } -} === removed file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/report/manager/ReportConfiguration.java' --- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/report/manager/ReportConfiguration.java 2010-04-12 21:23:33 +0000 +++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/report/manager/ReportConfiguration.java 1970-01-01 00:00:00 +0000 @@ -1,151 +0,0 @@ -package org.hisp.dhis.report.manager; - -/* - * 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.io.Serializable; - -/** - * @author Lars Helge Overland - * @version $Id$ - */ -public class ReportConfiguration - implements Serializable -{ - private static final String SEPARATOR = "/"; - - private String home; - - private String directory; - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - public ReportConfiguration() - { - } - - public ReportConfiguration( String home, String directory ) - { - this.home = home; - this.directory = directory; - } - - // ------------------------------------------------------------------------- - // Equals and hashCode - // ------------------------------------------------------------------------- - - @Override - public int hashCode() - { - final int prime = 31; - - int result = 1; - - result = prime * result + ( ( directory == null ) ? 0 : directory.hashCode() ); - result = prime * result + ( ( home == null ) ? 0 : home.hashCode() ); - - return result; - } - - @Override - public boolean equals( Object object ) - { - if ( this == object ) - { - return true; - } - - if ( object == null ) - { - return false; - } - - if ( getClass() != object.getClass() ) - { - return false; - } - - final ReportConfiguration other = (ReportConfiguration) object; - - if ( directory == null ) - { - if ( other.directory != null ) - { - return false; - } - } - else if ( !directory.equals( other.directory ) ) - { - return false; - } - - if ( home == null ) - { - if ( other.home != null ) - { - return false; - } - } - else if ( !home.equals( other.home ) ) - { - return false; - } - - return true; - } - - // ------------------------------------------------------------------------- - // Getters and setters - // ------------------------------------------------------------------------- - - public String getHome() - { - return home; - } - - public void setHome( String home ) - { - this.home = home; - } - - public String getDirectory() - { - if ( directory != null && directory.startsWith( SEPARATOR ) ) - { - return directory.substring( 1, directory.length() ); - } - - return directory; - } - - public void setDirectory( String directory ) - { - this.directory = directory; - } -} === modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml 2011-01-13 15:44:09 +0000 +++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml 2011-02-01 11:03:47 +0000 @@ -76,18 +76,7 @@ - - - - - - - - - + - - - - === modified file 'dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/dashboard/DashboardStoreTest.java' --- dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/dashboard/DashboardStoreTest.java 2010-04-12 21:23:33 +0000 +++ dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/dashboard/DashboardStoreTest.java 2011-02-01 11:03:47 +0000 @@ -30,7 +30,6 @@ import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertNotNull; import static junit.framework.Assert.assertNull; -import static org.hisp.dhis.report.Report.TYPE_BIRT; import org.hibernate.NonUniqueObjectException; import org.hisp.dhis.DhisSpringTest; @@ -81,7 +80,7 @@ userA = createUser( 'A' ); userStore.addUser( userA ); - reportA = new Report( "ReportA", "DesignA", TYPE_BIRT, null ); + reportA = new Report( "ReportA", "DesignA", null ); reportService.saveReport( reportA ); urlA = createOlapURL( 'A' ); === removed file 'dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/report/ReportManagerTest.java' --- dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/report/ReportManagerTest.java 2010-10-29 12:19:15 +0000 +++ dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/report/ReportManagerTest.java 1970-01-01 00:00:00 +0000 @@ -1,85 +0,0 @@ -package org.hisp.dhis.report; - -/* - * 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 static junit.framework.Assert.assertEquals; -import static junit.framework.Assert.assertNotNull; - -import org.hisp.dhis.DhisSpringTest; -import org.hisp.dhis.external.configuration.NoConfigurationFoundException; -import org.hisp.dhis.external.location.LocationManager; -import org.hisp.dhis.report.manager.ReportConfiguration; -import org.junit.Test; - -/** - * @author Lars Helge Overland - * @version $Id$ - */ -public class ReportManagerTest - extends DhisSpringTest -{ - private LocationManager locationManager; - - private ReportManager reportManager; - - // ------------------------------------------------------------------------- - // Fixture - // ------------------------------------------------------------------------- - - @Override - public void setUpTest() - { - locationManager = (LocationManager) getBean( "locationManager" ); - - reportManager = (ReportManager) getBean( ReportManager.ID ); - - setDependency( reportManager, "reportConfigDir", "test", String.class ); - setDependency( reportManager, "reportConfigFile", "testReportConfiguration.xml", String.class ); - } - - // ------------------------------------------------------------------------- - // Tests - // ------------------------------------------------------------------------- - - @Test - public void testConfiguration() - throws NoConfigurationFoundException - { - setExternalTestDir( locationManager ); - - ReportConfiguration config = new ReportConfiguration( "home", "directory" ); - - reportManager.setConfiguration( config ); - - ReportConfiguration receivedConfig = reportManager.getConfiguration(); - - assertNotNull( receivedConfig ); - - assertEquals( config, receivedConfig ); - } -} === modified file 'dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/report/ReportStoreTest.java' --- dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/report/ReportStoreTest.java 2010-04-12 21:23:33 +0000 +++ dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/report/ReportStoreTest.java 2011-02-01 11:03:47 +0000 @@ -32,8 +32,6 @@ import static junit.framework.Assert.assertNull; import static junit.framework.Assert.assertTrue; -import static org.hisp.dhis.report.Report.TYPE_BIRT; - import java.util.Collection; import java.util.HashSet; import java.util.Set; @@ -86,8 +84,8 @@ @Test public void testSaveGet() { - Report reportA = new Report( "ReportA", "DesignA", TYPE_BIRT, reportTables ); - Report reportB = new Report( "ReportB", "DesignB", TYPE_BIRT, reportTables ); + Report reportA = new Report( "ReportA", "DesignA", reportTables ); + Report reportB = new Report( "ReportB", "DesignB", reportTables ); int idA = reportStore.save( reportA ); int idB = reportStore.save( reportB ); @@ -99,8 +97,8 @@ @Test public void testSaveGetUpdate() { - Report reportA = new Report( "ReportA", "DesignA", TYPE_BIRT, reportTables ); - Report reportB = new Report( "ReportB", "DesignB", TYPE_BIRT, reportTables ); + Report reportA = new Report( "ReportA", "DesignA", reportTables ); + Report reportB = new Report( "ReportB", "DesignB", reportTables ); int idA = reportStore.save( reportA ); int idB = reportStore.save( reportB ); @@ -108,8 +106,8 @@ assertEquals( reportA, reportStore.get( idA ) ); assertEquals( reportB, reportStore.get( idB ) ); - reportA.setDesign( "UpdatedDesignA" ); - reportB.setDesign( "UpdatedDesignB" ); + reportA.setDesignContent( "UpdatedDesignA" ); + reportB.setDesignContent( "UpdatedDesignB" ); int updatedIdA = reportStore.save( reportA ); int updatedIdB = reportStore.save( reportB ); @@ -117,15 +115,15 @@ assertEquals( idA, updatedIdA ); assertEquals( idB, updatedIdB ); - assertEquals( "UpdatedDesignA", reportStore.get( updatedIdA ).getDesign() ); - assertEquals( "UpdatedDesignB", reportStore.get( updatedIdB ).getDesign() ); + assertEquals( "UpdatedDesignA", reportStore.get( updatedIdA ).getDesignContent() ); + assertEquals( "UpdatedDesignB", reportStore.get( updatedIdB ).getDesignContent() ); } @Test public void testDelete() { - Report reportA = new Report( "ReportA", "DesignA", TYPE_BIRT, reportTables ); - Report reportB = new Report( "ReportB", "DesignB", TYPE_BIRT, reportTables ); + Report reportA = new Report( "ReportA", "DesignA", reportTables ); + Report reportB = new Report( "ReportB", "DesignB", reportTables ); int idA = reportStore.save( reportA ); int idB = reportStore.save( reportB ); @@ -147,8 +145,8 @@ @Test public void testGetAll() { - Report reportA = new Report( "ReportA", "DesignA", TYPE_BIRT, reportTables ); - Report reportB = new Report( "ReportB", "DesignB", TYPE_BIRT, reportTables ); + Report reportA = new Report( "ReportA", "DesignA", reportTables ); + Report reportB = new Report( "ReportB", "DesignB", reportTables ); reportStore.save( reportA ); reportStore.save( reportB ); === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/SetSystemSettingsAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/SetSystemSettingsAction.java 2011-01-19 13:31:29 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/SetSystemSettingsAction.java 2011-02-01 11:03:47 +0000 @@ -33,7 +33,6 @@ import static org.hisp.dhis.options.SystemSettingManager.KEY_FACTOR_OF_DEVIATION; import static org.hisp.dhis.options.SystemSettingManager.KEY_FLAG; import static org.hisp.dhis.options.SystemSettingManager.KEY_OMIT_INDICATORS_ZERO_NUMERATOR_DATAMART; -import static org.hisp.dhis.options.SystemSettingManager.KEY_REPORT_FRAMEWORK; import static org.hisp.dhis.options.SystemSettingManager.KEY_START_MODULE; import org.apache.commons.lang.StringUtils; @@ -92,13 +91,6 @@ this.startModule = startModule; } - private String reportFramework; - - public void setReportFramework( String reportFramework ) - { - this.reportFramework = reportFramework; - } - private Boolean omitIndicatorsZeroNumeratorDataMart; public void setOmitIndicatorsZeroNumeratorDataMart( Boolean omitIndicatorsZeroNumeratorDataMart ) @@ -155,7 +147,6 @@ systemSettingManager.saveSystemSetting( KEY_APPLICATION_TITLE, applicationTitle ); systemSettingManager.saveSystemSetting( KEY_FLAG, flag ); systemSettingManager.saveSystemSetting( KEY_START_MODULE, startModule ); - systemSettingManager.saveSystemSetting( KEY_REPORT_FRAMEWORK, reportFramework ); systemSettingManager.saveSystemSetting( KEY_OMIT_INDICATORS_ZERO_NUMERATOR_DATAMART, omitIndicatorsZeroNumeratorDataMart ); systemSettingManager.saveSystemSetting( KEY_DISABLE_DATAENTRYFORM_WHEN_COMPLETED, disableDataEntryWhenCompleted ); systemSettingManager.saveSystemSetting( KEY_FACTOR_OF_DEVIATION, factorDeviation ); === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemSettings.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemSettings.vm 2011-01-19 13:31:29 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemSettings.vm 2011-02-01 11:03:47 +0000 @@ -47,15 +47,6 @@

-

$i18n.getString( "report_framework" )

- -

- -

-

$i18n.getString( "omit_indicators_zero_numerator_data_mart" )

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/AddReportAction.java' --- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/AddReportAction.java 2010-07-30 12:59:39 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/AddReportAction.java 2011-02-01 11:03:47 +0000 @@ -32,15 +32,12 @@ import java.io.File; import java.util.Collection; -import java.util.Map; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.hisp.dhis.i18n.I18n; import org.hisp.dhis.report.Report; -import org.hisp.dhis.report.ReportManager; import org.hisp.dhis.report.ReportService; -import org.hisp.dhis.report.manager.ReportConfiguration; import org.hisp.dhis.reporttable.ReportTableService; import org.hisp.dhis.system.util.StreamUtils; @@ -59,13 +56,6 @@ // Dependencies // ------------------------------------------------------------------------- - private ReportManager reportManager; - - public void setReportManager( ReportManager reportManager ) - { - this.reportManager = reportManager; - } - private ReportService reportService; public void setReportService( ReportService reportService ) @@ -130,13 +120,6 @@ this.fileName = fileName; } - private String type; - - public void setType( String type ) - { - this.type = type; - } - private String contentType; public void setUploadContentType( String contentType ) @@ -203,8 +186,6 @@ Report report = ( id == null ) ? new Report() : reportService.getReport( id ); report.setName( name ); - report.setDesign( fileName ); - report.setType( type ); report.setReportTables( selectedReportTables != null ? getSet( reportTableService.getReportTables( getIntegerCollection( selectedReportTables ) ) ) : null ); @@ -216,33 +197,7 @@ if ( file != null ) { - if ( type != null && type.equals( Report.TYPE_JASPER ) ) - { - report.setDesignContent( StreamUtils.getContent( file ) ); - } - else // BIRT - { - ReportConfiguration reportConfig = reportManager.getConfiguration(); - - String birtHome = reportConfig.getHome(); - - File design = new File( birtHome, fileName ); - - log.info( "New file: " + design.getAbsolutePath() ); - - // ----------------------------------------------------------------- - // Updating database properties in design file - // ----------------------------------------------------------------- - - if ( file != null ) - { - Map connectionMap = reportManager.getReportConnectionMap(); - - StringBuffer in = StreamUtils.readContent( file, connectionMap ); - - StreamUtils.writeContent( design, in ); - } - } + report.setDesignContent( StreamUtils.getContent( file ) ); } reportService.saveReport( report ); === modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetAllReportsAction.java' --- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetAllReportsAction.java 2011-01-25 19:27:15 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetAllReportsAction.java 2011-02-01 11:03:47 +0000 @@ -28,22 +28,15 @@ */ import static org.apache.commons.lang.StringUtils.isNotBlank; -import static org.hisp.dhis.util.ContextUtils.getBaseUrl; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import javax.servlet.http.HttpServletRequest; - -import org.apache.struts2.ServletActionContext; -import org.hisp.dhis.options.SystemSettingManager; import org.hisp.dhis.paging.ActionPagingSupport; import org.hisp.dhis.report.Report; -import org.hisp.dhis.report.ReportManager; import org.hisp.dhis.report.ReportService; import org.hisp.dhis.report.comparator.ReportComparator; -import org.hisp.dhis.report.manager.ReportConfiguration; /** * @author Lars Helge Overland @@ -52,21 +45,12 @@ public class GetAllReportsAction extends ActionPagingSupport { - private static final String SEPARATOR = "/"; - private static final String BASE_QUERY = "frameset?__report="; private static final String JASPER_BASE_URL = "renderReport.action?id="; // ------------------------------------------------------------------------- // Dependencies // ------------------------------------------------------------------------- - private ReportManager reportManager; - - public void setReportManager( ReportManager reportManager ) - { - this.reportManager = reportManager; - } - private ReportService reportService; public void setReportService( ReportService reportService ) @@ -74,13 +58,6 @@ this.reportService = reportService; } - private SystemSettingManager systemSettingManager; - - public void setSystemSettingManager( SystemSettingManager systemSettingManager ) - { - this.systemSettingManager = systemSettingManager; - } - // ------------------------------------------------------------------------- // Input & Output // ------------------------------------------------------------------------- @@ -110,32 +87,12 @@ public String execute() throws Exception - { - String reportFramework = (String) systemSettingManager.getSystemSetting( SystemSettingManager.KEY_REPORT_FRAMEWORK, Report.TYPE_DEFAULT ); - - if ( reportFramework.equals( Report.TYPE_JASPER ) ) - { - for ( Report report : reportService.getAllReports() ) - { - report.setUrl( JASPER_BASE_URL + report.getId() ); - - reports.add( report ); - } - } - else // BIRT - { - ReportConfiguration config = reportManager.getConfiguration(); - - HttpServletRequest request = ServletActionContext.getRequest(); - - String birtURL = getBaseUrl( request ) + config.getDirectory() + SEPARATOR + BASE_QUERY; - - for ( Report report : reportService.getAllReports() ) - { - report.setUrl( birtURL + report.getDesign() ); - - reports.add( report ); - } + { + for ( Report report : reportService.getAllReports() ) + { + report.setUrl( JASPER_BASE_URL + report.getId() ); + + reports.add( report ); } Collections.sort( reports, new ReportComparator() ); === removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetReportConfigurationAction.java' --- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetReportConfigurationAction.java 2010-04-12 21:23:33 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetReportConfigurationAction.java 1970-01-01 00:00:00 +0000 @@ -1,115 +0,0 @@ -package org.hisp.dhis.reporting.reportviewer.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 static org.hisp.dhis.report.Report.TYPE_BIRT; -import static org.hisp.dhis.report.Report.TYPE_DEFAULT; - -import org.hisp.dhis.external.configuration.NoConfigurationFoundException; -import org.hisp.dhis.i18n.I18n; -import org.hisp.dhis.options.SystemSettingManager; -import org.hisp.dhis.report.ReportManager; -import org.hisp.dhis.report.manager.ReportConfiguration; - -import com.opensymphony.xwork2.Action; - -/** - * @author Lars Helge Overland - * @version $Id$ - */ -public class GetReportConfigurationAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private ReportManager reportManager; - - public void setReportManager( ReportManager reportManager ) - { - this.reportManager = reportManager; - } - - private I18n i18n; - - public void setI18n( I18n i18n ) - { - this.i18n = i18n; - } - - // ------------------------------------------------------------------------- - // Output - // ------------------------------------------------------------------------- - - private ReportConfiguration reportConfiguration; - - public ReportConfiguration getReportConfiguration() - { - return reportConfiguration; - } - - private SystemSettingManager systemSettingManager; - - public void setSystemSettingManager( SystemSettingManager systemSettingManager ) - { - this.systemSettingManager = systemSettingManager; - } - - private String message; - - public String getMessage() - { - return message; - } - - // ------------------------------------------------------------------------- - // Output - // ------------------------------------------------------------------------- - - public String execute() - { - String framework = (String) systemSettingManager.getSystemSetting( SystemSettingManager.KEY_REPORT_FRAMEWORK, TYPE_DEFAULT ); - - if ( framework.equals( TYPE_BIRT ) ) - { - try - { - reportConfiguration = reportManager.getConfiguration(); - } - catch ( NoConfigurationFoundException ex ) - { - message = i18n.getString( "set_configuration" ); - - return NONE; - } - } - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/SetReportConfigurationAction.java' --- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/SetReportConfigurationAction.java 2010-04-12 21:23:33 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/SetReportConfigurationAction.java 1970-01-01 00:00:00 +0000 @@ -1,83 +0,0 @@ -package org.hisp.dhis.reporting.reportviewer.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.report.ReportManager; -import org.hisp.dhis.report.manager.ReportConfiguration; - -import com.opensymphony.xwork2.Action; - -/** - * @author Lars Helge Overland - * @version $Id$ - */ -public class SetReportConfigurationAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private ReportManager reportManager; - - public void setReportManager( ReportManager reportManager ) - { - this.reportManager = reportManager; - } - - // ------------------------------------------------------------------------- - // Input - // ------------------------------------------------------------------------- - - private String home; - - public void setHome( String home ) - { - this.home = home; - } - - private String directory; - - public void setDirectory( String directory ) - { - this.directory = directory; - } - - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - public String execute() - { - ReportConfiguration config = new ReportConfiguration( home, directory ); - - reportManager.setConfiguration( config ); - - return SUCCESS; - } -} === modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml 2011-01-31 19:47:04 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml 2011-02-01 11:03:47 +0000 @@ -268,8 +268,6 @@ - - - - - - - - - - - - === 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-31 19:47:04 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml 2011-02-01 11:03:47 +0000 @@ -134,13 +134,7 @@ displayViewReportForm.action F_REPORT_VIEW - - - displayViewReportForm.action - displayConfigureReportForm.action - F_REPORT_VIEW - - + /main.vm 420 @@ -150,21 +144,7 @@ F_REPORT_VIEW ../dhis-web-commons/paging/paging.css - - - /main.vm - /main.vm - /dhis-web-reporting/configureReportForm.vm - /dhis-web-reporting/menu.vm - javascript/reportConfiguration.js - F_REPORT_VIEW - - - - displayViewReportForm.action - F_REPORT_VIEW - - + /dhis-web-reporting/responseSuccess.vm plainTextError === modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addReportForm.vm' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addReportForm.vm 2010-11-23 08:13:14 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addReportForm.vm 2011-02-01 11:03:47 +0000 @@ -5,7 +5,6 @@ - @@ -19,12 +18,10 @@ - #if( $reportFramework == "jasper" && $report && $report.designContent ) - #end === modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/index.vm' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/index.vm 2011-01-11 16:52:46 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/index.vm 2011-02-01 11:03:47 +0000 @@ -2,7 +2,7 @@

$i18n.getString( "dhis-web-reporting" )