=== added 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 1970-01-01 00:00:00 +0000 +++ 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 @@ -0,0 +1,70 @@ +package org.hisp.dhis.light.dashboard.action; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +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 + // ------------------------------------------------------------------------- + + // ------------------------------------------------------------------------- + // Input & Output + // ------------------------------------------------------------------------- + + /** + * + */ + private int id; + + /** + * + * @return + */ + public int getId() { + return id; + } + + /** + * + * @param id + */ + public void setId(int id) { + this.id = id; + } + + // ------------------------------------------------------------------------- + // Action Implementation + // ------------------------------------------------------------------------- + + + + + @Override + public String execute() + throws Exception + { + return SUCCESS; + } +} === added 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 1970-01-01 00:00:00 +0000 +++ 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 @@ -0,0 +1,166 @@ +package org.hisp.dhis.light.interpretation.action; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.hisp.dhis.chart.Chart; +import org.hisp.dhis.chart.ChartService; +import org.hisp.dhis.interpretation.Interpretation; +import org.hisp.dhis.interpretation.InterpretationService; +import org.hisp.dhis.user.CurrentUserService; + +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; + } + + /** + * + */ + private CurrentUserService currentUserService; + + /** + * + * @return + */ + public CurrentUserService getCurrentUserService() { + return currentUserService; + } + + /** + * + * @param currentUserService + */ + public void setCurrentUserService(CurrentUserService currentUserService) { + this.currentUserService = currentUserService; + } + + /** + * + */ + private ChartService chartService; + + /** + * + * @return + */ + public ChartService getChartService() { + return 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; + } + + + // ------------------------------------------------------------------------- + // Action Implementation + // ------------------------------------------------------------------------- + + @Override + public String execute() + throws Exception + { + 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-19 11:42:06 +0000 +++ 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 @@ -1,22 +1,53 @@ package org.hisp.dhis.light.interpretation.action; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.hisp.dhis.interpretation.Interpretation; import org.hisp.dhis.interpretation.InterpretationService; import com.opensymphony.xwork2.Action; /** - * @author Paul Mark Castillo + * + * @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; @@ -26,37 +57,66 @@ // 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 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; @@ -71,9 +131,7 @@ throws Exception { setInterpretation( interpretationService.getInterpretation( getInterpretationId() ) ); - interpretationService.addInterpretationComment( getInterpretation().getUid(), getComment() ); - return SUCCESS; } } === modified file 'dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml 2014-05-19 07:34:54 +0000 +++ dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml 2014-05-26 10:22:07 +0000 @@ -477,6 +477,10 @@ class="org.hisp.dhis.light.dashboard.action.GetChartAction" scope="prototype"> + + + + + + + + + + + /dhis-web-light/main.vm + /dhis-web-light/dashboard_chart.vm + + /dhis-web-light/interpretation/interpretation.vm + + /dhis-web-light/main.vm + /dhis-web-light/menu.vm + + === added file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/dashboard_chart.vm' --- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/dashboard_chart.vm 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/dashboard_chart.vm 2014-05-26 10:22:07 +0000 @@ -0,0 +1,24 @@ +## ============================================================================ +

+ $i18n.getString( "chart" ) +

+ + +## ============================================================================ +

+
+

+ + +## ============================================================================ +

$i18n.getString("interpretation_share")

+ +
+ +
+

+ + +

+
+
\ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/dashboard_charts.vm' --- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/dashboard_charts.vm 2013-03-13 14:14:24 +0000 +++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/dashboard_charts.vm 2014-05-26 10:22:07 +0000 @@ -6,7 +6,7 @@ #end
#foreach( $chart in $chartsForAll ) -$chart.name
+$chart.name
#end
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/interpretation/interpretation.vm' --- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/interpretation/interpretation.vm 2014-05-19 07:34:54 +0000 +++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/interpretation/interpretation.vm 2014-05-26 10:22:07 +0000 @@ -1,6 +1,6 @@ ## ============================================================================

- $i18n.getString( "Interpretation" ) + $i18n.getString( "interpretation" )