dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #12631
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3931: Merged Mobile code from 2.1
------------------------------------------------------------
revno: 3931
committer: Bharath <chbharathk@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2011-06-17 15:36:08 +0530
message:
Merged Mobile code from 2.1
added:
local/in/dhis-mobile/dhis-web-mobile/src/main/java/org/hisp/dhis/mobile/BulkSMSHttpInterface.java
local/in/dhis-mobile/dhis-web-mobile/src/main/java/org/hisp/dhis/mobile/action/SendBulkSMSAction.java
local/in/dhis-mobile/dhis-web-mobile/src/main/java/org/hisp/dhis/mobile/action/SendBulkSMSThirdPartyAction.java
local/in/dhis-mobile/dhis-web-mobile/src/main/webapp/dhis-web-mobile/javascript/bulkSMS.js
local/in/dhis-mobile/dhis-web-mobile/src/main/webapp/dhis-web-mobile/sendBulkSMSPage.vm
modified:
local/in/dhis-mobile/dhis-service-mobile/pom.xml
local/in/dhis-mobile/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/SmsService.java
local/in/dhis-mobile/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/api/DefaultMobileImportService.java
local/in/dhis-mobile/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/scheduler/CheckDataStatusJob.java
local/in/dhis-mobile/dhis-web-mobile/pom.xml
local/in/dhis-mobile/dhis-web-mobile/src/main/java/org/hisp/dhis/mobile/action/ReceiveMessagesPageAction.java
local/in/dhis-mobile/dhis-web-mobile/src/main/resources/META-INF/dhis/beans.xml
local/in/dhis-mobile/dhis-web-mobile/src/main/resources/struts.xml
local/in/dhis-mobile/dhis-web-mobile/src/main/webapp/WEB-INF/web.xml
local/in/dhis-mobile/dhis-web-mobile/src/main/webapp/dhis-web-mobile/menu.vm
local/in/dhis-mobile/pom.xml
--
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 'local/in/dhis-mobile/dhis-service-mobile/pom.xml'
--- local/in/dhis-mobile/dhis-service-mobile/pom.xml 2011-04-15 11:41:30 +0000
+++ local/in/dhis-mobile/dhis-service-mobile/pom.xml 2011-06-17 10:06:08 +0000
@@ -6,7 +6,7 @@
<parent>
<groupId>org.hisp.dhis</groupId>
<artifactId>dhis-services</artifactId>
- <version>2.2-SNAPSHOT</version>
+ <version>2.3-SNAPSHOT</version>
</parent>
<artifactId>dhis-service-mobile</artifactId>
@@ -51,6 +51,7 @@
<artifactId>smslib-all</artifactId>
<version>3.4.5</version>
</dependency>
+ <!--
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
@@ -61,6 +62,7 @@
<artifactId>slf4j-jdk14</artifactId>
<version>1.5.11</version>
</dependency>
+ -->
<dependency>
<groupId>org.rxtx</groupId>
<artifactId>rxtx</artifactId>
=== modified file 'local/in/dhis-mobile/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/SmsService.java'
--- local/in/dhis-mobile/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/SmsService.java 2011-04-15 11:41:30 +0000
+++ local/in/dhis-mobile/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/SmsService.java 2011-06-17 10:06:08 +0000
@@ -1,4 +1,4 @@
-/*
+ /*
* Copyright (c) 2004-2010, University of Oslo
* All rights reserved.
*
@@ -86,13 +86,12 @@
}
private SendSMSService sendSMSService;
-
+
public void setSendSMSService( SendSMSService sendSMSService )
{
this.sendSMSService = sendSMSService;
}
-
/*------------------------------------------------------------------
* Implementation
------------------------------------------------------------------*/
@@ -119,8 +118,8 @@
outboundNotification = new OutboundNotification();
callNotification = new CallNotification();
}
-
- @Override
+
+ @Override
public String sendOtaMessage( String recipient, String url, String prompt )
{
String status = new String();
@@ -135,6 +134,7 @@
} else
{
status = "SERVICE IS NOT RUNNING";
+
}
} catch ( Exception e )
{
@@ -143,7 +143,7 @@
}
return status;
}
-
+
private Service getService()
{
return serv;
@@ -213,9 +213,9 @@
if ( getServiceStatus() )
{
serv.createGroup( groupName );
-
+
//Collection<OutboundMessage> messages = new ArrayList<OutboundMessage>();
- for( String recepient : recepients )
+ for ( String recepient : recepients )
{
//OutboundMessage message = new OutboundMessage( recepient, msg );
//System.out.println("Phone:"+recepient);
@@ -224,118 +224,122 @@
}
OutboundMessage message = new OutboundMessage( groupName, msg );
-
+
try
{
- serv.sendMessage( message );
+ serv.sendMessage( message );
//serv.sendMessages( messages );
getService().getLogger().logInfo( "Message Sent to Group: " + groupName, null, null );
return "SUCCESS";
- }
- catch ( TimeoutException ex )
+ } catch ( TimeoutException ex )
{
getService().getLogger().logError( "Timeout error in sending message", ex, null );
return "ERROR";
- }
- catch ( GatewayException ex )
+ } catch ( GatewayException ex )
{
getService().getLogger().logError( "Gateway Exception in sending message", ex, null );
return "ERROR";
- }
- catch ( IOException ex )
+ } catch ( IOException ex )
{
getService().getLogger().logError( "IO Exception in sending message", ex, null );
return "ERROR";
- }
- catch ( InterruptedException ex )
+ } catch ( InterruptedException ex )
{
getService().getLogger().logError( "Interrupted Exception in sending message", ex, null );
return "ERROR";
- }
- finally
+ } finally
{
serv.removeGroup( groupName );
}
- }
- else
+ } else
{
getService().getLogger().logError( "Service not running", null, null );
return "SERVICE NOT RUNNING";
}
}
-
+
@Override
public String sendDrafts()
{
int successCount = 0;
int failCount = 0;
-
+
int draftCount = (int) sendSMSService.getRowCount();
-
+
List<SendSMS> sendSMSList = new ArrayList<SendSMS>();
-
- if( draftCount == 0 )
+
+ if ( draftCount == 0 )
{
return "No Drafts to send";
- }
- else if( draftCount < SendSMS.sendSMSRange )
- {
- sendSMSList.addAll( sendSMSService.getSendSMS( 0, draftCount ) );
- }
- else
- {
- sendSMSList.addAll( sendSMSService.getSendSMS( 0, SendSMS.sendSMSRange-1 ) );
+ } else
+ {
+ if ( draftCount < SendSMS.sendSMSRange )
+ {
+ sendSMSList.addAll( sendSMSService.getSendSMS( 0, draftCount ) );
+ } else
+ {
+ sendSMSList.addAll( sendSMSService.getSendSMS( 0, SendSMS.sendSMSRange - 1 ) );
+ }
}
- for( SendSMS sendSMS : sendSMSList )
+ for ( SendSMS sendSMS : sendSMSList )
{
String status = sendMessage( sendSMS.getSenderInfo().split( "_" )[0], sendSMS.getSendingMessage() );
- if( status.equalsIgnoreCase( "SUCCESS" ) )
+ if ( status.equalsIgnoreCase( "SUCCESS" ) )
{
sendSMSService.deleteSendSMS( sendSMS );
successCount++;
- }
- else if( status.equalsIgnoreCase( "MODEMERROR" ) )
- {
- getService().getLogger().logError( "Modem Stops Responding...Till then successfully sent : "+successCount, null, null );
- return "Modem Stops Responding...Till then successfully sent : "+successCount;
- }
- else
- {
- failCount++;
+ } else
+ {
+ if ( status.equalsIgnoreCase( "MODEMERROR" ) )
+ {
+ getService().getLogger().logError( "Modem Stops Responding...Till then successfully sent : " + successCount, null, null );
+ return "Modem Stops Responding...Till then successfully sent : " + successCount;
+ } else
+ {
+ failCount++;
+ }
}
}
-
- return "SMS Successfully Sent : "+ successCount +" Failed : " + failCount;
+
+ return "SMS Successfully Sent : " + successCount + " Failed : " + failCount;
}
-
+
@Override
public String sendMessages( List<SendSMS> sendSMSList )
{
int successCount = 0;
int failCount = 0;
-
- for( SendSMS sendSMS : sendSMSList )
+ String status = null;
+ for ( int i = 0; i < sendSMSList.size(); i++ )
{
- String status = sendMessage( sendSMS.getSenderInfo().split( "_" )[0], sendSMS.getSendingMessage() );
- if( status.equalsIgnoreCase( "SUCCESS" ) )
+ //System.out.println("Successfully sent : "+ successCount +" Failed : " + failCount);
+ status = sendMessage( sendSMSList.get( i ).getSenderInfo(), sendSMSList.get( i ).getSendingMessage() );
+ if ( status.equalsIgnoreCase( "SUCCESS" ) )
{
successCount++;
- }
- else if( status.equalsIgnoreCase( "MODEMERROR" ) )
- {
- getService().getLogger().logError( "Modem Stops Responding...Till then successfully sent : "+successCount, null, null );
- return "Modem Stops Responding...Till then successfully sent : "+successCount;
- }
- else
- {
- failCount++;
+ } else
+ {
+ if ( status.equalsIgnoreCase( "MODEMERROR" ) )
+ {
+ getService().getLogger().logError( "Modem Stops Responding...Till then successfully sent : " + successCount, null, null );
+ //System.out.println("Successfully sent : "+ successCount +" Failed : " + failCount);
+ System.out.println( "modem is not responding....waiting for it to respond..." );
+ // return "Modem Stops Responding...Till then successfully sent : "+successCount;
+ i--;
+ } else
+ {
+ if ( status.equals( "SERVICE NOT RUNNING" ) )
+ {
+ return "SERVICE NOT RUNNING";
+ }
+ }
}
}
-
- return "Successfully sent : "+ successCount +" Failed : " + failCount;
+
+ return status;
}
-
+
@Override
public String sendMessage( String recipient, String msg )
{
@@ -344,39 +348,33 @@
{
try
{
- if( serv.sendMessage( message ) )
+ if ( serv.sendMessage( message ) )
{
getService().getLogger().logInfo( "Message Sent to: " + recipient, null, null );
return "SUCCESS";
- }
- else
+ } else
{
- getService().getLogger().logError( "Timeout error in sending message to: "+recipient, null, null );
+ getService().getLogger().logError( "Timeout error in sending message to: " + recipient, null, null );
return "MODEMERROR";
}
- }
- catch ( TimeoutException ex )
+ } catch ( TimeoutException ex )
{
getService().getLogger().logError( "Timeout error in sending message", ex, null );
return "ERROR";
- }
- catch ( GatewayException ex )
+ } catch ( GatewayException ex )
{
getService().getLogger().logError( "Gateway Exception in sending message", ex, null );
return "ERROR";
- }
- catch ( IOException ex )
+ } catch ( IOException ex )
{
getService().getLogger().logError( "IO Exception in sending message", ex, null );
return "ERROR";
- }
- catch ( InterruptedException ex )
+ } catch ( InterruptedException ex )
{
getService().getLogger().logError( "Interrupted Exception in sending message", ex, null );
return "ERROR";
}
- }
- else
+ } else
{
getService().getLogger().logError( "Service not running", null, null );
return "SERVICE NOT RUNNING";
@@ -396,11 +394,11 @@
String sender = binaryMsg.getOriginator();
Date sendTime = binaryMsg.getDate();
-
+
// Creating XML File
getService().getLogger().logInfo( "Creating XML file...", null, null );
createXMLFile( sender, sendTime, unCompressedText );
-
+
//Delete SMS
getService().getLogger().logInfo( "Deleting SMS...", null, null );
if ( getProperties().getProperty( "settings.delete_after_processing", "no" ).equalsIgnoreCase( "yes" ) )
@@ -410,55 +408,48 @@
getService().deleteMessage( (InboundMessage) message );
getService().getLogger().logInfo( "Deleted message", null, null );
delSMSflag = 1;
- }
- catch ( Exception e )
+ } catch ( Exception e )
{
getService().getLogger().logError( "Error deleting received message!", e, null );
}
}
-
+
// Import data into DHIS
//getService().getLogger().logInfo( "Importing data into DHIS...", null, null );
//String statusMessage = importData( sender, sendTime, unCompressedText );
-
+
//Sending ACK/Status SMS
//getService().getLogger().logInfo( "Sending ACK/Status messge...", null, null );
//sendMessage( sender, statusMessage );
-
+
getService().getLogger().logInfo( "---Message Processing Finished---", null, null );
-
+
//String statusMessage = saveData( sender, sendTime, unCompressedText );
//getService().getLogger().logInfo( "Saved Report. Sending Acknowledgement to " + sender, null, null );
//sendAck( sender, "REPORT", unCompressedText );
//sendMessage( sender, statusMessage );
- }
- catch ( UnsupportedEncodingException uneex )
+ } catch ( UnsupportedEncodingException uneex )
{
getService().getLogger().logError( "Error reading encoding: ", uneex, null );
return;
- }
- catch ( ClassCastException ccex )
+ } catch ( ClassCastException ccex )
{
getService().getLogger().logError( "Error performing ClassCast: ", ccex, null );
return;
- }
- catch ( ArithmeticException aex )
+ } catch ( ArithmeticException aex )
{
getService().getLogger().logError( "Error performing arithmatic operation: ", aex, null );
return;
- }
- catch (ArrayIndexOutOfBoundsException aiobex)
+ } catch ( ArrayIndexOutOfBoundsException aiobex )
{
getService().getLogger().logError( "Error with message format. PLEASE CHECK APP VERSION: ", aiobex, null );
return;
- }
- catch (NullPointerException npex)
+ } catch ( NullPointerException npex )
{
getService().getLogger().logError( "MISSING form number. PLEASE CHECK formIDLayout.csv: ", npex, null );
return;
- }
- finally
+ } finally
{
if ( getProperties().getProperty( "settings.delete_after_processing", "no" ).equalsIgnoreCase( "yes" ) && delSMSflag == 0 )
{
@@ -466,8 +457,7 @@
{
getService().deleteMessage( (InboundMessage) message );
getService().getLogger().logInfo( "Deleted message", null, null );
- }
- catch ( Exception e )
+ } catch ( Exception e )
{
getService().getLogger().logError( "Error deleting received message!", e, null );
}
@@ -539,7 +529,7 @@
getService().getLogger().logInfo( "Importing Completed for current messages", null, null );
return statusMessage;
}
-
+
@Override
public String saveData( String mobileNumber, Date sendTime, String data )
{
@@ -566,52 +556,51 @@
@Override
public String processPendingMessages()
{
- if( !getServiceStatus() )
+ if ( !getServiceStatus() )
{
getService().getLogger().logError( "SMSService not running", null, null );
-
+
return "SMSService not running";
}
-
+
List<InboundMessage> msgList = new ArrayList<InboundMessage>();
-
+
msgList = readAllMessages();
-
- if( msgList != null && msgList.size() > 0 )
+
+ if ( msgList != null && msgList.size() > 0 )
{
- for( InboundMessage msg : msgList )
+ for ( InboundMessage msg : msgList )
{
processMessage( msg );
}
-
+
return "Successfully Processed all Pending Messages.";
- }
- else
+ } else
{
return "No Pending Messages to Process.";
}
}
-
+
@Override
- public Map<String,String> readAllPendingMessages()
+ public Map<String, String> readAllPendingMessages()
{
- if( !getServiceStatus() )
+ if ( !getServiceStatus() )
{
getService().getLogger().logError( "SMSService not running", null, null );
-
+
return null;
}
-
- Map<String,String> pendingMessages = new HashMap<String,String>();
+
+ Map<String, String> pendingMessages = new HashMap<String, String>();
// Define a list which will hold the read messages.
List<InboundMessage> msgList = new ArrayList<InboundMessage>();
try
{
getService().getLogger().logInfo( "Reading All Pending Messages...", null, null );
- serv.readMessages(msgList, MessageClasses.ALL);
-
- for( Object msg : msgList )
+ serv.readMessages( msgList, MessageClasses.ALL );
+
+ for ( Object msg : msgList )
{
try
{
@@ -622,76 +611,71 @@
String sender = binaryMsg.getOriginator();
SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd_HH-mm-ss" );
String timeStamp = dateFormat.format( sendTime );
-
- pendingMessages.put( sender+"_"+timeStamp, unCompressedText );
-
- }
- catch ( ClassCastException ccex )
+
+ pendingMessages.put( sender + "_" + timeStamp, unCompressedText );
+
+ } catch ( ClassCastException ccex )
{
InboundMessage message = (InboundMessage) msg;
Date sendTime = message.getDate();
String sender = message.getOriginator();
SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd_HH-mm-ss" );
String timeStamp = dateFormat.format( sendTime );
-
+
try
{
- pendingMessages.put( sender+"_"+timeStamp, message.getText() );
+ pendingMessages.put( sender + "_" + timeStamp, message.getText() );
getService().getLogger().logInfo( "Normal Text Message", null, null );
- }
- catch( Exception e )
+ } catch ( Exception e )
{
- pendingMessages.put( sender+"_"+timeStamp, "Unsupported Format" );
+ pendingMessages.put( sender + "_" + timeStamp, "Unsupported Format" );
getService().getLogger().logError( "UnSupported Format", null, null );
}
- }
- catch( Exception e )
+ } catch ( Exception e )
{
getService().getLogger().logError( "Error While reading messages, returning whatever sms got till now", null, null );
return pendingMessages;
}
}
-
+
return pendingMessages;
- }
- catch (Exception e)
+ } catch ( Exception e )
{
e.printStackTrace();
getService().getLogger().logError( "SMSServer: error setting custom balancer!", null, null );
-
+
return null;
}
}
-
+
@Override
public List<InboundMessage> readAllMessages()
{
- if( !getServiceStatus() )
+ if ( !getServiceStatus() )
{
getService().getLogger().logError( "SMSService not running", null, null );
-
+
return null;
}
-
+
// Define a list which will hold the read messages.
List<InboundMessage> msgList = new ArrayList<InboundMessage>();
try
{
getService().getLogger().logInfo( "Reading All Messages...", null, null );
- serv.readMessages(msgList, MessageClasses.ALL);
-
+ serv.readMessages( msgList, MessageClasses.ALL );
+
return msgList;
- }
- catch (Exception e)
+ } catch ( Exception e )
{
e.printStackTrace();
getService().getLogger().logError( "SMSServer: error setting custom balancer!", null, null );
-
+
return null;
}
}
-
+
/*------------------------------------------------------------------
* Internal methods
------------------------------------------------------------------*/
@@ -700,7 +684,7 @@
private String loadConfiguration() throws Exception
{
CONFIG_FILE = System.getenv( "DHIS2_HOME" ) + File.separator + "SMSServer.conf";
-
+
if ( new File( CONFIG_FILE ).exists() )
{
FileInputStream f = new FileInputStream( CONFIG_FILE );
@@ -779,13 +763,13 @@
String pin = getProperties().getProperty( modemName + ".pin" );
String inbound = getProperties().getProperty( modemName + ".inbound" );
String outbound = getProperties().getProperty( modemName + ".outbound" );
- String simMemLocation = getProperties().getProperty(modemName + ".simMemLocation");
+ String simMemLocation = getProperties().getProperty( modemName + ".simMemLocation" );
SerialModemGateway gateway = new SerialModemGateway( modemName, port, baudRate, manufacturer, model );
- if( simMemLocation != null || !simMemLocation.equals("-") )
+ if ( simMemLocation != null || !simMemLocation.equals( "-" ) )
{
- gateway.getATHandler().setStorageLocations(simMemLocation);
+ gateway.getATHandler().setStorageLocations( simMemLocation );
}
if ( protocol != null && protocol.equalsIgnoreCase( "PDU" ) )
@@ -833,7 +817,9 @@
} catch ( Exception e )
{
getService().getLogger().logError( "SMSServer: Unknown Gateway in configuration file!, " + e.getMessage(), null, null );
+
e.printStackTrace();
+
}
}
gatewayLoaded = true;
@@ -864,8 +850,7 @@
{
getService().getLogger().logInfo( "New INBOUND MESSAGE on Gateway: " + gatewayId + " from " + msg.getOriginator(), null, null );
processMessage( msg );
- }
- else
+ } else
{
if ( msgType == MessageTypes.STATUSREPORT )
{
@@ -879,28 +864,27 @@
{
getService().deleteMessage( msg );
getService().getLogger().logInfo( "Deleted message", null, null );
- }
- catch ( Exception e )
+ } catch ( Exception e )
{
getService().getLogger().logError( "Error deleting received message!", e, null );
}
}
}
-
+
/*
if ( getProperties().getProperty( "settings.delete_after_processing", "no" ).equalsIgnoreCase( "yes" ) )
{
- try
- {
- getService().deleteMessage( msg );
- getService().getLogger().logInfo( "Deleted message", null, null );
- }
- catch ( Exception e )
- {
- getService().getLogger().logError( "Error deleting received message!", e, null );
- }
- }
- */
+ try
+ {
+ getService().deleteMessage( msg );
+ getService().getLogger().logInfo( "Deleted message", null, null );
+ }
+ catch ( Exception e )
+ {
+ getService().getLogger().logError( "Error deleting received message!", e, null );
+ }
+ }
+ */
}
}
//</editor-fold>
@@ -938,8 +922,6 @@
}
}
//</editor-fold>
-
-
//</editor-fold>
/*----------------------------------------------------------------*/
}
=== modified file 'local/in/dhis-mobile/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/api/DefaultMobileImportService.java'
--- local/in/dhis-mobile/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/api/DefaultMobileImportService.java 2011-04-15 11:41:30 +0000
+++ local/in/dhis-mobile/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/api/DefaultMobileImportService.java 2011-06-17 10:06:08 +0000
@@ -1170,7 +1170,7 @@
return "Phone number is not registered to any facility. Please contact admin";
}
- List<Source> sources = new ArrayList<Source>( curUser.getOrganisationUnits() );
+ List<OrganisationUnit> sources = new ArrayList<OrganisationUnit>( curUser.getOrganisationUnits() );
if ( sources == null || sources.size() <= 0 )
{
@@ -1181,7 +1181,7 @@
return "Phone number is not registered to any facility. Please contact admin";
}
- Source source = sources.get( 0 );
+ OrganisationUnit source = sources.get( 0 );
Period period = getPeriodInfo( mobImportParameters.getStartDate(), mobImportParameters.getPeriodType() );
=== modified file 'local/in/dhis-mobile/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/scheduler/CheckDataStatusJob.java'
--- local/in/dhis-mobile/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/scheduler/CheckDataStatusJob.java 2011-04-15 11:41:30 +0000
+++ local/in/dhis-mobile/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/scheduler/CheckDataStatusJob.java 2011-06-17 10:06:08 +0000
@@ -108,7 +108,11 @@
String groupName = "datastatusgroup"+count;
for( OrganisationUnit orgUnit : orgUnitList )
{
- List<User> users = new ArrayList<User>( userStore.getUsersByOrganisationUnit( orgUnit ) );
+ //List<User> users = new ArrayList<User>( userStore.getUsersByOrganisationUnit( orgUnit ) );
+ /**
+ * need to change this to get phone numbers from organisaitonunit instead user
+ */
+ List<User> users = new ArrayList<User>( );
for( User user : users )
{
if( user.getPhoneNumber() != null && !user.getPhoneNumber().trim().equalsIgnoreCase( "" ) )
@@ -160,7 +164,10 @@
{
OrganisationUnit orgUnit = orgUnitIterator.next();
- if( !dataSetService.getDataSetsBySource( orgUnit ).contains( dataSet ) )
+ /**
+ * need to fix this as the method has been changed
+ */
+ //if( !dataSetService.getDataSetsBySource( orgUnit ).contains( dataSet ) )
{
orgUnitIterator.remove();
}
=== modified file 'local/in/dhis-mobile/dhis-web-mobile/pom.xml'
--- local/in/dhis-mobile/dhis-web-mobile/pom.xml 2011-04-15 11:41:30 +0000
+++ local/in/dhis-mobile/dhis-web-mobile/pom.xml 2011-06-17 10:06:08 +0000
@@ -6,7 +6,7 @@
<parent>
<groupId>org.hisp.dhis</groupId>
<artifactId>dhis-web</artifactId>
- <version>2.2-SNAPSHOT</version>
+ <version>2.3-SNAPSHOT</version>
</parent>
<artifactId>dhis-web-mobile</artifactId>
=== added file 'local/in/dhis-mobile/dhis-web-mobile/src/main/java/org/hisp/dhis/mobile/BulkSMSHttpInterface.java'
--- local/in/dhis-mobile/dhis-web-mobile/src/main/java/org/hisp/dhis/mobile/BulkSMSHttpInterface.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-mobile/dhis-web-mobile/src/main/java/org/hisp/dhis/mobile/BulkSMSHttpInterface.java 2011-06-17 10:06:08 +0000
@@ -0,0 +1,312 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.hisp.dhis.mobile;
+
+
+import java.io.BufferedReader;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+import org.apache.commons.collections.iterators.ArrayListIterator;
+
+/**
+ *
+ * @author harsh
+ */
+public class BulkSMSHttpInterface
+{
+
+ private String username, password, message, phoneNo, senderName;
+
+ private URL url;
+
+ private String url_string, data, response = "";
+
+ Properties properties;
+
+ public BulkSMSHttpInterface() throws FileNotFoundException, IOException
+ {
+
+// FileReader bulkSMSconfig= new FileReader( "BulkSMS.conf");
+ properties = new Properties();
+
+ properties.load( new FileReader( System.getenv( "DHIS2_HOME" ) + "BulkSMS.conf" ) );
+
+ username = getUsername();
+ password = getPassword();
+ senderName = getSenderName();
+
+//System.out.println("user="+username+"p"+password);
+ }
+
+ public String getUsername()
+ {
+
+ return properties.getProperty( "username" );
+ }
+
+ public String getPassword()
+ {
+ return properties.getProperty( "password" );
+ }
+
+ public String getSenderName()
+ {
+ return properties.getProperty( "sendername" );
+
+ }
+
+ public BulkSMSHttpInterface( String username, String password, String senderName )
+ {
+ this.username = username;
+ this.password = password;
+ this.senderName = senderName;
+ }
+
+ public String sendMessage( String message, String phoneNo ) throws MalformedURLException, IOException
+ {
+
+ data = "username=" + username + "&password=" + password + "&sendername=" + senderName + "&mobileno=" + phoneNo + "&message=" + message;
+
+ //for sending sms
+ url_string = "http://bulksms.mysmsmantra.com:8080/WebSMS/SMSAPI.jsp?";
+
+ url = new URL( url_string );
+ URLConnection conn = url.openConnection();
+ conn.setDoOutput( true );
+
+ OutputStreamWriter out = new OutputStreamWriter( conn.getOutputStream() );
+ out.write( data );
+ out.flush();
+
+ InputStreamReader in = new InputStreamReader( conn.getInputStream() );
+ BufferedReader buff_in = new BufferedReader( in );
+
+ while ( buff_in.ready() )
+ {
+ response += buff_in.readLine() + " ";
+ System.out.println( response + " " + data );
+
+ }
+
+ buff_in.close();
+ out.close();
+
+ return response;
+ }
+
+ public String sendMessages( String message, List<String> phonenos ) throws MalformedURLException, IOException
+ {
+
+ Iterator it = phonenos.iterator();
+
+ while ( it.hasNext() )
+ {
+ if ( phoneNo == null )
+ {
+ phoneNo = (String) it.next();
+ } else
+ {
+ phoneNo += "," + it.next();
+ }
+ }
+ //System.out.println("-------------------->"+phoneNo);
+
+
+
+ data = "username=" + username + "&password=" + password + "&sendername=" + senderName + "&mobileno=" + phoneNo + "&message=" + message;
+
+ //for sending multiple sms (same as single sms)
+ url_string = "http://bulksms.mysmsmantra.com:8080/WebSMS/SMSAPI.jsp?";
+
+ url = new URL( url_string );
+ URLConnection conn = url.openConnection();
+ conn.setDoOutput( true );
+
+ OutputStreamWriter out = new OutputStreamWriter( conn.getOutputStream() );
+ out.write( data );
+ out.flush();
+
+ InputStreamReader in = new InputStreamReader( conn.getInputStream() );
+ BufferedReader buff_in = new BufferedReader( in );
+
+ while ( buff_in.ready() )
+ {
+ response += buff_in.readLine() + " ";
+ System.out.println( response + " " + data );
+
+ }
+
+ buff_in.close();
+ out.close();
+
+ return response;
+
+
+ }
+
+ public String sendMessages( String message, String filename ) throws FileNotFoundException, IOException
+ {
+ properties = new Properties();
+ List<String> phoneno = new ArrayList<String>();
+ FileReader fr = new FileReader( System.getenv( "DHIS2_HOME" ) + "test.prop" );
+ BufferedReader bfr = new BufferedReader( fr );
+
+ while ( bfr.ready() )
+ {
+
+ if ( phoneNo == null )
+ {
+ phoneNo = bfr.readLine();
+ } else
+ {
+ phoneNo += "," + bfr.readLine();
+ }
+ }
+ System.out.println( phoneNo );
+
+ data = "username=" + username + "&password=" + password + "&sendername=" + senderName + "&mobileno=" + phoneNo + "&message=" + message;
+
+ //for sending multiple sms (same as single sms)
+ url_string = "http://bulksms.mysmsmantra.com:8080/WebSMS/SMSAPI.jsp?";
+
+ url = new URL( url_string );
+ URLConnection conn = url.openConnection();
+ conn.setDoOutput( true );
+
+ OutputStreamWriter out = new OutputStreamWriter( conn.getOutputStream() );
+ out.write( data );
+ out.flush();
+
+ InputStreamReader in = new InputStreamReader( conn.getInputStream() );
+ BufferedReader buff_in = new BufferedReader( in );
+
+ while ( buff_in.ready() )
+ {
+ response += buff_in.readLine() + " ";
+ System.out.println( response + " " + data );
+ }
+
+ buff_in.close();
+ out.close();
+
+ return response;
+ }
+
+ public String sendMessages( String message, String filename, int repeat ) throws FileNotFoundException, IOException
+ {
+ properties = new Properties();
+ List<String> phonenoList = new ArrayList<String>();
+ FileReader fr = new FileReader( System.getenv( "DHIS2_HOME" ) + "test.prop" );
+ BufferedReader bfr = new BufferedReader( fr );
+ //get nos from file
+ String str;
+ while ( bfr.ready() )
+ {
+ //str=bfr.readLine();
+ //if (!str.equals( "") )
+ phonenoList.add( bfr.readLine() );
+ }
+ //put them in a list
+ int phoneListSizeOriginal = phonenoList.size();
+ for ( int i = 0; i < repeat; i++ )
+ {
+ for ( int j = 0; j < phoneListSizeOriginal; j++ )
+ {
+ phonenoList.add( phonenoList.get( j ) );
+ }
+ }
+ for ( int i = 0; i < phonenoList.size(); i++ )
+ {
+ System.out.print( phonenoList.get( i ) + " " );
+ }
+
+ //append them in a string
+ for ( int i = 0; i < phonenoList.size(); i++ )
+ {
+ if ( phoneNo == null )
+ {
+ phoneNo = phonenoList.get( i );
+ // System.out.println("->"+phoneNo);
+
+ } else
+ {
+ phoneNo += "," + phonenoList.get( i );
+ // System.out.println("-->"+phoneNo+" ----"+phonenoList.get( i ) );
+ }
+ }
+
+
+ System.out.println( phoneNo );
+
+ data = "username=" + username + "&password=" + password + "&sendername=" + senderName + "&mobileno=" + phoneNo + "&message=" + message;
+
+ //for sending multiple sms (same as single sms)
+ url_string = "http://bulksms.mysmsmantra.com:8080/WebSMS/SMSAPI.jsp?";
+
+ url = new URL( url_string );
+ URLConnection conn = url.openConnection();
+ conn.setDoOutput( true );
+
+ OutputStreamWriter out = new OutputStreamWriter( conn.getOutputStream() );
+ out.write( data );
+ out.flush();
+
+ InputStreamReader in = new InputStreamReader( conn.getInputStream() );
+ BufferedReader buff_in = new BufferedReader( in );
+
+ while ( buff_in.ready() )
+ {
+ response += buff_in.readLine() + " ";
+ System.out.println( response + " " + data );
+
+ }
+
+ buff_in.close();
+ out.close();
+
+ return response;
+ }
+
+ public String checkBalance() throws MalformedURLException, IOException
+ {
+
+
+ data = "username=" + username + "&password=" + password;
+ //for checking balance
+ url_string = "http://bulksms.mysmsmantra.com:8080/WebSMS/balance.jsp?";
+ url = new URL( url_string );
+ URLConnection conn = url.openConnection();
+ conn.setDoOutput( true );
+
+ OutputStreamWriter out = new OutputStreamWriter( conn.getOutputStream() );
+ out.write( data );
+ out.flush();
+
+ InputStreamReader in = new InputStreamReader( conn.getInputStream() );
+ BufferedReader buff_in = new BufferedReader( in );
+
+ while ( buff_in.ready() )
+ {
+ response += buff_in.readLine() + " ";
+ System.out.println( response + " " + data );
+
+ }
+
+ buff_in.close();
+ out.close();
+
+ return response;
+ }
+}
=== modified file 'local/in/dhis-mobile/dhis-web-mobile/src/main/java/org/hisp/dhis/mobile/action/ReceiveMessagesPageAction.java'
--- local/in/dhis-mobile/dhis-web-mobile/src/main/java/org/hisp/dhis/mobile/action/ReceiveMessagesPageAction.java 2011-04-15 11:41:30 +0000
+++ local/in/dhis-mobile/dhis-web-mobile/src/main/java/org/hisp/dhis/mobile/action/ReceiveMessagesPageAction.java 2011-06-17 10:06:08 +0000
@@ -9,6 +9,7 @@
import org.hisp.dhis.mobile.XMLFilter;
import org.hisp.dhis.mobile.api.MobileImportService;
+
import com.opensymphony.xwork2.Action;
public class ReceiveMessagesPageAction implements Action
=== added file 'local/in/dhis-mobile/dhis-web-mobile/src/main/java/org/hisp/dhis/mobile/action/SendBulkSMSAction.java'
--- local/in/dhis-mobile/dhis-web-mobile/src/main/java/org/hisp/dhis/mobile/action/SendBulkSMSAction.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-mobile/dhis-web-mobile/src/main/java/org/hisp/dhis/mobile/action/SendBulkSMSAction.java 2011-06-17 10:06:08 +0000
@@ -0,0 +1,282 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.hisp.dhis.mobile.action;
+
+
+import com.opensymphony.xwork2.Action;
+import java.io.BufferedReader;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import org.hisp.dhis.mobile.BulkSMSHttpInterface;
+import org.hisp.dhis.mobile.SmsService;
+import org.hisp.dhis.mobile.api.SendSMS;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
+import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
+import org.hisp.dhis.organisationunit.comparator.OrganisationUnitGroupNameComparator;
+import org.smslib.http.BulkSmsHTTPGateway;
+
+/**
+ *
+ * @author harsh
+ */
+public class SendBulkSMSAction
+ implements Action
+{
+
+ SmsService smsService;
+
+ private int succ = 0, modemError = 0;
+
+ public void setSmsService( SmsService smsService )
+ {
+ this.smsService = smsService;
+ }
+
+ boolean smsServiceStatus;
+
+ public boolean getSmsServiceStatus()
+ {
+ smsServiceStatus = smsService.getServiceStatus();
+ return smsServiceStatus;
+ }
+
+ String statAction;
+
+ public void setStatAction( String statAction )
+ {
+ if ( statAction.equalsIgnoreCase( "Start" ) )
+ {
+ this.result = smsService.startService();
+ } else
+ {
+ this.result = smsService.stopService();
+ }
+ }
+
+ private String[] strArr;
+
+ private List<String> phonenos;
+
+ BulkSMSHttpInterface conn;
+
+ // OrganisationUnitGroup orgUnitGrp;
+ OrganisationUnitGroupService orgUnitGrpService;
+
+ public void setOrgUnitGrpService( OrganisationUnitGroupService orgUnitGrpService )
+ {
+ this.orgUnitGrpService = orgUnitGrpService;
+ }
+
+ private List<OrganisationUnitGroup> availableOrganisationUnitGroups;
+
+ public List<OrganisationUnitGroup> getAvailableOrganisationUnitGroups()
+ {
+ return availableOrganisationUnitGroups;
+ }
+
+ String message;
+
+ public void setMessage( String message )
+ {
+ this.message = message;
+ }
+
+ String tempString;
+
+ public void setTempString( String tempString )
+ {
+ this.tempString = tempString;
+ }
+
+ String selectedIdString;
+
+ public void setSelectedIdString( String selectedIdString )
+ {
+ this.selectedIdString = selectedIdString;
+ }
+
+ String result = "";
+
+ public String getResult()
+ {
+ return result;
+ }
+
+ @Override
+ public String execute()
+ throws Exception
+ {
+ //selectedOrganisationUnitGroup=new ArrayList<OrganisationUnitGroup>();
+
+ availableOrganisationUnitGroups = new ArrayList<OrganisationUnitGroup>( orgUnitGrpService.getAllOrganisationUnitGroups() );
+ System.out.println( "size(bulksmsmaction)==" + availableOrganisationUnitGroups.size() );
+ Collections.sort( availableOrganisationUnitGroups, new OrganisationUnitGroupNameComparator() );
+
+ conn = new BulkSMSHttpInterface();
+ phonenos = new ArrayList<String>();
+
+
+ //System.out.println( tempString );
+ if ( selectedIdString != null )
+ {
+ strArr = selectedIdString.split( "," );
+
+ for ( int i = 0; i < strArr.length; i++ )
+ {
+ if ( !( strArr[i].equals( "" ) ) )
+ {
+ System.out.println( "strArrid=" + strArr[i] );
+ int parseInt = Integer.parseInt( strArr[i] );
+
+
+ for ( int j = 0; j < availableOrganisationUnitGroups.size(); j++ )
+ {
+ if ( availableOrganisationUnitGroups.get( j ).getId() == parseInt )
+ {
+
+ //System.out.println( " -" + availableOrganisationUnitGroups.get( j ).getMembers().size() );
+ Iterator itr = availableOrganisationUnitGroups.get( j ).getMembers().iterator();
+ while ( itr.hasNext() )
+ {
+ OrganisationUnit temp = (OrganisationUnit) itr.next();
+ if ( temp.getPhoneNumber() != null )
+ {
+ phonenos.add( temp.getPhoneNumber() );
+ }
+ // System.out.println( " phone=" + temp.getPhoneNumber() );
+ }
+
+ }
+ }
+ }
+ }
+
+ // fill in the sendSMS fields...
+ List<SendSMS> sendSMSList = new ArrayList();
+ SendSMS tempSendSMS;
+ for ( int i = 0; i < phonenos.size(); i++ )
+ {
+ tempSendSMS = new SendSMS( phonenos.get( i ), message );
+ sendSMSList.add( tempSendSMS );
+ }
+
+ /* for testing........
+
+
+ List<SendSMS> sendSMSListForTesting=new ArrayList();
+ sendSMSListForTesting.add( new SendSMS( "9654", message) );
+ sendSMSListForTesting.add( new SendSMS( "9718", message) );
+ for (int i=0;i<80;i++){
+ sendSMSListForTesting.add( new SendSMS( "9654", message) );
+ sendSMSListForTesting.add( new SendSMS( "9718", message) );
+ }
+ result =smsService.sendMessages( sendSMSListForTesting );
+ */
+
+
+ /*
+ // for third party=
+ if (phonenos.size()>0)
+ {
+ result= conn.sendMessages( message, phonenos);
+ System.out.println(result);
+
+ String temp=conn.checkBalance();
+ result+="Balance="+temp;
+ }else result="no numbers found";
+ */
+
+
+ // for gsm modem
+ if ( !sendSMSList.isEmpty() )
+ {
+ result = smsService.sendMessages( sendSMSList );
+
+ } else
+ {
+ result = "no numbers found";
+ }
+
+
+
+ /* for testing...
+ if (message.startsWith( "group") )
+ result= sendGroupMessage();
+ else if (message.startsWith( "one") )
+ result= sendGroupMessageOneByOne();
+ else result="message not yet supported";
+ System.out.println("result="+result);
+ System.out.println(".............................>>success="+succ+" error="+modemError);
+ */
+ }
+
+ return SUCCESS;
+ // throw new UnsupportedOperationException("Not supported yet.");
+ }
+ /* for testing......
+
+
+ private String sendGroupMessage() throws FileNotFoundException, IOException
+ {
+ List<String> phoneno=new ArrayList<String>();
+ FileReader fr=new FileReader( System.getenv( "DHIS2_HOME")+"test.prop");
+ BufferedReader bfr=new BufferedReader( fr );
+
+ while(bfr.ready()){
+ phoneno.add( bfr.readLine());
+ }
+ System.out.println("------group:"+phoneno.get( 0) );
+ result=smsService.sendMessageToGroup( "testing", phoneno, message);
+
+ return result;
+ }
+
+ private String sendGroupMessageOneByOne() throws FileNotFoundException, IOException, InterruptedException
+ {
+ List<String> phonenoList=new ArrayList<String>();
+ FileReader fr=new FileReader( System.getenv( "DHIS2_HOME")+"test.prop");
+ BufferedReader bfr=new BufferedReader( fr );
+ String temp;
+ while(bfr.ready()){
+
+ phonenoList.add( bfr.readLine());
+ // System.out.println("------group:"+phoneno.get( 0) );
+ }
+ String strDelay;
+ int delay;
+ strDelay=message.substring( 3, 8);
+ delay=Integer.parseInt( strDelay);
+ System.out.println("repeat="+Integer.parseInt( message.substring( 8, 12)) );
+ for (int j=0;j<Integer.parseInt( message.substring( 8, 12) );j++)
+ for (int i=0;i<phonenoList.size();i++){
+ if (smsService.getServiceStatus()){
+ temp=smsService.sendMessage( phonenoList.get( i ), message);
+ if (temp.equals( "SUCCESS") )
+ succ++;
+ else if (temp.equals( "MODEMERROR") )
+ {modemError++;
+ i--;
+ }
+ result+=temp+" ";
+
+ System.out.println("..............succeded="+succ+" failed="+modemError);
+ }else{ i--;
+
+ System.out.println("servicestatus:false..............succeded="+succ+" failed="+modemError);
+ }
+ Thread.currentThread().sleep(delay );
+ }
+ //result=smsService.sendMessageToGroup( "testing", phoneno, message);
+
+ return result;
+ }
+ */
+}
=== added file 'local/in/dhis-mobile/dhis-web-mobile/src/main/java/org/hisp/dhis/mobile/action/SendBulkSMSThirdPartyAction.java'
--- local/in/dhis-mobile/dhis-web-mobile/src/main/java/org/hisp/dhis/mobile/action/SendBulkSMSThirdPartyAction.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-mobile/dhis-web-mobile/src/main/java/org/hisp/dhis/mobile/action/SendBulkSMSThirdPartyAction.java 2011-06-17 10:06:08 +0000
@@ -0,0 +1,278 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.hisp.dhis.mobile.action;
+
+
+import com.opensymphony.xwork2.Action;
+import java.io.BufferedReader;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import org.hisp.dhis.mobile.BulkSMSHttpInterface;
+import org.hisp.dhis.mobile.SmsService;
+import org.hisp.dhis.mobile.api.SendSMS;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
+import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
+import org.hisp.dhis.organisationunit.comparator.OrganisationUnitGroupNameComparator;
+import org.smslib.http.BulkSmsHTTPGateway;
+
+/**
+ *
+ * @author harsh
+ */
+public class SendBulkSMSThirdPartyAction
+ implements Action
+{
+
+ SmsService smsService;
+
+ private int succ = 0, modemError = 0;
+
+ public void setSmsService( SmsService smsService )
+ {
+ this.smsService = smsService;
+ }
+
+ boolean smsServiceStatus;
+
+ public boolean getSmsServiceStatus()
+ {
+ smsServiceStatus = smsService.getServiceStatus();
+ return smsServiceStatus;
+ }
+
+ String statAction;
+
+ public void setStatAction( String statAction )
+ {
+ if ( statAction.equalsIgnoreCase( "Start" ) )
+ {
+ this.result = smsService.startService();
+ } else
+ {
+ this.result = smsService.stopService();
+ }
+ }
+
+ private String[] strArr;
+
+ private List<String> phonenos;
+
+ BulkSMSHttpInterface conn;
+
+ // OrganisationUnitGroup orgUnitGrp;
+ OrganisationUnitGroupService orgUnitGrpService;
+
+ public void setOrgUnitGrpService( OrganisationUnitGroupService orgUnitGrpService )
+ {
+ this.orgUnitGrpService = orgUnitGrpService;
+ }
+
+ private List<OrganisationUnitGroup> availableOrganisationUnitGroups;
+
+ public List<OrganisationUnitGroup> getAvailableOrganisationUnitGroups()
+ {
+ return availableOrganisationUnitGroups;
+ }
+
+ String message;
+
+ public void setMessage( String message )
+ {
+ this.message = message;
+ }
+
+ String tempString;
+
+ public void setTempString( String tempString )
+ {
+ this.tempString = tempString;
+ }
+
+ String selectedIdString;
+
+ public void setSelectedIdString( String selectedIdString )
+ {
+ this.selectedIdString = selectedIdString;
+ }
+
+ String result = "";
+
+ public String getResult()
+ {
+ return result;
+ }
+
+ @Override
+ public String execute()
+ throws Exception
+ {
+ //selectedOrganisationUnitGroup=new ArrayList<OrganisationUnitGroup>();
+
+ availableOrganisationUnitGroups = new ArrayList<OrganisationUnitGroup>( orgUnitGrpService.getAllOrganisationUnitGroups() );
+ System.out.println( "size(bulksmsmaction)==" + availableOrganisationUnitGroups.size() );
+ Collections.sort( availableOrganisationUnitGroups, new OrganisationUnitGroupNameComparator() );
+
+ conn = new BulkSMSHttpInterface();
+ phonenos = new ArrayList<String>();
+
+
+ //System.out.println( tempString );
+ if ( selectedIdString != null )
+ {
+ strArr = selectedIdString.split( "," );
+
+ for ( int i = 0; i < strArr.length; i++ )
+ {
+ if ( !( strArr[i].equals( "" ) ) )
+ {
+ System.out.println( "strArrid=" + strArr[i] );
+ int parseInt = Integer.parseInt( strArr[i] );
+
+
+ for ( int j = 0; j < availableOrganisationUnitGroups.size(); j++ )
+ {
+ if ( availableOrganisationUnitGroups.get( j ).getId() == parseInt )
+ {
+
+ //System.out.println( " -" + availableOrganisationUnitGroups.get( j ).getMembers().size() );
+ Iterator itr = availableOrganisationUnitGroups.get( j ).getMembers().iterator();
+ while ( itr.hasNext() )
+ {
+ OrganisationUnit temp = (OrganisationUnit) itr.next();
+ if ( temp.getPhoneNumber() != null )
+ {
+ phonenos.add( temp.getPhoneNumber() );
+ }
+ // System.out.println( " phone=" + temp.getPhoneNumber() );
+ }
+
+ }
+ }
+ }
+ }
+
+ // fill in the sendSMS fields...
+ List<SendSMS> sendSMSList = new ArrayList();
+ SendSMS tempSendSMS;
+ for ( int i = 0; i < phonenos.size(); i++ )
+ {
+ tempSendSMS = new SendSMS( phonenos.get( i ), message );
+ sendSMSList.add( tempSendSMS );
+ }
+
+ /* for testing........
+
+
+ List<SendSMS> sendSMSListForTesting=new ArrayList();
+ sendSMSListForTesting.add( new SendSMS( "9654", message) );
+ sendSMSListForTesting.add( new SendSMS( "9718", message) );
+ for (int i=0;i<80;i++){
+ sendSMSListForTesting.add( new SendSMS( "9654", message) );
+ sendSMSListForTesting.add( new SendSMS( "9718", message) );
+ }
+ result =smsService.sendMessages( sendSMSListForTesting );
+ */
+
+ // for third party=
+ if ( phonenos.size() > 0 )
+ {
+ result = conn.sendMessages( message, phonenos );
+ System.out.println( result );
+
+ String temp = conn.checkBalance();
+ result += "Balance=" + temp;
+ } else
+ {
+ result = "no numbers found";
+ }
+
+ /*
+ // for gsm modem
+ if (!sendSMSList.isEmpty()){
+ result=smsService.sendMessages(sendSMSList);
+
+ }else result="no numbers found";
+ */
+
+
+ /* for testing...
+ if (message.startsWith( "group") )
+ result= sendGroupMessage();
+ else if (message.startsWith( "one") )
+ result= sendGroupMessageOneByOne();
+ else result="message not yet supported";
+ System.out.println("result="+result);
+ System.out.println(".............................>>success="+succ+" error="+modemError);
+ */
+ }
+
+ return SUCCESS;
+ // throw new UnsupportedOperationException("Not supported yet.");
+ }
+ /* for testing......
+
+
+ private String sendGroupMessage() throws FileNotFoundException, IOException
+ {
+ List<String> phoneno=new ArrayList<String>();
+ FileReader fr=new FileReader( System.getenv( "DHIS2_HOME")+"test.prop");
+ BufferedReader bfr=new BufferedReader( fr );
+
+ while(bfr.ready()){
+ phoneno.add( bfr.readLine());
+ }
+ System.out.println("------group:"+phoneno.get( 0) );
+ result=smsService.sendMessageToGroup( "testing", phoneno, message);
+
+ return result;
+ }
+
+ private String sendGroupMessageOneByOne() throws FileNotFoundException, IOException, InterruptedException
+ {
+ List<String> phonenoList=new ArrayList<String>();
+ FileReader fr=new FileReader( System.getenv( "DHIS2_HOME")+"test.prop");
+ BufferedReader bfr=new BufferedReader( fr );
+ String temp;
+ while(bfr.ready()){
+
+ phonenoList.add( bfr.readLine());
+ // System.out.println("------group:"+phoneno.get( 0) );
+ }
+ String strDelay;
+ int delay;
+ strDelay=message.substring( 3, 8);
+ delay=Integer.parseInt( strDelay);
+ System.out.println("repeat="+Integer.parseInt( message.substring( 8, 12)) );
+ for (int j=0;j<Integer.parseInt( message.substring( 8, 12) );j++)
+ for (int i=0;i<phonenoList.size();i++){
+ if (smsService.getServiceStatus()){
+ temp=smsService.sendMessage( phonenoList.get( i ), message);
+ if (temp.equals( "SUCCESS") )
+ succ++;
+ else if (temp.equals( "MODEMERROR") )
+ {modemError++;
+ i--;
+ }
+ result+=temp+" ";
+
+ System.out.println("..............succeded="+succ+" failed="+modemError);
+ }else{ i--;
+
+ System.out.println("servicestatus:false..............succeded="+succ+" failed="+modemError);
+ }
+ Thread.currentThread().sleep(delay );
+ }
+ //result=smsService.sendMessageToGroup( "testing", phoneno, message);
+
+ return result;
+ }
+ */
+}
=== modified file 'local/in/dhis-mobile/dhis-web-mobile/src/main/resources/META-INF/dhis/beans.xml'
--- local/in/dhis-mobile/dhis-web-mobile/src/main/resources/META-INF/dhis/beans.xml 2011-04-15 11:41:30 +0000
+++ local/in/dhis-mobile/dhis-web-mobile/src/main/resources/META-INF/dhis/beans.xml 2011-06-17 10:06:08 +0000
@@ -29,7 +29,7 @@
<property name="smsService" ref="org.hisp.dhis.mobile.SmsService" />
<property name="sendSMSService" ref="org.hisp.dhis.mobile.api.SendSMSService"/>
</bean>
-
+
<bean id="org.hisp.dhis.mobile.app.action.CreateMobileAppAction"
class="org.hisp.dhis.mobile.app.action.CreateMobileAppAction"
scope="prototype">
@@ -58,7 +58,21 @@
scope="prototype">
<property name="smsService" ref="org.hisp.dhis.mobile.SmsService" />
</bean>
-
+
+ <bean id="org.hisp.dhis.mobile.action.SendBulkSMSAction"
+ class="org.hisp.dhis.mobile.action.SendBulkSMSAction"
+ scope="prototype">
+ <property name="orgUnitGrpService" ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService" />
+ <property name="smsService" ref="org.hisp.dhis.mobile.SmsService" />
+ </bean>
+
+ <bean id="org.hisp.dhis.mobile.action.SendBulkSMSThirdPartyAction"
+ class="org.hisp.dhis.mobile.action.SendBulkSMSThirdPartyAction"
+ scope="prototype">
+ <property name="orgUnitGrpService" ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService" />
+ <property name="smsService" ref="org.hisp.dhis.mobile.SmsService" />
+ </bean>
+
<bean id="org.hisp.dhis.mobile.action.SendOtaAction"
class="org.hisp.dhis.mobile.action.SendOtaAction"
scope="prototype">
=== modified file 'local/in/dhis-mobile/dhis-web-mobile/src/main/resources/struts.xml'
--- local/in/dhis-mobile/dhis-web-mobile/src/main/resources/struts.xml 2011-04-15 11:41:30 +0000
+++ local/in/dhis-mobile/dhis-web-mobile/src/main/resources/struts.xml 2011-06-17 10:06:08 +0000
@@ -5,89 +5,107 @@
<struts>
<!-- use the DHIS web portal default -->
<include file="dhis-web-commons.xml"/>
- <package name="dhis-web-mobile" extends="dhis-web-commons"
- namespace="/dhis-web-mobile">
-
- <!-- Pages -->
- <action name="index"
- class="org.hisp.dhis.mobile.action.MobileHomePageAction">
- <result name="success" type="velocity">/main.vm</result>
- <param name="page">/dhis-web-mobile/welcome.vm</param>
- <param name="menu">/dhis-web-mobile/menu.vm</param>
- </action>
- <action name="receiveImport"
- class="org.hisp.dhis.mobile.action.ReceiveImportPageAction">
- <result name="success" type="velocity">/main.vm</result>
- <param name="page">/dhis-web-mobile/receiveImportPage.vm</param>
- <param name="menu">/dhis-web-mobile/menu.vm</param>
- <param name="stylesheets">css/receiveImportPage.css</param>
- </action>
- <action name="sendSMS" class="org.hisp.dhis.mobile.action.SendSMSAction">
- <result name="success" type="velocity">/main.vm</result>
- <param name="page">/dhis-web-mobile/sendSMSPage.vm</param>
- <param name="menu">/dhis-web-mobile/menu.vm</param>
- <param name="requiredAuthorities">F_MOBILE_SENDSMS</param>
- </action>
- <action name="sendOta" class="org.hisp.dhis.mobile.action.SendOtaAction">
- <result name="success" type="velocity">/main.vm</result>
- <param name="page">/dhis-web-mobile/sendOtaPage.vm</param>
- <param name="menu">/dhis-web-mobile/menu.vm</param>
- <param name="requiredAuthorities">F_MOBILE_SENDSMS</param>
- </action>
- <action name="mobileSettings"
- class="org.hisp.dhis.mobile.action.MobileSettingsAction">
- <result name="success" type="velocity">/main.vm</result>
- <param name="page">/dhis-web-mobile/mobileSettingsPage.vm</param>
- <param name="menu">/dhis-web-mobile/menu.vm</param>
- <param name="requiredAuthorities">F_MOBILE_SETTINGS</param>
- </action>
-
- <action name="receiveAllMessages"
- class="org.hisp.dhis.mobile.action.ReceiveMessagesPageAction">
- <result name="success" type="velocity">/main.vm</result>
- <param name="page">/dhis-web-mobile/inbox.vm</param>
- <param name="menu">/dhis-web-mobile/menu.vm</param>
- <param name="stylesheets">css/receiveImportPage.css</param>
- </action>
-
- <action name="getAllDraftMessages"
- class="org.hisp.dhis.mobile.action.DraftPageAction">
- <result name="success" type="velocity">/main.vm</result>
- <param name="page">/dhis-web-mobile/draft.vm</param>
- <param name="menu">/dhis-web-mobile/menu.vm</param>
- <param name="stylesheets">css/receiveImportPage.css</param>
- </action>
-
-
- <!-- Create Mobile Application -->
- <action name="createMobileApp"
- class="org.hisp.dhis.mobile.app.action.CreateMobileAppAction">
- <result name="success" type="velocity">/main.vm</result>
- <param name="page">/dhis-web-mobile/createMobileAppPage.vm</param>
- <param name="menu">/dhis-web-mobile/menu.vm</param>
- </action>
-
- <action name="getDataElements"
- class="org.hisp.dhis.mobile.app.action.GetDataElementsAction">
- <result name="success" type="velocity">
- /dhis-web-mobile/dataElementsResponse.vm</result>
- <param name="onExceptionReturn">plainTextError</param>
- </action>
-
- <action name="splashUpload"
- class="org.hisp.dhis.mobile.app.action.SplashUploadAction">
- <result name="success" type="velocity">
- /dhis-web-mobile/splashUploadResponse.vm</result>
- <param name="onExceptionReturn">plainTextError</param>
- <interceptor-ref name="fileUploadStack">
- <param name="allowedTypes">image/png</param>
- </interceptor-ref>
- </action>
-
- <action name="jarGenerator"
- class="org.hisp.dhis.mobile.app.action.JarGeneratorAction">
- <result name="success" type="chain">createMobileApp</result>
- </action>
-
- </package>
-</struts>
\ No newline at end of file
+ <package name="dhis-web-mobile" extends="dhis-web-commons"
+ namespace="/dhis-web-mobile">
+
+ <!-- Pages -->
+ <action name="index"
+ class="org.hisp.dhis.mobile.action.MobileHomePageAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-mobile/welcome.vm</param>
+ <param name="menu">/dhis-web-mobile/menu.vm</param>
+ </action>
+ <action name="receiveImport"
+ class="org.hisp.dhis.mobile.action.ReceiveImportPageAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-mobile/receiveImportPage.vm</param>
+ <param name="menu">/dhis-web-mobile/menu.vm</param>
+ <param name="stylesheets">css/receiveImportPage.css</param>
+ </action>
+ <action name="sendSMS" class="org.hisp.dhis.mobile.action.SendSMSAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-mobile/sendSMSPage.vm</param>
+ <param name="menu">/dhis-web-mobile/menu.vm</param>
+ <param name="requiredAuthorities">F_MOBILE_SENDSMS</param>
+ </action>
+
+ <action name="sendBulkSMS" class="org.hisp.dhis.mobile.action.SendBulkSMSAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-mobile/sendBulkSMSPage.vm</param>
+ <param name="menu">/dhis-web-mobile/menu.vm</param>
+ <param name="requiredAuthorities">F_MOBILE_SENDSMS</param>
+ </action>
+
+ <action name="sendBulkSMSThirdParty" class="org.hisp.dhis.mobile.action.SendBulkSMSThirdPartyAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-mobile/sendBulkSMSPage.vm</param>
+ <param name="menu">/dhis-web-mobile/menu.vm</param>
+ <param name="requiredAuthorities">F_MOBILE_SENDSMS</param>
+ </action>
+
+
+ <action name="sendOta" class="org.hisp.dhis.mobile.action.SendOtaAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-mobile/sendOtaPage.vm</param>
+ <param name="menu">/dhis-web-mobile/menu.vm</param>
+ <param name="requiredAuthorities">F_MOBILE_SENDSMS</param>
+ </action>
+ <action name="mobileSettings"
+ class="org.hisp.dhis.mobile.action.MobileSettingsAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-mobile/mobileSettingsPage.vm</param>
+ <param name="menu">/dhis-web-mobile/menu.vm</param>
+ <param name="requiredAuthorities">F_MOBILE_SETTINGS</param>
+ </action>
+
+ <action name="receiveAllMessages"
+ class="org.hisp.dhis.mobile.action.ReceiveMessagesPageAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-mobile/inbox.vm</param>
+ <param name="menu">/dhis-web-mobile/menu.vm</param>
+ <param name="stylesheets">css/receiveImportPage.css</param>
+ </action>
+
+ <action name="getAllDraftMessages"
+ class="org.hisp.dhis.mobile.action.DraftPageAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-mobile/draft.vm</param>
+ <param name="menu">/dhis-web-mobile/menu.vm</param>
+ <param name="stylesheets">css/receiveImportPage.css</param>
+ </action>
+
+
+ <!-- Create Mobile Application -->
+ <action name="createMobileApp"
+ class="org.hisp.dhis.mobile.app.action.CreateMobileAppAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-mobile/createMobileAppPage.vm</param>
+ <param name="menu">/dhis-web-mobile/menu.vm</param>
+ </action>
+
+ <action name="getDataElements"
+ class="org.hisp.dhis.mobile.app.action.GetDataElementsAction">
+ <result name="success" type="velocity">
+ /dhis-web-mobile/dataElementsResponse.vm
+ </result>
+ <param name="onExceptionReturn">plainTextError</param>
+ </action>
+
+ <action name="splashUpload"
+ class="org.hisp.dhis.mobile.app.action.SplashUploadAction">
+ <result name="success" type="velocity">
+ /dhis-web-mobile/splashUploadResponse.vm
+ </result>
+ <param name="onExceptionReturn">plainTextError</param>
+ <interceptor-ref name="fileUploadStack">
+ <param name="allowedTypes">image/png</param>
+ </interceptor-ref>
+ </action>
+
+ <action name="jarGenerator"
+ class="org.hisp.dhis.mobile.app.action.JarGeneratorAction">
+ <result name="success" type="chain">createMobileApp</result>
+ </action>
+
+ </package>
+</struts>
=== modified file 'local/in/dhis-mobile/dhis-web-mobile/src/main/webapp/WEB-INF/web.xml'
--- local/in/dhis-mobile/dhis-web-mobile/src/main/webapp/WEB-INF/web.xml 2011-04-15 11:41:30 +0000
+++ local/in/dhis-mobile/dhis-web-mobile/src/main/webapp/WEB-INF/web.xml 2011-06-17 10:06:08 +0000
@@ -12,7 +12,7 @@
<param-name>automaticAccessType</param-name>
<param-value>ghostAdmin</param-value>
</context-param>
-
+
<filter>
<filter-name>RedirectFilter</filter-name>
<filter-class>org.hisp.dhis.servlet.filter.HttpRedirectFilter</filter-class>
@@ -26,7 +26,7 @@
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
</filter>
<filter>
- <filter-name>filterChainProxy</filter-name>
+ <filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter>
@@ -43,7 +43,7 @@
<url-pattern>*.action</url-pattern>
</filter-mapping>
<filter-mapping>
- <filter-name>filterChainProxy</filter-name>
+ <filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
=== added file 'local/in/dhis-mobile/dhis-web-mobile/src/main/webapp/dhis-web-mobile/javascript/bulkSMS.js'
--- local/in/dhis-mobile/dhis-web-mobile/src/main/webapp/dhis-web-mobile/javascript/bulkSMS.js 1970-01-01 00:00:00 +0000
+++ local/in/dhis-mobile/dhis-web-mobile/src/main/webapp/dhis-web-mobile/javascript/bulkSMS.js 2011-06-17 10:06:08 +0000
@@ -0,0 +1,66 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+
+function disableSubmit(){
+ document.getElementById("submitButton").onclick=changePage;
+
+}
+
+function changePage(){
+
+ var form2= new document.createElement("bulkSMSPage2");
+ document.getElementsByName("send");
+
+
+}
+
+//
+function checkCheckBox() {
+ if (document.theForm.texttype.checked == false)
+ {
+ document.theForm.message.disabled = false;
+ document.theForm.availableDataElements.disabled = true;
+ }
+ else
+ {
+ document.theForm.message.disabled = true;
+ document.theForm.availableDataElements.disabled = false;
+ }
+}
+
+
+
+function validateSend()
+{
+ var validate=true;
+ if (document.theForm.texttype.checked == false)
+ {
+ if(document.theForm.message.value.length == 0)
+
+ {
+ alert("Enter the message");
+ validate=false;
+ }
+ }
+ else
+ if(document.theForm.availableDataElements.selectedIndex < 0)
+ {
+ alert("Select a data element");
+ validate=false;
+ }
+
+ if (document.theForm.selectedOrganisationUnitGroups.value.length==0)
+ {
+ alert("Select atleast 1 organization unit group");
+ validate=false;
+ }
+ if(validate==true)
+ {
+ // Select();
+ alert("Sending");
+ }
+
+}
=== modified file 'local/in/dhis-mobile/dhis-web-mobile/src/main/webapp/dhis-web-mobile/menu.vm'
--- local/in/dhis-mobile/dhis-web-mobile/src/main/webapp/dhis-web-mobile/menu.vm 2011-04-15 11:41:30 +0000
+++ local/in/dhis-mobile/dhis-web-mobile/src/main/webapp/dhis-web-mobile/menu.vm 2011-06-17 10:06:08 +0000
@@ -1,10 +1,12 @@
-<h2>DHIS Mobile</h2>
-<ul>
- <!--<li><a href = "createMobileApp.action">Create Mobile Application</a></li>-->
- <li><a href = "receiveImport.action">Receive Data and Import</a></li>
- <li><a href = "sendSMS.action">Send SMS</a></li>
- <li><a href = "sendOta.action">Send Application via OTA</a></li>
- <li><a href = "mobileSettings.action">Settings</a></li>
- <li><a href = "receiveAllMessages.action">Inbox</a></li>
- <li><a href = "getAllDraftMessages.action">Draft</a></li>
+<h2>DHIS Mobile</h2>
+<ul>
+ <!--<li><a href = "createMobileApp.action">Create Mobile Application</a></li>-->
+ <li><a href = "receiveImport.action">Receive Data and Import</a></li>
+ <li><a href = "sendSMS.action">Send SMS</a></li>
+ <li><a href = "sendBulkSMS.action">Send Bulk SMS</a></li>
+ <li><a href = "sendBulkSMSThirdParty.action">Send Bulk SMS through third party</a></li>
+ <li><a href = "sendOta.action">Send Application via OTA</a></li>
+ <li><a href = "mobileSettings.action">Settings</a></li>
+ <li><a href = "receiveAllMessages.action">Inbox</a></li>
+ <li><a href = "getAllDraftMessages.action">Draft</a></li>
</ul>
\ No newline at end of file
=== added file 'local/in/dhis-mobile/dhis-web-mobile/src/main/webapp/dhis-web-mobile/sendBulkSMSPage.vm'
--- local/in/dhis-mobile/dhis-web-mobile/src/main/webapp/dhis-web-mobile/sendBulkSMSPage.vm 1970-01-01 00:00:00 +0000
+++ local/in/dhis-mobile/dhis-web-mobile/src/main/webapp/dhis-web-mobile/sendBulkSMSPage.vm 2011-06-17 10:06:08 +0000
@@ -0,0 +1,80 @@
+<script type="text/javascript" src="javascript/bulkSMS.js"></script>
+
+<script type="text/javascript" language="javascript">
+function Select()
+{
+##alert("Size= "+$availableOrganisationUnitGroups.size());
+
+##alert(document.theForm.availableOrganisationUnitGroups.selectedIndex);
+document.theForm.selectedIdString.value=document.theForm.selectedIdString.value +","+ document.theForm.availableOrganisationUnitGroups.options[document.theForm.availableOrganisationUnitGroups.selectedIndex].value;
+##alert("....>"+document.theForm.selectedIdString.value);
+}
+</script>
+
+
+<style type="text/css">
+ .statusBar{
+ color: white;
+ padding: 5px 5px;
+ margin: -16px 0 20px -20px;
+ font-weight: bold;
+ background-color: #8FABC7;
+ }
+</style>
+
+<div class="statusBar" #if ($smsServiceStatus)style="background-color: olive"#end>
+ #if ($smsServiceStatus)
+ <form method="post">SMS Service: Started
+ <input type="submit" name="statAction" value="Stop" />
+ </form>
+ #else
+ <form method="post">SMS Service: Not Started
+ <input type="submit" name="statAction" value="Start" />
+ </form>
+ #end
+</div>
+
+<h1>Send Bulk SMS</h1>
+<div>
+ <form method="post" name="theForm">
+ <textarea ID="selectedIdString" name="selectedIdString" style="display:none;"></textarea>
+ <INPUT TYPE=CHECKBOX NAME="texttype" ID="p" VALUE="p" onClick="checkCheckBox()"/>Predefined Text <BR>
+ <select size="1" id="availableDataElements" disabled=true name="availableDataElements" style="min-width:400px">
+ #foreach ( $group in $availableDataElements )
+ <option value="$unit.id">$unit.name</option>
+ #end
+ </select><BR><BR>
+ Enter Text<BR>
+ <textarea name="message" ID="message" cols="70" rows="5" style="width: 397px; height: 97px;"></textarea><BR><BR>
+ User Groups<BR>
+ <select multiple id="availableOrganisationUnitGroups" name="availableOrganisationUnitGroups" style="min-width:400px" onClick="Select();moveSelectedById( 'availableOrganisationUnitGroups', 'selectedOrganisationUnitGroups' );">
+ #foreach ( $group in $availableOrganisationUnitGroups )
+ <option value="$group.id">$group.name</option>
+ #end
+ </select><BR><BR>
+ Selected Groups</BR>
+ <select multiple id="selectedOrganisationUnitGroups" name="selectedOrganisationUnitGroups" style="min-width:400px">
+ #foreach ( $group in $selectedOrganisationUnitGroups )
+ <option value="$group.id">$group.name</option>
+ #end
+ </select><BR><BR>
+ ## </form>
+
+ #if ($smsServiceStatus)
+ ##<form method="post" >
+ <BUTTON type="submit" name="send" value="Send" onClick="validateSend();">Send</BUTTON>
+ ##</form>
+ #else
+ ##<form method="post">
+ <BUTTON type="submit" name="send" value="Send" onClick="validateSend();">Send</BUTTON>
+
+ #end
+</form>
+
+
+</div>
+<p>
+<span id="result" style="#if($result.trim().equals("")) none#else background-color:yellow;
+border:3px; padding:.3em;#end"> $result
+
+</span>
=== modified file 'local/in/dhis-mobile/pom.xml'
--- local/in/dhis-mobile/pom.xml 2011-04-15 11:41:30 +0000
+++ local/in/dhis-mobile/pom.xml 2011-06-17 10:06:08 +0000
@@ -5,7 +5,7 @@
<groupId>org.hisp.dhis</groupId>
<artifactId>dhis-sms</artifactId>
- <version>2.2-SNAPSHOT</version>
+ <version>2.3-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Mobile SMS Modules</name>