dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #20249
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9167: Codestyle fix for mobile code
------------------------------------------------------------
revno: 9167
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-12-04 13:58:11 +0100
message:
Codestyle fix for mobile code
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/hibernate/HibernateUserStore.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/messaging/action/FindUserAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/DeleteRelationshipAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetProgramStageFormAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetProgramStageSectionAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetRelationshipFormAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/SaveProgramStageFormAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/SaveRepeatableEventAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/singleevent/action/FindSingleEventOptionSetAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/singleevent/action/GetSingleEventFormAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/singleevent/action/SaveSingleEventAction.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-api/src/main/java/org/hisp/dhis/user/UserService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserService.java 2012-12-04 08:35:56 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserService.java 2012-12-04 12:58:11 +0000
@@ -374,7 +374,5 @@
*/
void removeUserSettings( User user );
-
- Collection<User> getUsersByName(String name);
-
+ Collection<User> getUsersByName( String name );
}
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserService.java 2012-12-04 08:35:56 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserService.java 2012-12-04 12:58:11 +0000
@@ -252,8 +252,10 @@
{
return userStore.getUsersByPhoneNumber( phoneNumber );
}
- public Collection<User> getUsersByName(String name){
- return userStore.getUsersByName(name);
+
+ public Collection<User> getUsersByName( String name )
+ {
+ return userStore.getUsersByName( name );
}
public Collection<User> getUsersWithoutOrganisationUnit()
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/hibernate/HibernateUserStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/hibernate/HibernateUserStore.java 2012-12-04 08:35:56 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/hibernate/HibernateUserStore.java 2012-12-04 12:58:11 +0000
@@ -124,16 +124,13 @@
@Override
@SuppressWarnings( "unchecked" )
- public Collection<User> getUsersByName( String name)
+ public Collection<User> getUsersByName( String name )
{
Criteria criteria = getCriteria();
criteria.add( Restrictions.or( Restrictions.ilike( "surname", "%" + name + "%" ),
Restrictions.ilike( "firstName", "%" + name + "%" ) ) );
criteria.addOrder( Order.asc( "surname" ) ).addOrder( Order.asc( "firstName" ) );
- return criteria.list();
-
+ return criteria.list();
}
-
-
}
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/messaging/action/FindUserAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/messaging/action/FindUserAction.java 2012-12-04 08:35:56 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/messaging/action/FindUserAction.java 2012-12-04 12:58:11 +0000
@@ -72,8 +72,6 @@
{
this.userId = userId;
}
-
-
@Override
public String execute()
@@ -89,16 +87,16 @@
keyword = keys[0] + " " + keys[1];
}
}
- users = userService.getUsersByName(keyword);
-
-
- if(users.size() == 1){
+
+ users = userService.getUsersByName( keyword );
+
+ if ( users.size() == 1 )
+ {
User user = users.iterator().next();
userId = user.getId();
return REDIRECT;
}
-
+
return SUCCESS;
}
-
}
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/DeleteRelationshipAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/DeleteRelationshipAction.java 2012-09-24 06:51:00 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/DeleteRelationshipAction.java 2012-12-04 12:58:11 +0000
@@ -27,9 +27,7 @@
package org.hisp.dhis.light.namebaseddataentry.action;
-import org.hisp.dhis.patient.Patient;
import org.hisp.dhis.patient.PatientService;
-import org.hisp.dhis.program.ProgramInstanceService;
import org.hisp.dhis.relationship.Relationship;
import org.hisp.dhis.relationship.RelationshipService;
@@ -48,6 +46,7 @@
// -------------------------------------------------------------------------
// Input & Output
// -------------------------------------------------------------------------
+
private int relationshipTypeId;
public int getRelationshipTypeId()
@@ -75,6 +74,7 @@
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
+
private RelationshipService relationshipService;
public void setRelationshipService( RelationshipService relationshipService )
@@ -104,5 +104,4 @@
return REDIRECT;
}
-
}
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetProgramStageFormAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetProgramStageFormAction.java 2012-11-15 06:17:43 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetProgramStageFormAction.java 2012-12-04 12:58:11 +0000
@@ -32,6 +32,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+
import org.hisp.dhis.api.mobile.model.Activity;
import org.hisp.dhis.api.mobile.model.ActivityPlan;
import org.hisp.dhis.light.utils.NamebasedUtils;
@@ -52,8 +53,6 @@
public class GetProgramStageFormAction
implements Action
{
- private static final String REDIRECT = "redirect";
-
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetProgramStageSectionAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetProgramStageSectionAction.java 2012-10-23 07:56:15 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetProgramStageSectionAction.java 2012-12-04 12:58:11 +0000
@@ -30,16 +30,12 @@
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
-import org.hisp.dhis.dataset.Section;
import org.hisp.dhis.light.utils.NamebasedUtils;
import org.hisp.dhis.patient.Patient;
import org.hisp.dhis.patient.PatientService;
import org.hisp.dhis.program.Program;
-import org.hisp.dhis.program.ProgramInstance;
-import org.hisp.dhis.program.ProgramInstanceService;
import org.hisp.dhis.program.ProgramService;
import org.hisp.dhis.program.ProgramStage;
import org.hisp.dhis.program.ProgramStageDataElement;
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetRelationshipFormAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetRelationshipFormAction.java 2012-06-11 10:11:21 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetRelationshipFormAction.java 2012-12-04 12:58:11 +0000
@@ -4,13 +4,6 @@
public class GetRelationshipFormAction implements Action
{
- private Integer originalPatientId;
-
- private Integer relatedPatientId;
-
- private Integer relationshipTypeId;
-
-
@Override
public String execute()
throws Exception
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/SaveProgramStageFormAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/SaveProgramStageFormAction.java 2012-11-15 06:17:43 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/SaveProgramStageFormAction.java 2012-12-04 12:58:11 +0000
@@ -33,9 +33,10 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+
import javax.servlet.http.HttpServletRequest;
+
import org.apache.struts2.ServletActionContext;
-import org.hisp.dhis.program.ProgramExpressionService;
import org.hisp.dhis.dataelement.DataElementCategoryService;
import org.hisp.dhis.dataelement.DataElementService;
import org.hisp.dhis.i18n.I18nFormat;
@@ -47,6 +48,7 @@
import org.hisp.dhis.patientdatavalue.PatientDataValue;
import org.hisp.dhis.patientdatavalue.PatientDataValueService;
import org.hisp.dhis.program.Program;
+import org.hisp.dhis.program.ProgramExpressionService;
import org.hisp.dhis.program.ProgramStage;
import org.hisp.dhis.program.ProgramStageDataElement;
import org.hisp.dhis.program.ProgramStageDataElementService;
@@ -59,6 +61,7 @@
import org.hisp.dhis.program.ProgramValidationResult;
import org.hisp.dhis.program.ProgramValidationService;
import org.hisp.dhis.util.ContextUtils;
+
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/SaveRepeatableEventAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/SaveRepeatableEventAction.java 2012-08-16 15:47:08 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/SaveRepeatableEventAction.java 2012-12-04 12:58:11 +0000
@@ -35,6 +35,7 @@
import org.hisp.dhis.program.ProgramStageService;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.ISODateTimeFormat;
+
import com.opensymphony.xwork2.Action;
public class SaveRepeatableEventAction
@@ -161,8 +162,6 @@
public String execute()
throws Exception
{
- ProgramStageInstance currentStageInstance = programStageInstanceService
- .getProgramStageInstance( currentProgramStageInstanceId );
DateTimeFormatter sdf = ISODateTimeFormat.yearMonthDay();
ProgramInstance programInstance = programInstanceService.getProgramInstance( programInstanceId );
ProgramStage programStage = programStageService.getProgramStage( programStageId );
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/singleevent/action/FindSingleEventOptionSetAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/singleevent/action/FindSingleEventOptionSetAction.java 2012-10-24 09:02:06 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/singleevent/action/FindSingleEventOptionSetAction.java 2012-12-04 12:58:11 +0000
@@ -28,14 +28,11 @@
package org.hisp.dhis.light.singleevent.action;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementService;
import org.hisp.dhis.option.OptionSet;
-import org.hisp.dhis.util.SessionUtils;
import com.opensymphony.xwork2.Action;
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/singleevent/action/GetSingleEventFormAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/singleevent/action/GetSingleEventFormAction.java 2012-11-01 02:34:16 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/singleevent/action/GetSingleEventFormAction.java 2012-12-04 12:58:11 +0000
@@ -27,13 +27,13 @@
package org.hisp.dhis.light.singleevent.action;
-import com.opensymphony.xwork2.Action;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.patient.Patient;
import org.hisp.dhis.patient.PatientService;
@@ -49,6 +49,8 @@
import org.hisp.dhis.program.ProgramStageInstanceService;
import org.hisp.dhis.util.SessionUtils;
+import com.opensymphony.xwork2.Action;
+
public class GetSingleEventFormAction
implements Action
{
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/singleevent/action/SaveSingleEventAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/singleevent/action/SaveSingleEventAction.java 2012-10-09 04:45:29 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/singleevent/action/SaveSingleEventAction.java 2012-12-04 12:58:11 +0000
@@ -34,7 +34,9 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+
import javax.servlet.http.HttpServletRequest;
+
import org.apache.struts2.ServletActionContext;
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementService;
@@ -56,6 +58,7 @@
import org.hisp.dhis.program.ProgramStageInstanceService;
import org.hisp.dhis.util.ContextUtils;
import org.hisp.dhis.util.SessionUtils;
+
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;