← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5847: Improved logging (DEBUG) of DXF import process.

 

------------------------------------------------------------
revno: 5847
committer: Jason P. Pickering <jason.p.pickering@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-02-01 16:06:13 +0200
message:
  Improved logging (DEBUG) of DXF import process.
modified:
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DXFConverter.java
  resources/util/dxfgen.sh*


--
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/converter/DXFConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DXFConverter.java	2012-01-15 08:40:12 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/DXFConverter.java	2012-02-01 14:06:13 +0000
@@ -27,10 +27,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static org.apache.commons.lang.StringUtils.defaultIfEmpty;
-
-import javax.xml.namespace.QName;
-
 import org.amplecode.quick.BatchHandler;
 import org.amplecode.quick.BatchHandlerFactory;
 import org.amplecode.staxwax.reader.XMLReader;
@@ -47,74 +43,21 @@
 import org.hisp.dhis.constant.ConstantService;
 import org.hisp.dhis.datadictionary.DataDictionary;
 import org.hisp.dhis.datadictionary.DataDictionaryService;
-import org.hisp.dhis.dataelement.DataElement;
-import org.hisp.dhis.dataelement.DataElementCategory;
-import org.hisp.dhis.dataelement.DataElementCategoryCombo;
-import org.hisp.dhis.dataelement.DataElementCategoryOption;
-import org.hisp.dhis.dataelement.DataElementCategoryService;
-import org.hisp.dhis.dataelement.DataElementGroup;
-import org.hisp.dhis.dataelement.DataElementGroupSet;
-import org.hisp.dhis.dataelement.DataElementService;
+import org.hisp.dhis.dataelement.*;
 import org.hisp.dhis.dataset.CompleteDataSetRegistration;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.DataSetService;
 import org.hisp.dhis.datavalue.DataValue;
 import org.hisp.dhis.expression.ExpressionService;
-import org.hisp.dhis.importexport.ExportParams;
-import org.hisp.dhis.importexport.GroupMemberAssociation;
-import org.hisp.dhis.importexport.ImportDataValue;
-import org.hisp.dhis.importexport.ImportObjectService;
-import org.hisp.dhis.importexport.ImportParams;
-import org.hisp.dhis.importexport.XMLConverter;
+import org.hisp.dhis.importexport.*;
 import org.hisp.dhis.importexport.analysis.DefaultImportAnalyser;
 import org.hisp.dhis.importexport.analysis.ImportAnalyser;
 import org.hisp.dhis.importexport.invoker.ConverterInvoker;
 import org.hisp.dhis.importexport.mapping.NameMappingUtil;
 import org.hisp.dhis.importexport.mapping.ObjectMappingGenerator;
-import org.hisp.dhis.indicator.Indicator;
-import org.hisp.dhis.indicator.IndicatorGroup;
-import org.hisp.dhis.indicator.IndicatorGroupSet;
-import org.hisp.dhis.indicator.IndicatorService;
-import org.hisp.dhis.indicator.IndicatorType;
-import org.hisp.dhis.jdbc.batchhandler.CategoryCategoryOptionAssociationBatchHandler;
-import org.hisp.dhis.jdbc.batchhandler.CategoryComboCategoryAssociationBatchHandler;
-import org.hisp.dhis.jdbc.batchhandler.CompleteDataSetRegistrationBatchHandler;
-import org.hisp.dhis.jdbc.batchhandler.ConceptBatchHandler;
-import org.hisp.dhis.jdbc.batchhandler.ConstantBatchHandler;
-import org.hisp.dhis.jdbc.batchhandler.DataDictionaryBatchHandler;
-import org.hisp.dhis.jdbc.batchhandler.DataDictionaryDataElementBatchHandler;
-import org.hisp.dhis.jdbc.batchhandler.DataDictionaryIndicatorBatchHandler;
-import org.hisp.dhis.jdbc.batchhandler.DataElementBatchHandler;
-import org.hisp.dhis.jdbc.batchhandler.DataElementCategoryBatchHandler;
-import org.hisp.dhis.jdbc.batchhandler.DataElementCategoryComboBatchHandler;
-import org.hisp.dhis.jdbc.batchhandler.DataElementCategoryOptionBatchHandler;
-import org.hisp.dhis.jdbc.batchhandler.DataElementGroupBatchHandler;
-import org.hisp.dhis.jdbc.batchhandler.DataElementGroupMemberBatchHandler;
-import org.hisp.dhis.jdbc.batchhandler.DataElementGroupSetBatchHandler;
-import org.hisp.dhis.jdbc.batchhandler.DataElementGroupSetMemberBatchHandler;
-import org.hisp.dhis.jdbc.batchhandler.DataSetBatchHandler;
-import org.hisp.dhis.jdbc.batchhandler.DataSetMemberBatchHandler;
-import org.hisp.dhis.jdbc.batchhandler.DataSetSourceAssociationBatchHandler;
-import org.hisp.dhis.jdbc.batchhandler.DataValueBatchHandler;
-import org.hisp.dhis.jdbc.batchhandler.GroupSetBatchHandler;
-import org.hisp.dhis.jdbc.batchhandler.GroupSetMemberBatchHandler;
-import org.hisp.dhis.jdbc.batchhandler.ImportDataValueBatchHandler;
-import org.hisp.dhis.jdbc.batchhandler.IndicatorBatchHandler;
-import org.hisp.dhis.jdbc.batchhandler.IndicatorGroupBatchHandler;
-import org.hisp.dhis.jdbc.batchhandler.IndicatorGroupMemberBatchHandler;
-import org.hisp.dhis.jdbc.batchhandler.IndicatorGroupSetBatchHandler;
-import org.hisp.dhis.jdbc.batchhandler.IndicatorGroupSetMemberBatchHandler;
-import org.hisp.dhis.jdbc.batchhandler.IndicatorTypeBatchHandler;
-import org.hisp.dhis.jdbc.batchhandler.OrganisationUnitBatchHandler;
-import org.hisp.dhis.jdbc.batchhandler.OrganisationUnitGroupBatchHandler;
-import org.hisp.dhis.jdbc.batchhandler.OrganisationUnitGroupMemberBatchHandler;
-import org.hisp.dhis.jdbc.batchhandler.PeriodBatchHandler;
-import org.hisp.dhis.jdbc.batchhandler.ReportTableBatchHandler;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
-import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
-import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet;
-import org.hisp.dhis.organisationunit.OrganisationUnitService;
+import org.hisp.dhis.indicator.*;
+import org.hisp.dhis.jdbc.batchhandler.*;
+import org.hisp.dhis.organisationunit.*;
 import org.hisp.dhis.period.Period;
 import org.hisp.dhis.period.PeriodService;
 import org.hisp.dhis.report.ReportService;
@@ -122,6 +65,10 @@
 import org.hisp.dhis.reporttable.ReportTableService;
 import org.hisp.dhis.validation.ValidationRuleService;
 
+import javax.xml.namespace.QName;
+
+import static org.apache.commons.lang.StringUtils.defaultIfEmpty;
+
 /**
  * DXFConverter class This does NOT implement XMLConverter, because we need to
  * pass ProcessState in read() method.
@@ -332,6 +279,8 @@
         {
             if ( reader.isStartElement( ConceptConverter.COLLECTION_NAME ) )
             {
+                log.debug( "Starting Concepts import" );
+
                 state.setMessage( "importing_concepts" );
 
                 BatchHandler<Concept> batchHandler = batchHandlerFactory.createBatchHandler( ConceptBatchHandler.class )
@@ -347,6 +296,8 @@
             }
             else if ( reader.isStartElement( ConstantConverter.COLLECTION_NAME ) )
             {
+                log.debug( "Starting Constants import" ) ;
+
                 state.setMessage( "importing_constants" );
 
                 BatchHandler<Constant> batchHandler = batchHandlerFactory.createBatchHandler(
@@ -362,6 +313,8 @@
             }
             else if ( reader.isStartElement( DataElementCategoryOptionConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting DataElementCategoryOptions import ");
+
                 state.setMessage( "importing_data_element_category_options" );
 
                 BatchHandler<DataElementCategoryOption> batchHandler = batchHandlerFactory.createBatchHandler(
@@ -378,6 +331,8 @@
             }
             else if ( reader.isStartElement( DataElementCategoryConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting DataElementCategories import");
+
                 state.setMessage( "importing_data_element_categories" );
 
                 BatchHandler<DataElementCategory> batchHandler = batchHandlerFactory.createBatchHandler(
@@ -394,6 +349,8 @@
             }
             else if ( reader.isStartElement( DataElementCategoryComboConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting DataElementCategoryCombos import");
+
                 state.setMessage( "importing_data_element_category_combos" );
 
                 BatchHandler<DataElementCategoryCombo> batchHandler = batchHandlerFactory.createBatchHandler(
@@ -410,6 +367,8 @@
             }
             else if ( reader.isStartElement( DataElementCategoryOptionComboConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting DataElementCategoryOptionCombos import");
+
                 state.setMessage( "importing_data_element_category_option_combos" );
 
                 XMLConverter converter = new DataElementCategoryOptionComboConverter( importObjectService,
@@ -422,6 +381,8 @@
             }
             else if ( reader.isStartElement( CategoryCategoryOptionAssociationConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting CategoryCategoryOption associations import");
+
                 state.setMessage( "importing_data_element_category_members" );
 
                 BatchHandler<GroupMemberAssociation> batchHandler = batchHandlerFactory.createBatchHandler(
@@ -439,6 +400,8 @@
             }
             else if ( reader.isStartElement( CategoryComboCategoryAssociationConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting CategoryComboCategory associations import");
+
                 state.setMessage( "importing_data_element_category_combo_members" );
 
                 BatchHandler<GroupMemberAssociation> batchHandler = batchHandlerFactory.createBatchHandler(
@@ -456,6 +419,8 @@
             }
             else if ( reader.isStartElement( DataElementConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting DataElements import");
+
                 state.setMessage( "importing_data_elements" );
 
                 BatchHandler<DataElement> batchHandler = batchHandlerFactory.createBatchHandler(
@@ -473,6 +438,8 @@
             }
             else if ( reader.isStartElement( DataElementGroupConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting DataElementGroups import");
+
                 state.setMessage( "importing_data_element_groups" );
 
                 BatchHandler<DataElementGroup> batchHandler = batchHandlerFactory.createBatchHandler(
@@ -489,6 +456,8 @@
             }
             else if ( reader.isStartElement( DataElementGroupMemberConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting DataElementGroup members import");
+
                 state.setMessage( "importing_data_element_group_members" );
 
                 BatchHandler<GroupMemberAssociation> batchHandler = batchHandlerFactory.createBatchHandler(
@@ -506,6 +475,8 @@
             }
             else if ( reader.isStartElement( DataElementGroupSetConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting DataElementGroupSets import");
+
                 state.setMessage( "importing_data_element_group_sets" );
 
                 BatchHandler<DataElementGroupSet> batchHandler = batchHandlerFactory.createBatchHandler(
@@ -522,6 +493,8 @@
             }
             else if ( reader.isStartElement( DataElementGroupSetMemberConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting Imported DataElementGroupSet members import");
+
                 state.setMessage( "importing_data_element_group_set_members" );
 
                 BatchHandler<GroupMemberAssociation> batchHandler = batchHandlerFactory.createBatchHandler(
@@ -539,6 +512,8 @@
             }
             else if ( reader.isStartElement( IndicatorTypeConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting IndicatorTypes import");
+
                 state.setMessage( "importing_indicator_types" );
 
                 BatchHandler<IndicatorType> batchHandler = batchHandlerFactory.createBatchHandler(
@@ -555,6 +530,8 @@
             }
             else if ( reader.isStartElement( IndicatorConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting Indicators import");
+
                 state.setMessage( "importing_indicators" );
 
                 BatchHandler<Indicator> batchHandler = batchHandlerFactory.createBatchHandler(
@@ -573,6 +550,8 @@
             }
             else if ( reader.isStartElement( IndicatorGroupConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting IndicatorGroups import");
+
                 state.setMessage( "importing_indicator_groups" );
 
                 BatchHandler<IndicatorGroup> batchHandler = batchHandlerFactory.createBatchHandler(
@@ -589,6 +568,8 @@
             }
             else if ( reader.isStartElement( IndicatorGroupMemberConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting IndicatorGroup members import");
+
                 state.setMessage( "importing_indicator_group_members" );
 
                 BatchHandler<GroupMemberAssociation> batchHandler = batchHandlerFactory.createBatchHandler(
@@ -606,6 +587,8 @@
             }
             else if ( reader.isStartElement( IndicatorGroupSetConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting IndicatorGroupSets import");
+
                 state.setMessage( "importing_indicator_group_sets" );
 
                 BatchHandler<IndicatorGroupSet> batchHandler = batchHandlerFactory.createBatchHandler(
@@ -622,6 +605,8 @@
             }
             else if ( reader.isStartElement( IndicatorGroupSetMemberConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting IndicatorGroupSet import");
+
                 state.setMessage( "importing_indicator_group_set_members" );
 
                 BatchHandler<GroupMemberAssociation> batchHandler = batchHandlerFactory.createBatchHandler(
@@ -639,6 +624,8 @@
             }
             else if ( reader.isStartElement( DataDictionaryConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting DataDictionaries import");
+
                 state.setMessage( "importing_data_dictionaries" );
 
                 BatchHandler<DataDictionary> batchHandler = batchHandlerFactory.createBatchHandler(
@@ -655,6 +642,8 @@
             }
             else if ( reader.isStartElement( DataDictionaryDataElementConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting DataDictionary DataElements import");
+
                 state.setMessage( "importing_data_dictionary_data_elements" );
 
                 BatchHandler<GroupMemberAssociation> batchHandler = batchHandlerFactory.createBatchHandler(
@@ -672,6 +661,8 @@
             }
             else if ( reader.isStartElement( DataDictionaryIndicatorConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting DataDictionary Indicators import");
+
                 state.setMessage( "importing_data_dictionary_indicators" );
 
                 BatchHandler<GroupMemberAssociation> batchHandler = batchHandlerFactory.createBatchHandler(
@@ -689,6 +680,8 @@
             }
             else if ( reader.isStartElement( DataSetConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting DataSets import");
+
                 state.setMessage( "importing_data_sets" );
 
                 BatchHandler<DataSet> batchHandler = batchHandlerFactory.createBatchHandler( DataSetBatchHandler.class )
@@ -705,6 +698,8 @@
             }
             else if ( reader.isStartElement( DataSetMemberConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting DataSet members import");
+
                 state.setMessage( "importing_data_set_members" );
 
                 BatchHandler<GroupMemberAssociation> batchHandler = batchHandlerFactory.createBatchHandler(
@@ -722,6 +717,8 @@
             }
             else if ( reader.isStartElement( OrganisationUnitConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting OrganisationUnits import");
+
                 state.setMessage( "importing_organisation_units" );
 
                 BatchHandler<OrganisationUnit> batchHandler = batchHandlerFactory.createBatchHandler(
@@ -738,6 +735,8 @@
             }
             else if ( reader.isStartElement( OrganisationUnitRelationshipConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting OrganisationUnit relationships import");
+
                 state.setMessage( "importing_organisation_unit_relationships" );
 
                 BatchHandler<OrganisationUnit> batchHandler = batchHandlerFactory.createBatchHandler(
@@ -754,6 +753,8 @@
             }
             else if ( reader.isStartElement( OrganisationUnitGroupConverter.COLLECTION_NAME ) )
             {
+                log.info("Starting OrganisationUnitGroups import ");
+
                 state.setMessage( "importing_organisation_unit_groups" );
 
                 BatchHandler<OrganisationUnitGroup> batchHandler = batchHandlerFactory.createBatchHandler(
@@ -770,6 +771,8 @@
             }
             else if ( reader.isStartElement( OrganisationUnitGroupMemberConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting OrganisationUnitGroup members import");
+
                 state.setMessage( "importing_organisation_unit_group_members" );
 
                 BatchHandler<GroupMemberAssociation> batchHandler = batchHandlerFactory.createBatchHandler(
@@ -787,6 +790,8 @@
             }
             else if ( reader.isStartElement( GroupSetConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting OrganisationUnitGroupSets import");
+
                 state.setMessage( "importing_organisation_unit_group_sets" );
 
                 BatchHandler<OrganisationUnitGroupSet> batchHandler = batchHandlerFactory.createBatchHandler(
@@ -803,6 +808,8 @@
             }
             else if ( reader.isStartElement( GroupSetMemberConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting OrganisationUnitGroupSet members import");
+
                 state.setMessage( "importing_organisation_unit_group_set_members" );
 
                 BatchHandler<GroupMemberAssociation> batchHandler = batchHandlerFactory.createBatchHandler(
@@ -820,6 +827,8 @@
             }
             else if ( reader.isStartElement( OrganisationUnitLevelConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting OrganisationUnitLevels import");
+
                 state.setMessage( "importing_organisation_unit_levels" );
 
                 XMLConverter converter = new OrganisationUnitLevelConverter( organisationUnitService,
@@ -831,6 +840,8 @@
             }
             else if ( reader.isStartElement( DataSetSourceAssociationConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting DataSet Source associations import");
+
                 state.setMessage( "importing_data_set_source_associations" );
 
                 BatchHandler<GroupMemberAssociation> batchHandler = batchHandlerFactory.createBatchHandler(
@@ -848,6 +859,8 @@
             }
             else if ( reader.isStartElement( ValidationRuleConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting ValidationRules import");
+
                 state.setMessage( "importing_validation_rules" );
 
                 XMLConverter converter = new ValidationRuleConverter( importObjectService, validationRuleService,
@@ -860,6 +873,8 @@
             }
             else if ( reader.isStartElement( PeriodConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting Periods import");
+
                 state.setMessage( "importing_periods" );
 
                 BatchHandler<Period> batchHandler = batchHandlerFactory.createBatchHandler( PeriodBatchHandler.class )
@@ -876,6 +891,8 @@
             }
             else if ( reader.isStartElement( ReportConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting Reports import");
+
                 state.setMessage( "importing_reports" );
 
                 XMLConverter converter = new ReportConverter( reportService, importObjectService );
@@ -886,6 +903,8 @@
             }
             else if ( reader.isStartElement( ReportTableConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting ReportTables import");
+
                 state.setMessage( "importing_report_tables" );
 
                 BatchHandler<ReportTable> batchHandler = batchHandlerFactory.createBatchHandler(
@@ -907,6 +926,8 @@
             }
             else if ( reader.isStartElement( ChartConverter.COLLECTION_NAME ) )
             {
+                log.debug("Starting Charts import");
+
                 state.setMessage( "importing_charts" );
 
                 XMLConverter converter = new ChartConverter( chartService, importObjectService, indicatorService,
@@ -920,6 +941,7 @@
             else if ( reader.isStartElement( CompleteDataSetRegistrationConverter.COLLECTION_NAME )
                 && params.isDataValues() )
             {
+                log.debug("Starting CompleteDataSetRegistrations import");
                 state.setMessage( "importing_complete_data_set_registrations" );
 
                 BatchHandler<CompleteDataSetRegistration> batchHandler = batchHandlerFactory.createBatchHandler(
@@ -938,6 +960,7 @@
             }
             else if ( reader.isStartElement( DataValueConverter.COLLECTION_NAME ) && params.isDataValues() )
             {
+                log.debug("Starting DataValues import");
                 state.setMessage( "importing_data_values" );
 
                 BatchHandler<DataValue> batchHandler = batchHandlerFactory.createBatchHandler(

=== modified file 'resources/util/dxfgen.sh' (properties changed: +x to -x)