dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #25413
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12605: Removed PDF export classes from dhis-service-importexport
------------------------------------------------------------
revno: 12605
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2013-10-13 18:22:18 +0200
message:
Removed PDF export classes from dhis-service-importexport
removed:
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/DataElementConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/IndicatorConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/OrganisationUnitConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/OrganisationUnitHierarchyConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/UserConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/ValidationRuleConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/exporter/
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/exporter/ITextPDFExportService.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/exporter/PDFPipeThread.java
modified:
dhis-2/dhis-services/dhis-service-importexport/src/main/resources/META-INF/dhis/beans.xml
--
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
=== removed directory 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf'
=== removed directory 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter'
=== removed file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/DataElementConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/DataElementConverter.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/DataElementConverter.java 1970-01-01 00:00:00 +0000
@@ -1,93 +0,0 @@
-package org.hisp.dhis.importexport.pdf.converter;
-
-/*
- * Copyright (c) 2004-2013, 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.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
-import org.hisp.dhis.dataelement.DataElement;
-import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.i18n.I18n;
-import org.hisp.dhis.i18n.I18nFormat;
-import org.hisp.dhis.importexport.ExportParams;
-import org.hisp.dhis.importexport.PDFConverter;
-import org.hisp.dhis.system.util.PDFUtils;
-
-import com.lowagie.text.Document;
-
-/**
- * @author Lars Helge Overland
- * @version $Id: DataElementConverter.java 4646 2008-02-26 14:54:29Z larshelg $
- * @modifier Dang Duy Hieu
- * @since 2010-05-19
- */
-public class DataElementConverter
- extends PDFUtils
- implements PDFConverter
-{
-
- private DataElementService dataElementService;
-
- public DataElementConverter( DataElementService dataElementService )
- {
- this.dataElementService = dataElementService;
- }
-
- // -------------------------------------------------------------------------
- // PDFConverter implementation
- // -------------------------------------------------------------------------
-
- public void write( Document document, ExportParams params )
- {
- I18n i18n = params.getI18n();
- I18nFormat format = params.getFormat();
- List<DataElement> elements = null;
-
- if ( params.isMetaData() )
- {
- elements = new ArrayList<DataElement>( dataElementService.getDataElements( params.getDataElements() ) );
- }
- else
- {
- elements = new ArrayList<DataElement>( params.getDataElementObjects() );
- }
-
- Collections.sort( elements, IdentifiableObjectNameComparator.INSTANCE );
-
- PDFUtils.printObjectFrontPage( document, elements, i18n, format, "data_elements" );
-
- for ( DataElement element : elements )
- {
- addTableToDocument( document, printDataElement( element, i18n, true, 0.40f, 0.60f ) );
- }
-
- }
-}
=== removed file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/IndicatorConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/IndicatorConverter.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/IndicatorConverter.java 1970-01-01 00:00:00 +0000
@@ -1,95 +0,0 @@
-package org.hisp.dhis.importexport.pdf.converter;
-
-/*
- * Copyright (c) 2004-2013, 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.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
-import org.hisp.dhis.expression.ExpressionService;
-import org.hisp.dhis.i18n.I18n;
-import org.hisp.dhis.i18n.I18nFormat;
-import org.hisp.dhis.importexport.ExportParams;
-import org.hisp.dhis.importexport.PDFConverter;
-import org.hisp.dhis.indicator.Indicator;
-import org.hisp.dhis.indicator.IndicatorService;
-import org.hisp.dhis.system.util.PDFUtils;
-
-import com.lowagie.text.Document;
-
-/**
- * @author Lars Helge Overland
- * @version $Id: IndicatorConverter.java 4646 2008-02-26 14:54:29Z larshelg $
- * @modifier Dang Duy Hieu
- * @since 2010-05-19
- */
-public class IndicatorConverter
- extends PDFUtils
- implements PDFConverter
-{
- private ExpressionService expressionService;
-
- private IndicatorService indicatorService;
-
- public IndicatorConverter( ExpressionService expressionService, IndicatorService indicatorService )
- {
- this.expressionService = expressionService;
- this.indicatorService = indicatorService;
- }
-
- // -------------------------------------------------------------------------
- // PDFConverter implementation
- // -------------------------------------------------------------------------
-
- public void write( Document document, ExportParams params )
- {
- I18n i18n = params.getI18n();
- I18nFormat format = params.getFormat();
- List<Indicator> elements = null;
-
- if ( params.isMetaData() )
- {
- elements = new ArrayList<Indicator>( indicatorService.getIndicators( params.getIndicators() ) );
- }
- else
- {
- elements = new ArrayList<Indicator>( params.getIndicatorObjects() );
- }
-
- Collections.sort( elements, IdentifiableObjectNameComparator.INSTANCE );
-
- PDFUtils.printObjectFrontPage( document, elements, i18n, format, "indicators" );
-
- for ( Indicator indicator : elements )
- {
- addTableToDocument( document, printIndicator( indicator, i18n, expressionService, true, 0.40f, 0.60f ) );
- }
- }
-}
=== removed file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/OrganisationUnitConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/OrganisationUnitConverter.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/OrganisationUnitConverter.java 1970-01-01 00:00:00 +0000
@@ -1,96 +0,0 @@
-package org.hisp.dhis.importexport.pdf.converter;
-
-/*
- * Copyright (c) 2004-2013, 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.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
-import org.hisp.dhis.i18n.I18n;
-import org.hisp.dhis.i18n.I18nFormat;
-import org.hisp.dhis.importexport.ExportParams;
-import org.hisp.dhis.importexport.PDFConverter;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.hisp.dhis.system.util.PDFUtils;
-
-import com.lowagie.text.Document;
-
-/**
- * @author Lars Helge Overland
- * @version $Id: OrganisationUnitConverter.java 6251 2008-11-10 14:37:05Z
- * larshelg $
- * @modifier Dang Duy Hieu
- * @since 2010-05-19
- */
-public class OrganisationUnitConverter
- extends PDFUtils
- implements PDFConverter
-{
- private OrganisationUnitService organisationUnitService;
-
- public OrganisationUnitConverter( OrganisationUnitService organisationUnitService )
- {
- this.organisationUnitService = organisationUnitService;
- }
-
- public OrganisationUnitConverter()
- {
- }
-
- // -------------------------------------------------------------------------
- // PDFConverter implementation
- // -------------------------------------------------------------------------
-
- public void write( Document document, ExportParams params )
- {
- I18n i18n = params.getI18n();
- I18nFormat format = params.getFormat();
- List<OrganisationUnit> elements = null;
-
- if ( params.isMetaData() )
- {
- elements = new ArrayList<OrganisationUnit>( organisationUnitService.getOrganisationUnits( params.getOrganisationUnits() ) );
- }
- else
- {
- elements = new ArrayList<OrganisationUnit>( params.getOrganisationUnitObjects() );
- }
-
- Collections.sort( elements, IdentifiableObjectNameComparator.INSTANCE );
-
- PDFUtils.printObjectFrontPage( document, elements, i18n, format, "organisation_units" );
-
- for ( OrganisationUnit unit : elements )
- {
- addTableToDocument( document, printOrganisationUnit( unit, i18n, format, true, 0.40f, 0.60f ) );
- }
- }
-}
=== removed file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/OrganisationUnitHierarchyConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/OrganisationUnitHierarchyConverter.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/OrganisationUnitHierarchyConverter.java 1970-01-01 00:00:00 +0000
@@ -1,126 +0,0 @@
-package org.hisp.dhis.importexport.pdf.converter;
-
-/*
- * Copyright (c) 2004-2013, 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.util.ArrayList;
-import java.util.Collection;
-
-import org.hisp.dhis.i18n.I18n;
-import org.hisp.dhis.i18n.I18nFormat;
-import org.hisp.dhis.importexport.ExportParams;
-import org.hisp.dhis.importexport.PDFConverter;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.hisp.dhis.system.util.PDFUtils;
-
-import com.lowagie.text.Document;
-import com.lowagie.text.pdf.PdfPTable;
-
-/**
- * @author Lars Helge Overland
- * @version $Id: OrganisationUnitHierarchyConverter.java 5316 2008-06-02
- * 19:06:28Z larshelg $
- * @modifier Dang Duy Hieu
- * @since 2010-05-19
- */
-public class OrganisationUnitHierarchyConverter
- extends PDFUtils
- implements PDFConverter
-{
- private static final int SPACES_PER_INDENTATION = 6;
-
- private OrganisationUnitService organisationUnitService;
-
- public OrganisationUnitHierarchyConverter( OrganisationUnitService organisationUnitService )
- {
- this.organisationUnitService = organisationUnitService;
- }
-
- // -------------------------------------------------------------------------
- // PDFConverter implementation
- // -------------------------------------------------------------------------
-
- public void write( Document document, ExportParams params )
- {
- I18n i18n = params.getI18n();
- I18nFormat format = params.getFormat();
-
- PDFUtils.printObjectFrontPage( document, params.getOrganisationUnits(), i18n, format, "organisation_unit_hierarchy" );
-
- if ( params.getOrganisationUnits() != null && params.getOrganisationUnits().size() > 0 )
- {
- Collection<OrganisationUnit> hierarchy = getHierarchy();
-
- PdfPTable table = getPdfPTable( false, 0.100f );
-
- for ( OrganisationUnit unit : hierarchy )
- {
- String indent = getIndent( unit.getLevel() );
-
- table.addCell( getTextCell( indent + unit.getName() ) );
- }
-
- addTableToDocument( document, table );
-
- moveToNewPage( document );
- }
- }
-
- // -------------------------------------------------------------------------
- // Supportive methods
- // -------------------------------------------------------------------------
-
- private String getIndent( int step )
- {
- StringBuffer buffer = new StringBuffer();
-
- int indent = step * SPACES_PER_INDENTATION;
-
- for ( int i = 0; i < indent; i++ )
- {
- buffer.append( " " );
- }
-
- return buffer.toString();
- }
-
- private Collection<OrganisationUnit> getHierarchy()
- {
- Collection<OrganisationUnit> hierarchy = new ArrayList<OrganisationUnit>();
-
- Collection<OrganisationUnit> roots = organisationUnitService.getRootOrganisationUnits();
-
- for ( OrganisationUnit root : roots )
- {
- hierarchy.addAll( organisationUnitService.getOrganisationUnitWithChildren( root.getId() ) );
- }
-
- return hierarchy;
- }
-}
=== removed file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/UserConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/UserConverter.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/UserConverter.java 1970-01-01 00:00:00 +0000
@@ -1,92 +0,0 @@
-package org.hisp.dhis.importexport.pdf.converter;
-
-/*
- * Copyright (c) 2004-2013, 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.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.hisp.dhis.i18n.I18n;
-import org.hisp.dhis.i18n.I18nFormat;
-import org.hisp.dhis.importexport.ExportParams;
-import org.hisp.dhis.importexport.PDFConverter;
-import org.hisp.dhis.system.util.PDFUtils;
-import org.hisp.dhis.user.UserCredentials;
-import org.hisp.dhis.user.UserService;
-import org.hisp.dhis.user.comparator.UsernameComparator;
-
-import com.lowagie.text.Document;
-
-/**
- * @author Dang Duy Hieu
- * @version $Id$
- */
-public class UserConverter
- extends PDFUtils
- implements PDFConverter
-{
- private UserService userService;
-
- /**
- * Constructor for write operations.
- */
- public UserConverter( UserService userService )
- {
- this.userService = userService;
- }
-
- // -------------------------------------------------------------------------
- // PDFConverter implementation
- // -------------------------------------------------------------------------
-
- public void write( Document document, ExportParams params )
- {
- I18n i18n = params.getI18n();
- I18nFormat format = params.getFormat();
- List<UserCredentials> elements = null;
-
- if ( params.isMetaData() )
- {
- elements = new ArrayList<UserCredentials>( userService.getUsers( params.getUsers(), params.getCurrentUser() ) );
- }
- else
- {
- elements = new ArrayList<UserCredentials>( params.getUserObjects() );
- }
-
- Collections.sort( elements, new UsernameComparator() );
-
- PDFUtils.printObjectFrontPage( document, elements, i18n, format, "users" );
-
- for ( UserCredentials userCredentials : elements )
- {
- addTableToDocument( document, printUser( userCredentials, i18n, format, true, 0.40f, 0.60f ) );
- }
- }
-}
=== removed file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/ValidationRuleConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/ValidationRuleConverter.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/ValidationRuleConverter.java 1970-01-01 00:00:00 +0000
@@ -1,97 +0,0 @@
-package org.hisp.dhis.importexport.pdf.converter;
-
-/*
- * Copyright (c) 2004-2013, 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.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
-import org.hisp.dhis.expression.ExpressionService;
-import org.hisp.dhis.i18n.I18n;
-import org.hisp.dhis.i18n.I18nFormat;
-import org.hisp.dhis.importexport.ExportParams;
-import org.hisp.dhis.importexport.PDFConverter;
-import org.hisp.dhis.system.util.PDFUtils;
-import org.hisp.dhis.validation.ValidationRule;
-import org.hisp.dhis.validation.ValidationRuleService;
-
-import com.lowagie.text.Document;
-
-/**
- * @author Dang Duy Hieu
- * @version $Id$
- */
-public class ValidationRuleConverter
- extends PDFUtils
- implements PDFConverter
-{
- private ExpressionService expressionService;
-
- private ValidationRuleService validationRuleService;
-
- /**
- * Constructor for write operations.
- */
- public ValidationRuleConverter( ExpressionService expressionService, ValidationRuleService validationRuleService )
- {
- this.expressionService = expressionService;
- this.validationRuleService = validationRuleService;
- }
-
- // -------------------------------------------------------------------------
- // PDFConverter implementation
- // -------------------------------------------------------------------------
-
- public void write( Document document, ExportParams params )
- {
- I18n i18n = params.getI18n();
- I18nFormat format = params.getFormat();
- List<ValidationRule> elements = null;
-
- if ( params.isMetaData() )
- {
- elements = new ArrayList<ValidationRule>( validationRuleService.getValidationRules( params
- .getValidationRules() ) );
- }
- else
- {
- elements = new ArrayList<ValidationRule>( params.getValidationRuleObjects() );
- }
-
- Collections.sort( elements, IdentifiableObjectNameComparator.INSTANCE );
-
- PDFUtils.printObjectFrontPage( document, elements, i18n, format, "validation_rules" );
-
- for ( ValidationRule rule : elements )
- {
- addTableToDocument( document, printValidationRule( rule, i18n, expressionService, true, 0.40f, 0.60f ) );
- }
- }
-}
=== removed directory 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/exporter'
=== removed file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/exporter/ITextPDFExportService.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/exporter/ITextPDFExportService.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/exporter/ITextPDFExportService.java 1970-01-01 00:00:00 +0000
@@ -1,159 +0,0 @@
-package org.hisp.dhis.importexport.pdf.exporter;
-
-/*
- * Copyright (c) 2004-2013, 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.BufferedInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PipedInputStream;
-import java.io.PipedOutputStream;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipOutputStream;
-
-import org.hibernate.SessionFactory;
-import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.expression.ExpressionService;
-import org.hisp.dhis.importexport.ExportParams;
-import org.hisp.dhis.importexport.ExportService;
-import org.hisp.dhis.importexport.pdf.converter.DataElementConverter;
-import org.hisp.dhis.importexport.pdf.converter.IndicatorConverter;
-import org.hisp.dhis.importexport.pdf.converter.OrganisationUnitConverter;
-import org.hisp.dhis.importexport.pdf.converter.OrganisationUnitHierarchyConverter;
-import org.hisp.dhis.importexport.pdf.converter.UserConverter;
-import org.hisp.dhis.importexport.pdf.converter.ValidationRuleConverter;
-import org.hisp.dhis.indicator.IndicatorService;
-import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.hisp.dhis.user.UserService;
-import org.hisp.dhis.validation.ValidationRuleService;
-
-/**
- * @author Lars Helge Overland
- * @version $Id: ITextPDFExportService.java 4646 2008-02-26 14:54:29Z larshelg $
- */
-public class ITextPDFExportService
- implements ExportService
-{
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private SessionFactory sessionFactory;
-
- public void setSessionFactory( SessionFactory sessionFactory )
- {
- this.sessionFactory = sessionFactory;
- }
-
- private ExpressionService expressionService;
-
- public void setExpressionService( ExpressionService expressionService )
- {
- this.expressionService = expressionService;
- }
-
- private DataElementService dataElementService;
-
- public void setDataElementService( DataElementService dataElementService )
- {
- this.dataElementService = dataElementService;
- }
-
- private IndicatorService indicatorService;
-
- public void setIndicatorService( IndicatorService indicatorService )
- {
- this.indicatorService = indicatorService;
- }
-
- private OrganisationUnitService organisationUnitService;
-
- public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
- {
- this.organisationUnitService = organisationUnitService;
- }
-
- private UserService userService;
-
- public void setUserService( UserService userService )
- {
- this.userService = userService;
- }
-
- private ValidationRuleService validationRuleService;
-
- public void setValidationRuleService( ValidationRuleService validationRuleService )
- {
- this.validationRuleService = validationRuleService;
- }
-
- // -------------------------------------------------------------------------
- // ExportService implementation
- // -------------------------------------------------------------------------
-
- public InputStream exportData( ExportParams params )
- {
- try
- {
- // -------------------------------------------------------------------------
- // Pipes are input/output pairs. Data written on the output stream
- // shows
- // up on the input stream at the other end of the pipe.
- // -------------------------------------------------------------------------
-
- PipedOutputStream out = new PipedOutputStream();
-
- PipedInputStream in = new PipedInputStream( out );
-
- ZipOutputStream zipOut = new ZipOutputStream( out );
-
- zipOut.putNextEntry( new ZipEntry( "Export.pdf" ) );
-
- PDFPipeThread thread = new PDFPipeThread( sessionFactory );
-
- thread.setOutputStream( zipOut );
- thread.setExportParams( params );
-
- thread.setDataElementConverter( new DataElementConverter( dataElementService ) );
- thread.setIndicatorConverter( new IndicatorConverter( expressionService, indicatorService ) );
- thread.setOrganisationUnitHierarchyConverter( new OrganisationUnitHierarchyConverter(
- organisationUnitService ) );
- thread.setOrganisationUnitConverter( new OrganisationUnitConverter( organisationUnitService ) );
- thread.setUserConverter( new UserConverter( userService ) );
- thread.setValidationRuleConverter( new ValidationRuleConverter( expressionService, validationRuleService ) );
-
- thread.start();
-
- return new BufferedInputStream( in );
- }
- catch ( IOException ex )
- {
- throw new RuntimeException( "Error occured during PDF export", ex );
- }
- }
-}
=== removed file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/exporter/PDFPipeThread.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/exporter/PDFPipeThread.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/exporter/PDFPipeThread.java 1970-01-01 00:00:00 +0000
@@ -1,150 +0,0 @@
-package org.hisp.dhis.importexport.pdf.exporter;
-
-/*
- * Copyright (c) 2004-2013, 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.OutputStream;
-
-import org.hibernate.SessionFactory;
-import org.hisp.dhis.importexport.ExportParams;
-import org.hisp.dhis.importexport.PDFConverter;
-import org.hisp.dhis.importexport.pdf.converter.UserConverter;
-import org.hisp.dhis.system.process.OpenSessionThread;
-import org.hisp.dhis.system.util.PDFUtils;
-import org.hisp.dhis.system.util.StreamUtils;
-
-import com.lowagie.text.Document;
-
-/**
- * @author Lars Helge Overland
- * @version $Id: PDFPipeThread.java 4646 2008-02-26 14:54:29Z larshelg $
- */
-public class PDFPipeThread
- extends OpenSessionThread
-{
- private OutputStream outputStream;
-
- public void setOutputStream( OutputStream outputStream )
- {
- this.outputStream = outputStream;
- }
-
- private ExportParams exportParams;
-
- public void setExportParams( ExportParams exportParams )
- {
- this.exportParams = exportParams;
- }
-
- private PDFConverter dataElementConverter;
-
- public void setDataElementConverter( PDFConverter dataElementConverter )
- {
- this.dataElementConverter = dataElementConverter;
- }
-
- private PDFConverter indicatorConverter;
-
- public void setIndicatorConverter( PDFConverter indicatorConverter )
- {
- this.indicatorConverter = indicatorConverter;
- }
-
- private PDFConverter organisationUnitHierarchyConverter;
-
- public void setOrganisationUnitHierarchyConverter( PDFConverter organisationUnitHierarchyConverter )
- {
- this.organisationUnitHierarchyConverter = organisationUnitHierarchyConverter;
- }
-
- private PDFConverter organisationUnitConverter;
-
- public void setOrganisationUnitConverter( PDFConverter organisationUnitConverter )
- {
- this.organisationUnitConverter = organisationUnitConverter;
- }
-
- private PDFConverter userConverter;
-
- public void setUserConverter( UserConverter userConverter )
- {
- this.userConverter = userConverter;
-
- }
-
- private PDFConverter validationRuleConverter;
-
- public void setValidationRuleConverter( PDFConverter validationRuleConverter )
- {
- this.validationRuleConverter = validationRuleConverter;
- }
-
- // -------------------------------------------------------------------------
- // Constructor
- // -------------------------------------------------------------------------
-
- public PDFPipeThread( SessionFactory sessionFactory )
- {
- super( sessionFactory );
- }
-
- // -------------------------------------------------------------------------
- // Thread implementation
- // -------------------------------------------------------------------------
-
- public void doRun()
- {
- Document document = null;
-
- try
- {
- document = PDFUtils.openDocument( outputStream );
-
- PDFUtils.printDocumentFrontPage( document, exportParams.getI18n(), exportParams.getFormat() );
-
- dataElementConverter.write( document, exportParams );
-
- indicatorConverter.write( document, exportParams );
-
- organisationUnitHierarchyConverter.write( document, exportParams );
-
- organisationUnitConverter.write( document, exportParams );
-
- userConverter.write( document, exportParams );
-
- validationRuleConverter.write( document, exportParams );
-
- PDFUtils.closeDocument( document );
- }
- finally
- {
- StreamUtils.closeOutputStream( outputStream );
- }
- }
-
-}
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/resources/META-INF/dhis/beans.xml 2013-05-24 12:59:08 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/resources/META-INF/dhis/beans.xml 2013-10-13 16:22:18 +0000
@@ -10,7 +10,6 @@
<property name="services">
<map>
<entry key="DXF" value-ref="org.hisp.dhis.importexport.DXFExportService" />
- <entry key="PDF" value-ref="org.hisp.dhis.importexport.PDFExportService" />
<entry key="DHIS14XML" value-ref="org.hisp.dhis.importexport.Dhis14XMLExportService" />
<entry key="XLS" value-ref="org.hisp.dhis.importexport.XLSExportService" />
</map>
@@ -240,20 +239,6 @@
</bean>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <!-- PDF Export -->
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <bean id="org.hisp.dhis.importexport.PDFExportService" class="org.hisp.dhis.importexport.pdf.exporter.ITextPDFExportService">
- <property name="sessionFactory" ref="sessionFactory" />
- <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
- <property name="indicatorService" ref="org.hisp.dhis.indicator.IndicatorService" />
- <property name="expressionService" ref="org.hisp.dhis.expression.ExpressionService" />
- <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
- <property name="userService" ref="org.hisp.dhis.user.UserService" />
- <property name="validationRuleService" ref="org.hisp.dhis.validation.ValidationRuleService" />
- </bean>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- DHIS 1.4 XML Export -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->