dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #19004
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8118: Fix bug in Send SMS page
------------------------------------------------------------
revno: 8118
committer: Lai <lai.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-09-18 14:53:45 +0700
message:
Fix bug in Send SMS page
modified:
dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/smslib/SmsLibService.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/RemoveGatewayConfigAction.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-sms/src/main/java/org/hisp/dhis/sms/smslib/SmsLibService.java'
--- dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/smslib/SmsLibService.java 2012-09-14 09:11:26 +0000
+++ dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/smslib/SmsLibService.java 2012-09-18 07:53:45 +0000
@@ -72,7 +72,7 @@
private final String CLICKATELL_GATEWAY = "clickatell_gw";
- private final String HTTP_GATEWAY = "http_gw";
+ private final String HTTP_GATEWAY = "generic_http_gw";
private final String MODEM_GATEWAY = "modem_gw";
@@ -99,11 +99,10 @@
@Override
public Map<String, String> getGatewayMap()
{
- if ( gatewayMap == null || gatewayMap.isEmpty() )
+ if( gatewayMap == null || gatewayMap.isEmpty())
{
reloadConfig();
}
-
return gatewayMap;
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/RemoveGatewayConfigAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/RemoveGatewayConfigAction.java 2012-09-05 16:25:31 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/RemoveGatewayConfigAction.java 2012-09-18 07:53:45 +0000
@@ -30,8 +30,15 @@
import java.util.Iterator;
import org.hisp.dhis.sms.SmsConfigurationManager;
+import org.hisp.dhis.sms.config.BulkSmsGatewayConfig;
+import org.hisp.dhis.sms.config.ClickatellGatewayConfig;
+import org.hisp.dhis.sms.config.GenericHttpGatewayConfig;
+import org.hisp.dhis.sms.config.ModemGatewayConfig;
+import org.hisp.dhis.sms.config.SMPPGatewayConfig;
import org.hisp.dhis.sms.config.SmsConfiguration;
import org.hisp.dhis.sms.config.SmsGatewayConfig;
+import org.hisp.dhis.sms.outbound.OutboundSmsTransportService;
+import org.smslib.AGateway;
import org.springframework.beans.factory.annotation.Autowired;
import com.opensymphony.xwork2.Action;
@@ -44,12 +51,25 @@
public class RemoveGatewayConfigAction
implements Action
{
+ private final String BULK_GATEWAY = "bulk_gw";
+
+ private final String CLICKATELL_GATEWAY = "clickatell_gw";
+
+ private final String HTTP_GATEWAY = "generic_http_gw";
+
+ private final String MODEM_GATEWAY = "modem_gw";
+
+ private final String SMPP_GATEWAY = "smpp_gw";
+
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
@Autowired
private SmsConfigurationManager smsConfigurationManager;
+
+ @Autowired
+ private OutboundSmsTransportService transportService;
// -------------------------------------------------------------------------
// Input
@@ -78,10 +98,37 @@
{
if ( smsConfig.getGateways().indexOf( it.next() ) == id )
{
+ SmsGatewayConfig gatewayConfig = smsConfig.getGateways().get( id );
+
it.remove();
smsConfigurationManager.updateSmsConfiguration( smsConfig );
-
+
+ if ( gatewayConfig instanceof BulkSmsGatewayConfig )
+ {
+ transportService.getGatewayMap().remove( BULK_GATEWAY);
+ }
+
+ if ( gatewayConfig instanceof ClickatellGatewayConfig )
+ {
+ transportService.getGatewayMap().remove( CLICKATELL_GATEWAY );
+ }
+
+ if ( gatewayConfig instanceof ModemGatewayConfig )
+ {
+ transportService.getGatewayMap().remove( MODEM_GATEWAY );
+ }
+
+ if ( gatewayConfig instanceof GenericHttpGatewayConfig)
+ {
+ transportService.getGatewayMap().remove( HTTP_GATEWAY );
+ }
+
+ if ( gatewayConfig instanceof SMPPGatewayConfig )
+ {
+ transportService.getGatewayMap().remove( SMPP_GATEWAY );
+ }
+
break;
}
}