dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #16825
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6507: minor changes to importer
------------------------------------------------------------
revno: 6507
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-04-06 16:20:16 +0200
message:
minor changes to importer
modified:
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/IdScheme.java
dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/ImportStrategy.java
dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/Importer.java
dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/AbstractImporter.java
dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/ConstantImporter.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-04 17:50:32 +0000
+++ dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultImportService.java 2012-04-06 14:20:16 +0000
@@ -50,64 +50,6 @@
//-------------------------------------------------------------------------------------------------------
// Dependencies
//-------------------------------------------------------------------------------------------------------
-/*
- @Autowired
- private AttributeService attributeService;
-
- @Autowired
- private UserService userService;
-
- @Autowired
- private UserGroupService userGroupService;
-
- @Autowired
- private DataElementService dataElementService;
-
- @Autowired
- private OptionService optionService;
-
- @Autowired
- private ConceptService conceptService;
-
- @Autowired
- private DataElementCategoryService dataElementCategoryService;
-
- @Autowired
- private IndicatorService indicatorService;
-
- @Autowired
- private OrganisationUnitService organisationUnitService;
-
- @Autowired
- private OrganisationUnitGroupService organisationUnitGroupService;
-
- @Autowired
- private DataSetService dataSetService;
-
- @Autowired
- private ValidationRuleService validationRuleService;
-
- @Autowired
- private SqlViewService sqlViewService;
-
- @Autowired
- private ChartService chartService;
-
- @Autowired
- private ReportService reportService;
-
- @Autowired
- private ReportTableService reportTableService;
-
- @Autowired
- private DocumentService documentService;
-
- @Autowired
- private MappingService mappingService;
-
- @Autowired
- private DataDictionaryService dataDictionaryService;
-*/
@Autowired
private Set<Importer> importerClasses = new HashSet<Importer>();
=== modified file 'dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/IdScheme.java'
--- dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/IdScheme.java 2012-04-02 17:23:48 +0000
+++ dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/IdScheme.java 2012-04-06 14:20:16 +0000
@@ -33,9 +33,9 @@
*/
public class IdScheme
{
- public static String UID_SCHEME = "uid";
- public static String CODE_SCHEME = "code";
- public static String NAME_SCHEME = "name";
+ public static final String UID_SCHEME = "uid";
+ public static final String CODE_SCHEME = "code";
+ public static final String NAME_SCHEME = "name";
private String scheme;
=== modified file 'dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/ImportStrategy.java'
--- dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/ImportStrategy.java 2012-04-03 10:24:37 +0000
+++ dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/ImportStrategy.java 2012-04-06 14:20:16 +0000
@@ -32,9 +32,9 @@
*/
public class ImportStrategy
{
- public static String NEW_AND_UPDATES_STRATEGY = "newAndUpdates";
- public static String UPDATES_STRATEGY = "updates";
- public static String NEW_STRATEGY = "new";
+ public static final String NEW_AND_UPDATES_STRATEGY = "newAndUpdates";
+ public static final String UPDATES_STRATEGY = "updates";
+ public static final String NEW_STRATEGY = "new";
private String strategy;
=== modified file 'dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/Importer.java'
--- dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/Importer.java 2012-04-05 11:56:10 +0000
+++ dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/Importer.java 2012-04-06 14:20:16 +0000
@@ -27,11 +27,11 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import java.util.List;
-
import org.hisp.dhis.dxf2.importsummary.ImportConflict;
import org.hisp.dhis.dxf2.importsummary.ImportCount;
+import java.util.List;
+
/**
* @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
*/
=== modified file 'dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/AbstractImporter.java'
--- dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/AbstractImporter.java 2012-04-05 14:15:06 +0000
+++ dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/AbstractImporter.java 2012-04-06 14:20:16 +0000
@@ -69,6 +69,13 @@
protected int ignores;
+ //-------------------------------------------------------------------------------------------------------
+ // Mappings from identifier (uid, name, code) to a db object.
+ //
+ // WARNING: These maps might be out-of-date, depending on if new inserts has been made after the were
+ // fetched.
+ //-------------------------------------------------------------------------------------------------------
+
protected Map<String, T> uidMap;
protected Map<String, T> nameMap;
@@ -137,7 +144,7 @@
@Override
public ImportConflict importObject( T object, ImportOptions options )
{
- if ( object == null )
+ if ( object != null )
{
reset( object );
}
=== modified file 'dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/ConstantImporter.java'
--- dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/ConstantImporter.java 2012-04-05 11:56:10 +0000
+++ dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/ConstantImporter.java 2012-04-06 14:20:16 +0000
@@ -46,8 +46,6 @@
@Override
protected ImportConflict newObject( Constant constant, ImportOptions options )
{
- log.info( "NEW OBJECT: " + constant );
-
if ( !options.isDryRun() )
{
log.info( "Trying to save new object with UID: " + constant.getUid() );