dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #30399
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15431: Add import for EventReport
------------------------------------------------------------
revno: 15431
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-05-27 14:12:46 +0200
message:
Add import for EventReport
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventreport/EventReport.java
dhis-2/dhis-services/dhis-service-dxf2/src/main/resources/META-INF/dhis/beans.xml
--
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/eventreport/EventReport.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventreport/EventReport.java 2014-05-12 23:03:35 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventreport/EventReport.java 2014-05-27 12:12:46 +0000
@@ -28,10 +28,11 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonView;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import org.hisp.dhis.common.BaseAnalyticalObject;
import org.hisp.dhis.common.BaseIdentifiableObject;
import org.hisp.dhis.common.DxfNamespaces;
@@ -45,11 +46,9 @@
import org.hisp.dhis.program.ProgramStage;
import org.hisp.dhis.user.User;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonView;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
/**
* @author Lars Helge Overland
@@ -183,39 +182,6 @@
}
}
- @Override
- public void mergeWith( IdentifiableObject other )
- {
- super.mergeWith( other );
-
- if ( other.getClass().isInstance( this ) )
- {
- EventReport report = (EventReport) other;
-
- dataType = report.getDataType();
- program = report.getProgram();
- programStage = report.getProgramStage();
- startDate = report.getStartDate();
- endDate = report.getEndDate();
- totals = report.isTotals();
- subtotals = report.isSubtotals();
- hideEmptyRows = report.isHideEmptyRows();
- countType = report.getCountType();
- showHierarchy = report.isShowHierarchy();
- displayDensity = report.getDisplayDensity();
- fontSize = report.getFontSize();
-
- columnDimensions.clear();
- columnDimensions.addAll( report.getColumnDimensions() );
-
- rowDimensions.clear();
- rowDimensions.addAll( report.getRowDimensions() );
-
- filterDimensions.clear();
- filterDimensions.addAll( report.getFilterDimensions() );
- }
- }
-
// -------------------------------------------------------------------------
// Getters and setters
// -------------------------------------------------------------------------
@@ -419,4 +385,37 @@
{
this.fontSize = fontSize;
}
+
+ @Override
+ public void mergeWith( IdentifiableObject other )
+ {
+ super.mergeWith( other );
+
+ if ( other.getClass().isInstance( this ) )
+ {
+ EventReport report = (EventReport) other;
+
+ dataType = report.getDataType();
+ program = report.getProgram();
+ programStage = report.getProgramStage();
+ startDate = report.getStartDate();
+ endDate = report.getEndDate();
+ totals = report.isTotals();
+ subtotals = report.isSubtotals();
+ hideEmptyRows = report.isHideEmptyRows();
+ countType = report.getCountType();
+ showHierarchy = report.isShowHierarchy();
+ displayDensity = report.getDisplayDensity();
+ fontSize = report.getFontSize();
+
+ columnDimensions.clear();
+ columnDimensions.addAll( report.getColumnDimensions() );
+
+ rowDimensions.clear();
+ rowDimensions.addAll( report.getRowDimensions() );
+
+ filterDimensions.clear();
+ filterDimensions.addAll( report.getFilterDimensions() );
+ }
+ }
}
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/resources/META-INF/dhis/beans.xml 2014-05-26 14:19:42 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/resources/META-INF/dhis/beans.xml 2014-05-27 12:12:46 +0000
@@ -207,6 +207,10 @@
</bean>
<!-- register tracker importers -->
+ <bean id="eventReportImporter" class="org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter" scope="prototype">
+ <constructor-arg name="importerClass" type="java.lang.Class" value="org.hisp.dhis.eventreport.EventReport" />
+ </bean>
+
<bean id="programImporter" class="org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter" scope="prototype">
<constructor-arg name="importerClass" type="java.lang.Class" value="org.hisp.dhis.program.Program" />
</bean>