dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #03271
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1105: Implemented match-existing-data-elements.
------------------------------------------------------------
revno: 1105
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Tue 2009-11-24 14:01:57 +0100
message:
Implemented match-existing-data-elements.
modified:
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/importer/DefaultDXFImportService.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/hibernate/HibernateImportObjectStore.java
dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/compareToExistingForm.vm
dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/javascript/import.js
--
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-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/importer/DefaultDXFImportService.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/importer/DefaultDXFImportService.java 2009-11-24 08:19:08 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/importer/DefaultDXFImportService.java 2009-11-24 13:01:57 +0000
@@ -342,6 +342,8 @@
public void importData( ImportParams params, InputStream inputStream )
{
+ log.info( "Import process started" );
+
if ( params.isPreview() )
{
importObjectService.deleteImportObjects();
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/hibernate/HibernateImportObjectStore.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/hibernate/HibernateImportObjectStore.java 2009-06-10 22:25:07 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/hibernate/HibernateImportObjectStore.java 2009-11-24 13:01:57 +0000
@@ -191,6 +191,8 @@
String hql = "from ImportObject";
+ //TODO improve performance
+
Collection<ImportObject> importObjects = session.createQuery( hql ).list();
for ( ImportObject importObject : importObjects )
=== modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/compareToExistingForm.vm'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/compareToExistingForm.vm 2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/compareToExistingForm.vm 2009-11-24 13:01:57 +0000
@@ -9,6 +9,7 @@
<input type="hidden" id="objectType" name="objectType" value="$!objectType">
<input type="hidden" id="objectId" name="objectId" value="$!importObject.id">
+<input type="hidden" id="existingObjectId" name="existingObjectId" value="$!importObject.compareObject.id">
<table style="width:680px">
@@ -513,7 +514,8 @@
<tr>
<td colspan="2">
- <input type="button" value="$i18n.getString( 'back' )" style="width:25%" onclick="cancelObject()"><input
+ <input type="button" value="$i18n.getString( 'back' )" style="width:25%" onclick="cancelObject()"><input
+ type="button" value="$i18n.getString( 'match_to_existing' )" style="width:25%" onclick="matchUpdateObject()"><input
type="button" value="$i18n.getString( 'discard_update' )" style="width:25%" onclick="discardObject()">
</td>
</tr>
=== modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/javascript/import.js'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/javascript/import.js 2009-11-02 11:56:51 +0000
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/javascript/import.js 2009-11-24 13:01:57 +0000
@@ -374,6 +374,18 @@
}
}
+function matchUpdateObject()
+{
+ var importObjectId = document.getElementById( "objectId" ).value;
+
+ var existingObjectId = document.getElementById( "existingObjectId" ).value;
+
+ if ( importObjectId != null && existingObjectId != null )
+ {
+ window.location.href = "matchObject.action?importObjectId=" + importObjectId + "&existingObjectId=" + existingObjectId;
+ }
+}
+
function discardObject()
{
var objectId = document.getElementById( "objectId" ).value;