=== modified file 'dhis-2/dhis-web/dhis-web-commons/pom.xml' --- dhis-2/dhis-web/dhis-web-commons/pom.xml 2011-03-02 00:23:51 +0000 +++ dhis-2/dhis-web/dhis-web-commons/pom.xml 2011-04-07 13:48:56 +0000 @@ -68,6 +68,10 @@ org.hisp.dhis + dhis-service-reporting + + + org.hisp.dhis dhis-support-test === added 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 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/LoadDocumentAction.java 2011-04-07 13:48:56 +0000 @@ -0,0 +1,113 @@ +package org.hisp.dhis.commons.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 java.io.InputStream; +import java.io.OutputStream; + +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.hisp.dhis.document.Document; +import org.hisp.dhis.document.DocumentService; +import org.hisp.dhis.external.location.LocationManager; +import org.hisp.dhis.util.StreamActionSupport; + +/** + * @author Lars Helge Overland + * @version $Id$ + */ +public class LoadDocumentAction + extends StreamActionSupport +{ + private static final Log log = LogFactory.getLog( LoadDocumentAction.class ); + + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private LocationManager locationManager; + + public void setLocationManager( LocationManager locationManager ) + { + this.locationManager = locationManager; + } + + private DocumentService documentService; + + public void setDocumentService( DocumentService documentService ) + { + this.documentService = documentService; + } + + // ------------------------------------------------------------------------- + // Input + // ------------------------------------------------------------------------- + + private Integer id; + + public void setId( Integer id ) + { + this.id = id; + } + + private Document document; + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + @Override + protected String execute( HttpServletResponse response, OutputStream out ) + 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; + } + + @Override + protected String getContentType() + { + return document != null ? document.getContentType() : null; + } + + @Override + protected String getFilename() + { + return document != null ? document.getUrl() : null; + } +} === modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml 2011-04-07 12:42:11 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml 2011-04-07 13:48:56 +0000 @@ -437,6 +437,11 @@ + + + + + === modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/dhis-web-commons.xml' --- dhis-2/dhis-web/dhis-web-commons/src/main/resources/dhis-web-commons.xml 2011-04-06 12:17:02 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/dhis-web-commons.xml 2011-04-07 13:48:56 +0000 @@ -608,6 +608,17 @@ + + + + + + + + + + - - $i18n.getString( "data_mart_export" ) - - #foreach ( $export in $dataMartExports ) - - - $export.name - - - - $i18n.getString( 'remove' ) - - - #end - === modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/document.vm' --- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/document.vm 2009-03-07 13:10:38 +0000 +++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/document.vm 2011-04-07 13:48:56 +0000 @@ -9,7 +9,7 @@ #if ( $document.external ) #else - + #end $document.name === removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/document/action/LoadDocumentFromFileSystemAction.java' --- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/document/action/LoadDocumentFromFileSystemAction.java 2010-09-20 08:49:55 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/document/action/LoadDocumentFromFileSystemAction.java 1970-01-01 00:00:00 +0000 @@ -1,113 +0,0 @@ -package org.hisp.dhis.reporting.document.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 java.io.InputStream; -import java.io.OutputStream; - -import javax.servlet.http.HttpServletResponse; - -import org.apache.commons.io.IOUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.hisp.dhis.document.Document; -import org.hisp.dhis.document.DocumentService; -import org.hisp.dhis.external.location.LocationManager; -import org.hisp.dhis.util.StreamActionSupport; - -/** - * @author Lars Helge Overland - * @version $Id$ - */ -public class LoadDocumentFromFileSystemAction - extends StreamActionSupport -{ - private static final Log log = LogFactory.getLog( LoadDocumentFromFileSystemAction.class ); - - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private LocationManager locationManager; - - public void setLocationManager( LocationManager locationManager ) - { - this.locationManager = locationManager; - } - - private DocumentService documentService; - - public void setDocumentService( DocumentService documentService ) - { - this.documentService = documentService; - } - - // ------------------------------------------------------------------------- - // Input - // ------------------------------------------------------------------------- - - private Integer id; - - public void setId( Integer id ) - { - this.id = id; - } - - private Document document; - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - @Override - protected String execute( HttpServletResponse response, OutputStream out ) - 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; - } - - @Override - protected String getContentType() - { - return document != null ? document.getContentType() : null; - } - - @Override - protected String getFilename() - { - return document != null ? document.getUrl() : null; - } -} === modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml 2011-04-01 11:19:55 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml 2011-04-07 13:48:56 +0000 @@ -24,14 +24,6 @@ ref="org.hisp.dhis.document.DocumentService"/> - - - - - === modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml 2011-03-23 02:40:08 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml 2011-04-07 13:48:56 +0000 @@ -55,10 +55,6 @@ plainTextError - - - - === modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDocumentForm.vm' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDocumentForm.vm 2011-03-28 20:09:32 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDocumentForm.vm 2011-04-07 13:48:56 +0000 @@ -39,7 +39,7 @@ #if ( $document.external ) #else - + #end $i18n.getString( 'view_report' ) $i18n.getString( === modified 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 2011-04-07 13:30:46 +0000 +++ labs/dhis-web-light/src/main/webapp/dhis-web-light/style/dhis-web-light.css 2011-04-07 13:48:56 +0000 @@ -92,7 +92,7 @@ .listTable td { padding: 0.2em; - white-space:nowrap; + white-space: nowrap; } .listRow {