← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 425: Removed the Design class and implementations.

 

------------------------------------------------------------
revno: 425
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Tue 2009-07-07 17:33:52 +0200
message:
  Removed the Design class and implementations.
removed:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/design/
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/design/Design.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/design/DesignService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/design/comparator/
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/design/comparator/DesignComparator.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/design/
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/design/impl/
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/design/impl/DefaultDesignService.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/design/
  dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/design/hibernate/
  dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/design/hibernate/Design.hbm.xml
  dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/design/
  dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/design/DesignStoreTest.java
modified:
  dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml

=== removed directory 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/design'
=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/design/Design.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/design/Design.java	2009-05-19 08:43:37 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/design/Design.java	1970-01-01 00:00:00 +0000
@@ -1,125 +0,0 @@
-package org.hisp.dhis.design;
-
-/*
- * Copyright (c) 2004-2007, 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.ArrayList;
-import java.util.List;
-
-import org.hisp.dhis.chart.Chart;
-import org.hisp.dhis.reporttable.ReportTable;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public class Design
-{
-    private int id;
-    
-    private String name;
-    
-    private List<Chart> charts = new ArrayList<Chart>();
-    
-    private List<ReportTable> reportTables = new ArrayList<ReportTable>();
-    
-    public Design()
-    {   
-    }
-    
-    public Design( String name )
-    {
-        this.name = name;
-    }
-
-    public int getId()
-    {
-        return id;
-    }
-
-    public void setId( int id )
-    {
-        this.id = id;
-    }
-
-    public String getName()
-    {
-        return name;
-    }
-
-    public void setName( String name )
-    {
-        this.name = name;
-    }
-
-    public List<Chart> getCharts()
-    {
-        return charts;
-    }
-
-    public void setCharts( List<Chart> charts )
-    {
-        this.charts = charts;
-    }
-
-    public List<ReportTable> getReportTables()
-    {
-        return reportTables;
-    }
-
-    public void setReportTables( List<ReportTable> reportTables )
-    {
-        this.reportTables = reportTables;
-    }
-
-    @Override
-    public int hashCode()
-    {
-        return name.hashCode();
-    }
-
-    @Override
-    public boolean equals( Object object )
-    {
-        if ( this == object )
-        {
-            return true;
-        }
-        if ( object == null )
-        {
-            return false;
-        }
-        if ( getClass() != object.getClass() )
-        {
-            return false;
-        }
-        
-        final Design other = (Design) object;
-        
-        return name.equals( other.name );
-    }
-}

=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/design/DesignService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/design/DesignService.java	2009-05-19 08:43:37 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/design/DesignService.java	1970-01-01 00:00:00 +0000
@@ -1,49 +0,0 @@
-package org.hisp.dhis.design;
-
-/*
- * Copyright (c) 2004-2007, 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.Collection;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public interface DesignService
-{
-    final String ID = DesignService.class.getName();
-    
-    int saveDesign( Design design );
-    
-    void updateDesign( Design design );
-    
-    Design getDesign( int id );
-    
-    void deleteDesign( Design design );
-    
-    Collection<Design> getAllDesigns();
-}

=== removed directory 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/design/comparator'
=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/design/comparator/DesignComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/design/comparator/DesignComparator.java	2009-05-18 20:04:49 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/design/comparator/DesignComparator.java	1970-01-01 00:00:00 +0000
@@ -1,14 +0,0 @@
-package org.hisp.dhis.design.comparator;
-
-import java.util.Comparator;
-
-import org.hisp.dhis.design.Design;
-
-public class DesignComparator
-    implements Comparator<Design>
-{
-    public int compare( Design design1, Design design2 )
-    {
-        return design1.getName().compareTo( design2.getName() );
-    }
-}

=== removed directory 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/design'
=== removed directory 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/design/impl'
=== removed file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/design/impl/DefaultDesignService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/design/impl/DefaultDesignService.java	2009-06-19 09:00:57 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/design/impl/DefaultDesignService.java	1970-01-01 00:00:00 +0000
@@ -1,84 +0,0 @@
-package org.hisp.dhis.design.impl;
-
-/*
- * Copyright (c) 2004-2007, 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.Collection;
-
-import org.hisp.dhis.common.GenericStore;
-import org.hisp.dhis.design.Design;
-import org.hisp.dhis.design.DesignService;
-import org.springframework.transaction.annotation.Transactional;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-@Transactional
-public class DefaultDesignService
-implements DesignService
-{
-    // -------------------------------------------------------------------------
-    // Dependencies
-    // -------------------------------------------------------------------------
-
-    private GenericStore<Design> designStore;
-
-    public void setDesignStore( GenericStore<Design> designStore )
-    {
-        this.designStore = designStore;
-    }
-
-    // -------------------------------------------------------------------------
-    // DesignService implementation
-    // -------------------------------------------------------------------------
-
-    public int saveDesign( Design design )
-    {
-        return designStore.save( design );
-    }
-    
-    public void updateDesign( Design reportTemplate )
-    {
-        designStore.update( reportTemplate );
-    }
-    
-    public Design getDesign( int id )
-    {
-        return designStore.get( id );
-    }
-    
-    public void deleteDesign( Design design )
-    {
-        designStore.delete( design );
-    }
-    
-    public Collection<Design> getAllDesigns()
-    {
-        return designStore.getAll();
-    }
-}

=== 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	2009-07-07 10:27:18 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml	2009-07-07 15:33:52 +0000
@@ -63,20 +63,6 @@
       ref="org.hisp.dhis.completeness.DataSetCompletenessService"/>
   </bean>
   
-  <!-- Design -->
-
-  <bean id="org.hisp.dhis.design.DesignStore"
-    class="org.hisp.dhis.hibernate.HibernateGenericStore">
-    <property name="clazz" value="org.hisp.dhis.design.Design"/>
-    <property name="sessionFactory" ref="sessionFactory"/>
-  </bean>
-
-  <bean id="org.hisp.dhis.design.DesignService"
-    class="org.hisp.dhis.design.impl.DefaultDesignService">
-    <property name="designStore"
-      ref="org.hisp.dhis.design.DesignStore"/>
-  </bean>
-
   <!-- Report -->
   
   <bean id="org.hisp.dhis.report.ReportStore"

=== removed directory 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/design'
=== removed directory 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/design/hibernate'
=== removed file 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/design/hibernate/Design.hbm.xml'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/design/hibernate/Design.hbm.xml	2009-05-18 20:04:49 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/design/hibernate/Design.hbm.xml	1970-01-01 00:00:00 +0000
@@ -1,30 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE hibernate-mapping PUBLIC
-  "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
-  "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd";>
-
-<hibernate-mapping>
-  <class name="org.hisp.dhis.design.Design" table="design">
-  
-    <id name="id" column="designid">
-      <generator class="native"/>
-    </id>
-    
-    <property name="name" not-null="true" unique="true"/>
-    
-    <list name="charts" table="designcharts">
-      <key column="designid"/>
-      <list-index column="sort_order" base="0"/>
-      <many-to-many class="org.hisp.dhis.chart.Chart"
-        column="chartid" foreign-key="fk_design_chart"/>
-    </list>
-    
-    <list name="reportTables" table="designreporttables">
-      <key column="designid"/>
-      <list-index column="sort_order" base="0"/>
-      <many-to-many class="org.hisp.dhis.reporttable.ReportTable"
-        column="reporttableid" foreign-key="fk_design_reporttable"/>
-    </list>
-    
-  </class>
-</hibernate-mapping>

=== removed directory 'dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/design'
=== removed file 'dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/design/DesignStoreTest.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/design/DesignStoreTest.java	2009-06-19 09:00:57 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/design/DesignStoreTest.java	1970-01-01 00:00:00 +0000
@@ -1,141 +0,0 @@
-package org.hisp.dhis.design;
-
-/*
- * Copyright (c) 2004-2007, 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 static junit.framework.Assert.assertNull;
-
-import org.hisp.dhis.DhisSpringTest;
-import org.hisp.dhis.chart.Chart;
-import org.hisp.dhis.chart.ChartService;
-import org.hisp.dhis.common.GenericStore;
-import org.hisp.dhis.reporttable.ReportTable;
-import org.hisp.dhis.reporttable.ReportTableService;
-import org.junit.Test;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-@SuppressWarnings( "unchecked" )
-public class DesignStoreTest
-    extends DhisSpringTest
-{
-    private GenericStore<Design> designStore;
-    
-    private ChartService chartService;
-    
-    private ReportTableService reportTableService;
-
-    private Design designA;
-    private Design designB;
-    
-    private Chart chartA = new Chart( "ChartA" );
-    private Chart chartB = new Chart( "ChartB" );
-
-    private ReportTable reportTableA = new ReportTable( "ReportTableA", "TableNameA" );
-    private ReportTable reportTableB = new ReportTable( "ReportTableB", "TableNameB" );    
-    
-    @Override
-    public void setUpTest()
-    {
-        designStore = (GenericStore<Design>) getBean( "org.hisp.dhis.design.DesignStore" );
-        
-        chartService = (ChartService) getBean( ChartService.ID );
-        
-        reportTableService = (ReportTableService) getBean( ReportTableService.ID );
-        
-        chartService.saveChart( chartA );
-        chartService.saveChart( chartB );
-        
-        reportTableService.saveReportTable( reportTableA );
-        reportTableService.saveReportTable( reportTableB );
-        
-        designA = new Design( "DesignA" );
-        designB = new Design( "DesignB" );
-        
-        designA.getCharts().add( chartA );
-        designA.getCharts().add( chartB );
-        designB.getCharts().add( chartA );
-        designB.getCharts().add( chartB );
-        
-        designA.getReportTables().add( reportTableA );
-        designA.getReportTables().add( reportTableB );
-        designB.getReportTables().add( reportTableA );
-        designB.getReportTables().add( reportTableB );
-                
-        designStore.save( designA );
-        designStore.save( designB );
-    }
-
-    @Test
-    public void testSave()
-    {
-        int idA = designStore.save( designA );
-        int idB = designStore.save( designB );
-        
-        assertEquals( designA, designStore.get( idA ) );
-        assertEquals( designB, designStore.get( idB ) );
-
-        assertNotNull( designStore.get( idA ).getCharts() );
-        assertNotNull( designStore.get( idA ).getReportTables() );
-        
-        assertEquals( designStore.get( idA ).getCharts().size(), 2 );
-        assertEquals( designStore.get( idA ).getReportTables().size(), 2 );
-    }
-
-    @Test
-    public void testDelete()
-    {
-        int idA = designStore.save( designA );
-        int idB = designStore.save( designB );
-        
-        assertNotNull( designStore.get( idA ) );
-        assertNotNull( designStore.get( idB ) );
-        
-        designStore.delete( designA );
-
-        assertNull( designStore.get( idA ) );
-        assertNotNull( designStore.get( idB ) );
-
-        designStore.delete( designB );
-
-        assertNull( designStore.get( idA ) );
-        assertNull( designStore.get( idB ) );        
-    }
-
-    @Test
-    public void testGetAll()
-    {
-        designStore.save( designA );
-        designStore.save( designB );
-        
-        equals( designStore.getAll(), designA, designB );
-    }
-}



--
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.