dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #17157
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6742: minor fix, log which user started doing import
------------------------------------------------------------
revno: 6742
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-04-25 17:01:07 +0300
message:
minor fix, log which user started doing import
modified:
dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultImportService.java
--
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-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultImportService.java'
--- dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultImportService.java 2012-04-24 13:28:16 +0000
+++ dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultImportService.java 2012-04-25 14:01:07 +0000
@@ -27,20 +27,21 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hisp.dhis.cache.HibernateCacheManager;
import org.hisp.dhis.dxf2.importsummary.ImportConflict;
import org.hisp.dhis.dxf2.importsummary.ImportSummary;
+import org.hisp.dhis.user.CurrentUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
/**
* @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
*/
@@ -64,6 +65,9 @@
@Autowired
private HibernateCacheManager cacheManager;
+ @Autowired
+ private CurrentUserService currentUserService;
+
//-------------------------------------------------------------------------------------------------------
// ImportService Implementation
//-------------------------------------------------------------------------------------------------------
@@ -81,7 +85,8 @@
objectBridge.init();
Date startDate = new Date();
- log.info( "Started import at " + startDate );
+
+ log.info( "User " + currentUserService.getCurrentUsername() + " started import at " + startDate );
doImport( metaData.getOrganisationUnits(), importOptions, importSummary );
doImport( metaData.getOrganisationUnitLevels(), importOptions, importSummary );
@@ -176,7 +181,7 @@
if ( importer != null )
{
List<ImportConflict> importConflicts = importer.importObjects( objects, importOptions );
-
+
importSummary.getConflicts().addAll( importConflicts );
// importSummary.getCounts().add( count ); //FIXME
}