dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #14685
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5063: indentation and minor comment fixes
------------------------------------------------------------
revno: 5063
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2011-10-31 13:46:53 +0100
message:
indentation and minor comment fixes
modified:
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetAvailablePeriodsAction.java
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetConstantsAction.java
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementGroupAction.java
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementsAction.java
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetExpressionTextAction.java
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetIndicatorGroupAction.java
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetIndicatorGroupSetAction.java
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOperandsAction.java
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitLevelsAction.java
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetPeriodAction.java
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetPeriodTypesAction.java
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetPeriodsAction.java
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetUserAction.java
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/LoadDocumentAction.java
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/NoAction.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-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetAvailablePeriodsAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetAvailablePeriodsAction.java 2011-05-06 10:49:36 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetAvailablePeriodsAction.java 2011-10-31 12:46:53 +0000
@@ -64,9 +64,9 @@
{
this.periodType = periodType;
}
-
+
private int year;
-
+
public void setYear( int year )
{
this.year = year;
@@ -77,7 +77,7 @@
// -------------------------------------------------------------------------
private List<Period> periods;
-
+
public List<Period> getPeriods()
{
return periods;
@@ -90,27 +90,28 @@
public String execute()
{
periodType = periodType != null && !periodType.isEmpty() ? periodType : MonthlyPeriodType.NAME;
-
+
CalendarPeriodType _periodType = (CalendarPeriodType) CalendarPeriodType.getPeriodTypeByName( periodType );
-
+
int thisYear = Calendar.getInstance().get( Calendar.YEAR );
-
+
int currentYear = (Integer) SessionUtils.getSessionVar( SessionUtils.KEY_CURRENT_YEAR, thisYear );
Calendar cal = PeriodType.createCalendarInstance();
-
- if ( !( currentYear == thisYear && year > 0 ) ) // Cannot go to next year if current year equals this year
+
+ // Cannot go to next year if current year equals this year
+ if ( !(currentYear == thisYear && year > 0) )
{
cal.set( Calendar.YEAR, currentYear );
cal.add( Calendar.YEAR, year );
-
+
SessionUtils.setSessionVar( SessionUtils.KEY_CURRENT_YEAR, cal.get( Calendar.YEAR ) );
}
-
+
periods = _periodType.generatePeriods( cal.getTime() );
FilterUtils.filter( periods, new PastAndCurrentPeriodFilter() );
-
+
Collections.reverse( periods );
if ( usePaging )
@@ -119,12 +120,12 @@
periods = periods.subList( paging.getStartPos(), paging.getEndPos() );
}
-
+
for ( Period period : periods )
{
period.setName( format.formatPeriod( period ) );
}
-
+
return SUCCESS;
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetConstantsAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetConstantsAction.java 2011-07-06 07:04:25 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetConstantsAction.java 2011-10-31 12:46:53 +0000
@@ -61,9 +61,14 @@
}
// -------------------------------------------------------------------------
- // Output
+ // Input & Output
// -------------------------------------------------------------------------
+ public void setKey( String key )
+ {
+ this.key = key;
+ }
+
private List<Constant> constants;
public List<Constant> getConstants()
@@ -72,17 +77,12 @@
}
private String key;
-
+
public String getKey()
{
return key;
}
- public void setKey( String key )
- {
- this.key = key;
- }
-
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -92,16 +92,18 @@
if ( isNotBlank( key ) ) // Filter on key only if set
{
this.paging = createPaging( constantService.getConstantCountByName( key ) );
-
- constants = new ArrayList<Constant>( constantService.getConstantsBetweenByName( key, paging.getStartPos(), paging.getPageSize() ) );
+
+ constants = new ArrayList<Constant>( constantService.getConstantsBetweenByName( key, paging.getStartPos(),
+ paging.getPageSize() ) );
}
else
{
this.paging = createPaging( constantService.getConstantCount() );
-
- constants = new ArrayList<Constant>( constantService.getConstantsBetween( paging.getStartPos(), paging.getPageSize() ) );
+
+ constants = new ArrayList<Constant>( constantService.getConstantsBetween( paging.getStartPos(),
+ paging.getPageSize() ) );
}
-
+
Collections.sort( constants, new ConstantNameComparator() );
return SUCCESS;
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementGroupAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementGroupAction.java 2011-05-28 21:04:47 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementGroupAction.java 2011-10-31 12:46:53 +0000
@@ -50,7 +50,7 @@
}
// -------------------------------------------------------------------------
- // Input/output
+ // Input & Output
// -------------------------------------------------------------------------
private Integer id;
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementsAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementsAction.java 2011-07-07 05:00:40 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementsAction.java 2011-10-31 12:46:53 +0000
@@ -155,6 +155,13 @@
this.aggregate = aggregate;
}
+ public String domain;
+
+ public void setDomain( String domain )
+ {
+ this.domain = domain;
+ }
+
private List<DataElement> dataElements;
public List<DataElement> getDataElements()
@@ -162,13 +169,6 @@
return dataElements;
}
- public String domain;
-
- public void setDomain( String domain )
- {
- this.domain = domain;
- }
-
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -191,8 +191,8 @@
if ( categoryCombo != null )
{
- dataElements = new ArrayList<DataElement>( dataElementService
- .getDataElementByCategoryCombo( categoryCombo ) );
+ dataElements = new ArrayList<DataElement>(
+ dataElementService.getDataElementByCategoryCombo( categoryCombo ) );
}
}
else if ( dataSetId != null )
@@ -215,8 +215,8 @@
}
else if ( domain != null )
{
- dataElements = new ArrayList<DataElement>( dataElementService
- .getDataElementsByDomainType( DataElement.DOMAIN_TYPE_PATIENT ) );
+ dataElements = new ArrayList<DataElement>(
+ dataElementService.getDataElementsByDomainType( DataElement.DOMAIN_TYPE_PATIENT ) );
}
else
{
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetExpressionTextAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetExpressionTextAction.java 2011-05-06 10:49:36 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetExpressionTextAction.java 2011-10-31 12:46:53 +0000
@@ -75,6 +75,10 @@
return message;
}
+ // -------------------------------------------------------------------------
+ // Action implementation
+ // -------------------------------------------------------------------------
+
@Override
public String execute()
throws Exception
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetIndicatorGroupAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetIndicatorGroupAction.java 2011-05-28 21:04:47 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetIndicatorGroupAction.java 2011-10-31 12:46:53 +0000
@@ -50,7 +50,7 @@
}
// -------------------------------------------------------------------------
- // Input/output
+ // Input & output
// -------------------------------------------------------------------------
private Integer id;
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetIndicatorGroupSetAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetIndicatorGroupSetAction.java 2011-05-28 21:04:47 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetIndicatorGroupSetAction.java 2011-10-31 12:46:53 +0000
@@ -68,9 +68,12 @@
return indicatorGroupSet;
}
+ // -------------------------------------------------------------------------
+ // Action implementation
+ // -------------------------------------------------------------------------
+
@Override
public String execute()
- throws Exception
{
if ( id != null )
{
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOperandsAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOperandsAction.java 2011-09-23 18:54:49 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOperandsAction.java 2011-10-31 12:46:53 +0000
@@ -51,7 +51,7 @@
extends ActionPagingSupport<DataElementOperand>
{
private static Filter<DataElement> AGGREGATABLE_FILTER = new AggregatableDataElementFilter();
-
+
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
@@ -87,7 +87,7 @@
{
this.id = id;
}
-
+
private String key;
public void setKey( String key )
@@ -112,7 +112,7 @@
{
this.aggregationOperator = aggregationOperator;
}
-
+
private String periodType;
public void setPeriodType( String periodType )
@@ -167,13 +167,14 @@
{
FilterUtils.filter( dataElements, AGGREGATABLE_FILTER );
}
-
+
if ( periodType != null )
{
FilterUtils.filter( dataElements, new DataElementPeriodTypeFilter( periodType ) );
}
- operands = new ArrayList<DataElementOperand>( dataElementCategoryService.getOperands( dataElements, includeTotals ) );
+ operands = new ArrayList<DataElementOperand>( dataElementCategoryService.getOperands( dataElements,
+ includeTotals ) );
Collections.sort( operands, new DataElementOperandNameComparator() );
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitLevelsAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitLevelsAction.java 2011-05-06 10:49:36 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitLevelsAction.java 2011-10-31 12:46:53 +0000
@@ -63,6 +63,10 @@
return organisationUnitLevels;
}
+ // -------------------------------------------------------------------------
+ // Action Implementation
+ // -------------------------------------------------------------------------
+
@Override
public String execute()
throws Exception
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetPeriodAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetPeriodAction.java 2011-05-06 10:49:36 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetPeriodAction.java 2011-10-31 12:46:53 +0000
@@ -50,7 +50,7 @@
}
// -------------------------------------------------------------------------
- // Input
+ // Input & Output
// -------------------------------------------------------------------------
private Integer id;
@@ -60,10 +60,6 @@
this.id = id;
}
- // -------------------------------------------------------------------------
- // Period
- // -------------------------------------------------------------------------
-
private Period period;
public Period getPeriod()
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetPeriodTypesAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetPeriodTypesAction.java 2011-09-13 16:13:11 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetPeriodTypesAction.java 2011-10-31 12:46:53 +0000
@@ -62,6 +62,10 @@
return periodTypes;
}
+ // -------------------------------------------------------------------------
+ // Action implementation
+ // -------------------------------------------------------------------------
+
@Override
public String execute()
throws Exception
@@ -73,7 +77,7 @@
this.paging = createPaging( periodTypes.size() );
periodTypes = periodTypes.subList( paging.getStartPos(), paging.getEndPos() );
- }
+ }
return SUCCESS;
}
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetPeriodsAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetPeriodsAction.java 2011-05-28 21:04:47 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetPeriodsAction.java 2011-10-31 12:46:53 +0000
@@ -66,7 +66,7 @@
}
// -------------------------------------------------------------------------
- // Input
+ // Input & Output
// -------------------------------------------------------------------------
private String name;
@@ -76,10 +76,6 @@
this.name = name;
}
- // -------------------------------------------------------------------------
- // Output
- // -------------------------------------------------------------------------
-
private List<Period> periods;
public List<Period> getPeriods()
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetUserAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetUserAction.java 2011-06-17 13:22:05 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetUserAction.java 2011-10-31 12:46:53 +0000
@@ -48,9 +48,9 @@
{
this.userService = userService;
}
-
+
// -------------------------------------------------------------------------
- // Input
+ // Input & Output
// -------------------------------------------------------------------------
private Integer id;
@@ -60,10 +60,6 @@
this.id = id;
}
- // -------------------------------------------------------------------------
- // Output
- // -------------------------------------------------------------------------
-
private User user;
public User getUser()
@@ -78,7 +74,7 @@
public String execute()
{
user = userService.getUser( id );
-
+
return SUCCESS;
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/LoadDocumentAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/LoadDocumentAction.java 2011-05-28 21:04:47 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/LoadDocumentAction.java 2011-10-31 12:46:53 +0000
@@ -64,7 +64,7 @@
public void setDocumentService( DocumentService documentService )
{
this.documentService = documentService;
- }
+ }
// -------------------------------------------------------------------------
// Input
@@ -75,10 +75,10 @@
public void setId( Integer id )
{
this.id = id;
- }
-
+ }
+
private Document document;
-
+
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -88,13 +88,13 @@
throws Exception
{
document = documentService.getDocument( id );
-
+
InputStream in = locationManager.getInputStream( document.getUrl(), DocumentService.DIR );
-
+
IOUtils.copy( in, out );
-
+
log.info( "Document " + document.getName() + ", " + document.getUrl() + ", " + document.getContentType() );
-
+
return SUCCESS;
}
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/NoAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/NoAction.java 2011-05-28 21:04:47 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/NoAction.java 2011-10-31 12:46:53 +0000
@@ -56,7 +56,7 @@
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
-
+
public String execute()
{
return SUCCESS;