dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #20910
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9762: removed name/shortName uniqueness on indicator/indicatorGroup/indicatorGroupSet
------------------------------------------------------------
revno: 9762
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-02-07 17:25:34 +0700
message:
removed name/shortName uniqueness on indicator/indicatorGroup/indicatorGroupSet
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroup.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroupSet.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorService.java
dhis-2/dhis-services/dhis-service-administration/src/main/resources/org/hisp/dhis/sqlview/hibernate/SqlView.hbm.xml
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/startup/TableAlteror.java
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/attribute/hibernate/Attribute.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/common/identifiableProperties.hbm
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/concept/hibernate/Concept.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/constant/hibernate/Constant.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/datadictionary/hibernate/DataDictionary.hbm.xml
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/DataElementCategory.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategoryCombo.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategoryOption.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementGroup.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementGroupSet.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataset/hibernate/DataSet.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/indicator/hibernate/IndicatorGroup.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/indicator/hibernate/IndicatorGroupSet.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/indicator/hibernate/IndicatorType.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/mapping/hibernate/MapLayer.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/mapping/hibernate/MapLegendSet.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/option/hibernate/OptionSet.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/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnitGroup.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnitGroupSet.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnitLevel.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/UserAuthorityGroup.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/UserGroup.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/validation/hibernate/ValidationRule.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/validation/hibernate/ValidationRuleGroup.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/help/HelpManagerTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/indicator/IndicatorGroupStoreTest.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-importexport/src/main/java/org/hisp/dhis/importexport/importer/IndicatorGroupImporter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/IndicatorGroupSetImporter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/IndicatorImporter.java
dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/caseaggregation/hibernate/CaseAggregationCondition.hbm.xml
dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientAttribute.hbm.xml
dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientAttributeGroup.hbm.xml
dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientIdentifierType.hbm.xml
dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientreport/hibernate/PatientAggregateReport.hbm.xml
dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientreport/hibernate/PatientTabularReport.hbm.xml
dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml
dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml
dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageSection.hbm.xml
dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramValidation.hbm.xml
dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/relationship/hibernate/RelationshipType.hbm.xml
dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/document/hibernate/Document.hbm.xml
dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/report/hibernate/Report.hbm.xml
dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/reporttable/hibernate/ReportTable.hbm.xml
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/indicatorgroup/ValidateIndicatorGroupAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroupset/ValidateIndicatorGroupSetAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addIndicatorForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addIndicatorGroupForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/addIndicatorGroupSet.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorGroupForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorGroupSet.vm
--
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/indicator/Indicator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java 2012-11-05 19:23:01 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java 2013-02-07 10:25:34 +0000
@@ -142,12 +142,6 @@
// -------------------------------------------------------------------------
@Override
- public int hashCode()
- {
- return name.hashCode();
- }
-
- @Override
public boolean equals( Object o )
{
if ( this == o )
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroup.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroup.java 2012-06-01 11:35:55 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroup.java 2013-02-07 10:25:34 +0000
@@ -116,12 +116,6 @@
// -------------------------------------------------------------------------
@Override
- public int hashCode()
- {
- return name.hashCode();
- }
-
- @Override
public boolean equals( Object o )
{
if ( this == o )
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroupSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroupSet.java 2012-04-20 18:31:48 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroupSet.java 2013-02-07 10:25:34 +0000
@@ -157,12 +157,6 @@
// -------------------------------------------------------------------------
@Override
- public int hashCode()
- {
- return name.hashCode();
- }
-
- @Override
public boolean equals( Object o )
{
if ( this == o )
=== 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 2012-10-18 13:04:28 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorService.java 2013-02-07 10:25:34 +0000
@@ -55,12 +55,12 @@
Collection<Indicator> getAllIndicators();
Collection<Indicator> getIndicators( Collection<Integer> identifiers );
-
+
List<Indicator> getIndicatorsByUid( Collection<String> uids );
- Indicator getIndicatorByName( String name );
+ List<Indicator> getIndicatorByName( String name );
- Indicator getIndicatorByShortName( String shortName );
+ List<Indicator> getIndicatorByShortName( String shortName );
Indicator getIndicatorByCode( String code );
@@ -119,7 +119,7 @@
void deleteIndicatorGroup( IndicatorGroup indicatorGroup );
IndicatorGroup getIndicatorGroup( int id );
-
+
IndicatorGroup getIndicatorGroup( int id, boolean i18nIndicators );
Collection<IndicatorGroup> getIndicatorGroups( Collection<Integer> identifiers );
@@ -128,7 +128,7 @@
Collection<IndicatorGroup> getAllIndicatorGroups();
- IndicatorGroup getIndicatorGroupByName( String name );
+ List<IndicatorGroup> getIndicatorGroupByName( String name );
Collection<IndicatorGroup> getGroupsContainingIndicator( Indicator indicator );
@@ -151,12 +151,12 @@
void deleteIndicatorGroupSet( IndicatorGroupSet groupSet );
IndicatorGroupSet getIndicatorGroupSet( int id );
-
+
IndicatorGroupSet getIndicatorGroupSet( int id, boolean i18nGroups );
-
+
IndicatorGroupSet getIndicatorGroupSet( String uid );
- IndicatorGroupSet getIndicatorGroupSetByName( String name );
+ List<IndicatorGroupSet> getIndicatorGroupSetByName( String name );
Collection<IndicatorGroupSet> getCompulsoryIndicatorGroupSets();
=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/resources/org/hisp/dhis/sqlview/hibernate/SqlView.hbm.xml'
--- dhis-2/dhis-services/dhis-service-administration/src/main/resources/org/hisp/dhis/sqlview/hibernate/SqlView.hbm.xml 2011-12-11 00:21:52 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/resources/org/hisp/dhis/sqlview/hibernate/SqlView.hbm.xml 2013-02-07 10:25:34 +0000
@@ -13,6 +13,8 @@
</id>
&identifiableProperties;
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
+
<property name="description" type="text" />
<property name="sqlQuery" not-null="true" type="text" />
=== 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 2012-10-18 13:04:28 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/indicator/DefaultIndicatorService.java 2013-02-07 10:25:34 +0000
@@ -27,23 +27,19 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import static org.hisp.dhis.i18n.I18nUtils.getCountByName;
-import static org.hisp.dhis.i18n.I18nUtils.getObjectsBetween;
-import static org.hisp.dhis.i18n.I18nUtils.getObjectsBetweenByName;
-import static org.hisp.dhis.i18n.I18nUtils.getObjectsByName;
-import static org.hisp.dhis.i18n.I18nUtils.i18n;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
import org.hisp.dhis.common.GenericIdentifiableObjectStore;
import org.hisp.dhis.i18n.I18nService;
import org.hisp.dhis.system.util.Filter;
import org.hisp.dhis.system.util.FilterUtils;
import org.springframework.transaction.annotation.Transactional;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import static org.hisp.dhis.i18n.I18nUtils.*;
+
/**
* @author Lars Helge Overland
* @version $Id$
@@ -137,20 +133,20 @@
}
} );
}
-
+
public List<Indicator> getIndicatorsByUid( Collection<String> uids )
{
return indicatorStore.getByUid( uids );
}
- public Indicator getIndicatorByName( String name )
+ public List<Indicator> getIndicatorByName( String name )
{
- return i18n( i18nService, indicatorStore.getByName( name ) );
+ return new ArrayList<Indicator>( i18n( i18nService, indicatorStore.getAllEqName( name ) ) );
}
- public Indicator getIndicatorByShortName( String shortName )
+ public List<Indicator> getIndicatorByShortName( String shortName )
{
- return i18n( i18nService, indicatorStore.getByShortName( shortName ) );
+ return new ArrayList<Indicator>( i18n( i18nService, indicatorStore.getAllEqShortName( shortName ) ) );
}
public Indicator getIndicatorByCode( String code )
@@ -297,12 +293,12 @@
public IndicatorGroup getIndicatorGroup( int id, boolean i18nIndicators )
{
IndicatorGroup group = getIndicatorGroup( id );
-
+
if ( i18nIndicators )
{
i18n( i18nService, group.getMembers() );
}
-
+
return group;
}
@@ -329,9 +325,9 @@
return i18n( i18nService, indicatorGroupStore.getAll() );
}
- public IndicatorGroup getIndicatorGroupByName( String name )
+ public List<IndicatorGroup> getIndicatorGroupByName( String name )
{
- return i18n( i18nService, indicatorGroupStore.getByName( name ) );
+ return new ArrayList<IndicatorGroup>( i18n( i18nService, indicatorGroupStore.getAllEqName( name ) ) );
}
public Collection<IndicatorGroup> getGroupsContainingIndicator( Indicator indicator )
@@ -396,16 +392,16 @@
{
return i18n( i18nService, indicatorGroupSetStore.get( id ) );
}
-
+
public IndicatorGroupSet getIndicatorGroupSet( int id, boolean i18nGroups )
{
IndicatorGroupSet groupSet = getIndicatorGroupSet( id );
-
+
if ( i18nGroups )
{
i18n( i18nService, groupSet.getMembers() );
}
-
+
return groupSet;
}
@@ -414,9 +410,9 @@
return i18n( i18nService, indicatorGroupSetStore.getByUid( uid ) );
}
- public IndicatorGroupSet getIndicatorGroupSetByName( String name )
+ public List<IndicatorGroupSet> getIndicatorGroupSetByName( String name )
{
- return i18n( i18nService, indicatorGroupSetStore.getByName( name ) );
+ return new ArrayList<IndicatorGroupSet>( i18n( i18nService, indicatorGroupSetStore.getAllEqName( name ) ) );
}
@Override
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2013-02-04 18:03:10 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2013-02-07 10:25:34 +0000
@@ -511,6 +511,11 @@
executeSql( "ALTER TABLE orgunitgroup DROP CONSTRAINT orgunitgroup_name_key" );
executeSql( "ALTER TABLE orgunitgroupset DROP CONSTRAINT orgunitgroupset_name_key" );
+ executeSql( "ALTER TABLE indicator DROP CONSTRAINT indicator_name_key" );
+ executeSql( "ALTER TABLE indicator DROP CONSTRAINT indicator_shortname_key" );
+ executeSql( "ALTER TABLE indicatorgroup DROP CONSTRAINT indicatorgroup_name_key" );
+ executeSql( "ALTER TABLE indicatorgroupset DROP CONSTRAINT indicatorgroupset_name_key" );
+
log.info( "Tables updated" );
}
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/attribute/hibernate/Attribute.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/attribute/hibernate/Attribute.hbm.xml 2012-06-01 11:35:55 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/attribute/hibernate/Attribute.hbm.xml 2013-02-07 10:25:34 +0000
@@ -15,6 +15,8 @@
</id>
&identifiableProperties;
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
+
<property name="valueType" not-null="true" />
<property name="mandatory" not-null="true" />
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/common/identifiableProperties.hbm'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/common/identifiableProperties.hbm 2012-12-13 14:23:40 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/common/identifiableProperties.hbm 2013-02-07 10:25:34 +0000
@@ -1,4 +1,3 @@
- <property name="name" column="name" not-null="true" unique="true" length="230" />
<property name="uid" column="uid" unique="true" length="11" />
<property name="code" column="code" not-null="false" unique="true" length="50" />
<property name="created" type="timestamp"/>
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/concept/hibernate/Concept.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/concept/hibernate/Concept.hbm.xml 2011-11-03 01:02:13 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/concept/hibernate/Concept.hbm.xml 2013-02-07 10:25:34 +0000
@@ -13,5 +13,7 @@
</id>
&identifiableProperties;
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
+
</class>
</hibernate-mapping>
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/constant/hibernate/Constant.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/constant/hibernate/Constant.hbm.xml 2012-04-02 17:23:48 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/constant/hibernate/Constant.hbm.xml 2013-02-07 10:25:34 +0000
@@ -15,6 +15,8 @@
</id>
&identifiableProperties;
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
+
<property name="value" />
</class>
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/datadictionary/hibernate/DataDictionary.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/datadictionary/hibernate/DataDictionary.hbm.xml 2013-01-22 12:09:12 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/datadictionary/hibernate/DataDictionary.hbm.xml 2013-02-07 10:25:34 +0000
@@ -15,6 +15,8 @@
</id>
&identifiableProperties;
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
+
<property name="description" type="text" />
<property name="region" />
=== 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 2013-01-30 03:20:49 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElement.hbm.xml 2013-02-07 10:25:34 +0000
@@ -15,6 +15,8 @@
</id>
&identifiableProperties;
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
+
<property name="shortName" column="shortname" not-null="true" unique="true" length="50" />
<property name="description" type="text" />
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategory.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategory.hbm.xml 2011-11-03 01:02:13 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategory.hbm.xml 2013-02-07 10:25:34 +0000
@@ -15,6 +15,8 @@
</id>
&identifiableProperties;
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
+
<many-to-one name="concept" class="org.hisp.dhis.concept.Concept" column="conceptid"
foreign-key="fk_dataelementcategory_conceptid" />
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategoryCombo.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategoryCombo.hbm.xml 2012-11-07 14:39:18 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategoryCombo.hbm.xml 2013-02-07 10:25:34 +0000
@@ -15,6 +15,8 @@
</id>
&identifiableProperties;
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
+
<list name="categories" table="categorycombos_categories">
<cache usage="read-write" />
<key column="categorycomboid" foreign-key="fk_categorycombos_categories_categorycomboid" />
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategoryOption.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategoryOption.hbm.xml 2011-11-23 16:57:44 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategoryOption.hbm.xml 2013-02-07 10:25:34 +0000
@@ -15,6 +15,8 @@
</id>
&identifiableProperties;
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
+
<many-to-one name="concept" class="org.hisp.dhis.concept.Concept" column="conceptid"
foreign-key="fk_dataelementcategory_conceptid" />
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementGroup.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementGroup.hbm.xml 2013-01-22 13:37:45 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementGroup.hbm.xml 2013-02-07 10:25:34 +0000
@@ -15,6 +15,8 @@
</id>
&identifiableProperties;
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
+
<set name="members" table="dataelementgroupmembers">
<cache usage="read-write" />
<key column="dataelementgroupid" foreign-key="fk_dataelementgroupmembers_dataelementgroupid" />
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementGroupSet.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementGroupSet.hbm.xml 2013-01-22 13:37:45 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementGroupSet.hbm.xml 2013-02-07 10:25:34 +0000
@@ -15,6 +15,8 @@
</id>
&identifiableProperties;
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
+
<property name="description" />
<property name="compulsory" />
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataset/hibernate/DataSet.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataset/hibernate/DataSet.hbm.xml 2013-01-21 14:03:42 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataset/hibernate/DataSet.hbm.xml 2013-02-07 10:25:34 +0000
@@ -15,6 +15,8 @@
</id>
&identifiableProperties;
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
+
<property name="shortName" unique="true" length="50" />
<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 2013-01-30 03:20:49 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/indicator/hibernate/Indicator.hbm.xml 2013-02-07 10:25:34 +0000
@@ -15,7 +15,9 @@
</id>
&identifiableProperties;
- <property name="shortName" column="shortname" not-null="true" unique="true" length="50" />
+ <property name="name" column="name" not-null="true" unique="false" length="230" />
+
+ <property name="shortName" column="shortname" not-null="true" unique="false" length="50" />
<property name="description" type="text" />
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/indicator/hibernate/IndicatorGroup.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/indicator/hibernate/IndicatorGroup.hbm.xml 2013-01-22 15:07:52 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/indicator/hibernate/IndicatorGroup.hbm.xml 2013-02-07 10:25:34 +0000
@@ -15,6 +15,8 @@
</id>
&identifiableProperties;
+ <property name="name" column="name" not-null="true" unique="false" length="230" />
+
<set name="members" table="indicatorgroupmembers">
<cache usage="read-write" />
<key column="indicatorgroupid" foreign-key="fk_indicatorgroupmembers_indicatorgroupid" />
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/indicator/hibernate/IndicatorGroupSet.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/indicator/hibernate/IndicatorGroupSet.hbm.xml 2013-01-22 15:07:52 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/indicator/hibernate/IndicatorGroupSet.hbm.xml 2013-02-07 10:25:34 +0000
@@ -15,6 +15,8 @@
</id>
&identifiableProperties;
+ <property name="name" column="name" not-null="true" unique="false" length="230" />
+
<property name="description" />
<property name="compulsory" />
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/indicator/hibernate/IndicatorType.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/indicator/hibernate/IndicatorType.hbm.xml 2011-11-03 01:02:13 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/indicator/hibernate/IndicatorType.hbm.xml 2013-02-07 10:25:34 +0000
@@ -15,6 +15,8 @@
</id>
&identifiableProperties;
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
+
<property name="factor" column="indicatorfactor" not-null="true" />
<property name="number" column="indicatornumber" />
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/mapping/hibernate/MapLayer.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/mapping/hibernate/MapLayer.hbm.xml 2012-10-24 16:19:29 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/mapping/hibernate/MapLayer.hbm.xml 2013-02-07 10:25:34 +0000
@@ -13,6 +13,8 @@
</id>
&identifiableProperties;
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
+
<property name="type" column="type" />
<property name="url" column="url" type="text" />
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/mapping/hibernate/MapLegendSet.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/mapping/hibernate/MapLegendSet.hbm.xml 2012-10-25 08:23:30 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/mapping/hibernate/MapLegendSet.hbm.xml 2013-02-07 10:25:34 +0000
@@ -13,6 +13,8 @@
</id>
&identifiableProperties;
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
+
<property name="symbolizer" column="symbolizer" />
<set name="mapLegends" table="maplegendsetmaplegend">
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/option/hibernate/OptionSet.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/option/hibernate/OptionSet.hbm.xml 2012-04-17 08:04:52 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/option/hibernate/OptionSet.hbm.xml 2013-02-07 10:25:34 +0000
@@ -1,9 +1,9 @@
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
- "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
- "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"
- [<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
- >
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"
+ [<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
+ >
<hibernate-mapping>
<class name="org.hisp.dhis.option.OptionSet" table="optionset">
@@ -15,6 +15,8 @@
</id>
&identifiableProperties;
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
+
<list name="options" table="optionsetmembers">
<cache usage="read-write" />
<key column="optionsetid" foreign-key="fk_optionsetmembers_optionsetid" />
=== 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 2013-02-04 18:03:10 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnit.hbm.xml 2013-02-07 10:25:34 +0000
@@ -15,6 +15,10 @@
</id>
&identifiableProperties;
+ <property name="name" column="name" not-null="true" unique="false" length="230" />
+
+ <property name="shortName" column="shortname" not-null="true" unique="false" length="50" />
+
<set name="children" inverse="true">
<cache usage="read-write" />
<key column="parentid" />
@@ -26,7 +30,6 @@
<property name="uuid" unique="true" length="36"/>
- <property name="shortName" column="shortname" not-null="true" unique="false" length="50" />
<property name="description" type="text" />
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnitGroup.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnitGroup.hbm.xml 2012-10-24 13:47:13 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnitGroup.hbm.xml 2013-02-07 10:25:34 +0000
@@ -15,6 +15,8 @@
</id>
&identifiableProperties;
+ <property name="name" column="name" not-null="true" unique="false" length="230" />
+
<property name="symbol" />
<set name="members" table="orgunitgroupmembers">
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnitGroupSet.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnitGroupSet.hbm.xml 2011-11-03 01:02:13 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnitGroupSet.hbm.xml 2013-02-07 10:25:34 +0000
@@ -15,6 +15,8 @@
</id>
&identifiableProperties;
+ <property name="name" column="name" not-null="true" unique="false" length="230" />
+
<property name="description" />
<property name="compulsory" not-null="true" />
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnitLevel.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnitLevel.hbm.xml 2011-11-03 01:02:13 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnitLevel.hbm.xml 2013-02-07 10:25:34 +0000
@@ -3,7 +3,7 @@
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"
[<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
->
+ >
<hibernate-mapping>
<class name="org.hisp.dhis.organisationunit.OrganisationUnitLevel" table="orgunitlevel">
@@ -12,7 +12,9 @@
<generator class="native" />
</id>
&identifiableProperties;
-
+
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
+
<property name="level" not-null="true" unique="true" />
</class>
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/UserAuthorityGroup.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/UserAuthorityGroup.hbm.xml 2012-12-13 11:53:32 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/UserAuthorityGroup.hbm.xml 2013-02-07 10:25:34 +0000
@@ -13,6 +13,8 @@
</id>
&identifiableProperties;
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
+
<property name="description" />
<set name="members" table="userrolemembers" inverse="true">
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/UserGroup.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/UserGroup.hbm.xml 2013-01-30 04:56:16 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/UserGroup.hbm.xml 2013-02-07 10:25:34 +0000
@@ -13,6 +13,8 @@
</id>
&identifiableProperties;
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
+
<set name="members" table="usergroupmembers">
<key column="usergroupid" foreign-key="fk_usergroupmembers_usergroupid" />
<many-to-many column="userid" class="org.hisp.dhis.user.User" foreign-key="fk_usergroup_userid" />
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/validation/hibernate/ValidationRule.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/validation/hibernate/ValidationRule.hbm.xml 2011-11-03 01:02:13 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/validation/hibernate/ValidationRule.hbm.xml 2013-02-07 10:25:34 +0000
@@ -15,6 +15,8 @@
</id>
&identifiableProperties;
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
+
<property name="description" type="text" />
<property name="type" />
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/validation/hibernate/ValidationRuleGroup.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/validation/hibernate/ValidationRuleGroup.hbm.xml 2011-11-03 01:02:13 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/validation/hibernate/ValidationRuleGroup.hbm.xml 2013-02-07 10:25:34 +0000
@@ -15,6 +15,8 @@
</id>
&identifiableProperties;
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
+
<property name="description" type="text" />
<set name="members" table="validationrulegroupmembers">
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/help/HelpManagerTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/help/HelpManagerTest.java 2012-02-02 20:01:36 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/help/HelpManagerTest.java 2013-02-07 10:25:34 +0000
@@ -27,14 +27,13 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import java.io.ByteArrayOutputStream;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hisp.dhis.DhisSpringTest;
-import org.hisp.dhis.help.HelpManager;
import org.junit.Test;
+import java.io.ByteArrayOutputStream;
+
/**
* @author Lars Helge Overland
*/
@@ -42,9 +41,9 @@
extends DhisSpringTest
{
private static final Log log = LogFactory.getLog( HelpManagerTest.class );
-
+
private HelpManager helpManager;
-
+
@Override
public void setUpTest()
{
@@ -55,19 +54,19 @@
public void testGetEmbeddedHelpContent()
{
ByteArrayOutputStream out = new ByteArrayOutputStream();
-
+
helpManager.getHelpContent( out, "overview" );
-
- log.debug( out.toString() );
+
+ log.debug( out.toString() );
}
-
+
@Test
public void testGetHelpCenterContent()
{
ByteArrayOutputStream out = new ByteArrayOutputStream();
-
+
helpManager.getHelpItems( out );
-
- log.debug( out.toString() );
+
+ log.debug( out.toString() );
}
}
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/indicator/IndicatorGroupStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/indicator/IndicatorGroupStoreTest.java 2012-11-20 17:04:08 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/indicator/IndicatorGroupStoreTest.java 2013-02-07 10:25:34 +0000
@@ -27,58 +27,45 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.util.Collection;
-
import org.hisp.dhis.DhisSpringTest;
import org.hisp.dhis.common.GenericIdentifiableObjectStore;
import org.junit.Test;
+import java.util.Collection;
+
+import static org.junit.Assert.*;
+
/**
* @author Lars Helge Overland
* @version $Id$
*/
-@SuppressWarnings( "unchecked" )
+@SuppressWarnings("unchecked")
public class IndicatorGroupStoreTest
extends DhisSpringTest
{
private GenericIdentifiableObjectStore<IndicatorGroup> indicatorGroupStore;
-
+
@Override
public void setUpTest()
{
indicatorGroupStore = (GenericIdentifiableObjectStore<IndicatorGroup>) getBean( "org.hisp.dhis.indicator.IndicatorGroupStore" );
}
-
+
@Test
public void testAddIndicatorGroup()
throws Exception
- {
+ {
IndicatorGroup groupA = new IndicatorGroup( "IndicatorGroupA" );
IndicatorGroup groupB = new IndicatorGroup( "IndicatorGroupB" );
IndicatorGroup groupC = new IndicatorGroup( "IndicatorGroupA" );
-
+
int idA = indicatorGroupStore.save( groupA );
int idB = indicatorGroupStore.save( groupB );
-
- try
- {
- indicatorGroupStore.save( groupC );
- fail( "Expected unique constraint exception" );
- }
- catch ( Exception ex )
- {
- }
groupA = indicatorGroupStore.get( idA );
assertNotNull( groupA );
assertEquals( idA, groupA.getId() );
-
+
groupB = indicatorGroupStore.get( idB );
assertNotNull( groupB );
assertEquals( idB, groupB.getId() );
@@ -92,7 +79,7 @@
int idA = indicatorGroupStore.save( groupA );
groupA = indicatorGroupStore.get( idA );
assertEquals( groupA.getName(), "IndicatorGroupA" );
-
+
groupA.setName( "IndicatorGroupB" );
indicatorGroupStore.update( groupA );
groupA = indicatorGroupStore.get( idA );
@@ -106,13 +93,13 @@
{
IndicatorGroup groupA = new IndicatorGroup( "IndicatorGroupA" );
IndicatorGroup groupB = new IndicatorGroup( "IndicatorGroupB" );
-
+
int idA = indicatorGroupStore.save( groupA );
int idB = indicatorGroupStore.save( groupB );
-
+
assertNotNull( indicatorGroupStore.get( idA ) );
assertNotNull( indicatorGroupStore.get( idB ) );
-
+
indicatorGroupStore.delete( groupA );
assertNull( indicatorGroupStore.get( idA ) );
@@ -121,7 +108,7 @@
indicatorGroupStore.delete( groupB );
assertNull( indicatorGroupStore.get( idA ) );
- assertNull( indicatorGroupStore.get( idB ) );
+ assertNull( indicatorGroupStore.get( idB ) );
}
@Test
@@ -130,12 +117,12 @@
{
IndicatorGroup groupA = new IndicatorGroup( "IndicatorGroupA" );
IndicatorGroup groupB = new IndicatorGroup( "IndicatorGroupB" );
-
+
indicatorGroupStore.save( groupA );
indicatorGroupStore.save( groupB );
-
+
Collection<IndicatorGroup> groups = indicatorGroupStore.getAll();
-
+
assertEquals( groups.size(), 2 );
assertTrue( groups.contains( groupA ) );
assertTrue( groups.contains( groupB ) );
@@ -147,17 +134,17 @@
{
IndicatorGroup groupA = new IndicatorGroup( "IndicatorGroupA" );
IndicatorGroup groupB = new IndicatorGroup( "IndicatorGroupB" );
-
+
int idA = indicatorGroupStore.save( groupA );
int idB = indicatorGroupStore.save( groupB );
-
+
assertNotNull( indicatorGroupStore.get( idA ) );
assertNotNull( indicatorGroupStore.get( idB ) );
-
+
groupA = indicatorGroupStore.getByName( "IndicatorGroupA" );
assertNotNull( groupA );
assertEquals( groupA.getId(), idA );
-
+
IndicatorGroup groupC = indicatorGroupStore.getByName( "IndicatorGroupC" );
assertNull( groupC );
}
=== 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 2012-11-20 17:04:08 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/indicator/IndicatorServiceTest.java 2013-02-07 10:25:34 +0000
@@ -27,17 +27,14 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import org.hisp.dhis.DhisSpringTest;
+import org.junit.Test;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
-import org.hisp.dhis.DhisSpringTest;
-import org.junit.Test;
+import static org.junit.Assert.*;
/**
* @author Lars Helge Overland
@@ -62,7 +59,7 @@
// -------------------------------------------------------------------------
// Support methods
// -------------------------------------------------------------------------
-
+
private void assertEq( char uniqueCharacter, Indicator indicator )
{
assertEquals( "Indicator" + uniqueCharacter, indicator.getName() );
@@ -70,7 +67,7 @@
assertEquals( "IndicatorCode" + uniqueCharacter, indicator.getCode() );
assertEquals( "IndicatorDescription" + uniqueCharacter, indicator.getDescription() );
}
-
+
// -------------------------------------------------------------------------
// IndicatorType
// -------------------------------------------------------------------------
@@ -81,14 +78,14 @@
{
IndicatorType typeA = new IndicatorType( "IndicatorTypeA", 100, false );
IndicatorType typeB = new IndicatorType( "IndicatorTypeB", 1, false );
-
+
int idA = indicatorService.addIndicatorType( typeA );
int idB = indicatorService.addIndicatorType( typeB );
-
+
typeA = indicatorService.getIndicatorType( idA );
assertNotNull( typeA );
assertEquals( idA, typeA.getId() );
-
+
typeB = indicatorService.getIndicatorType( idB );
assertNotNull( typeB );
assertEquals( idB, typeB.getId() );
@@ -102,7 +99,7 @@
int idA = indicatorService.addIndicatorType( typeA );
typeA = indicatorService.getIndicatorType( idA );
assertEquals( typeA.getName(), "IndicatorTypeA" );
-
+
typeA.setName( "IndicatorTypeB" );
indicatorService.updateIndicatorType( typeA );
typeA = indicatorService.getIndicatorType( idA );
@@ -116,13 +113,13 @@
{
IndicatorType typeA = new IndicatorType( "IndicatorTypeA", 100, false );
IndicatorType typeB = new IndicatorType( "IndicatorTypeB", 1, false );
-
+
int idA = indicatorService.addIndicatorType( typeA );
int idB = indicatorService.addIndicatorType( typeB );
-
+
assertNotNull( indicatorService.getIndicatorType( idA ) );
assertNotNull( indicatorService.getIndicatorType( idB ) );
-
+
indicatorService.deleteIndicatorType( typeA );
assertNull( indicatorService.getIndicatorType( idA ) );
@@ -131,7 +128,7 @@
indicatorService.deleteIndicatorType( typeB );
assertNull( indicatorService.getIndicatorType( idA ) );
- assertNull( indicatorService.getIndicatorType( idB ) );
+ assertNull( indicatorService.getIndicatorType( idB ) );
}
@Test
@@ -140,12 +137,12 @@
{
IndicatorType typeA = new IndicatorType( "IndicatorTypeA", 100, false );
IndicatorType typeB = new IndicatorType( "IndicatorTypeB", 1, false );
-
+
indicatorService.addIndicatorType( typeA );
indicatorService.addIndicatorType( typeB );
-
+
Collection<IndicatorType> types = indicatorService.getAllIndicatorTypes();
-
+
assertEquals( types.size(), 2 );
assertTrue( types.contains( typeA ) );
assertTrue( types.contains( typeB ) );
@@ -157,21 +154,21 @@
{
IndicatorType typeA = new IndicatorType( "IndicatorTypeA", 100, false );
IndicatorType typeB = new IndicatorType( "IndicatorTypeB", 1, false );
-
+
int idA = indicatorService.addIndicatorType( typeA );
int idB = indicatorService.addIndicatorType( typeB );
-
+
assertNotNull( indicatorService.getIndicatorType( idA ) );
assertNotNull( indicatorService.getIndicatorType( idB ) );
-
+
typeA = indicatorService.getIndicatorTypeByName( "IndicatorTypeA" );
assertNotNull( typeA );
assertEquals( typeA.getId(), idA );
-
+
IndicatorType typeC = indicatorService.getIndicatorTypeByName( "IndicatorTypeC" );
assertNull( typeC );
}
-
+
// -------------------------------------------------------------------------
// IndicatorGroup
// -------------------------------------------------------------------------
@@ -182,14 +179,14 @@
{
IndicatorGroup groupA = new IndicatorGroup( "IndicatorGroupA" );
IndicatorGroup groupB = new IndicatorGroup( "IndicatorGroupB" );
-
+
int idA = indicatorService.addIndicatorGroup( groupA );
int idB = indicatorService.addIndicatorGroup( groupB );
-
+
groupA = indicatorService.getIndicatorGroup( idA );
assertNotNull( groupA );
assertEquals( idA, groupA.getId() );
-
+
groupB = indicatorService.getIndicatorGroup( idB );
assertNotNull( groupB );
assertEquals( idB, groupB.getId() );
@@ -203,7 +200,7 @@
int idA = indicatorService.addIndicatorGroup( groupA );
groupA = indicatorService.getIndicatorGroup( idA );
assertEquals( groupA.getName(), "IndicatorGroupA" );
-
+
groupA.setName( "IndicatorGroupB" );
indicatorService.updateIndicatorGroup( groupA );
groupA = indicatorService.getIndicatorGroup( idA );
@@ -217,13 +214,13 @@
{
IndicatorGroup groupA = new IndicatorGroup( "IndicatorGroupA" );
IndicatorGroup groupB = new IndicatorGroup( "IndicatorGroupB" );
-
+
int idA = indicatorService.addIndicatorGroup( groupA );
int idB = indicatorService.addIndicatorGroup( groupB );
-
+
assertNotNull( indicatorService.getIndicatorGroup( idA ) );
assertNotNull( indicatorService.getIndicatorGroup( idB ) );
-
+
indicatorService.deleteIndicatorGroup( groupA );
assertNull( indicatorService.getIndicatorGroup( idA ) );
@@ -232,7 +229,7 @@
indicatorService.deleteIndicatorGroup( groupB );
assertNull( indicatorService.getIndicatorGroup( idA ) );
- assertNull( indicatorService.getIndicatorGroup( idB ) );
+ assertNull( indicatorService.getIndicatorGroup( idB ) );
}
@Test
@@ -241,12 +238,12 @@
{
IndicatorGroup groupA = new IndicatorGroup( "IndicatorGroupA" );
IndicatorGroup groupB = new IndicatorGroup( "IndicatorGroupB" );
-
+
indicatorService.addIndicatorGroup( groupA );
indicatorService.addIndicatorGroup( groupB );
-
+
Collection<IndicatorGroup> groups = indicatorService.getAllIndicatorGroups();
-
+
assertEquals( groups.size(), 2 );
assertTrue( groups.contains( groupA ) );
assertTrue( groups.contains( groupB ) );
@@ -258,19 +255,18 @@
{
IndicatorGroup groupA = new IndicatorGroup( "IndicatorGroupA" );
IndicatorGroup groupB = new IndicatorGroup( "IndicatorGroupB" );
-
+
int idA = indicatorService.addIndicatorGroup( groupA );
int idB = indicatorService.addIndicatorGroup( groupB );
-
+
assertNotNull( indicatorService.getIndicatorGroup( idA ) );
assertNotNull( indicatorService.getIndicatorGroup( idB ) );
-
- groupA = indicatorService.getIndicatorGroupByName( "IndicatorGroupA" );
+
+ groupA = indicatorService.getIndicatorGroupByName( "IndicatorGroupA" ).get( 0 );
assertNotNull( groupA );
assertEquals( groupA.getId(), idA );
-
- IndicatorGroup groupC = indicatorService.getIndicatorGroupByName( "IndicatorGroupC" );
- assertNull( groupC );
+
+ assertTrue( indicatorService.getIndicatorGroupByName( "IndicatorGroupC" ).isEmpty() );
}
@Test
@@ -314,16 +310,16 @@
indicatorService.addIndicatorGroup( indicatorGroup4 );
Collection<IndicatorGroup> groups1 = indicatorService.getGroupsContainingIndicator( indicator1 );
-
+
assertTrue( groups1.size() == 4 );
Collection<IndicatorGroup> groups2 = indicatorService.getGroupsContainingIndicator( indicator2 );
-
+
assertTrue( groups2.size() == 2 );
assertTrue( groups2.contains( indicatorGroup1 ) );
assertTrue( groups2.contains( indicatorGroup3 ) );
}
-
+
// -------------------------------------------------------------------------
// Indicator
// -------------------------------------------------------------------------
@@ -333,19 +329,19 @@
throws Exception
{
IndicatorType type = new IndicatorType( "IndicatorType", 100, false );
-
+
indicatorService.addIndicatorType( type );
-
+
Indicator indicatorA = createIndicator( 'A', type );
Indicator indicatorB = createIndicator( 'B', type );
-
+
int idA = indicatorService.addIndicator( indicatorA );
int idB = indicatorService.addIndicator( indicatorB );
-
+
indicatorA = indicatorService.getIndicator( idA );
assertNotNull( indicatorA );
assertEq( 'A', indicatorA );
-
+
indicatorB = indicatorService.getIndicator( idB );
assertNotNull( indicatorB );
assertEq( 'B', indicatorB );
@@ -358,12 +354,12 @@
IndicatorType type = new IndicatorType( "IndicatorType", 100, false );
indicatorService.addIndicatorType( type );
-
+
Indicator indicatorA = createIndicator( 'A', type );
int idA = indicatorService.addIndicator( indicatorA );
indicatorA = indicatorService.getIndicator( idA );
assertEq( 'A', indicatorA );
-
+
indicatorA.setName( "IndicatorB" );
indicatorService.updateIndicator( indicatorA );
indicatorA = indicatorService.getIndicator( idA );
@@ -378,16 +374,16 @@
IndicatorType type = new IndicatorType( "IndicatorType", 100, false );
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 ) );
-
+
indicatorService.deleteIndicator( indicatorA );
assertNull( indicatorService.getIndicator( idA ) );
@@ -396,7 +392,7 @@
indicatorService.deleteIndicator( indicatorB );
assertNull( indicatorService.getIndicator( idA ) );
- assertNull( indicatorService.getIndicator( idB ) );
+ assertNull( indicatorService.getIndicator( idB ) );
}
@Test
@@ -406,15 +402,15 @@
IndicatorType type = new IndicatorType( "IndicatorType", 100, false );
indicatorService.addIndicatorType( type );
-
+
Indicator indicatorA = createIndicator( 'A', type );
Indicator indicatorB = createIndicator( 'B', type );
indicatorService.addIndicator( indicatorA );
indicatorService.addIndicator( indicatorB );
-
+
Collection<Indicator> indicators = indicatorService.getAllIndicators();
-
+
assertEquals( indicators.size(), 2 );
assertTrue( indicators.contains( indicatorA ) );
assertTrue( indicators.contains( indicatorB ) );
@@ -427,23 +423,22 @@
IndicatorType type = new IndicatorType( "IndicatorType", 100, false );
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.getIndicatorByName( "IndicatorA" );
+
+ indicatorA = indicatorService.getIndicatorByName( "IndicatorA" ).get( 0 );
assertNotNull( indicatorA );
assertEq( 'A', indicatorA );
-
- Indicator indicatorC = indicatorService.getIndicatorByName( "IndicatorC" );
- assertNull( indicatorC );
- }
+
+ assertTrue( indicatorService.getIndicatorByName( "IndicatorC" ).isEmpty() );
+ }
@Test
public void testGetIndicatorByShortName()
@@ -452,21 +447,20 @@
IndicatorType type = new IndicatorType( "IndicatorType", 100, false );
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.getIndicatorByShortName( "IndicatorShortA" );
+
+ indicatorA = indicatorService.getIndicatorByShortName( "IndicatorShortA" ).get( 0 );
assertNotNull( indicatorA );
assertEq( 'A', indicatorA );
-
- Indicator indicatorC = indicatorService.getIndicatorByShortName( "IndicatorShortC" );
- assertNull( indicatorC );
+
+ assertTrue( indicatorService.getIndicatorByShortName( "IndicatorShortC" ).isEmpty() );
}
}
=== 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 2012-11-20 17:04:08 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/indicator/IndicatorStoreTest.java 2013-02-07 10:25:34 +0000
@@ -27,18 +27,14 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.util.Collection;
-
import org.hisp.dhis.DhisSpringTest;
import org.hisp.dhis.common.GenericIdentifiableObjectStore;
import org.junit.Test;
+import java.util.Collection;
+
+import static org.junit.Assert.*;
+
/**
* @author Lars Helge Overland
* @version $Id: IndicatorStoreTest.java 3286 2007-05-07 18:05:21Z larshelg $
@@ -48,7 +44,7 @@
extends DhisSpringTest
{
private IndicatorStore indicatorStore;
-
+
private GenericIdentifiableObjectStore<IndicatorType> indicatorTypeStore;
// -------------------------------------------------------------------------
@@ -60,9 +56,9 @@
throws Exception
{
indicatorStore = (IndicatorStore) getBean( IndicatorStore.ID );
-
+
indicatorTypeStore = (GenericIdentifiableObjectStore<IndicatorType>) getBean( "org.hisp.dhis.indicator.IndicatorTypeStore" );
-
+
indicatorService = (IndicatorService) getBean( IndicatorService.ID );
}
@@ -77,7 +73,7 @@
assertEquals( "IndicatorCode" + uniqueCharacter, indicator.getCode() );
assertEquals( "IndicatorDescription" + uniqueCharacter, indicator.getDescription() );
}
-
+
// -------------------------------------------------------------------------
// IndicatorType
// -------------------------------------------------------------------------
@@ -85,27 +81,18 @@
@Test
public void testAddIndicatorType()
throws Exception
- {
+ {
IndicatorType typeA = new IndicatorType( "IndicatorTypeA", 100, false );
IndicatorType typeB = new IndicatorType( "IndicatorTypeB", 1, false );
IndicatorType typeC = new IndicatorType( "IndicatorTypeA", 100, false );
-
+
int idA = indicatorTypeStore.save( typeA );
int idB = indicatorTypeStore.save( typeB );
-
- try
- {
- indicatorTypeStore.save( typeC );
- fail( "Expected unique constraint exception" );
- }
- catch ( Exception ex )
- {
- }
typeA = indicatorTypeStore.get( idA );
assertNotNull( typeA );
assertEquals( idA, typeA.getId() );
-
+
typeB = indicatorTypeStore.get( idB );
assertNotNull( typeB );
assertEquals( idB, typeB.getId() );
@@ -119,7 +106,7 @@
int idA = indicatorTypeStore.save( typeA );
typeA = indicatorTypeStore.get( idA );
assertEquals( typeA.getName(), "IndicatorTypeA" );
-
+
typeA.setName( "IndicatorTypeB" );
indicatorTypeStore.update( typeA );
typeA = indicatorTypeStore.get( idA );
@@ -133,13 +120,13 @@
{
IndicatorType typeA = new IndicatorType( "IndicatorTypeA", 100, false );
IndicatorType typeB = new IndicatorType( "IndicatorTypeB", 1, false );
-
+
int idA = indicatorTypeStore.save( typeA );
int idB = indicatorTypeStore.save( typeB );
-
+
assertNotNull( indicatorTypeStore.get( idA ) );
assertNotNull( indicatorTypeStore.get( idB ) );
-
+
indicatorTypeStore.delete( typeA );
assertNull( indicatorTypeStore.get( idA ) );
@@ -148,7 +135,7 @@
indicatorTypeStore.delete( typeB );
assertNull( indicatorTypeStore.get( idA ) );
- assertNull( indicatorTypeStore.get( idB ) );
+ assertNull( indicatorTypeStore.get( idB ) );
}
@Test
@@ -157,12 +144,12 @@
{
IndicatorType typeA = new IndicatorType( "IndicatorTypeA", 100, false );
IndicatorType typeB = new IndicatorType( "IndicatorTypeB", 1, false );
-
+
indicatorTypeStore.save( typeA );
indicatorTypeStore.save( typeB );
-
+
Collection<IndicatorType> types = indicatorTypeStore.getAll();
-
+
assertEquals( types.size(), 2 );
assertTrue( types.contains( typeA ) );
assertTrue( types.contains( typeB ) );
@@ -174,22 +161,22 @@
{
IndicatorType typeA = new IndicatorType( "IndicatorTypeA", 100, false );
IndicatorType typeB = new IndicatorType( "IndicatorTypeB", 1, false );
-
+
int idA = indicatorTypeStore.save( typeA );
int idB = indicatorTypeStore.save( typeB );
-
+
assertNotNull( indicatorTypeStore.get( idA ) );
assertNotNull( indicatorTypeStore.get( idB ) );
-
+
typeA = indicatorTypeStore.getByName( "IndicatorTypeA" );
assertNotNull( typeA );
assertEquals( typeA.getId(), idA );
-
+
IndicatorType typeC = indicatorTypeStore.getByName( "IndicatorTypeC" );
assertNull( typeC );
}
-
-
+
+
// -------------------------------------------------------------------------
// Indicator
// -------------------------------------------------------------------------
@@ -197,31 +184,22 @@
@Test
public void testAddIndicator()
throws Exception
- {
+ {
IndicatorType type = new IndicatorType( "IndicatorType", 100, false );
-
+
indicatorTypeStore.save( type );
-
+
Indicator indicatorA = createIndicator( 'A', type );
Indicator indicatorB = createIndicator( 'B', type );
Indicator indicatorC = createIndicator( 'A', type );
-
+
int idA = indicatorStore.save( indicatorA );
int idB = indicatorStore.save( indicatorB );
-
- try
- {
- indicatorStore.save( indicatorC );
- fail( "Expected unique constraint exception" );
- }
- catch ( Exception ex )
- {
- }
indicatorA = indicatorStore.get( idA );
assertNotNull( indicatorA );
assertEq( 'A', indicatorA );
-
+
indicatorB = indicatorStore.get( idB );
assertNotNull( indicatorB );
assertEq( 'B', indicatorB );
@@ -234,12 +212,12 @@
IndicatorType type = new IndicatorType( "IndicatorType", 100, false );
indicatorTypeStore.save( type );
-
+
Indicator indicatorA = createIndicator( 'A', type );
int idA = indicatorStore.save( indicatorA );
indicatorA = indicatorStore.get( idA );
assertEq( 'A', indicatorA );
-
+
indicatorA.setName( "IndicatorB" );
indicatorStore.update( indicatorA );
indicatorA = indicatorStore.get( idA );
@@ -254,16 +232,16 @@
IndicatorType type = new IndicatorType( "IndicatorType", 100, false );
indicatorTypeStore.save( type );
-
+
Indicator indicatorA = createIndicator( 'A', type );
Indicator indicatorB = createIndicator( 'B', type );
int idA = indicatorStore.save( indicatorA );
int idB = indicatorStore.save( indicatorB );
-
+
assertNotNull( indicatorStore.get( idA ) );
assertNotNull( indicatorStore.get( idB ) );
-
+
indicatorStore.delete( indicatorA );
assertNull( indicatorStore.get( idA ) );
@@ -272,7 +250,7 @@
indicatorStore.delete( indicatorB );
assertNull( indicatorStore.get( idA ) );
- assertNull( indicatorStore.get( idB ) );
+ assertNull( indicatorStore.get( idB ) );
}
@Test
@@ -282,15 +260,15 @@
IndicatorType type = new IndicatorType( "IndicatorType", 100, false );
indicatorTypeStore.save( type );
-
+
Indicator indicatorA = createIndicator( 'A', type );
Indicator indicatorB = createIndicator( 'B', type );
indicatorStore.save( indicatorA );
indicatorStore.save( indicatorB );
-
+
Collection<Indicator> indicators = indicatorStore.getAll();
-
+
assertEquals( indicators.size(), 2 );
assertTrue( indicators.contains( indicatorA ) );
assertTrue( indicators.contains( indicatorB ) );
@@ -303,23 +281,23 @@
IndicatorType type = new IndicatorType( "IndicatorType", 100, false );
indicatorTypeStore.save( type );
-
+
Indicator indicatorA = createIndicator( 'A', type );
Indicator indicatorB = createIndicator( 'B', type );
int idA = indicatorStore.save( indicatorA );
int idB = indicatorStore.save( indicatorB );
-
+
assertNotNull( indicatorStore.get( idA ) );
assertNotNull( indicatorStore.get( idB ) );
-
+
indicatorA = indicatorStore.getByName( "IndicatorA" );
assertNotNull( indicatorA );
assertEq( 'A', indicatorA );
-
+
Indicator indicatorC = indicatorStore.getByName( "IndicatorC" );
assertNull( indicatorC );
- }
+ }
@Test
public void testGetIndicatorByShortName()
@@ -328,20 +306,20 @@
IndicatorType type = new IndicatorType( "IndicatorType", 100, false );
indicatorTypeStore.save( type );
-
+
Indicator indicatorA = createIndicator( 'A', type );
Indicator indicatorB = createIndicator( 'B', type );
-
+
int idA = indicatorStore.save( indicatorA );
int idB = indicatorStore.save( indicatorB );
-
+
assertNotNull( indicatorStore.get( idA ) );
assertNotNull( indicatorStore.get( idB ) );
-
+
indicatorA = indicatorStore.getByShortName( "IndicatorShortA" );
assertNotNull( indicatorA );
assertEq( 'A', indicatorA );
-
+
Indicator indicatorC = indicatorStore.getByShortName( "IndicatorShortC" );
assertNull( indicatorC );
}
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/IndicatorGroupImporter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/IndicatorGroupImporter.java 2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/IndicatorGroupImporter.java 2013-02-07 10:25:34 +0000
@@ -35,6 +35,8 @@
import org.hisp.dhis.indicator.IndicatorGroup;
import org.hisp.dhis.indicator.IndicatorService;
+import java.util.List;
+
/**
* @author Lars Helge Overland
* @version $Id: AbstractIndicatorGroupConverter.java 4646 2008-02-26 14:54:29Z larshelg $
@@ -47,18 +49,18 @@
public IndicatorGroupImporter()
{
}
-
+
public IndicatorGroupImporter( BatchHandler<IndicatorGroup> batchHandler, IndicatorService indicatorService )
{
this.batchHandler = batchHandler;
this.indicatorService = indicatorService;
}
-
+
@Override
public void importObject( IndicatorGroup object, ImportParams params )
{
NameMappingUtil.addIndicatorGroupMapping( object.getId(), object.getName() );
-
+
read( object, GroupMemberType.NONE, params );
}
@@ -72,14 +74,15 @@
protected void importMatching( IndicatorGroup object, IndicatorGroup match )
{
match.setName( object.getName() );
-
+
indicatorService.updateIndicatorGroup( object );
}
@Override
protected IndicatorGroup getMatching( IndicatorGroup object )
{
- return indicatorService.getIndicatorGroupByName( object.getName() );
+ List<IndicatorGroup> indicatorGroupByName = indicatorService.getIndicatorGroupByName( object.getName() );
+ return indicatorGroupByName.isEmpty() ? null : indicatorGroupByName.get( 0 );
}
@Override
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/IndicatorGroupSetImporter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/IndicatorGroupSetImporter.java 2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/IndicatorGroupSetImporter.java 2013-02-07 10:25:34 +0000
@@ -35,6 +35,8 @@
import org.hisp.dhis.indicator.IndicatorGroupSet;
import org.hisp.dhis.indicator.IndicatorService;
+import java.util.List;
+
/**
* @author Lars Helge Overland
* @version $Id$
@@ -47,18 +49,18 @@
public IndicatorGroupSetImporter()
{
}
-
+
public IndicatorGroupSetImporter( BatchHandler<IndicatorGroupSet> batchHandler, IndicatorService indicatorService )
{
this.batchHandler = batchHandler;
this.indicatorService = indicatorService;
}
-
+
@Override
public void importObject( IndicatorGroupSet object, ImportParams params )
{
NameMappingUtil.addIndicatorGroupSetMapping( object.getId(), object.getName() );
-
+
read( object, GroupMemberType.NONE, params );
}
@@ -72,14 +74,15 @@
protected void importMatching( IndicatorGroupSet object, IndicatorGroupSet match )
{
match.setName( object.getName() );
-
+
indicatorService.updateIndicatorGroupSet( match );
}
@Override
protected IndicatorGroupSet getMatching( IndicatorGroupSet object )
{
- return indicatorService.getIndicatorGroupSetByName( object.getName() );
+ List<IndicatorGroupSet> indicatorGroupSetByName = indicatorService.getIndicatorGroupSetByName( object.getName() );
+ return indicatorGroupSetByName.isEmpty() ? null : indicatorGroupSetByName.get( 0 );
}
@Override
=== 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 2012-10-18 13:04:28 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/IndicatorImporter.java 2013-02-07 10:25:34 +0000
@@ -35,6 +35,8 @@
import org.hisp.dhis.indicator.Indicator;
import org.hisp.dhis.indicator.IndicatorService;
+import java.util.List;
+
/**
* @author Lars Helge Overland
* @version $Id: AbstractIndicatorConverter.java 4753 2008-03-14 12:48:50Z larshelg $
@@ -47,18 +49,18 @@
public IndicatorImporter()
{
}
-
+
public IndicatorImporter( BatchHandler<Indicator> batchHandler, IndicatorService indicatorService )
{
this.batchHandler = batchHandler;
this.indicatorService = indicatorService;
}
-
+
@Override
public void importObject( Indicator object, ImportParams params )
{
NameMappingUtil.addIndicatorMapping( object.getId(), object.getName() );
-
+
read( object, GroupMemberType.NONE, params );
}
@@ -81,24 +83,26 @@
match.setDenominator( object.getDenominator() );
match.setDenominatorDescription( object.getDenominatorDescription() );
match.setLastUpdated( object.getLastUpdated() );
-
- indicatorService.updateIndicator( match );
+
+ indicatorService.updateIndicator( match );
}
@Override
protected Indicator getMatching( Indicator object )
{
- Indicator match = indicatorService.getIndicatorByName( object.getName() );
-
+ List<Indicator> indicatorByName = indicatorService.getIndicatorByName( object.getName() );
+ Indicator match = indicatorByName.isEmpty() ? null : indicatorByName.get( 0 );
+
if ( match == null )
{
- match = indicatorService.getIndicatorByShortName( object.getShortName() );
+ List<Indicator> indicatorByShortName = indicatorService.getIndicatorByShortName( object.getShortName() );
+ match = indicatorByShortName.isEmpty() ? null : indicatorByShortName.get( 0 );
}
if ( match == null )
{
match = indicatorService.getIndicatorByCode( object.getCode() );
}
-
+
return match;
}
@@ -113,23 +117,23 @@
{
return false;
}
- if ( !isSimiliar( object.getCode(), existing.getCode() ) || ( isNotNull( object.getCode(), existing.getCode() ) && !object.getCode().equals( existing.getCode() ) ) )
- {
- return false;
- }
- if ( !isSimiliar( object.getDescription(), existing.getDescription() ) || ( isNotNull( object.getDescription(), existing.getDescription() ) && !object.getDescription().equals( existing.getDescription() ) ) )
- {
- return false;
- }
- if ( !isSimiliar( object.getNumeratorDescription(), existing.getNumeratorDescription() ) || ( isNotNull( object.getNumeratorDescription(), existing.getNumeratorDescription() ) && !object.getNumeratorDescription().equals( existing.getNumeratorDescription() ) ) )
- {
- return false;
- }
- if ( !isSimiliar( object.getDenominatorDescription(), existing.getDenominatorDescription() ) || ( isNotNull( object.getDenominatorDescription(), existing.getDenominatorDescription() ) && !object.getDenominatorDescription().equals( existing.getDenominatorDescription() ) ) )
- {
- return false;
- }
-
+ if ( !isSimiliar( object.getCode(), existing.getCode() ) || (isNotNull( object.getCode(), existing.getCode() ) && !object.getCode().equals( existing.getCode() )) )
+ {
+ return false;
+ }
+ if ( !isSimiliar( object.getDescription(), existing.getDescription() ) || (isNotNull( object.getDescription(), existing.getDescription() ) && !object.getDescription().equals( existing.getDescription() )) )
+ {
+ return false;
+ }
+ if ( !isSimiliar( object.getNumeratorDescription(), existing.getNumeratorDescription() ) || (isNotNull( object.getNumeratorDescription(), existing.getNumeratorDescription() ) && !object.getNumeratorDescription().equals( existing.getNumeratorDescription() )) )
+ {
+ return false;
+ }
+ if ( !isSimiliar( object.getDenominatorDescription(), existing.getDenominatorDescription() ) || (isNotNull( object.getDenominatorDescription(), existing.getDenominatorDescription() ) && !object.getDenominatorDescription().equals( existing.getDenominatorDescription() )) )
+ {
+ return false;
+ }
+
return true;
}
}
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/caseaggregation/hibernate/CaseAggregationCondition.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/caseaggregation/hibernate/CaseAggregationCondition.hbm.xml 2013-02-07 08:12:12 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/caseaggregation/hibernate/CaseAggregationCondition.hbm.xml 2013-02-07 10:25:34 +0000
@@ -3,7 +3,7 @@
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"
[<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
->
+ >
<hibernate-mapping>
<class name="org.hisp.dhis.caseaggregation.CaseAggregationCondition" table="caseaggregationcondition">
@@ -11,8 +11,9 @@
<id name="id" column="caseaggregationconditionid">
<generator class="native" />
</id>
-
- &identifiableProperties;
+ &identifiableProperties;
+
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
<property name="operator" not-null="true" />
@@ -23,10 +24,9 @@
<many-to-one name="optionCombo" class="org.hisp.dhis.dataelement.DataElementCategoryOptionCombo" column="optionComboid"
foreign-key="fk_caseaggregationcondition_categoryoptioncomboid" />
-
- <many-to-one name="deSum" class="org.hisp.dhis.dataelement.DataElement" column="deSum"
+
+ <many-to-one name="deSum" class="org.hisp.dhis.dataelement.DataElement" column="deSum"
foreign-key="fk_caseaggregationcondition_deSum" />
-
</class>
</hibernate-mapping>
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientAttribute.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientAttribute.hbm.xml 2012-12-21 09:23:20 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientAttribute.hbm.xml 2013-02-07 10:25:34 +0000
@@ -3,7 +3,7 @@
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"
[<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
->
+ >
<hibernate-mapping>
<class name="org.hisp.dhis.patient.PatientAttribute" table="patientattribute">
@@ -11,15 +11,16 @@
<id name="id" column="patientattributeid">
<generator class="native" />
</id>
-
- &identifiableProperties;
-
+ &identifiableProperties;
+
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
+
<property name="description" />
<property name="valueType" column="valuetype" not-null="true" />
<property name="mandatory" column="mandatory" not-null="true" />
-
+
<property name="groupBy" column="groupby" />
<many-to-one name="patientAttributeGroup" column="patientattributegroupid" class="org.hisp.dhis.patient.PatientAttributeGroup"
@@ -30,9 +31,9 @@
<one-to-many class="org.hisp.dhis.patient.PatientAttributeOption" />
</set>
- <property name="inherit" column="inherit"/>
-
- <property name="expression" column="expression"/>
-
+ <property name="inherit" column="inherit" />
+
+ <property name="expression" column="expression" />
+
</class>
</hibernate-mapping>
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientAttributeGroup.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientAttributeGroup.hbm.xml 2012-02-27 01:07:19 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientAttributeGroup.hbm.xml 2013-02-07 10:25:34 +0000
@@ -3,7 +3,7 @@
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"
[<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
->
+ >
<hibernate-mapping>
<class name="org.hisp.dhis.patient.PatientAttributeGroup" table="patientattributegroup">
@@ -11,13 +11,14 @@
<id name="id" column="patientattributegroupid">
<generator class="native" />
</id>
+ &identifiableProperties;
- &identifiableProperties;
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
<property name="description" />
-
- <property name="sortOrder" />
-
+
+ <property name="sortOrder" />
+
<list name="attributes" table="patientattributegroupmembers">
<key column="patientattributegroupid" />
<list-index column="sort_order" base="1" />
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientIdentifierType.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientIdentifierType.hbm.xml 2012-09-05 14:30:23 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientIdentifierType.hbm.xml 2013-02-07 10:25:34 +0000
@@ -3,7 +3,7 @@
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"
[<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
->
+ >
<hibernate-mapping>
<class name="org.hisp.dhis.patient.PatientIdentifierType" table="patientidentifiertype">
@@ -11,11 +11,12 @@
<id name="id" column="patientidentifiertypeid">
<generator class="native" />
</id>
-
- &identifiableProperties;
-
- <property name="description" not-null="true" />
-
+ &identifiableProperties;
+
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
+
+ <property name="description" not-null="true" />
+
<property name="mandatory" not-null="true" />
<property name="related" not-null="true" />
@@ -23,8 +24,8 @@
<property name="noChars" />
<property name="type" />
-
+
<property name="personDisplayName" />
-
+
</class>
</hibernate-mapping>
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientreport/hibernate/PatientAggregateReport.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientreport/hibernate/PatientAggregateReport.hbm.xml 2013-01-30 09:34:29 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientreport/hibernate/PatientAggregateReport.hbm.xml 2013-02-07 10:25:34 +0000
@@ -1,82 +1,83 @@
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
- "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
- "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"
- [<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
- >
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"
+ [<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
+ >
<hibernate-mapping>
- <class name="org.hisp.dhis.patientreport.PatientAggregateReport"
- table="patientaggregatereport">
-
- <id name="id" column="patientaggregatereportid">
- <generator class="native" />
- </id>
-
- &identifiableProperties;
-
- <many-to-one name="programStage" class="org.hisp.dhis.program.ProgramStage"
- column="programstageid" foreign-key="fk_patientaggregatereport_programstage" />
-
- <list name="startDates" table="patientaggregatereport_startdates">
- <key column="patientaggregatereportid"/>
- <list-index column="sort_order" />
- <element type="date" column="startdate" />
- </list>
-
-
- <list name="endDates" table="patientaggregatereport_enddates">
- <key column="patientaggregatereportid"/>
- <list-index column="sort_order" />
- <element type="date" column="enddate" />
- </list>
-
- <set name="relativePeriods" table="patientaggregatereport_relativeperiods">
- <key column="patientaggregatereportid"
- foreign-key="fk_patientaggregatereportid_relativeperiods" />
- <element type="text" column="relativeperiod" />
- </set>
-
- <list name="fixedPeriods" table="patientaggregatereport_fixedperiods">
- <key column="patientaggregatereportid"/>
- <list-index column="sort_order" />
- <element type="text" column="fixedperiod" />
- </list>
-
- <set name="organisationUnits" table="patientaggregatereport_organisationUnits">
- <key column="patientaggregatereportid" foreign-key="fk_patientaggregatereport_organisationunitid" />
- <many-to-many column="organisationunitid"
- class="org.hisp.dhis.organisationunit.OrganisationUnit" foreign-key="fk_patientaggregatereportid_organisationunit" />
- </set>
-
- <set name="filterValues" table="patientaggregatereport_filtervalues">
- <key column="patientaggregatereportid"
- foreign-key="fk_patientaggregatereportid_filtervalues" />
- <element type="text" column="filtervalue" />
- </set>
-
- <property name="facilityLB" />
-
- <property name="limitRecords" />
-
- <property name="position" />
-
- <many-to-one name="deGroupBy" class="org.hisp.dhis.dataelement.DataElement"
- column="dataelementid" foreign-key="fk_patientaggregatereport_dataelementid" />
-
- <property name="aggregateType" />
-
- <many-to-one name="user" class="org.hisp.dhis.user.User"
- column="userid" foreign-key="fk_patientaggregatereport_userid" />
-
- <property name="useCompletedEvents" />
-
- <property name="userOrganisationUnit" />
-
- <property name="userOrganisationUnitChildren" />
-
- <many-to-one name="deSum" class="org.hisp.dhis.dataelement.DataElement"
- column="desumid" foreign-key="fk_patientaggregatereport_dataelementsumtid" />
-
- </class>
+ <class name="org.hisp.dhis.patientreport.PatientAggregateReport"
+ table="patientaggregatereport">
+
+ <id name="id" column="patientaggregatereportid">
+ <generator class="native" />
+ </id>
+ &identifiableProperties;
+
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
+
+ <many-to-one name="programStage" class="org.hisp.dhis.program.ProgramStage"
+ column="programstageid" foreign-key="fk_patientaggregatereport_programstage" />
+
+ <list name="startDates" table="patientaggregatereport_startdates">
+ <key column="patientaggregatereportid" />
+ <list-index column="sort_order" />
+ <element type="date" column="startdate" />
+ </list>
+
+
+ <list name="endDates" table="patientaggregatereport_enddates">
+ <key column="patientaggregatereportid" />
+ <list-index column="sort_order" />
+ <element type="date" column="enddate" />
+ </list>
+
+ <set name="relativePeriods" table="patientaggregatereport_relativeperiods">
+ <key column="patientaggregatereportid"
+ foreign-key="fk_patientaggregatereportid_relativeperiods" />
+ <element type="text" column="relativeperiod" />
+ </set>
+
+ <list name="fixedPeriods" table="patientaggregatereport_fixedperiods">
+ <key column="patientaggregatereportid" />
+ <list-index column="sort_order" />
+ <element type="text" column="fixedperiod" />
+ </list>
+
+ <set name="organisationUnits" table="patientaggregatereport_organisationUnits">
+ <key column="patientaggregatereportid" foreign-key="fk_patientaggregatereport_organisationunitid" />
+ <many-to-many column="organisationunitid"
+ class="org.hisp.dhis.organisationunit.OrganisationUnit" foreign-key="fk_patientaggregatereportid_organisationunit" />
+ </set>
+
+ <set name="filterValues" table="patientaggregatereport_filtervalues">
+ <key column="patientaggregatereportid"
+ foreign-key="fk_patientaggregatereportid_filtervalues" />
+ <element type="text" column="filtervalue" />
+ </set>
+
+ <property name="facilityLB" />
+
+ <property name="limitRecords" />
+
+ <property name="position" />
+
+ <many-to-one name="deGroupBy" class="org.hisp.dhis.dataelement.DataElement"
+ column="dataelementid" foreign-key="fk_patientaggregatereport_dataelementid" />
+
+ <property name="aggregateType" />
+
+ <many-to-one name="user" class="org.hisp.dhis.user.User"
+ column="userid" foreign-key="fk_patientaggregatereport_userid" />
+
+ <property name="useCompletedEvents" />
+
+ <property name="userOrganisationUnit" />
+
+ <property name="userOrganisationUnitChildren" />
+
+ <many-to-one name="deSum" class="org.hisp.dhis.dataelement.DataElement"
+ column="desumid" foreign-key="fk_patientaggregatereport_dataelementsumtid" />
+
+ </class>
</hibernate-mapping>
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientreport/hibernate/PatientTabularReport.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientreport/hibernate/PatientTabularReport.hbm.xml 2012-10-18 03:29:28 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientreport/hibernate/PatientTabularReport.hbm.xml 2013-02-07 10:25:34 +0000
@@ -1,66 +1,67 @@
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
- "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
- "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"
- [<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
- >
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"
+ [<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
+ >
<hibernate-mapping>
- <class name="org.hisp.dhis.patientreport.PatientTabularReport"
- table="patienttabularreport">
-
- <id name="id" column="patienttabularreportid">
- <generator class="native" />
- </id>
-
- &identifiableProperties;
-
- <property name="startDate" />
-
- <property name="endDate" />
-
- <list name="identifiers"
- table="patienttabularreport_identifiers">
- <key column="patienttabularreportid" />
- <list-index column="sort_order" base="0" />
- <many-to-many class="org.hisp.dhis.patient.PatientIdentifierType"
- column="patientidentifiertypeid" foreign-key="patienttabularreport_indentifierid" />
- </list>
-
- <list name="attributes" table="patienttabularreport_attributes">
- <key column="patienttabularreportid" />
- <list-index column="sort_order" base="0" />
- <many-to-many class="org.hisp.dhis.patient.PatientAttribute"
- column="patientattributeid" foreign-key="patienttabularreport_attributeid" />
- </list>
-
- <list name="fixedAttributes" table="patienttabularreport_fixedattribute">
- <key column="patienttabularreportid" foreign-key="patienttabularreport_fixedAttribute" />
- <list-index column="sort_order" />
- <element type="text" column="fixedAttribute" />
- </list>
-
- <list name="programStageDataElements" table="patienttabularreport_programstagedataelements">
- <key column="patienttabularreportid" />
- <list-index column="tabular_sort_order" base="1" />
- <one-to-many class="org.hisp.dhis.program.ProgramStageDataElement"/>
- </list>
-
- <set name="organisationUnits" table="patienttabularreport_organisationUnits">
- <cache usage="read-write" />
- <key column="patienttabularreportid" foreign-key="fk_patienttabularreport_organisationUnitid" />
- <many-to-many column="organisationunitid" class="org.hisp.dhis.organisationunit.OrganisationUnit"
- foreign-key="fk_patienttabularreportid_organisationunit" />
- </set>
-
- <property name="level" />
-
- <property name="sortedOrgunitAsc" />
-
- <property name="facilityLB" />
-
- <many-to-one name="user" class="org.hisp.dhis.user.User"
- column="userid" foreign-key="fk_patienttabularreport_userid" />
-
- </class>
+ <class name="org.hisp.dhis.patientreport.PatientTabularReport"
+ table="patienttabularreport">
+
+ <id name="id" column="patienttabularreportid">
+ <generator class="native" />
+ </id>
+ &identifiableProperties;
+
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
+
+ <property name="startDate" />
+
+ <property name="endDate" />
+
+ <list name="identifiers"
+ table="patienttabularreport_identifiers">
+ <key column="patienttabularreportid" />
+ <list-index column="sort_order" base="0" />
+ <many-to-many class="org.hisp.dhis.patient.PatientIdentifierType"
+ column="patientidentifiertypeid" foreign-key="patienttabularreport_indentifierid" />
+ </list>
+
+ <list name="attributes" table="patienttabularreport_attributes">
+ <key column="patienttabularreportid" />
+ <list-index column="sort_order" base="0" />
+ <many-to-many class="org.hisp.dhis.patient.PatientAttribute"
+ column="patientattributeid" foreign-key="patienttabularreport_attributeid" />
+ </list>
+
+ <list name="fixedAttributes" table="patienttabularreport_fixedattribute">
+ <key column="patienttabularreportid" foreign-key="patienttabularreport_fixedAttribute" />
+ <list-index column="sort_order" />
+ <element type="text" column="fixedAttribute" />
+ </list>
+
+ <list name="programStageDataElements" table="patienttabularreport_programstagedataelements">
+ <key column="patienttabularreportid" />
+ <list-index column="tabular_sort_order" base="1" />
+ <one-to-many class="org.hisp.dhis.program.ProgramStageDataElement" />
+ </list>
+
+ <set name="organisationUnits" table="patienttabularreport_organisationUnits">
+ <cache usage="read-write" />
+ <key column="patienttabularreportid" foreign-key="fk_patienttabularreport_organisationUnitid" />
+ <many-to-many column="organisationunitid" class="org.hisp.dhis.organisationunit.OrganisationUnit"
+ foreign-key="fk_patienttabularreportid_organisationunit" />
+ </set>
+
+ <property name="level" />
+
+ <property name="sortedOrgunitAsc" />
+
+ <property name="facilityLB" />
+
+ <many-to-one name="user" class="org.hisp.dhis.user.User"
+ column="userid" foreign-key="fk_patienttabularreport_userid" />
+
+ </class>
</hibernate-mapping>
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml 2013-01-23 04:48:39 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml 2013-02-07 10:25:34 +0000
@@ -3,7 +3,7 @@
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"
[<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
->
+ >
<hibernate-mapping>
<class name="org.hisp.dhis.program.Program" table="program">
@@ -11,8 +11,9 @@
<id name="id" column="programid">
<generator class="native" />
</id>
+ &identifiableProperties;
- &identifiableProperties;
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
<property name="description" type="text" />
@@ -29,39 +30,41 @@
<set name="organisationUnits" table="program_organisationunits">
<key column="programid" foreign-key="fk_program_organisationunits_programid" />
- <many-to-many column="organisationunitid" class="org.hisp.dhis.organisationunit.OrganisationUnit" foreign-key="fk_program_organisationunits_organisationunitid" />
+ <many-to-many column="organisationunitid" class="org.hisp.dhis.organisationunit.OrganisationUnit"
+ foreign-key="fk_program_organisationunits_organisationunitid" />
</set>
<set name="patientValidationCriteria" table="program_criteria">
<key column="programid" foreign-key="fk_program_criteria_programid" />
- <many-to-many column="validationcriteriaid" class="org.hisp.dhis.validation.ValidationCriteria" foreign-key="fk_program_criteria_validationcriteriaid" />
+ <many-to-many column="validationcriteriaid" class="org.hisp.dhis.validation.ValidationCriteria"
+ foreign-key="fk_program_criteria_validationcriteriaid" />
</set>
<property name="type" />
-
+
<property name="displayProvidedOtherFacility" />
-
+
<property name="displayIncidentDate" />
-
+
<list name="patientIdentifierTypes" table="program_patientIdentifierTypes">
- <key column="programid" foreign-key="fk_program_patientIdentifierTypes_programid" />
- <list-index column="sort_order" base="0" />
- <many-to-many column="patientidentifiertypeid" class="org.hisp.dhis.patient.PatientIdentifierType"
- foreign-key="fk_program_patientIdentifierTypes_patientidentifiertypeid" />
- </list>
-
- <list name="patientAttributes" table="program_patientAttributes">
- <key column="programid" foreign-key="fk_program_patientAttributes_programid" />
- <list-index column="sort_order" base="0" />
- <many-to-many column="patientattributeid" class="org.hisp.dhis.patient.PatientAttribute"
- foreign-key="fk_program_patientAttributes_patientattributeid" />
- </list>
-
+ <key column="programid" foreign-key="fk_program_patientIdentifierTypes_programid" />
+ <list-index column="sort_order" base="0" />
+ <many-to-many column="patientidentifiertypeid" class="org.hisp.dhis.patient.PatientIdentifierType"
+ foreign-key="fk_program_patientIdentifierTypes_patientidentifiertypeid" />
+ </list>
+
+ <list name="patientAttributes" table="program_patientAttributes">
+ <key column="programid" foreign-key="fk_program_patientAttributes_programid" />
+ <list-index column="sort_order" base="0" />
+ <many-to-many column="patientattributeid" class="org.hisp.dhis.patient.PatientAttribute"
+ foreign-key="fk_program_patientAttributes_patientattributeid" />
+ </list>
+
<property name="generatedByEnrollmentDate" />
-
+
<property name="ignoreOverdueEvents" />
-
+
<property name="blockEntryForm" />
-
+
</class>
</hibernate-mapping>
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml 2012-12-12 04:43:25 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml 2013-02-07 10:25:34 +0000
@@ -3,7 +3,7 @@
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"
[<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
->
+ >
<hibernate-mapping>
<class name="org.hisp.dhis.program.ProgramStage" table="programstage">
@@ -11,16 +11,17 @@
<id name="id" column="programstageid">
<generator class="native" />
</id>
+ &identifiableProperties;
- &identifiableProperties;
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
<property name="description" />
-
+
<property name="minDaysFromStart" column="mindaysfromstart" not-null="true" />
<many-to-one name="program" class="org.hisp.dhis.program.Program" column="programid" foreign-key="fk_programstage_program" />
- <property name="irregular" column="irregular" />
+ <property name="irregular" column="irregular" />
<set name="programStageDataElements" order-by="sort_order">
<key column="programstageid" />
@@ -29,26 +30,26 @@
<many-to-one name="dataEntryForm" class="org.hisp.dhis.dataentryform.DataEntryForm"
foreign-key="fk_programstage_dataentryform" />
-
+
<property name="standardInterval" />
-
+
<set name="programStageSections" order-by="sortOrder" cascade="all">
<key column="programStageid" />
<one-to-many class="org.hisp.dhis.program.ProgramStageSection" />
</set>
-
+
<property name="reportDateDescription" />
-
+
<set name="patientReminders" order-by="daysAllowedSendMessage" cascade="all">
<key column="programStageid" />
<one-to-many class="org.hisp.dhis.patient.PatientReminder" />
</set>
-
- <property name="autoGenerateEvent"/>
-
- <property name="validCompleteOnly"/>
-
- <property name="displayGenerateEventBox"/>
-
+
+ <property name="autoGenerateEvent" />
+
+ <property name="validCompleteOnly" />
+
+ <property name="displayGenerateEventBox" />
+
</class>
</hibernate-mapping>
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageSection.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageSection.hbm.xml 2012-10-01 09:28:45 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageSection.hbm.xml 2013-02-07 10:25:34 +0000
@@ -2,8 +2,8 @@
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"
- [<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
->
+ [<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
+ >
<hibernate-mapping>
<class name="org.hisp.dhis.program.ProgramStageSection" table="programstagesection">
@@ -11,16 +11,17 @@
<id name="id" column="programstagesectionid">
<generator class="native" />
</id>
-
- &identifiableProperties;
-
+ &identifiableProperties;
+
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
+
<list name="programStageDataElements" table="programstagesection_dataelement">
<key column="programstagesectionid" />
<list-index column="section_sort_order" base="1" />
- <one-to-many class="org.hisp.dhis.program.ProgramStageDataElement"/>
+ <one-to-many class="org.hisp.dhis.program.ProgramStageDataElement" />
</list>
-
- <property name="sortOrder" column="sortorder" not-null="true" />
-
+
+ <property name="sortOrder" column="sortorder" not-null="true" />
+
</class>
</hibernate-mapping>
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramValidation.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramValidation.hbm.xml 2013-01-07 05:07:05 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramValidation.hbm.xml 2013-02-07 10:25:34 +0000
@@ -3,31 +3,32 @@
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"
[<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
->
+ >
<hibernate-mapping>
- <class name="org.hisp.dhis.program.ProgramValidation" table="programvalidation">
-
- <id name="id" column="programvalidationid">
- <generator class="native" />
- </id>
-
- &identifiableProperties;
-
- <many-to-one name="leftSide" column="leftprogramexpressionid"
- class="org.hisp.dhis.program.ProgramExpression" cascade="all"
- foreign-key="fk_programvalidation_leftprogramexpressionid" />
-
- <property name="operator" type="org.hisp.dhis.expression.OperatorUserType">
- <column name="operator" unique="false" />
- </property>
-
- <many-to-one name="rightSide" column="rightprogramexpressionid"
- class="org.hisp.dhis.program.ProgramExpression" cascade="all"
- foreign-key="fk_programvalidation_rightprogramexpressionid" />
-
- <many-to-one name="program" class="org.hisp.dhis.program.Program"
- column="programid" not-null="true" foreign-key="fk_programvalidation_programid" />
-
- </class>
+ <class name="org.hisp.dhis.program.ProgramValidation" table="programvalidation">
+
+ <id name="id" column="programvalidationid">
+ <generator class="native" />
+ </id>
+ &identifiableProperties;
+
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
+
+ <many-to-one name="leftSide" column="leftprogramexpressionid"
+ class="org.hisp.dhis.program.ProgramExpression" cascade="all"
+ foreign-key="fk_programvalidation_leftprogramexpressionid" />
+
+ <property name="operator" type="org.hisp.dhis.expression.OperatorUserType">
+ <column name="operator" unique="false" />
+ </property>
+
+ <many-to-one name="rightSide" column="rightprogramexpressionid"
+ class="org.hisp.dhis.program.ProgramExpression" cascade="all"
+ foreign-key="fk_programvalidation_rightprogramexpressionid" />
+
+ <many-to-one name="program" class="org.hisp.dhis.program.Program"
+ column="programid" not-null="true" foreign-key="fk_programvalidation_programid" />
+
+ </class>
</hibernate-mapping>
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/relationship/hibernate/RelationshipType.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/relationship/hibernate/RelationshipType.hbm.xml 2012-02-27 01:07:19 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/relationship/hibernate/RelationshipType.hbm.xml 2013-02-07 10:25:34 +0000
@@ -3,7 +3,7 @@
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"
[<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
->
+ >
<hibernate-mapping>
<class name="org.hisp.dhis.relationship.RelationshipType" table="relationshiptype">
@@ -11,12 +11,13 @@
<id name="id" column="relationshiptypeid">
<generator class="native" />
</id>
-
&identifiableProperties;
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
+
<property name="aIsToB" column="a_is_to_b" not-null="true" />
<property name="bIsToA" column="b_is_to_a" not-null="true" />
-
+
</class>
</hibernate-mapping>
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/document/hibernate/Document.hbm.xml'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/document/hibernate/Document.hbm.xml 2013-01-03 12:43:44 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/document/hibernate/Document.hbm.xml 2013-02-07 10:25:34 +0000
@@ -15,6 +15,8 @@
</id>
&identifiableProperties;
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
+
<property name="url" not-null="true" type="text" />
<property name="external" not-null="true" />
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/report/hibernate/Report.hbm.xml'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/report/hibernate/Report.hbm.xml 2013-01-25 15:24:37 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/report/hibernate/Report.hbm.xml 2013-02-07 10:25:34 +0000
@@ -15,6 +15,8 @@
</id>
&identifiableProperties;
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
+
<property name="type" />
<property name="designContent" type="text" />
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/reporttable/hibernate/ReportTable.hbm.xml'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/reporttable/hibernate/ReportTable.hbm.xml 2013-01-17 15:31:26 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/reporttable/hibernate/ReportTable.hbm.xml 2013-02-07 10:25:34 +0000
@@ -15,6 +15,8 @@
</id>
&identifiableProperties;
+ <property name="name" column="name" not-null="true" unique="true" length="230" />
+
<property name="regression" />
<property name="cumulative" />
=== 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 2012-10-18 13:04:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/ValidateIndicatorAction.java 2013-02-07 10:25:34 +0000
@@ -27,12 +27,11 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import com.opensymphony.xwork2.Action;
import org.hisp.dhis.i18n.I18n;
import org.hisp.dhis.indicator.Indicator;
import org.hisp.dhis.indicator.IndicatorService;
-import com.opensymphony.xwork2.Action;
-
/**
* @author Torgeir Lorange Ostby
*/
@@ -108,7 +107,8 @@
{
if ( name != null )
{
- Indicator match = indicatorService.getIndicatorByName( name );
+ // TODO compile fix, this should be removed
+ Indicator match = indicatorService.getIndicatorByName( name ).get( 0 );
if ( match != null && (id == null || match.getId() != id) )
{
@@ -120,7 +120,8 @@
if ( shortName != null )
{
- Indicator match = indicatorService.getIndicatorByShortName( shortName );
+ // TODO compile fix, this should be removed
+ Indicator match = indicatorService.getIndicatorByShortName( shortName ).get( 0 );
if ( match != null && (id == null || match.getId() != id) )
{
@@ -129,7 +130,7 @@
return ERROR;
}
}
-
+
if ( code != null && !code.trim().isEmpty() )
{
Indicator match = indicatorService.getIndicatorByCode( code );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/ValidateIndicatorGroupAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/ValidateIndicatorGroupAction.java 2012-09-21 08:32:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/ValidateIndicatorGroupAction.java 2013-02-07 10:25:34 +0000
@@ -27,12 +27,11 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import com.opensymphony.xwork2.Action;
import org.hisp.dhis.i18n.I18n;
import org.hisp.dhis.indicator.IndicatorGroup;
import org.hisp.dhis.indicator.IndicatorService;
-import com.opensymphony.xwork2.Action;
-
/**
* @author Torgeir Lorange Ostby
* @version $Id: ValidateIndicatorGroupAction.java 3305 2007-05-14 18:55:52Z
@@ -96,7 +95,8 @@
{
if ( name != null )
{
- IndicatorGroup match = indicatorService.getIndicatorGroupByName( name );
+ // TODO compile fix, this should be removed
+ IndicatorGroup match = indicatorService.getIndicatorGroupByName( name ).get( 0 );
if ( match != null && (id == null || match.getId() != id) )
{
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroupset/ValidateIndicatorGroupSetAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroupset/ValidateIndicatorGroupSetAction.java 2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroupset/ValidateIndicatorGroupSetAction.java 2013-02-07 10:25:34 +0000
@@ -27,12 +27,11 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import com.opensymphony.xwork2.Action;
import org.hisp.dhis.i18n.I18n;
import org.hisp.dhis.indicator.IndicatorGroupSet;
import org.hisp.dhis.indicator.IndicatorService;
-import com.opensymphony.xwork2.Action;
-
/**
* @author Tran Thanh Tri
* @version $Id$
@@ -90,11 +89,10 @@
public String execute()
{
-
if ( name != null )
{
-
- IndicatorGroupSet match = indicatorService.getIndicatorGroupSetByName( name );
+ // TODO compile fix, this should be removed
+ IndicatorGroupSet match = indicatorService.getIndicatorGroupSetByName( name ).get( 0 );
if ( match != null && (id == null || match.getId() != id) )
{
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addIndicatorForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addIndicatorForm.vm 2013-01-30 07:31:03 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addIndicatorForm.vm 2013-02-07 10:25:34 +0000
@@ -11,8 +11,8 @@
'rules' : getValidationRules( "indicator" )
} );
- checkValueIsExist( "name", "validateIndicator.action" );
- checkValueIsExist( "shortName", "validateIndicator.action" );
+ // checkValueIsExist( "name", "validateIndicator.action" );
+ // checkValueIsExist( "shortName", "validateIndicator.action" );
checkValueIsExist( "code", "validateIndicator.action" );
} );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addIndicatorGroupForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addIndicatorGroupForm.vm 2012-10-17 11:58:35 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addIndicatorGroupForm.vm 2013-02-07 10:25:34 +0000
@@ -12,7 +12,7 @@
'rules' : getValidationRules( "indicatorGroup" )
} );
- checkValueIsExist( "name", "validateIndicatorGroup.action" );
+ // checkValueIsExist( "name", "validateIndicatorGroup.action" );
var nameField = document.getElementById( 'name' );
nameField.select();
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/addIndicatorGroupSet.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/addIndicatorGroupSet.js 2011-08-19 21:33:57 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/addIndicatorGroupSet.js 2013-02-07 10:25:34 +0000
@@ -11,5 +11,5 @@
'rules' : getValidationRules( "indicatorGroupSet" )
} );
- checkValueIsExist( "name", "validateIndicatorGroupSet.action" );
+ // checkValueIsExist( "name", "validateIndicatorGroupSet.action" );
} );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorForm.vm 2013-01-30 07:31:03 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorForm.vm 2013-02-07 10:25:34 +0000
@@ -11,8 +11,8 @@
'rules' : getValidationRules( "indicator" )
} );
- checkValueIsExist( "name", "validateIndicator.action", { id : getFieldValue( 'id' ) } );
- checkValueIsExist( "shortName", "validateIndicator.action", { id : getFieldValue( 'id' ) } );
+ // checkValueIsExist( "name", "validateIndicator.action", { id : getFieldValue( 'id' ) } );
+ // checkValueIsExist( "shortName", "validateIndicator.action", { id : getFieldValue( 'id' ) } );
checkValueIsExist( "code", "validateIndicator.action", { id : getFieldValue( 'id' ) } );
} );
</script>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorGroupForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorGroupForm.vm 2012-10-17 11:58:35 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorGroupForm.vm 2013-02-07 10:25:34 +0000
@@ -25,7 +25,7 @@
}
});
- checkValueIsExist( "name", "validateIndicatorGroup.action", {id: $indicatorGroup.id});
+ // checkValueIsExist( "name", "validateIndicatorGroup.action", {id: $indicatorGroup.id});
});
</script>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorGroupSet.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorGroupSet.vm 2013-02-04 15:02:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorGroupSet.vm 2013-02-07 10:25:34 +0000
@@ -17,7 +17,7 @@
}
});
- checkValueIsExist( "name", "validateIndicatorGroupSet.action", {id: $indicatorGroupSet.id});
+ // checkValueIsExist( "name", "validateIndicatorGroupSet.action", {id: $indicatorGroupSet.id});
});
</script>