dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #05266
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1727: Codestyle fixes
------------------------------------------------------------
revno: 1727
committer: Lars <larshelg@larshelg-laptop>
branch nick: trunk
timestamp: Sat 2010-04-03 11:35:43 +0200
message:
Codestyle fixes
modified:
dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/useraudit/DefaultUserAuditService.java
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/AbstractAutomaticAccessProvider.java
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/useraccount/action/UpdateUserAccountAction.java
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/action/GenerateReportSupport.java
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/importing/action/ViewDataFlowAction.java
dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/item/action/ValidateAddReportExcelItemAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/databrowser/SearchAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/GetOptionCombosAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/GetSelectedDataElementsAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/SelectProgramStageDataElementAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/ShowDataEntryFormAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/ViewDataEntryFormAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/RemovePatientAttributeOptionAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/ShowUpdatePatientAttributeValueAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientidentifiertype/GetPatientIdentifierTypeListAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/GetProgramListAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/GetProgramStageListAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/UpdateProgramStageAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/paging/RequestUtil.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/useraudit/DefaultUserAuditService.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/useraudit/DefaultUserAuditService.java 2010-03-31 16:44:55 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/useraudit/DefaultUserAuditService.java 2010-04-03 09:35:43 +0000
@@ -40,19 +40,19 @@
/**
* @author Lars Helge Overland
- *
- * TODO: Cleanup code by MAX_NUMBER_OF_ATTEMPTS and TIMEFRAME_MINUTES loading
- * in system setting with default values through startup routine
+ *
+ * TODO: Cleanup code by MAX_NUMBER_OF_ATTEMPTS and TIMEFRAME_MINUTES
+ * loading in system setting with default values through startup routine
*/
public class DefaultUserAuditService
implements UserAuditService
{
-
private static final Log log = LogFactory.getLog( DefaultUserAuditService.class );
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
+
private SystemSettingManager systemSettingManager;
public void setSystemSettingManager( SystemSettingManager systemSettingManager )
@@ -91,12 +91,13 @@
int no = userAuditStore.getLoginFailures( username, getDate() );
- int MAX_NUMBER_OF_ATTEMPTS = 5; //DEFAULT
+ int MAX_NUMBER_OF_ATTEMPTS = 5; // DEFAULT
if ( systemSettingManager.getSystemSetting( KEY_MAX_NUMBER_OF_ATTEMPTS ) != null )
{
MAX_NUMBER_OF_ATTEMPTS = (Integer) systemSettingManager.getSystemSetting( KEY_MAX_NUMBER_OF_ATTEMPTS );
- } else
+ }
+ else
{
systemSettingManager.saveSystemSetting( KEY_MAX_NUMBER_OF_ATTEMPTS, 5 );
}
@@ -111,8 +112,7 @@
@Override
public int getLoginFailures( String username )
{
- int no = userAuditStore.getLoginFailures( username, getDate() );
- return no;
+ return userAuditStore.getLoginFailures( username, getDate() );
}
@Override
@@ -123,7 +123,8 @@
if ( systemSettingManager.getSystemSetting( KEY_MAX_NUMBER_OF_ATTEMPTS ) != null )
{
MAX_NUMBER_OF_ATTEMPTS = (Integer) systemSettingManager.getSystemSetting( KEY_MAX_NUMBER_OF_ATTEMPTS );
- } else
+ }
+ else
{
systemSettingManager.saveSystemSetting( KEY_MAX_NUMBER_OF_ATTEMPTS, 5 );
}
@@ -134,12 +135,13 @@
@Override
public int getLockoutTimeframe()
{
- int TIMEFRAME_MINUTES = 10; //DEFAULT
+ int TIMEFRAME_MINUTES = 10; // DEFAULT
if ( systemSettingManager.getSystemSetting( KEY_TIMEFRAME_MINUTES ) != null )
{
TIMEFRAME_MINUTES = (Integer) systemSettingManager.getSystemSetting( KEY_TIMEFRAME_MINUTES );
- } else
+ }
+ else
{
systemSettingManager.saveSystemSetting( KEY_TIMEFRAME_MINUTES, 10 );
}
@@ -160,13 +162,15 @@
if ( systemSettingManager.getSystemSetting( KEY_TIMEFRAME_MINUTES ) != null )
{
TIMEFRAME_MINUTES = (Integer) systemSettingManager.getSystemSetting( KEY_TIMEFRAME_MINUTES );
- } else
+ }
+ else
{
systemSettingManager.saveSystemSetting( KEY_TIMEFRAME_MINUTES, 10 );
}
Calendar cal = Calendar.getInstance();
cal.add( Calendar.MINUTE, TIMEFRAME_MINUTES * -1 );
+
return cal.getTime();
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/AbstractAutomaticAccessProvider.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/AbstractAutomaticAccessProvider.java 2010-03-04 22:55:47 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/AbstractAutomaticAccessProvider.java 2010-04-03 09:35:43 +0000
@@ -28,7 +28,6 @@
*/
import java.util.Collection;
-import java.util.HashSet;
import org.hisp.dhis.security.authority.SystemAuthoritiesProvider;
import org.hisp.dhis.user.UserStore;
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/useraccount/action/UpdateUserAccountAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/useraccount/action/UpdateUserAccountAction.java 2010-03-30 02:59:14 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/useraccount/action/UpdateUserAccountAction.java 2010-04-03 09:35:43 +0000
@@ -40,7 +40,6 @@
* @version $Id: UpdateUserAction.java 5556 2008-08-20 11:36:20Z abyot $
* @version $Id: UpdateUserAction.java 5556 2009-11-30 11:18:30Z Chau Thu Tran $
*/
-
public class UpdateUserAccountAction
implements Action
{
@@ -51,17 +50,16 @@
private UserStore userStore;
private PasswordManager passwordManager;
-
// -------------------------------------------------------------------------
// Input
// -------------------------------------------------------------------------
private I18n i18n;
-
+
private Integer id;
private String oldPassword;
-
+
private String rawPassword;
private String surname;
@@ -71,7 +69,7 @@
private String email;
private String phoneNumber;
-
+
private String message;
// -------------------------------------------------------------------------
@@ -156,21 +154,22 @@
}
User user = userStore.getUser( id );
-
+
UserCredentials userCredentials = userStore.getUserCredentials( user );
- String encodeOldPassword = passwordManager.encodePassword( userCredentials.getUsername(), oldPassword);
+ String encodeOldPassword = passwordManager.encodePassword( userCredentials.getUsername(), oldPassword );
String currentPassword = userCredentials.getPassword();
- if(!encodeOldPassword.equals( currentPassword)){
+
+ if ( !encodeOldPassword.equals( currentPassword ) )
+ {
message = i18n.getString( "wrong_password" );
return INPUT;
}
-
+
// ---------------------------------------------------------------------
// Update userCredentials and user
// ---------------------------------------------------------------------
-
user.setSurname( surname );
user.setFirstName( firstName );
@@ -179,19 +178,18 @@
user.setPhoneNumber( phoneNumber );
-
if ( rawPassword != null )
{
userCredentials.setPassword( passwordManager.encodePassword( userCredentials.getUsername(), rawPassword ) );
-
+
userStore.updateUserCredentials( userCredentials );
-
+
}
-
+
userStore.updateUser( user );
message = i18n.getString( "update_user_success" );
-
+
return SUCCESS;
}
-}
\ No newline at end of file
+}
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/action/GenerateReportSupport.java'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/action/GenerateReportSupport.java 2010-04-02 03:30:02 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/action/GenerateReportSupport.java 2010-04-03 09:35:43 +0000
@@ -43,7 +43,6 @@
import java.util.regex.Pattern;
import org.amplecode.quick.StatementManager;
-import org.apache.poi.hssf.usermodel.HSSFHeader;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
@@ -288,8 +287,6 @@
protected Date endSixMonthly;
- private Period period;
-
// ------------------------------------------
// Excel format
// ------------------------------------------
@@ -388,8 +385,6 @@
protected void installPeriod( Period period )
{
- this.period = period;
-
Calendar calendar = Calendar.getInstance();
// Monthly period
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/importing/action/ViewDataFlowAction.java'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/importing/action/ViewDataFlowAction.java 2010-03-05 08:27:33 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/importing/action/ViewDataFlowAction.java 2010-04-03 09:35:43 +0000
@@ -29,18 +29,12 @@
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.Set;
-import org.hisp.dhis.dataset.DataSet;
import org.hisp.dhis.reportexcel.excelitem.ExcelItem;
import org.hisp.dhis.reportexcel.excelitem.ExcelItemGroup;
import org.hisp.dhis.reportexcel.excelitem.ExcelItemService;
import org.hisp.dhis.reportexcel.excelitem.comparator.ExcelItemComparator;
import org.hisp.dhis.reportexcel.state.SelectionManager;
-import org.hisp.dhis.user.CurrentUserService;
-import org.hisp.dhis.user.UserAuthorityGroup;
-import org.hisp.dhis.user.UserCredentials;
-import org.hisp.dhis.user.UserStore;
import com.opensymphony.xwork2.Action;
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/item/action/ValidateAddReportExcelItemAction.java'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/item/action/ValidateAddReportExcelItemAction.java 2010-02-24 07:28:03 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/item/action/ValidateAddReportExcelItemAction.java 2010-04-03 09:35:43 +0000
@@ -27,7 +27,6 @@
package org.hisp.dhis.reportexcel.item.action;
import org.hisp.dhis.reportexcel.ReportExcel;
-import org.hisp.dhis.reportexcel.ReportExcelItem;
import org.hisp.dhis.reportexcel.ReportExcelService;
import org.hisp.dhis.reportexcel.action.ActionSupport;
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/databrowser/SearchAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/databrowser/SearchAction.java 2010-03-17 06:31:25 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/databrowser/SearchAction.java 2010-04-03 09:35:43 +0000
@@ -589,8 +589,6 @@
* @param toDate
* @return List of Periods
*/
-
- @SuppressWarnings( "unused" )
private List<Period> getPeriodsList( PeriodType periodType, String fromDate, String toDate )
{
String formatString = "yyyy-MM-dd";
@@ -629,8 +627,7 @@
String stringFormatDate = "";
List<Period> periods = new ArrayList( this.getPeriodsList( periodType, fromDate, toDate ) );
- for ( @SuppressWarnings( "unused" )
- Period period : periods )
+ for ( Period period : periods )
{
String sTemp = format.formatPeriod( period );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/GetOptionCombosAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/GetOptionCombosAction.java 2010-02-22 09:19:15 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/GetOptionCombosAction.java 2010-04-03 09:35:43 +0000
@@ -43,37 +43,47 @@
* @version $Id$
*/
public class GetOptionCombosAction
- implements Action {
+ implements Action
+{
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
private DataElementService dataElementService;
- public void setDataElementService(DataElementService dataElementService) {
+ public void setDataElementService( DataElementService dataElementService )
+ {
this.dataElementService = dataElementService;
}
+
private DataElementCategoryService dataElementCategoryService;
- public void setDataElementCategoryService(DataElementCategoryService dataElementCategoryService) {
+ public void setDataElementCategoryService( DataElementCategoryService dataElementCategoryService )
+ {
this.dataElementCategoryService = dataElementCategoryService;
}
+
// -------------------------------------------------------------------------
// Getters & Setters
// -------------------------------------------------------------------------
private int dataElementId;
- public void setDataElementId(int dataElementId) {
+ public void setDataElementId( int dataElementId )
+ {
this.dataElementId = dataElementId;
}
+
private List<String> optionComboIds;
- public List<String> getOptionComboIds() {
+ public List<String> getOptionComboIds()
+ {
return optionComboIds;
}
+
private List<String> optionComboNames;
- public List<String> getOptionComboNames() {
+ public List<String> getOptionComboNames()
+ {
return optionComboNames;
}
@@ -81,53 +91,59 @@
// Execute
// -------------------------------------------------------------------------
public String execute()
- throws Exception {
+ throws Exception
+ {
optionComboIds = new ArrayList<String>();
optionComboNames = new ArrayList<String>();
- DataElement dataElement = dataElementService.getDataElement(dataElementId);
+ DataElement dataElement = dataElementService.getDataElement( dataElementId );
DataElementCategoryCombo dataElementCategoryCombo = dataElement.getCategoryCombo();
List<DataElementCategoryOptionCombo> optionCombos = new ArrayList<DataElementCategoryOptionCombo>(
- dataElementCategoryCombo.getOptionCombos());
+ dataElementCategoryCombo.getOptionCombos() );
String dataElementType = dataElement.getType();
- System.out.println("Type = " + dataElementType);
-
- /*if (dataElementType.equals("string")) {
-
- DataElementCategoryOptionCombo optionCombo = dataElementCategoryService.getDefaultDataElementCategoryOptionCombo();
- optionComboNames.add(DataElementCategoryCombo.DEFAULT_CATEGORY_COMBO_NAME);
-
- optionComboIds.add(String.valueOf(optionCombo.getId()));
-
- return SUCCESS;
-
- }*/
-
+ System.out.println( "Type = " + dataElementType );
+
+ /*
+ * if (dataElementType.equals("string")) {
+ *
+ * DataElementCategoryOptionCombo optionCombo =
+ * dataElementCategoryService
+ * .getDefaultDataElementCategoryOptionCombo();
+ * optionComboNames.add(DataElementCategoryCombo
+ * .DEFAULT_CATEGORY_COMBO_NAME);
+ *
+ * optionComboIds.add(String.valueOf(optionCombo.getId()));
+ *
+ * return SUCCESS;
+ *
+ * }
+ */
Iterator<DataElementCategoryOptionCombo> optionComboIterator = optionCombos.iterator();
-
- while (optionComboIterator.hasNext()) {
+ while ( optionComboIterator.hasNext() )
+ {
DataElementCategoryOptionCombo optionCombo = optionComboIterator.next();
String optionComboName = optionCombo.getName();
- String optionComboId = String.valueOf(optionCombo.getId());
-
-
- if (optionComboId != null) {
- if (optionComboName == null || optionComboName.trim().length() == 0) {
+ String optionComboId = String.valueOf( optionCombo.getId() );
+
+ if ( optionComboId != null )
+ {
+ if ( optionComboName == null || optionComboName.trim().length() == 0 )
+ {
optionComboName = DataElementCategoryCombo.DEFAULT_CATEGORY_COMBO_NAME;
}
}
- System.out.println("optionComboId = "+optionComboId);
- optionComboNames.add(optionComboName);
+ System.out.println( "optionComboId = " + optionComboId );
+ optionComboNames.add( optionComboName );
- optionComboIds.add(optionComboId);
+ optionComboIds.add( optionComboId );
}
return SUCCESS;
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/GetSelectedDataElementsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/GetSelectedDataElementsAction.java 2010-02-22 09:19:15 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/GetSelectedDataElementsAction.java 2010-04-03 09:35:43 +0000
@@ -54,10 +54,11 @@
private ProgramStageService programStageService;
- public void setProgramStageService(ProgramStageService programStageService) {
+ public void setProgramStageService( ProgramStageService programStageService )
+ {
this.programStageService = programStageService;
}
-
+
private Comparator<DataElement> dataElementComparator;
public void setDataElementComparator( Comparator<DataElement> dataElementComparator )
@@ -71,11 +72,10 @@
{
this.displayPropertyHandler = displayPropertyHandler;
}
-
+
private ProgramStageDataElementService programStageDataElementService;
-
- public void setProgramStageDataElementService(
- ProgramStageDataElementService programStageDataElementService )
+
+ public void setProgramStageDataElementService( ProgramStageDataElementService programStageDataElementService )
{
this.programStageDataElementService = programStageDataElementService;
}
@@ -86,7 +86,8 @@
private int associationId;
- public void setAssociationId(int associationId) {
+ public void setAssociationId( int associationId )
+ {
this.associationId = associationId;
}
@@ -97,25 +98,24 @@
return dataElementList;
}
- private String associationName;
-
- public String getAssociationName() {
- return DataEntryFormAssociation.DATAENTRY_ASSOCIATE_PROGRAMSTAGE;
+ public String getAssociationName()
+ {
+ return DataEntryFormAssociation.DATAENTRY_ASSOCIATE_PROGRAMSTAGE;
}
// -------------------------------------------------------------------------
// Execute
// -------------------------------------------------------------------------
-
+
public String execute()
throws Exception
{
ProgramStage programStage = programStageService.getProgramStage( associationId );
- dataElementList = new ArrayList<DataElement>(programStageDataElementService.getListDataElement( programStage ) );
+ dataElementList = new ArrayList<DataElement>( programStageDataElementService.getListDataElement( programStage ) );
Collections.sort( dataElementList, dataElementComparator );
-
+
displayPropertyHandler.handle( dataElementList );
return SUCCESS;
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/SelectProgramStageDataElementAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/SelectProgramStageDataElementAction.java 2010-02-22 09:19:15 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/SelectProgramStageDataElementAction.java 2010-04-03 09:35:43 +0000
@@ -43,79 +43,81 @@
* @author Viet Nguyen
* @version $Id$
*/
-public class SelectProgramStageDataElementAction implements Action {
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private ProgramStageService programStageService;
-
- public void setProgramStageService(ProgramStageService programStageService) {
- this.programStageService = programStageService;
- }
-
- // -------------------------------------------------------------------------
- // Getters & Setters
- // -------------------------------------------------------------------------
-
- private int programStageId;
-
- public void setProgramStageId(int programStageId) {
- this.programStageId = programStageId;
- }
-
- private boolean typeTextOnly;
-
- public void setTypeTextOnly(boolean typeTextOnly) {
- this.typeTextOnly = typeTextOnly;
- }
-
- private List<ProgramStage> programStages;
-
- public List<ProgramStage> getProgramStages() {
- return programStages;
- }
-
- private ProgramStage programStage;
-
- public ProgramStage getProgramStage() {
- return programStage;
- }
-
- public String getAssociationName() {
- return DataEntryFormAssociation.DATAENTRY_ASSOCIATE_PROGRAMSTAGE;
- }
-
- // -------------------------------------------------------------------------
- // Execute
- // -------------------------------------------------------------------------
-
- public String execute() throws Exception
- {
- programStage = programStageService.getProgramStage( programStageId );
-
- if ( programStage != null )
- {
-
- Program program = programStage.getProgram();
-
- if ( program != null ) {
-
- programStages = new ArrayList( program.getProgramStages() );
- for ( ProgramStage ps : programStages )
- {
- if ( ps.equals( programStage ) )
- {
- programStages.remove( ps );
- break;
- }
- }
-
- Collections.sort( programStages, new ProgramStageNameComparator() );
-
- }
-
- }
- return SUCCESS;
- }
+public class SelectProgramStageDataElementAction
+ implements Action
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private ProgramStageService programStageService;
+
+ public void setProgramStageService( ProgramStageService programStageService )
+ {
+ this.programStageService = programStageService;
+ }
+
+ // -------------------------------------------------------------------------
+ // Getters & Setters
+ // -------------------------------------------------------------------------
+
+ private int programStageId;
+
+ public void setProgramStageId( int programStageId )
+ {
+ this.programStageId = programStageId;
+ }
+
+ private List<ProgramStage> programStages;
+
+ public List<ProgramStage> getProgramStages()
+ {
+ return programStages;
+ }
+
+ private ProgramStage programStage;
+
+ public ProgramStage getProgramStage()
+ {
+ return programStage;
+ }
+
+ public String getAssociationName()
+ {
+ return DataEntryFormAssociation.DATAENTRY_ASSOCIATE_PROGRAMSTAGE;
+ }
+
+ // -------------------------------------------------------------------------
+ // Execute
+ // -------------------------------------------------------------------------
+
+ public String execute()
+ throws Exception
+ {
+ programStage = programStageService.getProgramStage( programStageId );
+
+ if ( programStage != null )
+ {
+
+ Program program = programStage.getProgram();
+
+ if ( program != null )
+ {
+
+ programStages = new ArrayList<ProgramStage>( program.getProgramStages() );
+ for ( ProgramStage ps : programStages )
+ {
+ if ( ps.equals( programStage ) )
+ {
+ programStages.remove( ps );
+ break;
+ }
+ }
+
+ Collections.sort( programStages, new ProgramStageNameComparator() );
+ }
+ }
+
+ return SUCCESS;
+ }
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/ShowDataEntryFormAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/ShowDataEntryFormAction.java 2010-02-28 10:44:15 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/ShowDataEntryFormAction.java 2010-04-03 09:35:43 +0000
@@ -26,20 +26,9 @@
*/
package org.hisp.dhis.patient.action.dataentryform;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
import org.hisp.dhis.dataentryform.DataEntryForm;
-import org.hisp.dhis.dataentryform.DataEntryFormAssociation;
-import org.hisp.dhis.dataentryform.DataEntryFormAssociationService;
import org.hisp.dhis.dataentryform.DataEntryFormService;
import org.hisp.dhis.patient.screen.DataEntryManager;
-import org.hisp.dhis.program.ProgramInstance;
-import org.hisp.dhis.program.ProgramStage;
-import org.hisp.dhis.program.ProgramStageService;
import com.opensymphony.xwork2.Action;
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/ViewDataEntryFormAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/ViewDataEntryFormAction.java 2010-02-22 09:19:15 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/ViewDataEntryFormAction.java 2010-04-03 09:35:43 +0000
@@ -38,7 +38,6 @@
import org.hisp.dhis.dataentryform.DataEntryFormAssociationService;
import org.hisp.dhis.dataentryform.DataEntryFormService;
import org.hisp.dhis.patient.screen.DataEntryManager;
-import org.hisp.dhis.program.ProgramInstance;
import org.hisp.dhis.program.ProgramStage;
import org.hisp.dhis.program.ProgramStageService;
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/RemovePatientAttributeOptionAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/RemovePatientAttributeOptionAction.java 2010-02-22 09:19:15 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/RemovePatientAttributeOptionAction.java 2010-04-03 09:35:43 +0000
@@ -27,7 +27,6 @@
package org.hisp.dhis.patient.action.patientattribute;
import org.hisp.dhis.i18n.I18n;
-import org.hisp.dhis.patient.PatientAttribute;
import org.hisp.dhis.patient.PatientAttributeOption;
import org.hisp.dhis.patient.PatientAttributeOptionService;
import org.hisp.dhis.patientattributevalue.PatientAttributeValueService;
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/ShowUpdatePatientAttributeValueAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/ShowUpdatePatientAttributeValueAction.java 2010-03-05 13:00:37 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/ShowUpdatePatientAttributeValueAction.java 2010-04-03 09:35:43 +0000
@@ -27,7 +27,6 @@
package org.hisp.dhis.patient.action.patientattribute;
-import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
@@ -61,13 +60,12 @@
this.patientService = patientService;
}
- private PatientAttributeService patientAttributeService;
-
- public void setPatientAttributeService( PatientAttributeService
- patientAttributeService )
- {
- this.patientAttributeService = patientAttributeService;
- }
+ private PatientAttributeService patientAttributeService;
+
+ public void setPatientAttributeService( PatientAttributeService patientAttributeService )
+ {
+ this.patientAttributeService = patientAttributeService;
+ }
private PatientAttributeGroupService patientAttributeGroupService;
@@ -148,20 +146,22 @@
{
patient = patientService.getPatient( id );
-// if ( patientAttributeGroups == null )
- patientAttributeGroups = patientAttributeGroupService.getAllPatientAttributeGroups();
-
-// if ( patientAttributeGroupId != 0 )
-// {
-// patientAttributes = new ArrayList<PatientAttribute>();
-//
-// patientAttributes = patientAttributeGroupService.getPatientAttributeGroup(
-// patientAttributeGroupId ).getAttributes();
-// }else
-// {
-// patientAttributes = patientAttributeService.getAllPatientAttributes();
-// }
-
+ // if ( patientAttributeGroups == null )
+ patientAttributeGroups = patientAttributeGroupService.getAllPatientAttributeGroups();
+
+ // if ( patientAttributeGroupId != 0 )
+ // {
+ // patientAttributes = new ArrayList<PatientAttribute>();
+ //
+ // patientAttributes =
+ // patientAttributeGroupService.getPatientAttributeGroup(
+ // patientAttributeGroupId ).getAttributes();
+ // }else
+ // {
+ // patientAttributes =
+ // patientAttributeService.getAllPatientAttributes();
+ // }
+
patientNoGroupAttributes = patientAttributeService.getPatientAttributesNotGroup();
Collection<PatientAttributeValue> patientAttributeValues = patientAttributeValueService
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientidentifiertype/GetPatientIdentifierTypeListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientidentifiertype/GetPatientIdentifierTypeListAction.java 2010-02-22 09:19:15 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientidentifiertype/GetPatientIdentifierTypeListAction.java 2010-04-03 09:35:43 +0000
@@ -30,7 +30,6 @@
import java.util.ArrayList;
import java.util.List;
-import org.hisp.dhis.i18n.I18n;
import org.hisp.dhis.patient.PatientIdentifierType;
import org.hisp.dhis.patient.PatientIdentifierTypeService;
import org.hisp.dhis.patient.comparator.PatientIdentifierTypeComparator;
@@ -87,7 +86,6 @@
public void setPatientIdentifierTypeService( PatientIdentifierTypeService patientIdentifierTypeService )
{
this.patientIdentifierTypeService = patientIdentifierTypeService;
- }
-
+ }
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/GetProgramListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/GetProgramListAction.java 2010-02-22 09:19:15 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/GetProgramListAction.java 2010-04-03 09:35:43 +0000
@@ -103,8 +103,6 @@
this.programs = programs;
}
- private String associationName;
-
public String getAssociationName()
{
return DataEntryFormAssociation.DATAENTRY_ASSOCIATE_PROGRAMSTAGE;
@@ -127,7 +125,6 @@
Program program = programService.getProgram( id );
associations = program.getProgramStages();
-
}
return SUCCESS;
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/GetProgramStageListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/GetProgramStageListAction.java 2010-02-22 09:19:15 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/GetProgramStageListAction.java 2010-04-03 09:35:43 +0000
@@ -102,8 +102,6 @@
{
this.programs = programs;
}
-
- private String associationName;
public String getAssociationName()
{
@@ -117,18 +115,18 @@
public String execute()
throws Exception
{
-
- programs = programService.getAllPrograms();
-
- if ( id != null )
- {
- Program program = programService.getProgram( id );
-
- associations = program.getProgramStages();
-
- }else{
- associations = programStageService.getAllProgramStages();
- }
+ programs = programService.getAllPrograms();
+
+ if ( id != null )
+ {
+ Program program = programService.getProgram( id );
+
+ associations = program.getProgramStages();
+ }
+ else
+ {
+ associations = programStageService.getAllProgramStages();
+ }
return SUCCESS;
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/UpdateProgramStageAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/UpdateProgramStageAction.java 2010-02-22 09:19:15 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/UpdateProgramStageAction.java 2010-04-03 09:35:43 +0000
@@ -136,7 +136,7 @@
programStageService.updateProgramStage( programStage );
- Set<ProgramStageDataElement> programStageDataElements = new HashSet(programStage.getProgramStageDataElements());
+ Set<ProgramStageDataElement> programStageDataElements = new HashSet<ProgramStageDataElement>(programStage.getProgramStageDataElements());
if( StringUtils.isNotBlank( selectedList ) )
{
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/paging/RequestUtil.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/paging/RequestUtil.java 2010-03-09 07:55:42 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/paging/RequestUtil.java 2010-04-03 09:35:43 +0000
@@ -1,4 +1,5 @@
package org.hisp.dhis.patient.paging;
+
/*
* Copyright (c) 2004-2009, University of Oslo
* All rights reserved.
@@ -25,6 +26,7 @@
* (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 javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
@@ -75,7 +77,7 @@
return session.getAttribute( attributeName ).toString();
}
- public static Object getSessionObject( HttpServletRequest request, String attributeName, Class clazz )
+ public static Object getSessionObject( HttpServletRequest request, String attributeName, Class<?> clazz )
{
HttpSession session = request.getSession();
if ( session != null )