dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #17913
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7325: [mobile] support serialize methods for 2.8 and 2.9 version
------------------------------------------------------------
revno: 7325
committer: Long <thanhlongngo1988@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-06-18 16:20:33 +0700
message:
[mobile] support serialize methods for 2.8 and 2.9 version
modified:
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/Activity.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/ActivityPlan.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/ActivityValue.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/Beneficiary.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/DataElement.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/DataSet.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/DataSetList.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/DataSetValue.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/DataStreamSerializable.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/DataValue.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/MobileModel.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/MobileOrgUnitLinks.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/Model.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/ModelList.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/OptionSet.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/OrgUnits.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/PatientAttribute.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/PatientIdentifier.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/Program.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/ProgramStage.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/Section.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/Task.java
dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileOrganisationUnitController.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-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/Activity.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/Activity.java 2011-11-04 11:27:33 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/Activity.java 2012-06-18 09:20:33 +0000
@@ -37,6 +37,7 @@
public class Activity
implements DataStreamSerializable
{
+ private String clientVersion;
private Beneficiary beneficiary;
@@ -45,7 +46,7 @@
private Task task;
private Date dueDate;
-
+
private Date expireDate;
public Beneficiary getBeneficiary()
@@ -89,15 +90,27 @@
this.late = late;
}
- public Date getExpireDate() {
- return expireDate;
- }
-
- public void setExpireDate(Date expireDate) {
- this.expireDate = expireDate;
- }
-
- @Override
+ public Date getExpireDate()
+ {
+ return expireDate;
+ }
+
+ public void setExpireDate( Date expireDate )
+ {
+ this.expireDate = expireDate;
+ }
+
+ public String getClientVersion()
+ {
+ return clientVersion;
+ }
+
+ public void setClientVersion( String clientVersion )
+ {
+ this.clientVersion = clientVersion;
+ }
+
+ @Override
public void serialize( DataOutputStream dout )
throws IOException
{
@@ -105,7 +118,7 @@
this.getBeneficiary().serialize( dout );
dout.writeBoolean( late );
dout.writeLong( this.getDueDate().getTime() );
- dout.writeLong(this.getExpireDate().getTime());
+ dout.writeLong( this.getExpireDate().getTime() );
}
@Override
@@ -120,7 +133,23 @@
this.late = dataInputStream.readBoolean();
this.dueDate = new Date( dataInputStream.readLong() );
- this.expireDate = new Date(dataInputStream.readLong());
+ this.expireDate = new Date( dataInputStream.readLong() );
+ }
+
+ @Override
+ public void serializeVerssion2Point8()
+ throws IOException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void serializeVerssion2Point9()
+ throws IOException
+ {
+ // TODO Auto-generated method stub
+
}
}
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/ActivityPlan.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/ActivityPlan.java 2011-11-04 11:27:33 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/ActivityPlan.java 2012-06-18 09:20:33 +0000
@@ -39,6 +39,7 @@
public class ActivityPlan
implements DataStreamSerializable
{
+ private String clientVersion;
private List<Activity> activitiesList;
@@ -62,6 +63,16 @@
{
this.activitiesList = activitiesList;
}
+
+ public String getClientVersion()
+ {
+ return clientVersion;
+ }
+
+ public void setClientVersion( String clientVersion )
+ {
+ this.clientVersion = clientVersion;
+ }
@Override
public void serialize( DataOutputStream dout )
@@ -82,6 +93,8 @@
}
}
+
+
@Override
public void deSerialize( DataInputStream dataInputStream )
@@ -91,4 +104,21 @@
}
+ @Override
+ public void serializeVerssion2Point8()
+ throws IOException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void serializeVerssion2Point9()
+ throws IOException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+
}
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/ActivityValue.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/ActivityValue.java 2011-11-04 11:27:33 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/ActivityValue.java 2012-06-18 09:20:33 +0000
@@ -36,7 +36,8 @@
public class ActivityValue
implements DataStreamSerializable
{
-
+ private String clientVersion;
+
private int programInstanceId;
private List<DataValue> dataValues = new ArrayList<DataValue>();
@@ -92,4 +93,20 @@
}
+ @Override
+ public void serializeVerssion2Point8()
+ throws IOException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void serializeVerssion2Point9()
+ throws IOException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
}
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/Beneficiary.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/Beneficiary.java 2012-05-29 15:37:40 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/Beneficiary.java 2012-06-18 09:20:33 +0000
@@ -46,6 +46,8 @@
public class Beneficiary
implements DataStreamSerializable
{
+ private String clientVersion;
+
@XmlAttribute
private int id;
@@ -324,4 +326,20 @@
Beneficiary otherBeneficiary = (Beneficiary) otherObject;
return this.getId() == otherBeneficiary.getId();
}
+
+ @Override
+ public void serializeVerssion2Point8()
+ throws IOException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void serializeVerssion2Point9()
+ throws IOException
+ {
+ // TODO Auto-generated method stub
+
+ }
}
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/DataElement.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/DataElement.java 2012-04-25 21:27:53 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/DataElement.java 2012-06-18 09:20:33 +0000
@@ -36,6 +36,7 @@
public class DataElement
extends Model
{
+ private String clientVersion;
private String type;
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/DataSet.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/DataSet.java 2011-11-04 11:27:33 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/DataSet.java 2012-06-18 09:20:33 +0000
@@ -39,6 +39,7 @@
extends Model
implements DataStreamSerializable, Comparable<DataSet>
{
+ private String clientVersion;
private String periodType;
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/DataSetList.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/DataSetList.java 2011-11-04 11:27:33 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/DataSetList.java 2012-06-18 09:20:33 +0000
@@ -37,6 +37,8 @@
extends Model
implements DataStreamSerializable
{
+ private String clientVersion;
+
private List<DataSet> addedDataSets = new ArrayList<DataSet>();
private List<DataSet> deletedDataSets = new ArrayList<DataSet>();
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/DataSetValue.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/DataSetValue.java 2011-11-04 11:27:33 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/DataSetValue.java 2012-06-18 09:20:33 +0000
@@ -41,7 +41,8 @@
public class DataSetValue
extends Model
{
-
+ private String clientVersion;
+
private String periodName;
private boolean completed;
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/DataStreamSerializable.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/DataStreamSerializable.java 2011-11-04 11:27:33 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/DataStreamSerializable.java 2012-06-18 09:20:33 +0000
@@ -37,6 +37,11 @@
*/
public interface DataStreamSerializable
{
+ public static final String BLANK = "";
+
+ public static final String TWO_POINT_EIGHT = "2.8";
+
+ public static final String TWO_POINT_NINE = "2.9";
public void serialize( DataOutputStream dataOutputStream )
throws IOException;
@@ -44,4 +49,10 @@
public void deSerialize( DataInputStream dataInputStream )
throws IOException;
+ public void serializeVerssion2Point8()
+ throws IOException;
+
+ public void serializeVerssion2Point9()
+ throws IOException;
+
}
\ No newline at end of file
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/DataValue.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/DataValue.java 2011-11-04 11:27:33 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/DataValue.java 2012-06-18 09:20:33 +0000
@@ -36,8 +36,10 @@
public class DataValue
implements DataStreamSerializable
{
-
+
private int id;
+
+ private String clientVersion;
private int categoryOptComboID;
@@ -93,4 +95,20 @@
setValue( din.readUTF() );
}
+ @Override
+ public void serializeVerssion2Point8()
+ throws IOException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void serializeVerssion2Point9()
+ throws IOException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
}
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/MobileModel.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/MobileModel.java 2011-11-04 11:27:33 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/MobileModel.java 2012-06-18 09:20:33 +0000
@@ -40,14 +40,16 @@
public class MobileModel
implements DataStreamSerializable
{
+ private String clientVersion;
+
private ActivityPlan activityPlan;
private List<Program> programs;
-
+
private Date serverCurrentDate;
private List<DataSet> datasets;
-
+
private Collection<String> locales;
public ActivityPlan getActivityPlan()
@@ -69,17 +71,18 @@
{
this.programs = programs;
}
-
-
- public Date getServerCurrentDate() {
- return serverCurrentDate;
- }
-
- public void setServerCurrentDate(Date serverCurrentDate) {
- this.serverCurrentDate = serverCurrentDate;
- }
-
- public List<DataSet> getDatasets()
+
+ public Date getServerCurrentDate()
+ {
+ return serverCurrentDate;
+ }
+
+ public void setServerCurrentDate( Date serverCurrentDate )
+ {
+ this.serverCurrentDate = serverCurrentDate;
+ }
+
+ public List<DataSet> getDatasets()
{
return datasets;
}
@@ -87,7 +90,7 @@
public void setDatasets( List<DataSet> datasets )
{
this.datasets = datasets;
- }
+ }
public Collection<String> getLocales()
{
@@ -127,9 +130,9 @@
{
this.activityPlan.serialize( dout );
}
-
+
// Write current server's date
- dout.writeLong(serverCurrentDate.getTime());
+ dout.writeLong( serverCurrentDate.getTime() );
// Write DataSets
if ( datasets == null )
@@ -144,18 +147,21 @@
ds.serialize( dout );
}
}
-
+
// Write Locales
- if ( locales == null ){
+ if ( locales == null )
+ {
dout.writeInt( 0 );
- }else{
- dout.writeInt(locales.size());
- for(String locale : locales){
- dout.writeUTF( locale );
+ }
+ else
+ {
+ dout.writeInt( locales.size() );
+ for ( String locale : locales )
+ {
+ dout.writeUTF( locale );
}
}
-
-
+
}
@Override
@@ -166,4 +172,20 @@
}
+ @Override
+ public void serializeVerssion2Point8()
+ throws IOException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void serializeVerssion2Point9()
+ throws IOException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
}
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/MobileOrgUnitLinks.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/MobileOrgUnitLinks.java 2011-11-04 11:27:33 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/MobileOrgUnitLinks.java 2012-06-18 09:20:33 +0000
@@ -38,6 +38,8 @@
public class MobileOrgUnitLinks
implements DataStreamSerializable
{
+ private String clientVersion;
+
private int id;
private String name;
@@ -174,4 +176,20 @@
this.searchUrl = dataInputStream.readUTF();
}
+ @Override
+ public void serializeVerssion2Point8()
+ throws IOException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void serializeVerssion2Point9()
+ throws IOException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
}
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/Model.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/Model.java 2011-11-04 11:27:33 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/Model.java 2012-06-18 09:20:33 +0000
@@ -36,9 +36,10 @@
public class Model
implements DataStreamSerializable
{
+ private String clientVersion;
private int id;
-
+
private String name;
@XmlAttribute
@@ -79,4 +80,20 @@
this.name = dataInputStream.readUTF();
}
+ @Override
+ public void serializeVerssion2Point8()
+ throws IOException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void serializeVerssion2Point9()
+ throws IOException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
}
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/ModelList.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/ModelList.java 2011-11-04 11:27:33 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/ModelList.java 2012-06-18 09:20:33 +0000
@@ -38,7 +38,8 @@
public class ModelList
implements DataStreamSerializable
{
-
+ private String clientVersion;
+
private List<Model> models;
@XmlElement( name = "model" )
@@ -86,4 +87,20 @@
}
+ @Override
+ public void serializeVerssion2Point8()
+ throws IOException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void serializeVerssion2Point9()
+ throws IOException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
}
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/OptionSet.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/OptionSet.java 2012-04-13 08:27:30 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/OptionSet.java 2012-06-18 09:20:33 +0000
@@ -10,6 +10,8 @@
extends Model
implements DataStreamSerializable
{
+ private String clientVersion;
+
private List<String> options = new ArrayList<String>();
public List<String> getOptions()
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/OrgUnits.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/OrgUnits.java 2011-11-04 11:27:33 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/OrgUnits.java 2012-06-18 09:20:33 +0000
@@ -40,6 +40,8 @@
public class OrgUnits
implements DataStreamSerializable
{
+ private String clientVersion;
+
private List<MobileOrgUnitLinks> orgUnits = new ArrayList<MobileOrgUnitLinks>();
public OrgUnits()
@@ -89,4 +91,20 @@
}
}
+ @Override
+ public void serializeVerssion2Point8()
+ throws IOException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void serializeVerssion2Point9()
+ throws IOException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
}
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/PatientAttribute.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/PatientAttribute.java 2011-11-04 11:27:33 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/PatientAttribute.java 2012-06-18 09:20:33 +0000
@@ -36,6 +36,8 @@
public class PatientAttribute
implements DataStreamSerializable
{
+ private String clientVersion;
+
private String name;
private String value;
@@ -88,4 +90,20 @@
value = dataInputStream.readUTF();
}
+ @Override
+ public void serializeVerssion2Point8()
+ throws IOException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void serializeVerssion2Point9()
+ throws IOException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
}
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/PatientIdentifier.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/PatientIdentifier.java 2011-11-04 11:27:33 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/PatientIdentifier.java 2012-06-18 09:20:33 +0000
@@ -36,6 +36,8 @@
public class PatientIdentifier
implements DataStreamSerializable
{
+ private String clientVersion;
+
private String identifierType;
private String identifier;
@@ -88,4 +90,20 @@
identifier = dataInputStream.readUTF();
}
+ @Override
+ public void serializeVerssion2Point8()
+ throws IOException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void serializeVerssion2Point9()
+ throws IOException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
}
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/Program.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/Program.java 2011-11-04 11:27:33 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/Program.java 2012-06-18 09:20:33 +0000
@@ -35,7 +35,8 @@
public class Program
extends Model
{
-
+ private String clientVersion;
+
private int version;
public int getVersion()
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/ProgramStage.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/ProgramStage.java 2012-04-13 08:27:30 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/ProgramStage.java 2012-06-18 09:20:33 +0000
@@ -35,7 +35,8 @@
public class ProgramStage
extends Model
{
-
+ private String clientVersion;
+
private List<DataElement> dataElements;
public List<DataElement> getDataElements()
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/Section.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/Section.java 2012-04-13 08:27:30 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/Section.java 2012-06-18 09:20:33 +0000
@@ -36,7 +36,8 @@
public class Section
extends Model
{
-
+ private String clientVersion;
+
private List<DataElement> dataElements;
@XmlElement( name = "dataElement" )
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/Task.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/Task.java 2011-11-04 11:27:33 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/Task.java 2012-06-18 09:20:33 +0000
@@ -34,6 +34,8 @@
public class Task
implements DataStreamSerializable
{
+ private String clientVersion;
+
private int id;
private int programStageId;
@@ -99,4 +101,20 @@
// Fixme
}
+
+ @Override
+ public void serializeVerssion2Point8()
+ throws IOException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void serializeVerssion2Point9()
+ throws IOException
+ {
+ // TODO Auto-generated method stub
+
+ }
}
=== modified file 'dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileOrganisationUnitController.java'
--- dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileOrganisationUnitController.java 2012-03-07 14:05:05 +0000
+++ dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileOrganisationUnitController.java 2012-06-18 09:20:33 +0000
@@ -13,6 +13,7 @@
import org.hisp.dhis.api.mobile.model.ActivityValue;
import org.hisp.dhis.api.mobile.model.DataSetList;
import org.hisp.dhis.api.mobile.model.DataSetValue;
+import org.hisp.dhis.api.mobile.model.DataStreamSerializable;
import org.hisp.dhis.api.mobile.model.MobileModel;
import org.hisp.dhis.api.mobile.model.ModelList;
import org.hisp.dhis.i18n.I18nService;
@@ -32,10 +33,10 @@
public class MobileOrganisationUnitController
extends AbstractMobileController
{
- private static final String ACTIVITY_REPORT_UPLOADED = "activity_report_uploaded";
-
+ private static final String ACTIVITY_REPORT_UPLOADED = "activity_report_uploaded";
+
private static final String DATASET_REPORT_UPLOADED = "dataset_report_uploaded";
-
+
@Autowired
private ActivityReportingService activityReportingService;
@@ -53,10 +54,16 @@
@RequestMapping( method = RequestMethod.GET, value = "{id}/all" )
@ResponseBody
- public MobileModel getAllDataForOrgUnit( @PathVariable int id, @RequestHeader( "accept-language" ) String locale )
+ public MobileModel getAllDataForOrgUnit( @PathVariable int id, @RequestHeader( "accept-language" ) String locale,
+ @RequestHeader( "client-version" ) String clientVersion )
{
+ if ( clientVersion == null || clientVersion.equals( DataStreamSerializable.BLANK ) )
+ {
+ clientVersion = DataStreamSerializable.TWO_POINT_EIGHT;
+ }
+
MobileModel mobileModel = new MobileModel();
-
+
OrganisationUnit unit = getUnit( id );
mobileModel.setActivityPlan( activityReportingService.getCurrentActivityPlan( unit, locale ) );
mobileModel.setPrograms( programService.getPrograms( unit, locale ) );