IDEMPIERE-20 Logo not printed in GardenWorld documents. Hook up resource finder to report image element.
(transplanted from 0f850c295919acc723f3447b71170b4b5aaa39c8)
This commit is contained in:
parent
0e6ace57bf
commit
6e00887194
|
@ -27,6 +27,7 @@ import java.net.URL;
|
|||
import java.util.Properties;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.adempiere.base.Core;
|
||||
import org.compiere.model.MAttachment;
|
||||
import org.compiere.model.MImage;
|
||||
import org.compiere.print.MPrintFormatItem;
|
||||
|
@ -209,6 +210,9 @@ public class ImageElement extends PrintElement
|
|||
{
|
||||
ClassLoader cl = getClass().getClassLoader();
|
||||
url = cl.getResource(urlString);
|
||||
if (url != null)
|
||||
return url;
|
||||
url = Core.getResourceFinder().getResource(urlString);
|
||||
if (url != null)
|
||||
return url;
|
||||
log.log(Level.WARNING, "Not found - " + urlString);
|
||||
|
|
|
@ -27,7 +27,12 @@ public class WebUIResourceFinder implements IResourceFinder {
|
|||
|
||||
@Override
|
||||
public URL getResource(String name) {
|
||||
return WebUIActivator.getBundleContext().getBundle().getEntry(name);
|
||||
URL url = WebUIActivator.getBundleContext().getBundle().getEntry(name);
|
||||
if (url == null && name.startsWith("org/compiere/images")) {
|
||||
String t = name.substring("org/compiere/".length());
|
||||
url = WebUIActivator.getBundleContext().getBundle().getEntry(t);
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue