dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #26819
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13273: Renamed action class
------------------------------------------------------------
revno: 13273
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-12-17 10:33:58 +0100
message:
Renamed action class
removed:
dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/input/SMSInput.java
added:
dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/input/SMSInputAction.java
modified:
dhis-2/dhis-web/dhis-web-sms/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-sms/src/main/resources/struts.xml
dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/META-INF/dhis/beans.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
=== removed file 'dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/input/SMSInput.java'
--- dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/input/SMSInput.java 2013-09-19 12:43:34 +0000
+++ dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/input/SMSInput.java 1970-01-01 00:00:00 +0000
@@ -1,159 +0,0 @@
-package org.hisp.dhis.sms.input;
-
-/*
- * Copyright (c) 2004-2013, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import org.hisp.dhis.sms.incoming.IncomingSms;
-import org.hisp.dhis.sms.incoming.IncomingSmsService;
-import org.hisp.dhis.sms.incoming.SmsMessageEncoding;
-import org.hisp.dhis.sms.incoming.SmsMessageStatus;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Christian and Magnus
- */
-public class SMSInput
- implements Action
-{
- private String sender, phone, number, msisdn;
-
- private String message, text, content;
-
- private IncomingSmsService incomingSmsService;
-
- @Override
- public String execute()
- throws Exception
- {
- IncomingSms sms = new IncomingSms();
-
- // setter for sms originator
- if ( sender != null )
- {
- sms.setOriginator( sender );
- }
- else if ( phone != null )
- {
- sms.setOriginator( phone );
- }
- else if ( number != null )
- {
- sms.setOriginator( number );
- }
- else if ( msisdn != null )
- {
- sms.setOriginator( msisdn );
- }
-
- // setter for sms text
- if ( message != null )
- {
- sms.setText( message );
- }
- else if ( text != null )
- {
- sms.setText( text );
- }
- else if ( content != null )
- {
- sms.setText( content );
- }
-
- // check whether two necessary attributes are null
- if ( sms.getOriginator() == null || sms.getText() == null )
- {
- setNullToAll();
- return ERROR;
- }
-
- java.util.Date rec = new java.util.Date();
- sms.setReceivedDate( rec );
- sms.setSentDate( rec );
-
- sms.setEncoding( SmsMessageEncoding.ENC7BIT );
- sms.setStatus( SmsMessageStatus.INCOMING );
- sms.setGatewayId( "HARDCODEDTESTGATEWAY" );
-
- incomingSmsService.save( sms );
-
- setNullToAll();
-
- return SUCCESS;
- }
-
- public void setNullToAll()
- {
- sender = null;
- phone = null;
- number = null;
- message = null;
- text = null;
- content = null;
- }
-
- public void setSender( String sender )
- {
- this.sender = sender;
- }
-
- public void setPhone( String phone )
- {
- this.phone = phone;
- }
-
- public void setNumber( String number )
- {
- this.number = number;
- }
-
- public void setMsisdn( String msisdn )
- {
- this.msisdn = msisdn;
- }
-
- public void setMessage( String message )
- {
- this.message = message;
- }
-
- public void setText( String text )
- {
- this.text = text;
- }
-
- public void setContent( String content )
- {
- this.content = content;
- }
-
- public void setIncomingSmsService( IncomingSmsService incomingSmsService )
- {
- this.incomingSmsService = incomingSmsService;
- }
-}
=== added file 'dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/input/SMSInputAction.java'
--- dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/input/SMSInputAction.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/input/SMSInputAction.java 2013-12-17 09:33:58 +0000
@@ -0,0 +1,159 @@
+package org.hisp.dhis.sms.input;
+
+/*
+ * Copyright (c) 2004-2013, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * Neither the name of the HISP project nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import org.hisp.dhis.sms.incoming.IncomingSms;
+import org.hisp.dhis.sms.incoming.IncomingSmsService;
+import org.hisp.dhis.sms.incoming.SmsMessageEncoding;
+import org.hisp.dhis.sms.incoming.SmsMessageStatus;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Christian and Magnus
+ */
+public class SMSInputAction
+ implements Action
+{
+ private String sender, phone, number, msisdn;
+
+ private String message, text, content;
+
+ private IncomingSmsService incomingSmsService;
+
+ @Override
+ public String execute()
+ throws Exception
+ {
+ IncomingSms sms = new IncomingSms();
+
+ // setter for sms originator
+ if ( sender != null )
+ {
+ sms.setOriginator( sender );
+ }
+ else if ( phone != null )
+ {
+ sms.setOriginator( phone );
+ }
+ else if ( number != null )
+ {
+ sms.setOriginator( number );
+ }
+ else if ( msisdn != null )
+ {
+ sms.setOriginator( msisdn );
+ }
+
+ // setter for sms text
+ if ( message != null )
+ {
+ sms.setText( message );
+ }
+ else if ( text != null )
+ {
+ sms.setText( text );
+ }
+ else if ( content != null )
+ {
+ sms.setText( content );
+ }
+
+ // check whether two necessary attributes are null
+ if ( sms.getOriginator() == null || sms.getText() == null )
+ {
+ setNullToAll();
+ return ERROR;
+ }
+
+ java.util.Date rec = new java.util.Date();
+ sms.setReceivedDate( rec );
+ sms.setSentDate( rec );
+
+ sms.setEncoding( SmsMessageEncoding.ENC7BIT );
+ sms.setStatus( SmsMessageStatus.INCOMING );
+ sms.setGatewayId( "HARDCODEDTESTGATEWAY" );
+
+ incomingSmsService.save( sms );
+
+ setNullToAll();
+
+ return SUCCESS;
+ }
+
+ public void setNullToAll()
+ {
+ sender = null;
+ phone = null;
+ number = null;
+ message = null;
+ text = null;
+ content = null;
+ }
+
+ public void setSender( String sender )
+ {
+ this.sender = sender;
+ }
+
+ public void setPhone( String phone )
+ {
+ this.phone = phone;
+ }
+
+ public void setNumber( String number )
+ {
+ this.number = number;
+ }
+
+ public void setMsisdn( String msisdn )
+ {
+ this.msisdn = msisdn;
+ }
+
+ public void setMessage( String message )
+ {
+ this.message = message;
+ }
+
+ public void setText( String text )
+ {
+ this.text = text;
+ }
+
+ public void setContent( String content )
+ {
+ this.content = content;
+ }
+
+ public void setIncomingSmsService( IncomingSmsService incomingSmsService )
+ {
+ this.incomingSmsService = incomingSmsService;
+ }
+}
=== modified file 'dhis-2/dhis-web/dhis-web-sms/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-sms/src/main/resources/META-INF/dhis/beans.xml 2013-11-12 08:46:01 +0000
+++ dhis-2/dhis-web/dhis-web-sms/src/main/resources/META-INF/dhis/beans.xml 2013-12-17 09:33:58 +0000
@@ -3,22 +3,26 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd">
- <bean id="org.hisp.dhis.sms.input.SMSInput" class="org.hisp.dhis.sms.input.SMSInput">
- <property name="incomingSmsService"
- ref="org.hisp.dhis.sms.incoming.IncomingSmsService" />
+ <bean id="org.hisp.dhis.sms.input.SMSInputAction"
+ class="org.hisp.dhis.sms.input.SMSInputAction"
+ scope="prototype">
+ <property name="incomingSmsService" ref="org.hisp.dhis.sms.incoming.IncomingSmsService" />
</bean>
<bean id="org.hisp.dhis.sms.outcoming.ShowSendSMSFormAction"
- class="org.hisp.dhis.sms.outcoming.ShowSendSMSFormAction" scope="prototype" />
+ class="org.hisp.dhis.sms.outcoming.ShowSendSMSFormAction"
+ scope="prototype" />
<bean id="org.hisp.dhis.sms.outcoming.ShowSendSMSBeneficiaryFormAction"
class="org.hisp.dhis.sms.outcoming.ShowSendSMSBeneficiaryFormAction"
scope="prototype" />
<bean id="org.hisp.dhis.sms.outcoming.ProcessingSendSMSAction"
- class="org.hisp.dhis.sms.outcoming.ProcessingSendSMSAction" scope="prototype"/>
+ class="org.hisp.dhis.sms.outcoming.ProcessingSendSMSAction"
+ scope="prototype"/>
- <bean id="org.hisp.dhis.sms.outcoming.SearchPatientAction" class="org.hisp.dhis.sms.outcoming.SearchPatientAction"
+ <bean id="org.hisp.dhis.sms.outcoming.SearchPatientAction"
+ class="org.hisp.dhis.sms.outcoming.SearchPatientAction"
scope="prototype" />
</beans>
=== modified file 'dhis-2/dhis-web/dhis-web-sms/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-sms/src/main/resources/struts.xml 2013-05-24 10:15:02 +0000
+++ dhis-2/dhis-web/dhis-web-sms/src/main/resources/struts.xml 2013-12-17 09:33:58 +0000
@@ -17,7 +17,7 @@
<param name="page">/dhis-web-sms/testsms.vm</param>
</action>
- <action name="smsinput" class="org.hisp.dhis.sms.input.SMSInput">
+ <action name="smsinput" class="org.hisp.dhis.sms.input.SMSInputAction">
<result name="success" type="velocity">/dhis-web-sms/smssuccess.vm</result>
<result name="error" type="velocity">/dhis-web-sms/smserror.vm</result>
</action>
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/META-INF/dhis/beans.xml 2013-10-13 16:15:28 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/META-INF/dhis/beans.xml 2013-12-17 09:33:58 +0000
@@ -7,7 +7,8 @@
<!-- ValidationRule CRUD operations -->
- <bean id="org.hisp.dhis.validationrule.action.AddValidationRuleAction" class="org.hisp.dhis.validationrule.action.AddValidationRuleAction"
+ <bean id="org.hisp.dhis.validationrule.action.AddValidationRuleAction"
+ class="org.hisp.dhis.validationrule.action.AddValidationRuleAction"
scope="prototype">
<property name="validationRuleService" ref="org.hisp.dhis.validation.ValidationRuleService" />
<property name="expressionService" ref="org.hisp.dhis.expression.ExpressionService" />
@@ -23,7 +24,8 @@
<property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
</bean>
- <bean id="org.hisp.dhis.validationrule.action.GetValidationRuleAction" class="org.hisp.dhis.validationrule.action.GetValidationRuleAction"
+ <bean id="org.hisp.dhis.validationrule.action.GetValidationRuleAction"
+ class="org.hisp.dhis.validationrule.action.GetValidationRuleAction"
scope="prototype">
<property name="validationRuleService" ref="org.hisp.dhis.validation.ValidationRuleService" />
<property name="expressionService" ref="org.hisp.dhis.expression.ExpressionService" />