dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #14337
Re: [Branch ~dhis2-devs-core/dhis2/trunk] Rev 4838: Put code uniqueness check back in import module
Is there going to be a way for the system to autogenerate a code if 1)
there is a collision during import 2) if the user does not enter one
(I suppose it will be enforced through the UI), but does not know what
the code should be?
On Wed, Oct 5, 2011 at 1:51 PM, <noreply@xxxxxxxxxxxxx> wrote:
> ------------------------------------------------------------
> revno: 4838
> committer: Lars Helge Overland <larshelge@xxxxxxxxx>
> branch nick: dhis2
> timestamp: Wed 2011-10-05 13:50:05 +0200
> message:
> Put code uniqueness check back in import module
> modified:
> dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/DataElementImporter.java
> dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/IndicatorImporter.java
> dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/OrganisationUnitImporter.java
> dhis-2/dhis-services/dhis-service-importexport/src/test/java/org/hisp/dhis/importexport/dxf2/service/DataValueSetServiceTest.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-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/DataElementImporter.java'
> --- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/DataElementImporter.java 2011-04-24 15:50:02 +0000
> +++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/DataElementImporter.java 2011-10-05 11:50:05 +0000
> @@ -99,6 +99,10 @@
> {
> match = dataElementService.getDataElementByShortName( object.getShortName() );
> }
> + if ( match == null )
> + {
> + match = dataElementService.getDataElementByCode( object.getCode() );
> + }
>
> return match;
> }
>
> === modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/IndicatorImporter.java'
> --- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/IndicatorImporter.java 2011-09-24 11:35:11 +0000
> +++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/IndicatorImporter.java 2011-10-05 11:50:05 +0000
> @@ -100,6 +100,10 @@
> {
> match = indicatorService.getIndicatorByShortName( object.getShortName() );
> }
> + if ( match == null )
> + {
> + match = indicatorService.getIndicatorByCode( object.getCode() );
> + }
>
> return match;
> }
>
> === modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/OrganisationUnitImporter.java'
> --- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/OrganisationUnitImporter.java 2011-04-22 21:04:14 +0000
> +++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/OrganisationUnitImporter.java 2011-10-05 11:50:05 +0000
> @@ -92,7 +92,14 @@
> @Override
> protected OrganisationUnit getMatching( OrganisationUnit object )
> {
> - return organisationUnitService.getOrganisationUnitByName( object.getName() );
> + OrganisationUnit match = organisationUnitService.getOrganisationUnitByName( object.getName() );
> +
> + if ( match == null )
> + {
> + match = organisationUnitService.getOrganisationUnitByCode( object.getCode() );
> + }
> +
> + return match;
> }
>
> @Override
>
> === modified file 'dhis-2/dhis-services/dhis-service-importexport/src/test/java/org/hisp/dhis/importexport/dxf2/service/DataValueSetServiceTest.java'
> --- dhis-2/dhis-services/dhis-service-importexport/src/test/java/org/hisp/dhis/importexport/dxf2/service/DataValueSetServiceTest.java 2011-09-23 18:54:49 +0000
> +++ dhis-2/dhis-services/dhis-service-importexport/src/test/java/org/hisp/dhis/importexport/dxf2/service/DataValueSetServiceTest.java 2011-10-05 11:50:05 +0000
> @@ -63,6 +63,7 @@
> import org.junit.Ignore;
> import org.junit.Test;
>
> +@Ignore //TODO fix
> public class DataValueSetServiceTest
> extends DhisTest
> {
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help : https://help.launchpad.net/ListHelp
>
>
Follow ups
References