dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #19392
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8435: Minor fixes
------------------------------------------------------------
revno: 8435
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-10-08 19:59:38 +0200
message:
Minor fixes
modified:
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/utils/FormUtils.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/utils/FormUtils.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/utils/FormUtils.java 2012-10-08 17:42:51 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/utils/FormUtils.java 2012-10-08 17:59:38 +0000
@@ -27,8 +27,8 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import org.hisp.dhis.api.webdomain.form.Field;
import org.hisp.dhis.api.webdomain.form.Form;
-import org.hisp.dhis.api.webdomain.form.Field;
import org.hisp.dhis.api.webdomain.form.InputType;
import org.hisp.dhis.api.webdomain.form.Section;
import org.hisp.dhis.dataelement.DataElement;
@@ -78,7 +78,7 @@
for ( DataElement dataElement : dataElements )
{
- if ( dataElement.getCategoryCombo().getName().equalsIgnoreCase( "default" ) )
+ if ( dataElement.getCategoryCombo().isDefault() )
{
Field field = new Field();
@@ -112,9 +112,9 @@
private static InputType inputTypeFromDataElement( DataElement dataElement )
{
- if ( dataElement.getType().equalsIgnoreCase( "string" ) )
+ if ( DataElement.VALUE_TYPE_STRING.equals( dataElement.getType() ) )
{
- if ( dataElement.getTextType().equalsIgnoreCase( "text" ) )
+ if ( DataElement.VALUE_TYPE_TEXT.equals( dataElement.getTextType() ) )
{
return InputType.TEXT;
}
@@ -125,26 +125,26 @@
}
*/
}
- else if ( dataElement.getType().equalsIgnoreCase( "int" ) )
+ else if ( DataElement.VALUE_TYPE_INT.equals( dataElement.getType() ) )
{
- if ( dataElement.getNumberType().equalsIgnoreCase( "number" ) )
+ if ( DataElement.VALUE_TYPE_NUMBER.equals( dataElement.getNumberType() ) )
{
return InputType.NUMBER;
}
- else if ( dataElement.getNumberType().equalsIgnoreCase( "int" ) )
+ else if ( DataElement.VALUE_TYPE_INT.equals( dataElement.getNumberType() ) )
{
return InputType.INTEGER;
}
- else if ( dataElement.getNumberType().equalsIgnoreCase( "positiveNumber" ) )
+ else if ( DataElement.VALUE_TYPE_POSITIVE_INT.equals( dataElement.getNumberType() ) )
{
return InputType.INTEGER_POSITIVE;
}
- else if ( dataElement.getNumberType().equalsIgnoreCase( "negativeNumber" ) )
+ else if ( DataElement.VALUE_TYPE_NEGATIVE_INT.equals( dataElement.getNumberType() ) )
{
return InputType.INTEGER_NEGATIVE;
}
}
- else if ( dataElement.getType().equalsIgnoreCase( "bool" ) )
+ else if ( DataElement.VALUE_TYPE_BOOL.equals( dataElement.getType() ) )
{
return InputType.BOOLEAN;
}
@@ -154,7 +154,7 @@
return InputType.TRUE_ONLY;
}
*/
- else if ( dataElement.getType().equalsIgnoreCase( "date" ) )
+ else if ( DataElement.VALUE_TYPE_DATE.equals( dataElement.getType() ) )
{
return InputType.DATE;
}