← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6318: removed .toJSON from old code

 

------------------------------------------------------------
revno: 6318
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-03-20 16:05:16 +0100
message:
  removed .toJSON from old code
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionCombo.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementOperand.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-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java	2012-03-19 22:10:02 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java	2012-03-20 15:05:16 +0000
@@ -384,19 +384,6 @@
         return expiryDays == Integer.MAX_VALUE ? NO_EXPIRY : expiryDays;
     }
 
-    public String toJSON()
-    {
-        StringBuffer result = new StringBuffer();
-
-        result.append( "{" );
-        result.append( "\"id\":\"" + this.id + "\"" );
-        result.append( ",\"name\":\"" + StringEscapeUtils.escapeJavaScript( this.name ) + "\"" );
-        result.append( ",\"shortName\":\"" + StringEscapeUtils.escapeJavaScript( this.shortName ) + "\"" );
-        result.append( ",\"type\":\"" + StringEscapeUtils.escapeJavaScript( this.type ) + "\"" );
-        result.append( "}" );
-        return result.toString();
-    }
-
     // -------------------------------------------------------------------------
     // Getters and setters
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionCombo.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionCombo.java	2012-03-19 14:58:46 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionCombo.java	2012-03-20 15:05:16 +0000
@@ -326,15 +326,4 @@
     {
         this.categoryOptions = categoryOptions;
     }
-
-    public String toJSON()
-    {
-        StringBuilder result = new StringBuilder();
-        result.append( "{" );
-        result.append( "\"id\":" + this.getId() + "\"" );
-        result.append( ",\"name\":" + StringEscapeUtils.escapeJavaScript( this.getName() ) + "\"" );
-        result.append( ",\"isDefault\":" + this.isDefault() + "\"" );
-        result.append( "}" );
-        return result.toString();
-    }
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementOperand.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementOperand.java	2012-03-12 14:27:51 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementOperand.java	2012-03-20 15:05:16 +0000
@@ -546,22 +546,4 @@
 
         return this.getOptionComboId() - other.getOptionComboId();
     }
-
-    public String toJSON()
-    {
-        StringBuffer stringBuffer = new StringBuffer();
-
-        stringBuffer.append( "{" );
-        stringBuffer.append( "\"dataElement\":{\"id\":\"" + this.dataElementId + "\", \"name\":\""
-            + StringEscapeUtils.escapeJavaScript( this.dataElement.getName() ) + "\",\"shortName\":\""
-            + StringEscapeUtils.escapeJavaScript( this.dataElement.getShortName() ) + "\",\"type\":\""
-            + this.dataElement.getType() + "\"}" );
-
-        stringBuffer.append( ",\"optionCombo\":{\"id\":\"" + this.optionComboId + "\",\"name\":\""
-            + StringEscapeUtils.escapeJavaScript( this.categoryOptionCombo.getName() ) + "\"}" );
-
-        stringBuffer.append( "}" );
-
-        return stringBuffer.toString();
-    }
 }