IDEMPIERE-20 Logo not printed in GardenWorld documents. Hook up resource finder to report image element.

(transplanted from 0f850c295919acc723f3447b71170b4b5aaa39c8)
This commit is contained in:
Heng Sin Low 2011-09-06 11:15:26 +08:00
parent 0e6ace57bf
commit 6e00887194
2 changed files with 10 additions and 1 deletions

View File

@ -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);

View File

@ -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;
}
}