dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #30352
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15407: [IMPROVED] Cleaned up code for Interpretations for Mobile Lite
------------------------------------------------------------
revno: 15407
committer: paulmarkcastillo@xxxxxxxxx
branch nick: trunk
timestamp: Mon 2014-05-26 19:17:36 +0800
message:
[IMPROVED] Cleaned up code for Interpretations for Mobile Lite
https://blueprints.launchpad.net/dhis-mobile/+spec/mla-interpretations
modified:
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dashboard/action/GetDashboardChartAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/interpretation/action/PostInterpretation.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/interpretation/action/PostInterpretationComment.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-light/src/main/java/org/hisp/dhis/light/dashboard/action/GetDashboardChartAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dashboard/action/GetDashboardChartAction.java 2014-05-26 10:22:07 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dashboard/action/GetDashboardChartAction.java 2014-05-26 11:17:36 +0000
@@ -5,26 +5,11 @@
import com.opensymphony.xwork2.Action;
-/**
- *
- * @author Paul Mark Castillo
- *
- */
public class GetDashboardChartAction
implements Action
{
- /**
- *
- */
private static final Log log = LogFactory.getLog( GetDashboardChartAction.class );
- /**
- *
- */
- public GetDashboardChartAction()
- {
- }
-
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
@@ -33,35 +18,23 @@
// Input & Output
// -------------------------------------------------------------------------
- /**
- *
- */
private int id;
-
- /**
- *
- * @return
- */
- public int getId() {
- return id;
- }
-
- /**
- *
- * @param id
- */
- public void setId(int id) {
- this.id = id;
- }
-
+
+ public void setId( int id )
+ {
+ this.id = id;
+ }
+
+ public int getId()
+ {
+ return id;
+ }
+
// -------------------------------------------------------------------------
// Action Implementation
// -------------------------------------------------------------------------
-
-
-
- @Override
+ @Override
public String execute()
throws Exception
{
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/interpretation/action/PostInterpretation.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/interpretation/action/PostInterpretation.java 2014-05-26 10:22:07 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/interpretation/action/PostInterpretation.java 2014-05-26 11:17:36 +0000
@@ -10,141 +10,54 @@
import com.opensymphony.xwork2.Action;
-/**
- *
- * @author Paul Mark Castillo
- *
- */
public class PostInterpretation
implements Action
{
- /**
- *
- */
private static final Log log = LogFactory.getLog( PostInterpretation.class );
- /**
- *
- */
- public PostInterpretation()
- {
- }
-
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
- /**
- *
- */
private InterpretationService interpretationService;
- /**
- * @return the interpretationService
- */
- public InterpretationService getInterpretationService()
- {
- return interpretationService;
- }
-
- /**
- * @param interpretationService the interpretationService to set
- */
public void setInterpretationService( InterpretationService interpretationService )
{
- this.interpretationService = interpretationService;
+ this.interpretationService = interpretationService;
}
- /**
- *
- */
private CurrentUserService currentUserService;
- /**
- *
- * @return
- */
- public CurrentUserService getCurrentUserService() {
- return currentUserService;
- }
-
- /**
- *
- * @param currentUserService
- */
- public void setCurrentUserService(CurrentUserService currentUserService) {
- this.currentUserService = currentUserService;
- }
-
- /**
- *
- */
+ public void setCurrentUserService( CurrentUserService currentUserService )
+ {
+ this.currentUserService = currentUserService;
+ }
+
private ChartService chartService;
- /**
- *
- * @return
- */
- public ChartService getChartService() {
- return chartService;
- }
+ public void setChartService( ChartService chartService )
+ {
+ this.chartService = chartService;
+ }
- /**
- *
- * @param chartService
- */
- public void setChartService(ChartService chartService) {
- this.chartService = chartService;
- }
-
-
// -------------------------------------------------------------------------
// Input & Output
// -------------------------------------------------------------------------
- /**
- *
- */
- private int id;
-
- /**
- *
- * @return
- */
- public int getId() {
- return id;
- }
-
- /**
- *
- * @param id
- */
- public void setId(int id) {
- this.id = id;
- }
-
- /**
- *
- */
- private String interpretation;
-
- /**
- *
- * @return
- */
- public String getInterpretation() {
- return interpretation;
- }
-
- /**
- *
- * @param interpretation
- */
- public void setInterpretation(String interpretation) {
- this.interpretation = interpretation;
- }
-
-
+ private int id;
+
+ public void setId( int id )
+ {
+ this.id = id;
+ }
+
+ private String interpretation;
+
+ public void setInterpretation( String interpretation )
+ {
+ this.interpretation = interpretation;
+ }
+
// -------------------------------------------------------------------------
// Action Implementation
// -------------------------------------------------------------------------
@@ -153,14 +66,14 @@
public String execute()
throws Exception
{
- Chart c = chartService.getChart(id);
-
- Interpretation i = new Interpretation(c, null, interpretation);
-
- i.setUser(currentUserService.getCurrentUser());
-
- interpretationService.saveInterpretation(i);
-
+ Chart c = chartService.getChart( id );
+
+ Interpretation i = new Interpretation( c, null, interpretation );
+
+ i.setUser( currentUserService.getCurrentUser() );
+
+ interpretationService.saveInterpretation( i );
+
return SUCCESS;
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/interpretation/action/PostInterpretationComment.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/interpretation/action/PostInterpretationComment.java 2014-05-26 10:22:07 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/interpretation/action/PostInterpretationComment.java 2014-05-26 11:17:36 +0000
@@ -7,47 +7,17 @@
import com.opensymphony.xwork2.Action;
-/**
- *
- * @author Paul Mark Castillo
- *
- */
public class PostInterpretationComment
implements Action
{
-
- /**
- *
- */
private static final Log log = LogFactory.getLog( PostInterpretationComment.class );
- /**
- *
- */
- public PostInterpretationComment()
- {
- }
-
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
- /**
- *
- */
private InterpretationService interpretationService;
- /**
- * @return the interpretationService
- */
- public InterpretationService getInterpretationService()
- {
- return interpretationService;
- }
-
- /**
- * @param interpretationService the interpretationService to set
- */
public void setInterpretationService( InterpretationService interpretationService )
{
this.interpretationService = interpretationService;
@@ -57,66 +27,27 @@
// Input & Output
// -------------------------------------------------------------------------
- /**
- *
- */
private int interpretationId;
- /**
- * @return the interpretationId
- */
- public int getInterpretationId()
- {
- return interpretationId;
- }
-
- /**
- * @param interpretationId the interpretationId to set
- */
public void setInterpretationId( int interpretationId )
{
this.interpretationId = interpretationId;
}
- /**
- *
- */
private Interpretation interpretation;
- /**
- * @return the interpretation
- */
+ public void setInterpretation( Interpretation interpretation )
+ {
+ this.interpretation = interpretation;
+ }
+
public Interpretation getInterpretation()
{
return interpretation;
}
- /**
- * @param interpretation the interpretation to set
- */
- public void setInterpretation( Interpretation interpretation )
- {
- this.interpretation = interpretation;
- }
-
- /**
- *
- */
private String comment;
- /**
- *
- * @return
- */
- public String getComment()
- {
- return comment;
- }
-
- /**
- *
- * @param comment
- */
public void setComment( String comment )
{
this.comment = comment;
@@ -130,8 +61,10 @@
public String execute()
throws Exception
{
- setInterpretation( interpretationService.getInterpretation( getInterpretationId() ) );
- interpretationService.addInterpretationComment( getInterpretation().getUid(), getComment() );
+ setInterpretation( interpretationService.getInterpretation( interpretationId ) );
+
+ interpretationService.addInterpretationComment( interpretation.getUid(), comment );
+
return SUCCESS;
}
}