=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/login.css' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/login.css 2011-03-23 18:29:28 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/login.css 2011-03-24 19:34:13 +0000 @@ -14,7 +14,7 @@ .loginField { - margin-top: 6%; + margin-top: 7%; } .loginField td === added directory 'labs' === added directory 'labs/dhis-web-light' === added file 'labs/dhis-web-light/pom.xml' --- labs/dhis-web-light/pom.xml 1970-01-01 00:00:00 +0000 +++ labs/dhis-web-light/pom.xml 2011-03-24 19:34:13 +0000 @@ -0,0 +1,53 @@ + + 4.0.0 + + + org.hisp.dhis + dhis-web + 2.2-SNAPSHOT + + + dhis-web-light + war + DHIS Web Light + + + dhis-web-light + + + + + + + + org.hisp.dhis + dhis-web-commons + + + org.hisp.dhis + dhis-web-commons-resources + war + + + org.hisp.dhis + dhis-service-reporting + + + org.hisp.dhis + dhis-service-core + + + + + + jfree + jfreechart + + + + + ../../ + + === added directory 'labs/dhis-web-light/src' === added directory 'labs/dhis-web-light/src/main' === added directory 'labs/dhis-web-light/src/main/java' === added directory 'labs/dhis-web-light/src/main/java/org' === added directory 'labs/dhis-web-light/src/main/java/org/hisp' === added directory 'labs/dhis-web-light/src/main/java/org/hisp/dhis' === added directory 'labs/dhis-web-light/src/main/java/org/hisp/dhis/light' === added directory 'labs/dhis-web-light/src/main/java/org/hisp/dhis/light/action' === added file 'labs/dhis-web-light/src/main/java/org/hisp/dhis/light/action/GetChartAction.java' --- labs/dhis-web-light/src/main/java/org/hisp/dhis/light/action/GetChartAction.java 1970-01-01 00:00:00 +0000 +++ labs/dhis-web-light/src/main/java/org/hisp/dhis/light/action/GetChartAction.java 2011-03-24 19:34:13 +0000 @@ -0,0 +1,124 @@ +package org.hisp.dhis.light.action; + +/* + * Copyright (c) 2004-2010, University of Oslo + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of the HISP project nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (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 org.hisp.dhis.chart.ChartService; +import org.hisp.dhis.i18n.I18nFormat; +import org.jfree.chart.JFreeChart; + +import com.opensymphony.xwork2.Action; + +/** + * @author Lars Helge Overland + * @version $Id$ + */ +public class GetChartAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private ChartService chartService; + + public void setChartService( ChartService chartService ) + { + this.chartService = chartService; + } + + private I18nFormat format; + + public void setFormat( I18nFormat format ) + { + this.format = format; + } + + // ------------------------------------------------------------------------- + // Input + // ------------------------------------------------------------------------- + + private Integer id; + + public void setId( Integer id ) + { + this.id = id; + } + + // ------------------------------------------------------------------------- + // Output + // ------------------------------------------------------------------------- + + private JFreeChart chart; + + public JFreeChart getChart() + { + return chart; + } + + private int height; + + public int getHeight() + { + return height; + } + + public void setHeight( int height ) + { + this.height = height; + } + + private int width; + + public int getWidth() + { + return width; + } + + public void setWidth( int width ) + { + this.width = width; + } + + // ------------------------------------------------------------------------- + // Action implemenation + // ------------------------------------------------------------------------- + + public String execute() + { + if ( id != null ) + { + chart = chartService.getJFreeChart( id, format ); + + height = 200; + + width = 400; + } + + return SUCCESS; + } +} === added file 'labs/dhis-web-light/src/main/java/org/hisp/dhis/light/action/ProvideContentAction.java' --- labs/dhis-web-light/src/main/java/org/hisp/dhis/light/action/ProvideContentAction.java 1970-01-01 00:00:00 +0000 +++ labs/dhis-web-light/src/main/java/org/hisp/dhis/light/action/ProvideContentAction.java 2011-03-24 19:34:13 +0000 @@ -0,0 +1,88 @@ +package org.hisp.dhis.light.action; + +import java.util.List; + +import org.hisp.dhis.dashboard.DashboardConfiguration; +import org.hisp.dhis.dashboard.DashboardContent; +import org.hisp.dhis.dashboard.DashboardManager; +import org.hisp.dhis.dashboard.DashboardService; +import org.hisp.dhis.document.Document; +import org.hisp.dhis.reporttable.ReportTable; +import org.hisp.dhis.user.CurrentUserService; +import org.hisp.dhis.user.User; + +import com.opensymphony.xwork2.Action; +import com.opensymphony.xwork2.ActionContext; + +public class ProvideContentAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private DashboardService dashboardService; + + public void setDashboardService( DashboardService dashboardService ) + { + this.dashboardService = dashboardService; + } + + private DashboardManager dashboardManager; + + public void setDashboardManager( DashboardManager dashboardManager ) + { + this.dashboardManager = dashboardManager; + } + + private CurrentUserService currentUserService; + + public void setCurrentUserService( CurrentUserService currentUserService ) + { + this.currentUserService = currentUserService; + } + + // ------------------------------------------------------------------------- + // Output + // ------------------------------------------------------------------------- + + private List reportTables; + + public List getReportTables() + { + return reportTables; + } + + private List documents; + + public List getDocuments() + { + return documents; + } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + public String execute() + throws Exception + { + DashboardConfiguration config = dashboardManager.getConfiguration(); + + if ( config != null ) + { + ActionContext.getContext().getActionInvocation().getStack().push( config.getAreaItems() ); + System.out.println( config.getAreaItems() ); + } + + User user = currentUserService.getCurrentUser(); + + DashboardContent content = dashboardService.getDashboardContent( user ); + + reportTables = content.getReportTables(); + + documents = content.getDocuments(); + + return SUCCESS; + } +} === added directory 'labs/dhis-web-light/src/main/resources' === added directory 'labs/dhis-web-light/src/main/resources/META-INF' === added directory 'labs/dhis-web-light/src/main/resources/META-INF/dhis' === added file 'labs/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml' --- labs/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml 1970-01-01 00:00:00 +0000 +++ labs/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml 2011-03-24 19:34:13 +0000 @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + \ No newline at end of file === added directory 'labs/dhis-web-light/src/main/resources/org' === added directory 'labs/dhis-web-light/src/main/resources/org/hisp' === added directory 'labs/dhis-web-light/src/main/resources/org/hisp/dhis' === added directory 'labs/dhis-web-light/src/main/resources/org/hisp/dhis/light' === added file 'labs/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties' === added file 'labs/dhis-web-light/src/main/resources/struts.xml' --- labs/dhis-web-light/src/main/resources/struts.xml 1970-01-01 00:00:00 +0000 +++ labs/dhis-web-light/src/main/resources/struts.xml 2011-03-24 19:34:13 +0000 @@ -0,0 +1,23 @@ + + + + + + + + + + /dhis-web-light/dashboard.vm + + + + + 480 + 800 + + + + + \ No newline at end of file === added directory 'labs/dhis-web-light/src/main/webapp' === added directory 'labs/dhis-web-light/src/main/webapp/WEB-INF' === added file 'labs/dhis-web-light/src/main/webapp/WEB-INF/web.xml' --- labs/dhis-web-light/src/main/webapp/WEB-INF/web.xml 1970-01-01 00:00:00 +0000 +++ labs/dhis-web-light/src/main/webapp/WEB-INF/web.xml 2011-03-24 19:34:13 +0000 @@ -0,0 +1,60 @@ + + + + DHIS Web Light + + + contextConfigLocation + classpath*:/META-INF/dhis/beans.xml + + + automaticAccessType + ghostAdmin + + + + RedirectFilter + org.hisp.dhis.servlet.filter.HttpRedirectFilter + + redirectPath + dhis-web-light/index.action + + + + OpenSessionInViewFilter + org.springframework.orm.hibernate3.support.OpenSessionInViewFilter + + + springSecurityFilterChain + org.springframework.web.filter.DelegatingFilterProxy + + + Struts + org.apache.struts2.dispatcher.FilterDispatcher + + + + RedirectFilter + / + + + OpenSessionInViewFilter + *.action + + + springSecurityFilterChain + /* + + + Struts + *.action + + + + org.springframework.web.context.ContextLoaderListener + + + org.hisp.dhis.system.startup.StartupListener + + === added directory 'labs/dhis-web-light/src/main/webapp/dhis-web-light' === added file 'labs/dhis-web-light/src/main/webapp/dhis-web-light/dashboard.vm' --- labs/dhis-web-light/src/main/webapp/dhis-web-light/dashboard.vm 1970-01-01 00:00:00 +0000 +++ labs/dhis-web-light/src/main/webapp/dhis-web-light/dashboard.vm 2011-03-24 19:34:13 +0000 @@ -0,0 +1,45 @@ + + + + DHIS 2 + + + + + + + + + + + + +
DHIS 2
+ +
+ + + +#if( $chartAreaA ) +
+#end + +#if( $chartAreaB ) +
+#end + +#if( $chartAreaC ) +
+#end + +#if( $chartAreaD ) +
+#end + + + + + +
+ + === added directory 'labs/dhis-web-light/src/main/webapp/dhis-web-light/style' === added file 'labs/dhis-web-light/src/main/webapp/dhis-web-light/style/dhis-web-light.css' --- labs/dhis-web-light/src/main/webapp/dhis-web-light/style/dhis-web-light.css 1970-01-01 00:00:00 +0000 +++ labs/dhis-web-light/src/main/webapp/dhis-web-light/style/dhis-web-light.css 2011-03-24 19:34:13 +0000 @@ -0,0 +1,32 @@ + +html, body { + font-family: arial; +} + +body { + margin: 0px; + padding: 0px; +} + +.headerDiv { + position: relative; + width: 100%; + font-size: 2em; + text-align: center; + color: #ffffff; + background-color: #32669a; + padding: 0.5em; + border-bottom: 1px solid #d0d0d0; +} + +.contentDiv { + position: relative; + width: 100%; +} + +.contentItemDiv { + position: relative; + padding-top: 3em; + padding-bottom: 3em; + border-bottom: 1px solid #d0d0d0; +}