IDEMPIERE-1698 LEt the user choose a different JasperReports class

This commit is contained in:
Thomas Bayen 2014-06-18 14:06:59 +02:00
parent c6b0e769d0
commit 42a3f4f9f3
19 changed files with 95 additions and 27 deletions

View File

@ -5,9 +5,11 @@ Bundle-SymbolicName: org.adempiere.report.jasper.swing;singleton:=true
Bundle-Version: 2.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.adempiere.base;bundle-version="2.0.0",
org.adempiere.ui.swing;bundle-version="2.0.0",
org.adempiere.report.jasper;bundle-version="2.0.0",
org.adempiere.report.jasper.library;bundle-version="2.0.0"
Import-Package: org.osgi.framework
org.adempiere.ui.swing;bundle-version="2.0.0"
Import-Package: net.sf.jasperreports.engine,
net.sf.jasperreports.engine.export,
net.sf.jasperreports.view,
org.compiere.report.jasper,
org.osgi.framework
Service-Component: OSGI-INF/jrviewerprovider.xml
Bundle-ActivationPolicy: lazy

View File

@ -2,6 +2,6 @@
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.compiere.report.SwingJRViewerProvider">
<implementation class="org.compiere.report.SwingJRViewerProvider"/>
<service>
<provide interface="org.compiere.report.JRViewerProvider"/>
<provide interface="org.compiere.report.jasper.JRViewerProvider"/>
</service>
</scr:component>

View File

@ -1,5 +1,7 @@
package org.compiere.report;
import org.compiere.report.jasper.JRViewerProvider;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperPrint;

View File

@ -25,6 +25,11 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ds.core.builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>

View File

@ -4,12 +4,13 @@ Bundle-Name: JasperReport integration
Bundle-SymbolicName: org.adempiere.report.jasper;singleton:=true
Bundle-Version: 2.0.0.qualifier
Bundle-ClassPath: JasperReports.jar
Export-Package: org.compiere.report,
org.compiere.utils
Require-Bundle: org.adempiere.base;bundle-version="2.0.0",
org.adempiere.report.jasper.library;bundle-version="2.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: org.apache.commons.codec;version="1.3.0",
org.apache.commons.codec.binary;version="1.3.0",
org.apache.commons.logging;version="1.1.1",
org.apache.commons.logging.impl;version="1.1.1"
Require-Bundle: org.adempiere.base;bundle-version="2.0.0",
org.adempiere.report.jasper.library;bundle-version="2.0.0"
Service-Component: OSGI-INF/processfactory.xml
Export-Package: org.compiere.report.jasper
Bundle-ActivationPolicy: lazy

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.compiere.report.jasper.ProcessFactory">
<implementation class="org.compiere.report.jasper.ProcessFactory"/>
<service>
<provide interface="org.adempiere.base.IProcessFactory"/>
</service>
<property name="service.ranking" type="Integer" value="1"/>
</scr:component>

View File

@ -1,4 +1,5 @@
bin.includes = META-INF/,\
JasperReports.jar,\
OSGI-INF/
source.JasperReports.jar = src/
output.JasperReports.jar = build/
bin.includes = META-INF/,\
JasperReports.jar

View File

@ -95,6 +95,7 @@ import org.compiere.process.ClientProcess;
import org.compiere.process.ProcessCall;
import org.compiere.process.ProcessInfo;
import org.compiere.process.ProcessInfoParameter;
import org.compiere.report.jasper.JRViewerProvider;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.Env;

View File

@ -1,4 +1,4 @@
package org.compiere.report;
package org.compiere.report.jasper;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperPrint;

View File

@ -0,0 +1,43 @@
/******************************************************************************
* Copyright (C) 2014 Thomas Bayen *
* Copyright (C) 2014 Jakob Bayen KG & BX Service GmbH *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*****************************************************************************/
package org.compiere.report.jasper;
import org.adempiere.base.IProcessFactory;
import org.adempiere.util.ProcessUtil;
import org.compiere.process.ProcessCall;
import org.compiere.report.ReportStarter;
/**
* ProcessFactory to start the ReportStarter class.
*
* Before this Factory was initiated the class was started with the
* DefaultProcessFactory because its package namespace was exported and joined
* into the org.compiere.report package of the org.adempiere.base plugin via
* Split Packages (through the Require-Bundle technique) See
* http://wiki.osgi.org/wiki/Split_Packages why this is not the best idea.
* Especially this prevents us from exchange the JasperReports plugin with
* another implementation.
*
* @author tbayen
*/
public class ProcessFactory implements IProcessFactory {
@Override
public ProcessCall newProcessInstance(String className) {
if (ProcessUtil.JASPER_STARTER_CLASS.equals(className))
return new ReportStarter();
else
return null;
}
}

View File

@ -38,6 +38,10 @@
id="org.idempiere.felix.webconsole"
version="2.0.0.qualifier"/>
<includes
id="org.adempiere.report.jasper"
version="0.0.0"/>
<requires>
<import feature="org.adempiere.base" version="2.0.0" match="compatible"/>
</requires>

File diff suppressed because one or more lines are too long

View File

@ -4,9 +4,7 @@ Bundle-Name: org.adempiere.server
Bundle-SymbolicName: org.adempiere.server;singleton:=true
Bundle-Version: 2.0.0.qualifier
Require-Bundle: org.adempiere.base;bundle-version="2.0.0",
org.eclipse.equinox.app;bundle-version="1.3.0",
org.adempiere.report.jasper;bundle-version="2.0.0",
org.adempiere.report.jasper.library;bundle-version="2.0.0"
org.eclipse.equinox.app;bundle-version="1.3.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Web-ContextPath: /
Bundle-ClassPath: WEB-INF/lib/jardiff.jar,

View File

@ -69,8 +69,6 @@ Export-Package: com.jgoodies.looks,
org.jdesktop.swingx.util
Require-Bundle: org.adempiere.base;bundle-version="2.0.0",
org.adempiere.ui;bundle-version="2.0.0",
org.adempiere.report.jasper;bundle-version="2.0.0",
org.adempiere.report.jasper.library;bundle-version="2.0.0",
org.restlet;bundle-version="2.1.0",
org.restlet.ext.net;bundle-version="2.1.0",
org.restlet.ext.servlet;bundle-version="2.1.0",
@ -79,6 +77,7 @@ Eclipse-ExtensibleAPI: true
Eclipse-RegisterBuddy: org.adempiere.base
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: javax.net.ssl,
net.sf.jasperreports.engine,
org.apache.ecs,
org.apache.ecs.xhtml,
org.apache.poi.hssf.usermodel,

View File

@ -8,12 +8,16 @@ Import-Package: javax.activation;version="1.1.1",
javax.servlet,
javax.servlet.http,
metainfo.zk,
net.sf.jasperreports.engine,
net.sf.jasperreports.engine.export,
net.sf.jasperreports.engine.util,
org.apache.commons.codec.binary,
org.apache.ecs,
org.apache.ecs.xhtml,
org.apache.tools.ant,
org.apache.tools.ant.taskdefs,
org.compiere.css,
org.compiere.report.jasper,
org.osgi.framework;version="1.5.0",
org.osgi.service.event;version="1.3.0",
org.osgi.util.tracker;version="1.5.0",
@ -79,9 +83,7 @@ Export-Package: fi.jawsy.jawwa.zk.atmosphere,
web.js.jawwa.atmosphere,
web.js.zkforge,
web.js.zkforge.mold
Require-Bundle: org.adempiere.report.jasper;bundle-version="2.0.0",
org.adempiere.base;bundle-version="2.0.0",
org.adempiere.report.jasper.library;bundle-version="2.0.0",
Require-Bundle: org.adempiere.base;bundle-version="2.0.0",
org.adempiere.ui;bundle-version="2.0.0",
org.zkoss.zk.library;bundle-version="6.0.0"
Bundle-Activator: org.adempiere.webui.WebUIActivator

View File

@ -2,6 +2,6 @@
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.adempiere.webui.window.ZkJRViewerProvider">
<implementation class="org.adempiere.webui.window.ZkJRViewerProvider"/>
<service>
<provide interface="org.compiere.report.JRViewerProvider"/>
<provide interface="org.compiere.report.jasper.JRViewerProvider"/>
</service>
</scr:component>

View File

@ -7,7 +7,7 @@ import org.adempiere.webui.apps.AEnv;
import org.adempiere.webui.component.Window;
import org.adempiere.webui.part.WindowContainer;
import org.adempiere.webui.session.SessionManager;
import org.compiere.report.JRViewerProvider;
import org.compiere.report.jasper.JRViewerProvider;
public class ZkJRViewerProvider implements JRViewerProvider {

View File

@ -3,8 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: org.adempiere.webstore
Bundle-SymbolicName: org.adempiere.webstore;singleton:=true
Bundle-Version: 2.0.0.qualifier
Require-Bundle: org.adempiere.report.jasper;bundle-version="2.0.0",
org.adempiere.base;bundle-version="2.0.0",
Require-Bundle: org.adempiere.base;bundle-version="2.0.0",
org.adempiere.report.jasper.webapp;bundle-version="2.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Web-ContextPath: wstore

View File

@ -18,6 +18,9 @@ Import-Package: javax.activation;version="1.1.1",
javax.xml.rpc.server;version="1.1.0.v20110517",
javax.xml.rpc.soap;version="1.1.0.v20110517",
javax.xml.soap;version="1.3.0",
net.sf.jasperreports.engine,
net.sf.jasperreports.engine.base,
net.sf.jasperreports.engine.util,
org.apache.commons.codec.binary;version="1.3.0",
org.apache.commons.logging;version="1.1.1",
org.apache.commons.logging.impl;version="1.1.1",
@ -57,7 +60,6 @@ Import-Package: javax.activation;version="1.1.1",
org.apache.xml.serialize;version="2.9.0",
org.osgi.framework;version="1.6.0"
Require-Bundle: org.adempiere.base;bundle-version="2.0.0",
org.adempiere.report.jasper.library;bundle-version="2.0.0",
org.adempiere.ui;bundle-version="2.0.0",
org.apache.ecs;bundle-version="1.0.0"
Bundle-ClassPath: .,