diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-06-07 11:55:00 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-06-07 12:07:17 +0200 |
commit | e57eeb6d5f547a4a49df796641141c733f6c5204 (patch) | |
tree | e870edf4b2924295ed2912ab3fdba2117a25fefa /wizards | |
parent | e98c03ed6525b026ca3cd7941b3634c0f5561397 (diff) |
fdo#65168: Fix regressions introduced with de-extension-ing report builder
...in 90a326c7028d5af132c62edfaef77c53627e4c0e "fdo#61950 move report builder
from bundled extensions to plain code":
* For one, ReportWizard.startReportWizard
(wizards/com/sun/star/wizards/report/ReportWizard.java) would still try to load
reportbuilderwizard.jar from the unpacked extension (and, failing that, fell
back to the old default engine, so this didn't cause any failure per se).
Instead, reference reportbuilderwizard.jar (which was also missing from scp2)
from report.jar's manifest Class-Path (which will always be OK, even if
reportbuilderwizard.jar is not installed) and check for the relevant class via
Class::forName directly.
* For another, the en-US/wizard/report/default.otr template had gone missing.
The way to find it inside the unpacked extension in the past was to include a
Paths.xcu update that extends the Template path. Instead, install that
template directly into share/template now, and drop the (unused already)
Paths.xcu update.
Change-Id: I09eca2b69aa55d5b15fb5ecfec6881f8a6f6e5e5
Diffstat (limited to 'wizards')
-rw-r--r-- | wizards/com/sun/star/wizards/report/MANIFEST.MF | 1 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/report/ReportWizard.java | 37 |
2 files changed, 9 insertions, 29 deletions
diff --git a/wizards/com/sun/star/wizards/report/MANIFEST.MF b/wizards/com/sun/star/wizards/report/MANIFEST.MF index 1a4f8da6e3b0..2dda41ae35ed 100644 --- a/wizards/com/sun/star/wizards/report/MANIFEST.MF +++ b/wizards/com/sun/star/wizards/report/MANIFEST.MF @@ -1,2 +1,3 @@ +Class-Path: reportbuilderwizard.jar RegistrationClassName: com.sun.star.wizards.report.CallReportWizard UNO-Type-Path: diff --git a/wizards/com/sun/star/wizards/report/ReportWizard.java b/wizards/com/sun/star/wizards/report/ReportWizard.java index bae9152e6e45..c14a40bb840b 100644 --- a/wizards/com/sun/star/wizards/report/ReportWizard.java +++ b/wizards/com/sun/star/wizards/report/ReportWizard.java @@ -24,7 +24,6 @@ import com.sun.star.awt.XTextListener; import com.sun.star.beans.PropertyValue; import com.sun.star.container.XContentEnumerationAccess; -import com.sun.star.deployment.XPackageInformationProvider; import com.sun.star.lang.EventObject; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.logging.XLogger; @@ -52,9 +51,6 @@ import com.sun.star.wizards.ui.TitlesComponent; import com.sun.star.wizards.ui.UIConsts; import com.sun.star.wizards.ui.UnoDialog; import java.lang.reflect.Method; -import java.net.URI; -import java.net.URL; -import java.net.URLClassLoader; import java.util.Map; public class ReportWizard extends DatabaseObjectWizard implements XTextListener @@ -398,19 +394,6 @@ public class ReportWizard extends DatabaseObjectWizard implements XTextListener return e.hasMoreElements(); } - /** - * Return the path to the "com.sun.reportdesigner" extension - * @param _xMSF - * @return - */ - public static String getPathToExtension(XMultiServiceFactory _xMSF) - { - // Get the path to the extension and try to add the path to the class loader - final XComponentContext xComponentContext = Helper.getComponentContext(_xMSF); - final Object aSingleton = xComponentContext.getValueByName("/singletons/com.sun.star.deployment.PackageInformationProvider"); - XPackageInformationProvider xProvider = UnoRuntime.queryInterface(XPackageInformationProvider.class, aSingleton); - return xProvider.getPackageLocation("com.sun.reportdesigner"); - } private static XLogger m_xLogger; private static void initializeLogger(XMultiServiceFactory _xMSF) @@ -438,19 +421,16 @@ public class ReportWizard extends DatabaseObjectWizard implements XTextListener if (isReportBuilderInstalled()) { - // Get the path to the extension and try to add the path to the class loader - String sLocation = getPathToExtension(xMSF); - // TODO: Umlaut in filename! - if (sLocation.length() > 0) + Class<?> a = null; + try + { + a = Class.forName("com.sun.star.wizards.reportbuilder.ReportBuilderImplementation"); + } + catch (ClassNotFoundException e) {} + if (a != null) { try { - URI aLocationURI = URI.create(sLocation + "/" + "reportbuilderwizard.jar"); - - URL[] aURLs = new URL[1]; - aURLs[0] = aLocationURI.toURL(); - URLClassLoader aClassLoader = new URLClassLoader(aURLs, this.getClass().getClassLoader()); - Class<?> a = aClassLoader.loadClass("com.sun.star.wizards.reportbuilder.ReportBuilderImplementation"); Method aMethod = a.getMethod("create", new Class[] { XMultiServiceFactory.class @@ -460,8 +440,7 @@ public class ReportWizard extends DatabaseObjectWizard implements XTextListener } catch (Exception e) { - // Maybe problems in URI create() if a wrong char is used like '[' ']', ... - System.out.println("There could be a problem with the path '" + sLocation + "'"); + e.printStackTrace(); } } } |