This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 238107 - TemplateRegistration does not respect resources in classpath
Summary: TemplateRegistration does not respect resources in classpath
Status: RESOLVED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: Templates (show other bugs)
Version: 7.3.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks: 206129
  Show dependency tree
 
Reported: 2013-11-07 16:10 UTC by nigjo_iqn
Modified: 2015-05-19 13:16 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nigjo_iqn 2013-11-07 16:10:14 UTC
IDE:
Product Version = NetBeans IDE 7.4 (Build 201310111528)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.7.0_40
Runtime = Java HotSpot(TM) 64-Bit Server VM 24.0-b56

Suitesettings:
Product Version = NetBeans IDE 7.3.1 (Build 201306052037)
javac 1.6.0_26


I want to register a Template like this:
<pre>@TemplateRegistration(
      folder = "Project/de-rwthaachen-wzl-gt-app-kegelspan-project",
      content = "KegelspanProject.zip",
      displayName = "#Templates/KegelspanProject.zip",
      iconBase = "de/rwthaachen/wzl/gt/app/kegelspan/project/resources/projecticon.png",
      description = "KegelspanDescription.html")
  public static KegelspanWizardIterator createIterator()
  {
    return new KegelspanWizardIterator();
  }</pre>

This works great if the "iconBase" points to a resource inside the same module project.
If "iconBase" points to a resource in another project this will fail. Do I put this other module to the registrating modules classpath the editors error message vanished but the javac compiler outputs an error:
<pre>Compiling 3 source files to D:\Projekte\ssd\WZL Gear Toolbox\kegelspan\Kegelspan - Project UI\build\classes
D:\Projekte\Project UI\src\de\rwthaachen\wzl\gt\app\kegelspan\projectui\KegelspanWizardIterator.java:53: error: Cannot find resource de/rwthaachen/wzl/gt/app/kegelspan/project/resources/projecticon.png
  @TemplateRegistration(
</pre>

As I understand, there will be no problem at runtime if the resource is not inside the same modul as the defining layer. With https://netbeans.org/bugzilla/show_bug.cgi?id=206129 this will be "a normal situation".
Comment 1 Martin Entlicher 2014-07-28 14:08:56 UTC
A JavaDoc comment to LayerBuilder.validateResource(), that process the iconBase, mentions that: "As of the 7.1 harness it does include non-classfile resources from public packages of module dependencies."

Do you have the package containing the icon declared as a public package in project.xml?
Comment 2 Martin Entlicher 2015-05-19 13:16:05 UTC
This is not specific to templates, but to LayerBuilder's resources handling.
When the resources are in a public package, it should work.