dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #04346
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1431: Removed the uniquness constraint on code property on DataElement, Indicator, Orgunit.
------------------------------------------------------------
revno: 1431
committer: Lars Helge Oeverland <larshelge@xxxxxxxxx>
branch nick: trunk
timestamp: Mon 2010-02-15 13:29:14 +0100
message:
Removed the uniquness constraint on code property on DataElement, Indicator, Orgunit.
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementStore.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorService.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorStore.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitService.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitStore.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/OptionsCategoriesDefaultSortOrderPopulator.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/indicator/DefaultIndicatorService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitService.java
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElement.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/indicator/hibernate/Indicator.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnit.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataelement/DataElementServiceTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataelement/DataElementStoreTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/indicator/IndicatorServiceTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/indicator/IndicatorStoreTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/organisationunit/OrganisationUnitServiceTest.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/converter/AbstractCalculatedDataElementConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/converter/AbstractDataElementConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/converter/AbstractExtendedDataElementConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/converter/AbstractExtendedIndicatorConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/converter/AbstractIndicatorConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/converter/AbstractOrganisationUnitConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/converter/DataElementConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/converter/DataValueConverter.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ValidateDataElementAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/extendeddataelement/ValidateExtendedDataElementAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/extendedindicator/ValidateExtendedIndicatorAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/ValidateIndicatorAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElement.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/indicator.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/ValidateOrganisationUnitAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnit.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-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java 2010-02-04 16:57:55 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java 2010-02-15 12:29:14 +0000
@@ -117,14 +117,6 @@
DataElement getDataElementByShortName( String shortName );
/**
- * Returns a DataElement with a given code.
- *
- * @param code the code of the DataElement to return.
- * @return the DataElement with the given code, or null if no match.
- */
- DataElement getDataElementByCode( String code );
-
- /**
* Returns all DataElements.
*
* @return a collection of all DataElements, or an empty collection if there
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementStore.java 2010-02-04 09:59:45 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementStore.java 2010-02-15 12:29:14 +0000
@@ -113,14 +113,6 @@
DataElement getDataElementByShortName( String shortName );
/**
- * Returns a DataElement with a given code.
- *
- * @param code the code of the DataElement to return.
- * @return the DataElement with the given code, or null if no match.
- */
- DataElement getDataElementByCode( String code );
-
- /**
* Returns all DataElements.
*
* @return a collection of all DataElements, or an empty collection if there
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorService.java 2010-01-27 11:51:54 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorService.java 2010-02-15 12:29:14 +0000
@@ -61,8 +61,6 @@
Indicator getIndicatorByAlternativeName( String alternativeName );
- Indicator getIndicatorByCode( String code );
-
Collection<Indicator> getIndicatorsWithGroupSets();
Collection<Indicator> getIndicatorsWithoutGroups();
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorStore.java 2010-01-27 11:51:54 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorStore.java 2010-02-15 12:29:14 +0000
@@ -55,8 +55,6 @@
Indicator getIndicatorByAlternativeName( String alternativeName );
- Indicator getIndicatorByCode( String code );
-
Collection<Indicator> getIndicatorsWithGroupSets();
Collection<Indicator> getIndicatorsWithoutGroups();
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitService.java 2010-01-27 11:51:54 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitService.java 2010-02-15 12:29:14 +0000
@@ -131,14 +131,6 @@
OrganisationUnit getOrganisationUnitByShortName( String shortName );
/**
- * Returns an OrganisationUnit with a given code.
- *
- * @param code the code of the OrgananisationUnit to return.
- * @return the OrganisationUnit with the given code, or null if no match.
- */
- OrganisationUnit getOrganisationUnitByCode( String code );
-
- /**
* Returns all root OrganisationUnits. A root OrganisationUnit is an
* OrganisationUnit with no parent/the parent set to null.
*
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitStore.java 2010-01-27 11:51:54 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitStore.java 2010-02-15 12:29:14 +0000
@@ -70,14 +70,6 @@
OrganisationUnit getOrganisationUnitByShortName( String shortName );
/**
- * Returns an OrganisationUnit with a given code.
- *
- * @param code the code of the OrgananisationUnit to return.
- * @return the OrganisationUnit with the given code, or null if no match.
- */
- OrganisationUnit getOrganisationUnitByCode( String code );
-
- /**
* Returns all root OrganisationUnits. A root OrganisationUnit is an
* OrganisationUnit with no parent/has the parent set to null.
*
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java 2010-02-04 16:57:55 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java 2010-02-15 12:29:14 +0000
@@ -233,11 +233,6 @@
return i18n( i18nService, dataElementStore.getDataElementByShortName( shortName ) );
}
- public DataElement getDataElementByCode( String code )
- {
- return i18n( i18nService, dataElementStore.getDataElementByCode( code ) );
- }
-
public Collection<DataElement> getDataElementsByAggregationOperator( String aggregationOperator )
{
return i18n( i18nService, dataElementStore.getDataElementsByAggregationOperator( aggregationOperator ) );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/OptionsCategoriesDefaultSortOrderPopulator.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/OptionsCategoriesDefaultSortOrderPopulator.java 2009-12-23 07:35:17 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/OptionsCategoriesDefaultSortOrderPopulator.java 2010-02-15 12:29:14 +0000
@@ -113,8 +113,14 @@
//executeSql( "ALTER TABLE dataelementcategoryoption DROP CONSTRAINT dataelementcategoryoption_name_key" ); will be maintained in transition period
executeSql( "ALTER TABLE dataelementcategoryoption DROP CONSTRAINT dataelementcategoryoption_shortname_key" );
+ //minmaxdataelement query index
executeSql( "CREATE INDEX index_minmaxdataelement ON minmaxdataelement( sourceid, dataelementid, categoryoptioncomboid )" );
+ //drop code unique constraints
+ executeSql( "ALTER TABLE dataelement DROP CONSTRAINT dataelement_code_key" );
+ executeSql( "ALTER TABLE indicator DROP CONSTRAINT indicator_code_key" );
+ executeSql( "ALTER TABLE organisationunit DROP CONSTRAINT organisationunit_code_key" );
+
log.info( "Updated Category sort order and primary keys" );
}
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/indicator/DefaultIndicatorService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/indicator/DefaultIndicatorService.java 2010-01-27 11:51:54 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/indicator/DefaultIndicatorService.java 2010-02-15 12:29:14 +0000
@@ -166,11 +166,6 @@
return i18n( i18nService, indicatorStore.getIndicatorByAlternativeName( alternativeName ) );
}
- public Indicator getIndicatorByCode( String code )
- {
- return i18n( i18nService, indicatorStore.getIndicatorByCode( code ) );
- }
-
public Collection<Indicator> getIndicatorsWithGroupSets()
{
return i18n( i18nService, indicatorStore.getIndicatorsWithGroupSets() );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitService.java 2010-01-27 11:51:54 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitService.java 2010-02-15 12:29:14 +0000
@@ -172,11 +172,6 @@
return organisationUnitStore.getOrganisationUnitByShortName( shortName );
}
- public OrganisationUnit getOrganisationUnitByCode( String code )
- {
- return organisationUnitStore.getOrganisationUnitByCode( code );
- }
-
public Collection<OrganisationUnit> getRootOrganisationUnits()
{
return organisationUnitStore.getRootOrganisationUnits();
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElement.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElement.hbm.xml 2010-01-22 03:15:07 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElement.hbm.xml 2010-02-15 12:29:14 +0000
@@ -29,7 +29,7 @@
</property>
<property name="code">
- <column name="code" not-null="false" unique="true" length="100"/>
+ <column name="code" not-null="false" unique="false" length="100"/>
</property>
<property name="description" type="text"/>
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/indicator/hibernate/Indicator.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/indicator/hibernate/Indicator.hbm.xml 2009-11-07 13:03:26 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/indicator/hibernate/Indicator.hbm.xml 2010-02-15 12:29:14 +0000
@@ -29,7 +29,7 @@
</property>
<property name="code">
- <column name="code" not-null="false" unique="true" length="25"/>
+ <column name="code" not-null="false" unique="false" length="25"/>
</property>
<property name="description" type="text"/>
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnit.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnit.hbm.xml 2010-01-14 07:10:41 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnit.hbm.xml 2010-02-15 12:29:14 +0000
@@ -30,7 +30,7 @@
</property>
<property name="code">
- <column name="code" not-null="false" unique="true" length="25"/>
+ <column name="code" not-null="false" unique="false" length="25"/>
</property>
<property name="openingDate" column="openingdate" type="date"/>
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataelement/DataElementServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataelement/DataElementServiceTest.java 2009-11-10 15:53:07 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataelement/DataElementServiceTest.java 2010-02-15 12:29:14 +0000
@@ -261,29 +261,6 @@
}
@Test
- public void testGetDataElementByCode()
- throws Exception
- {
- DataElement dataElementA = createDataElement( 'A' );
- DataElement dataElementB = createDataElement( 'B' );
- int idA = dataElementService.addDataElement( dataElementA );
- int idB = dataElementService.addDataElement( dataElementB );
-
- dataElementA = dataElementService.getDataElementByCode( "CodeA" );
- assertNotNull( dataElementA );
- assertEquals( idA, dataElementA.getId() );
- assertEquals( "DataElementA", dataElementA.getName() );
-
- dataElementB = dataElementService.getDataElementByCode( "CodeB" );
- assertNotNull( dataElementB );
- assertEquals( idB, dataElementB.getId() );
- assertEquals( "DataElementB", dataElementB.getName() );
-
- DataElement dataElementC = dataElementService.getDataElementByCode( "CodeC" );
- assertNull( dataElementC );
- }
-
- @Test
public void testGetAllDataElements()
throws Exception
{
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataelement/DataElementStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataelement/DataElementStoreTest.java 2010-01-22 10:15:02 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataelement/DataElementStoreTest.java 2010-02-15 12:29:14 +0000
@@ -275,29 +275,7 @@
DataElement dataElementC = dataElementStore.getDataElementByShortName( "ShortNameC" );
assertNull( dataElementC );
}
-
- @Test
- public void testGetDataElementByCode()
- {
- DataElement dataElementA = createDataElement( 'A' );
- DataElement dataElementB = createDataElement( 'B' );
- int idA = dataElementStore.addDataElement( dataElementA );
- int idB = dataElementStore.addDataElement( dataElementB );
-
- dataElementA = dataElementStore.getDataElementByCode( "CodeA" );
- assertNotNull( dataElementA );
- assertEquals( idA, dataElementA.getId() );
- assertEquals( "DataElementA", dataElementA.getName() );
-
- dataElementB = dataElementStore.getDataElementByCode( "CodeB" );
- assertNotNull( dataElementB );
- assertEquals( idB, dataElementB.getId() );
- assertEquals( "DataElementB", dataElementB.getName() );
-
- DataElement dataElementC = dataElementStore.getDataElementByCode( "CodeC" );
- assertNull( dataElementC );
- }
-
+
@Test
public void testGetAllDataElements()
{
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/indicator/IndicatorServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/indicator/IndicatorServiceTest.java 2009-11-10 11:45:58 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/indicator/IndicatorServiceTest.java 2010-02-15 12:29:14 +0000
@@ -527,30 +527,5 @@
Indicator indicatorC = indicatorService.getIndicatorByShortName( "ShortNameC" );
assertNull( indicatorC );
- }
-
- @Test
- public void testGetIndicatorByCodeName()
- throws Exception
- {
- IndicatorType type = new IndicatorType( "IndicatorType", 100 );
-
- indicatorService.addIndicatorType( type );
-
- Indicator indicatorA = createIndicator( 'A', type );
- Indicator indicatorB = createIndicator( 'B', type );
-
- int idA = indicatorService.addIndicator( indicatorA );
- int idB = indicatorService.addIndicator( indicatorB );
-
- assertNotNull( indicatorService.getIndicator( idA ) );
- assertNotNull( indicatorService.getIndicator( idB ) );
-
- indicatorA = indicatorService.getIndicatorByCode( "CodeA" );
- assertNotNull( indicatorA );
- assertEq( 'A', indicatorA );
-
- Indicator indicatorC = indicatorService.getIndicatorByCode( "CodeC" );
- assertNull( indicatorC );
}
}
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/indicator/IndicatorStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/indicator/IndicatorStoreTest.java 2009-11-07 13:03:26 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/indicator/IndicatorStoreTest.java 2010-02-15 12:29:14 +0000
@@ -394,31 +394,6 @@
}
@Test
- public void testGetIndicatorByCodeName()
- throws Exception
- {
- IndicatorType type = new IndicatorType( "IndicatorType", 100 );
-
- indicatorTypeStore.save( type );
-
- Indicator indicatorA = createIndicator( 'A', type );
- Indicator indicatorB = createIndicator( 'B', type );
-
- int idA = indicatorStore.addIndicator( indicatorA );
- int idB = indicatorStore.addIndicator( indicatorB );
-
- assertNotNull( indicatorStore.getIndicator( idA ) );
- assertNotNull( indicatorStore.getIndicator( idB ) );
-
- indicatorA = indicatorStore.getIndicatorByCode( "CodeA" );
- assertNotNull( indicatorA );
- assertEq( 'A', indicatorA );
-
- Indicator indicatorC = indicatorStore.getIndicatorByCode( "CodeC" );
- assertNull( indicatorC );
- }
-
- @Test
public void testGetIndicatorsWithGroupSets()
throws Exception
{
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/organisationunit/OrganisationUnitServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/organisationunit/OrganisationUnitServiceTest.java 2010-01-19 21:48:28 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/organisationunit/OrganisationUnitServiceTest.java 2010-02-15 12:29:14 +0000
@@ -186,9 +186,6 @@
OrganisationUnit unit2 = organisationUnitService.getOrganisationUnitByShortName( oU2ShortName );
assertEquals( unit2.getShortName(), oU2ShortName );
- OrganisationUnit unit3 = organisationUnitService.getOrganisationUnitByCode( oU3Code );
- assertEquals( unit3.getCode(), oU3Code );
-
OrganisationUnit unit4 = organisationUnitService.getOrganisationUnitByName( "foo" );
assertNull( unit4 );
}
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/converter/AbstractCalculatedDataElementConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/converter/AbstractCalculatedDataElementConverter.java 2009-04-03 21:49:51 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/converter/AbstractCalculatedDataElementConverter.java 2010-02-15 12:29:14 +0000
@@ -78,10 +78,6 @@
{
match = dataElementService.getDataElementByShortName( object.getShortName() );
}
- if ( match == null )
- {
- match = dataElementService.getDataElementByCode( object.getCode() );
- }
CalculatedDataElement calculated = (CalculatedDataElement) match;
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/converter/AbstractDataElementConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/converter/AbstractDataElementConverter.java 2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/converter/AbstractDataElementConverter.java 2010-02-15 12:29:14 +0000
@@ -75,10 +75,6 @@
{
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/converter/AbstractExtendedDataElementConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/converter/AbstractExtendedDataElementConverter.java 2009-08-12 21:06:37 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/converter/AbstractExtendedDataElementConverter.java 2010-02-15 12:29:14 +0000
@@ -134,10 +134,6 @@
{
match = dataElementService.getDataElementByShortName( object.getShortName() );
}
- if ( match == null )
- {
- match = dataElementService.getDataElementByCode( object.getCode() );
- }
if ( match != null && match.getExtended() != null )
{
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/converter/AbstractExtendedIndicatorConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/converter/AbstractExtendedIndicatorConverter.java 2009-08-12 21:06:37 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/converter/AbstractExtendedIndicatorConverter.java 2010-02-15 12:29:14 +0000
@@ -138,10 +138,6 @@
{
match = indicatorService.getIndicatorByShortName( object.getShortName() );
}
- if ( match == null )
- {
- match = indicatorService.getIndicatorByCode( object.getCode() );
- }
if ( match != null && match.getExtended() != null )
{
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/converter/AbstractIndicatorConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/converter/AbstractIndicatorConverter.java 2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/converter/AbstractIndicatorConverter.java 2010-02-15 12:29:14 +0000
@@ -79,10 +79,6 @@
{
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/converter/AbstractOrganisationUnitConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/converter/AbstractOrganisationUnitConverter.java 2009-08-12 21:06:37 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/converter/AbstractOrganisationUnitConverter.java 2010-02-15 12:29:14 +0000
@@ -79,10 +79,6 @@
{
match = organisationUnitService.getOrganisationUnitByShortName( object.getShortName() );
}
- if ( match == null )
- {
- match = organisationUnitService.getOrganisationUnitByCode( object.getCode() );
- }
return match;
}
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/converter/DataElementConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/converter/DataElementConverter.java 2010-02-08 07:04:26 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/converter/DataElementConverter.java 2010-02-15 12:29:14 +0000
@@ -199,17 +199,19 @@
public void read( XMLReader reader, ImportParams params )
{
- final Map<String, String> values = reader.readElements( ELEMENT_NAME );
-
- final boolean calculated = convertBooleanFromDhis14( values.get( FIELD_CALCULATED ) );
-
- final DataElementCategoryCombo categoryCombo = categoryService.getDataElementCategoryComboByName( DEFAULT_CATEGORY_COMBO_NAME );
+ Map<String, String> values = reader.readElements( ELEMENT_NAME );
+
+ boolean calculated = convertBooleanFromDhis14( values.get( FIELD_CALCULATED ) );
+
+ DataElementCategoryCombo categoryCombo = categoryService.getDataElementCategoryComboByName( DEFAULT_CATEGORY_COMBO_NAME );
+ DataElementCategoryCombo proxyCategoryCombo = new DataElementCategoryCombo();
+ proxyCategoryCombo.setId( categoryCombo.getId() );
if ( calculated )
{
final CalculatedDataElement element = new CalculatedDataElement();
- element.setCategoryCombo( categoryCombo );
+ element.setCategoryCombo( proxyCategoryCombo );
element.setId( Integer.valueOf( values.get( FIELD_ID ) ) );
element.setName( values.get( FIELD_NAME ) );
@@ -231,7 +233,7 @@
{
final DataElement element = new DataElement();
- element.setCategoryCombo( categoryCombo );
+ element.setCategoryCombo( proxyCategoryCombo );
element.setId( Integer.valueOf( values.get( FIELD_ID ) ) );
element.setName( values.get( FIELD_NAME ) );
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/converter/DataValueConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/converter/DataValueConverter.java 2010-02-08 10:56:08 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/converter/DataValueConverter.java 2010-02-15 12:29:14 +0000
@@ -201,11 +201,13 @@
{
String line = "";
- final DataValue value = new DataValue();
- final DataElement dataElement = new DataElement();
- final Period period = new Period();
- final OrganisationUnit organisationUnit = new OrganisationUnit();
- final DataElementCategoryOptionCombo categoryOptionCombo = categoryService.getDefaultDataElementCategoryOptionCombo();
+ DataValue value = new DataValue();
+ DataElement dataElement = new DataElement();
+ Period period = new Period();
+ OrganisationUnit organisationUnit = new OrganisationUnit();
+ DataElementCategoryOptionCombo categoryOptionCombo = categoryService.getDefaultDataElementCategoryOptionCombo();
+ DataElementCategoryOptionCombo proxyCategoryOptionCombo = new DataElementCategoryOptionCombo();
+ proxyCategoryOptionCombo.setId( categoryOptionCombo.getId() );
try
{
@@ -224,7 +226,7 @@
value.setSource( organisationUnit );
value.setValue( handleValue( values[6] ) );
value.setComment( values[13] );
- value.setOptionCombo( categoryOptionCombo );
+ value.setOptionCombo( proxyCategoryOptionCombo );
read( value, GroupMemberType.NONE, params );
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ValidateDataElementAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ValidateDataElementAction.java 2009-12-04 14:09:09 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ValidateDataElementAction.java 2010-02-15 12:29:14 +0000
@@ -103,13 +103,6 @@
this.shortName = shortName;
}
- private String code;
-
- public void setCode( String code )
- {
- this.code = code;
- }
-
private String valueType;
public void setValueType( String valueType )
@@ -229,18 +222,6 @@
}
}
- if ( code != null && code.trim().length() != 0 )
- {
- DataElement match = dataElementService.getDataElementByCode( code );
-
- if ( match != null && (id == null || match.getId() != id) )
- {
- message = i18n.getString( "code_in_use" );
-
- return INPUT;
- }
- }
-
if ( selectedCategoryComboId == null )
{
message = i18n.getString( "select_categorycombo" );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/extendeddataelement/ValidateExtendedDataElementAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/extendeddataelement/ValidateExtendedDataElementAction.java 2009-08-20 08:17:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/extendeddataelement/ValidateExtendedDataElementAction.java 2010-02-15 12:29:14 +0000
@@ -285,35 +285,15 @@
}
// -------------------------------------------------------------------------
- // code: required / unique
+ // code: required
// -------------------------------------------------------------------------
- if ( code == null )
+ if ( code == null || code.trim().length() == 0 )
{
message = i18n.getString( "specify_code" );
return INPUT;
}
- else
- {
- code = code.trim();
-
- if ( code.length() == 0 )
- {
- message = i18n.getString( "specify_code" );
-
- return INPUT;
- }
-
- DataElement match = dataElementService.getDataElementByCode( code );
-
- if ( match != null && ( id == null || match.getId() != id ) )
- {
- message = i18n.getString( "code_in_use" );
-
- return INPUT;
- }
- }
// -------------------------------------------------------------------------
// description: required
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/extendedindicator/ValidateExtendedIndicatorAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/extendedindicator/ValidateExtendedIndicatorAction.java 2009-08-20 08:17:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/extendedindicator/ValidateExtendedIndicatorAction.java 2010-02-15 12:29:14 +0000
@@ -282,21 +282,16 @@
return INPUT;
}
}
+
+ // -------------------------------------------------------------------------
+ // code: required
+ // -------------------------------------------------------------------------
- // -------------------------------------------------------------------------
- // code: unique
- // -------------------------------------------------------------------------
-
- if ( code != null && code.trim().length() != 0 )
+ if ( code == null || code.trim().length() == 0 )
{
- Indicator match = indicatorService.getIndicatorByCode( code );
-
- if ( match != null && (id == null || match.getId() != id) )
- {
- message = i18n.getString( "code_in_use" );
-
- return INPUT;
- }
+ message = i18n.getString( "specify_code" );
+
+ return INPUT;
}
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/ValidateIndicatorAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/ValidateIndicatorAction.java 2009-12-02 13:19:53 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/ValidateIndicatorAction.java 2010-02-15 12:29:14 +0000
@@ -90,13 +90,6 @@
this.alternativeName = alternativeName;
}
- private String code;
-
- public void setCode( String code )
- {
- this.code = code;
- }
-
private Integer indicatorTypeId;
public void setIndicatorTypeId( Integer indicatorTypeId )
@@ -229,18 +222,6 @@
}
}
- if ( code != null && code.trim().length() != 0 )
- {
- Indicator match = indicatorService.getIndicatorByCode( code );
-
- if ( match != null && (id == null || match.getId() != id) )
- {
- message = i18n.getString( "code_in_use" );
-
- return INPUT;
- }
- }
-
if ( indicatorTypeId == null )
{
message = i18n.getString( "choose_indicator_type" );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElement.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElement.js 2010-02-10 17:00:47 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElement.js 2010-02-15 12:29:14 +0000
@@ -143,7 +143,6 @@
request.send( 'validateDataElement.action?name=' + getFieldValue( 'name' ) +
'&shortName=' + getFieldValue( 'shortName' ) +
'&alternativeName=' + getFieldValue( 'alternativeName' ) +
- '&code=' + getFieldValue( 'code' ) +
'&valueType=' + getSelectValue( 'valueType' ) +
'&calculated=' + getCheckboxValue( 'calculated' ) +
'&selectedCategoryComboId=' + getSelectValue( 'selectedCategoryComboId' ) +
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/indicator.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/indicator.js 2010-02-10 17:09:24 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/indicator.js 2010-02-15 12:29:14 +0000
@@ -77,7 +77,6 @@
request.send( 'validateIndicator.action?name=' + getFieldValue( 'name' ) +
'&shortName=' + getFieldValue( 'shortName' ) +
'&alternativeName=' + getFieldValue( 'alternativeName' ) +
- '&code=' + getFieldValue( 'code' ) +
'&indicatorTypeId=' + getListValue( 'indicatorTypeId' ) +
'&numerator=' + getFieldValue( 'numerator' ) +
'&numeratorDescription=' + getFieldValue( 'numeratorDescription' ) +
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/ValidateOrganisationUnitAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/ValidateOrganisationUnitAction.java 2009-08-20 08:17:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/ValidateOrganisationUnitAction.java 2010-02-15 12:29:14 +0000
@@ -86,13 +86,6 @@
this.shortName = shortName;
}
- private String code;
-
- public void setCode( String code )
- {
- this.code = code;
- }
-
private String openingDate;
public void setOpeningDate( String openingDate )
@@ -182,24 +175,6 @@
}
}
- if ( code != null && code.trim().length() == 0 )
- {
- code = null;
- }
- else
- {
- code = code.trim();
-
- OrganisationUnit match = organisationUnitService.getOrganisationUnitByCode( code );
-
- if ( match != null && (id == null || match.getId() != id) )
- {
- message = i18n.getString( "org_unit_code_in_use" );
-
- return INPUT;
- }
- }
-
Date oDate;
if ( openingDate == null || openingDate.trim().length() == 0 )
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnit.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnit.js 2010-02-10 19:12:22 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnit.js 2010-02-15 12:29:14 +0000
@@ -66,7 +66,6 @@
request.setCallbackSuccess( addValidationCompleted );
request.send( 'validateOrganisationUnit.action?name=' + getFieldValue( 'name' ) +
'&shortName=' + getFieldValue( 'shortName' ) +
- '&code=' + getFieldValue( 'code' ) +
'&openingDate=' + getFieldValue( 'openingDate' ) );
return false;