=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java' --- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java 2014-05-05 18:01:22 +0000 +++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java 2014-06-01 14:24:43 +0000 @@ -28,6 +28,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +import static org.apache.commons.lang.StringUtils.trimToNull; import static org.hisp.dhis.common.IdentifiableObject.IdentifiableProperty.UUID; import static org.hisp.dhis.system.notification.NotificationLevel.ERROR; import static org.hisp.dhis.system.notification.NotificationLevel.INFO; @@ -53,7 +54,6 @@ import org.amplecode.quick.BatchHandler; import org.amplecode.quick.BatchHandlerFactory; import org.amplecode.staxwax.factory.XMLFactory; -import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.hisp.dhis.common.DxfNamespaces; @@ -495,10 +495,10 @@ totalCount++; - DataElement dataElement = dataElementMap.get( dataValue.getDataElement() ); - DataElementCategoryOptionCombo categoryOptionCombo = categoryOptionComboMap.get( dataValue.getCategoryOptionCombo() ); - Period period = outerPeriod != null ? outerPeriod : PeriodType.getPeriodFromIsoString( dataValue.getPeriod() ); - OrganisationUnit orgUnit = outerOrgUnit != null ? outerOrgUnit : orgUnitMap.get( dataValue.getOrgUnit() ); + DataElement dataElement = dataElementMap.get( trimToNull( dataValue.getDataElement() ) ); + DataElementCategoryOptionCombo categoryOptionCombo = categoryOptionComboMap.get( trimToNull( dataValue.getCategoryOptionCombo() ) ); + Period period = outerPeriod != null ? outerPeriod : PeriodType.getPeriodFromIsoString( trimToNull( dataValue.getPeriod() ) ); + OrganisationUnit orgUnit = outerOrgUnit != null ? outerOrgUnit : orgUnitMap.get( trimToNull( dataValue.getOrgUnit() ) ); if ( dataElement == null ) { @@ -559,7 +559,7 @@ internalValue.setSource( orgUnit ); internalValue.setCategoryOptionCombo( categoryOptionCombo ); internalValue.setAttributeOptionCombo( fallbackCategoryOptionCombo ); // TODO - internalValue.setValue( StringUtils.trimToNull( dataValue.getValue() ) ); + internalValue.setValue( trimToNull( dataValue.getValue() ) ); if ( dataValue.getStoredBy() == null || dataValue.getStoredBy().trim().isEmpty() ) { @@ -571,7 +571,7 @@ } internalValue.setTimestamp( getDefaultDate( dataValue.getLastUpdated() ) ); - internalValue.setComment( StringUtils.trimToNull( dataValue.getComment() ) ); + internalValue.setComment( trimToNull( dataValue.getComment() ) ); internalValue.setFollowup( dataValue.getFollowup() ); if ( !skipExistingCheck && batchHandler.objectExists( internalValue ) )