← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12490: check null case for sending sms, re-arrange setters position

 

------------------------------------------------------------
revno: 12490
committer: Lai <lai.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-10-08 12:37:25 +0700
message:
  check null case for sending sms, re-arrange setters position
modified:
  dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java
  dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/ProcessingSendSMSAction.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/mobile/service/ActivityReportingServiceImpl.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java	2013-10-07 18:38:10 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java	2013-10-08 05:37:25 +0000
@@ -218,6 +218,111 @@
         this.patientId = patientId;
     }
 
+    @Required
+    public void setProgramStageInstanceService(
+        org.hisp.dhis.program.ProgramStageInstanceService programStageInstanceService )
+    {
+        this.programStageInstanceService = programStageInstanceService;
+    }
+
+    @Required
+    public void setPatientAttValueService( PatientAttributeValueService patientAttValueService )
+    {
+        this.patientAttValueService = patientAttValueService;
+    }
+
+    @Required
+    public void setPatientAttService( PatientAttributeService patientAttService )
+    {
+        this.patientAttService = patientAttService;
+    }
+
+    @Required
+    public void setDataValueService( org.hisp.dhis.patientdatavalue.PatientDataValueService dataValueService )
+    {
+        this.dataValueService = dataValueService;
+    }
+
+    @Required
+    public void setPatientMobileSettingService( PatientMobileSettingService patientMobileSettingService )
+    {
+        this.patientMobileSettingService = patientMobileSettingService;
+    }
+
+    @Required
+    public void setModelMapping( org.hisp.dhis.mobile.service.ModelMapping modelMapping )
+    {
+        this.modelMapping = modelMapping;
+    }
+
+    public PatientMobileSetting getSetting()
+    {
+        return setting;
+    }
+
+    public void setSetting( PatientMobileSetting setting )
+    {
+        this.setting = setting;
+    }
+
+    public org.hisp.dhis.patient.PatientAttribute getGroupByAttribute()
+    {
+        return groupByAttribute;
+    }
+
+    public void setGroupByAttribute( org.hisp.dhis.patient.PatientAttribute groupByAttribute )
+    {
+        this.groupByAttribute = groupByAttribute;
+    }
+
+    @Required
+    public void setPatientIdentifierService( PatientIdentifierService patientIdentifierService )
+    {
+        this.patientIdentifierService = patientIdentifierService;
+    }
+
+    @Required
+    public void setPatientService( PatientService patientService )
+    {
+        this.patientService = patientService;
+    }
+
+    @Required
+    public void setProgramInstanceService( ProgramInstanceService programInstanceService )
+    {
+        this.programInstanceService = programInstanceService;
+    }
+
+    @Required
+    public void setRelationshipService( RelationshipService relationshipService )
+    {
+        this.relationshipService = relationshipService;
+    }
+
+    @Required
+    public void setProgramStageSectionService( ProgramStageSectionService programStageSectionService )
+    {
+        this.programStageSectionService = programStageSectionService;
+    }
+
+    @Required
+    public void setDataElementService( DataElementService dataElementService )
+    {
+        this.dataElementService = dataElementService;
+    }
+
+    @Required
+    public void setPatientDataValueService( PatientDataValueService patientDataValueService )
+    {
+        this.patientDataValueService = patientDataValueService;
+    }
+
+    @Required
+    public void setProgramService( ProgramService programService )
+    {
+        this.programService = programService;
+    }
+
     // -------------------------------------------------------------------------
     // MobileDataSetService
     // -------------------------------------------------------------------------
@@ -1546,112 +1651,6 @@
         }
     }
 
-    // Setters...
-
-    @Required
-    public void setProgramStageInstanceService(
-        org.hisp.dhis.program.ProgramStageInstanceService programStageInstanceService )
-    {
-        this.programStageInstanceService = programStageInstanceService;
-    }
-
-    @Required
-    public void setPatientAttValueService( PatientAttributeValueService patientAttValueService )
-    {
-        this.patientAttValueService = patientAttValueService;
-    }
-
-    @Required
-    public void setPatientAttService( PatientAttributeService patientAttService )
-    {
-        this.patientAttService = patientAttService;
-    }
-
-    @Required
-    public void setDataValueService( org.hisp.dhis.patientdatavalue.PatientDataValueService dataValueService )
-    {
-        this.dataValueService = dataValueService;
-    }
-
-    @Required
-    public void setPatientMobileSettingService( PatientMobileSettingService patientMobileSettingService )
-    {
-        this.patientMobileSettingService = patientMobileSettingService;
-    }
-
-    @Required
-    public void setModelMapping( org.hisp.dhis.mobile.service.ModelMapping modelMapping )
-    {
-        this.modelMapping = modelMapping;
-    }
-
-    public PatientMobileSetting getSetting()
-    {
-        return setting;
-    }
-
-    public void setSetting( PatientMobileSetting setting )
-    {
-        this.setting = setting;
-    }
-
-    public org.hisp.dhis.patient.PatientAttribute getGroupByAttribute()
-    {
-        return groupByAttribute;
-    }
-
-    public void setGroupByAttribute( org.hisp.dhis.patient.PatientAttribute groupByAttribute )
-    {
-        this.groupByAttribute = groupByAttribute;
-    }
-
-    @Required
-    public void setPatientIdentifierService( PatientIdentifierService patientIdentifierService )
-    {
-        this.patientIdentifierService = patientIdentifierService;
-    }
-
-    @Required
-    public void setPatientService( PatientService patientService )
-    {
-        this.patientService = patientService;
-    }
-
-    @Required
-    public void setProgramInstanceService( ProgramInstanceService programInstanceService )
-    {
-        this.programInstanceService = programInstanceService;
-    }
-
-    @Required
-    public void setRelationshipService( RelationshipService relationshipService )
-    {
-        this.relationshipService = relationshipService;
-    }
-
-    @Required
-    public void setProgramStageSectionService( ProgramStageSectionService programStageSectionService )
-    {
-        this.programStageSectionService = programStageSectionService;
-    }
-
-    @Required
-    public void setDataElementService( DataElementService dataElementService )
-    {
-        this.dataElementService = dataElementService;
-    }
-
-    @Required
-    public void setPatientDataValueService( PatientDataValueService patientDataValueService )
-    {
-        this.patientDataValueService = patientDataValueService;
-    }
-
-    @Required
-    public void setProgramService( ProgramService programService )
-    {
-        this.programService = programService;
-    }
 
     public Collection<PatientIdentifierType> getIdentifierTypes()
     {
@@ -1782,8 +1781,6 @@
     {
         org.hisp.dhis.patient.Patient patientWeb = new org.hisp.dhis.patient.Patient();
         
-        System.out.println("Name: " + patient.getName());
-        
         patientWeb.setName( patient.getName() );
         patientWeb.setGender( patient.getGender() );
         patientWeb.setDobType( patient.getDobType() );

=== modified file 'dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/ProcessingSendSMSAction.java'
--- dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/ProcessingSendSMSAction.java	2013-09-11 13:46:35 +0000
+++ dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/ProcessingSendSMSAction.java	2013-10-08 05:37:25 +0000
@@ -198,7 +198,6 @@
         }
         else if ( sendTarget.equals( "userGroup" ) )
         {
-
             UserGroup group = userGroupService.getUserGroup( userGroup );
 
             if ( group == null )
@@ -273,6 +272,11 @@
 
             return ERROR;
         }
+        if ( message == null )
+        {
+            message = "An inter error occurs, please contact your administration";
+            return ERROR;
+        }
 
         return SUCCESS;
     }