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 208888 - Allow @TemplateRegistration to register templates at any point in config filestore (not just /Templates)
Summary: Allow @TemplateRegistration to register templates at any point in config file...
Status: RESOLVED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: Data Systems (show other bugs)
Version: 7.1
Hardware: All All
: P3 normal with 1 vote (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-27 10:22 UTC by richard_l
Modified: 2012-03-03 11:33 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description richard_l 2012-02-27 10:22:26 UTC
Currently @TemplateRegistration only allows registration of templates in the /Templates folder.

I need to register templates for programmatic use (not using the New File Wizard) and I do not want to be visible by the Template Manger/New File Wizard.  I can do this by registering the template using the layer file (registering them in location not in the /Templates folder).

It would be more convenient to use @TemplateRegistration annotations to do this.

One potential solution is to allow the folder element to be optionally expressed as an absolute path (which currently causes a exception to be thrown: "java.lang.IllegalArgumentException: Templates//linsdale/Other/DMCTemplate.xml") so that other folder locations can be specified.  The current implementation for relative paths should remain the same (relative the /Templates) so ensuring backward compatability.

Alternatives could include a new element for this purpose, but then the folder path would be ignored and hence could no longer be a required element.  Whilst this would still handle existing code correctly, it could increase the potential for future errors (although a default of "Others" for the element could be helpful in that situation).

/Richard
Comment 1 Jesse Glick 2012-02-28 00:20:00 UTC
Define a folder in layer.xml to place these templates - under Templates/ - and mark it <attr name="simple" boolvalue="false"/>. Then any subentries will not be displayed as such, but you can still use @TemplateRegistration.
Comment 2 Quality Engineering 2012-03-03 11:33:41 UTC
Integrated into 'main-golden', will be available in build *201203030400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/ec71b09be774
User: Jesse Glick <jglick@netbeans.org>
Log: Documenting template folder definitions with a mind toward #208888.