← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10514: [mobile] link registered person to dashboard

 

------------------------------------------------------------
revno: 10514
committer: Homg Em <em.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-04-10 17:07:56 +0700
message:
  [mobile] link registered person to dashboard
modified:
  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/test/java/org/hisp/dhis/mobile/api/model/OrgUnitTest.java
  dhis-2/dhis-services/dhis-service-mobile/src/test/java/org/hisp/dhis/mobile/api/model/OrgUnitsTest.java
  dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileClientController.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/MobileOrgUnitLinks.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/MobileOrgUnitLinks.java	2013-04-05 06:01:19 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/MobileOrgUnitLinks.java	2013-04-10 10:07:56 +0000
@@ -80,6 +80,8 @@
 
     private String getVariesInfoUrl;
 
+    private String findLatestPersonUrl;
+
     @XmlAttribute
     public int getId()
     {
@@ -282,6 +284,16 @@
         this.findProgramUrl = findProgramUrl;
     }
 
+    public String getFindLatestPersonUrl()
+    {
+        return findLatestPersonUrl;
+    }
+
+    public void setFindLatestPersonUrl( String findLatestPersonUrl )
+    {
+        this.findLatestPersonUrl = findLatestPersonUrl;
+    }
+
     public void serialize( DataOutputStream dataOutputStream )
 
         throws IOException
@@ -305,6 +317,7 @@
         dataOutputStream.writeUTF( this.addRelationshipUrl );
         dataOutputStream.writeUTF( this.downloadAnonymousProgramUrl );
         dataOutputStream.writeUTF( this.findProgramUrl );
+        dataOutputStream.writeUTF( this.findLatestPersonUrl );
     }
 
     public void deSerialize( DataInputStream dataInputStream )
@@ -329,6 +342,7 @@
         this.addRelationshipUrl = dataInputStream.readUTF();
         this.downloadAnonymousProgramUrl = dataInputStream.readUTF();
         this.findProgramUrl = dataInputStream.readUTF();
+        this.findLatestPersonUrl = dataInputStream.readUTF();
     }
 
     @Override
@@ -386,5 +400,6 @@
         dataOutputStream.writeUTF( this.addRelationshipUrl );
         dataOutputStream.writeUTF( this.downloadAnonymousProgramUrl );
         dataOutputStream.writeUTF( this.findProgramUrl );
+        dataOutputStream.writeUTF( this.findLatestPersonUrl );
     }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/test/java/org/hisp/dhis/mobile/api/model/OrgUnitTest.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/test/java/org/hisp/dhis/mobile/api/model/OrgUnitTest.java	2013-04-03 09:12:02 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/test/java/org/hisp/dhis/mobile/api/model/OrgUnitTest.java	2013-04-10 10:07:56 +0000
@@ -46,11 +46,11 @@
         throws IOException
     {
         MobileOrgUnitLinks unit = new MobileOrgUnitLinks();
-        
+
         unit.setId( 1 );
         unit.setName( "name" );
         unit.setDownloadAllUrl( "downloadAllUrl" );
-        unit.setUpdateActivityPlanUrl("updateActivityPlanUrl");
+        unit.setUpdateActivityPlanUrl( "updateActivityPlanUrl" );
         unit.setUploadFacilityReportUrl( "uploadFacilityReportUrl" );
         unit.setUploadActivityReportUrl( "uploadActivityReportUrl" );
         unit.setUpdateDataSetUrl( "updateDataSetUrl" );
@@ -66,6 +66,7 @@
         unit.setAddRelationshipUrl( "addRelationshipUrl" );
         unit.setDownloadAnonymousProgramUrl( "downloadAnonymousProgramUrl" );
         unit.setFindProgramUrl( "findProgramUrl" );
+        unit.setFindLatestPersonUrl( "findLatestPersonUrl" );
 
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         DataOutputStream dos = new DataOutputStream( baos );

=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/test/java/org/hisp/dhis/mobile/api/model/OrgUnitsTest.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/test/java/org/hisp/dhis/mobile/api/model/OrgUnitsTest.java	2013-04-03 09:12:02 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/test/java/org/hisp/dhis/mobile/api/model/OrgUnitsTest.java	2013-04-10 10:07:56 +0000
@@ -71,11 +71,11 @@
     private MobileOrgUnitLinks createOrgUnit()
     {
         MobileOrgUnitLinks unit = new MobileOrgUnitLinks();
-        
+
         unit.setId( 1 );
         unit.setName( "name" );
         unit.setDownloadAllUrl( "downloadAllUrl" );
-        unit.setUpdateActivityPlanUrl("updateActivityPlanUrl");
+        unit.setUpdateActivityPlanUrl( "updateActivityPlanUrl" );
         unit.setUploadFacilityReportUrl( "uploadFacilityReportUrl" );
         unit.setUploadActivityReportUrl( "uploadActivityReportUrl" );
         unit.setUpdateDataSetUrl( "updateDataSetUrl" );
@@ -91,6 +91,7 @@
         unit.setAddRelationshipUrl( "addRelationshipUrl" );
         unit.setDownloadAnonymousProgramUrl( "downloadAnonymousProgramUrl" );
         unit.setFindProgramUrl( "findProgramUrl" );
+        unit.setFindLatestPersonUrl( "findLatestPersonUrl" );
         return unit;
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileClientController.java'
--- dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileClientController.java	2013-04-05 06:01:19 +0000
+++ dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileClientController.java	2013-04-10 10:07:56 +0000
@@ -127,6 +127,7 @@
         orgUnit.setAddRelationshipUrl( getUrl( request, unit.getId(), "addRelationship" ) );
         orgUnit.setDownloadAnonymousProgramUrl( getUrl( request, unit.getId(), "downloadAnonymousProgramUrl" ) );
         orgUnit.setFindProgramUrl( getUrl( request, unit.getId(), "findProgram" ) );
+        orgUnit.setFindLatestPersonUrl( getUrl( request, unit.getId(), "findLatestPerson" ) );
 
         // generate URL for download new version
         String full = UrlUtils.buildFullRequestUrl( request );

=== 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	2013-04-05 06:01:19 +0000
+++ dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileOrganisationUnitController.java	2013-04-10 10:07:56 +0000
@@ -553,4 +553,14 @@
         return patientIdentifierAndAttribute;
 
     }
+    
+    @RequestMapping( method = RequestMethod.GET, value = "{clientVersion}/LWUIT/orgUnits/{id}/findLatestPerson" )
+    @ResponseBody
+    public Patient findLatestPerson( @PathVariable
+    int id, @RequestHeader( "name" )
+    String keyword )
+        throws NotAllowedException
+    {
+        return activityReportingService.findPatient( keyword, id );
+    }
 }