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 158163 - Manifest dataloader does not support freemarker templating
Summary: Manifest dataloader does not support freemarker templating
Status: RESOLVED WORKSFORME
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: dynamite
URL:
Keywords: NETFIX, SIMPLEFIX
Depends on:
Blocks:
 
Reported: 2009-02-09 00:20 UTC by _ tboudreau
Modified: 2009-07-30 02:43 UTC (History)
3 users (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 _ tboudreau 2009-02-09 00:20:31 UTC
(not sure where this really belongs - filing against the Java module since manifest files are java-related)

I am working on a project type that needs to create a manifest file with template substitutions.  
I have created a .MF file in the system filesystem with the attribute
<attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>

However, CreateFromTemplate (DataFolder, String, Map<String,String>) does not work - I get the raw template created,
with no processing of the template.  

Would like to see this fixed for 7.0, as the JavaCard modules need this - I am having to create multiple templates and
do manual substitutions using MapFormat, when I could have one template and use <#if foo == bar> .... if freemarker was
working.
Comment 1 Jan Jancura 2009-02-09 12:46:07 UTC
This scenario is currently not supported. We should look at it.
Comment 2 _ tboudreau 2009-02-10 05:30:52 UTC
Should probably be a 2-3 line code change plus adding a dependency or two.  Can you tell me when you will look at it?
Comment 3 Jan Jancura 2009-02-11 09:58:02 UTC
Feel free to attach some patch. I have so many issues assigned... Sorry.
Comment 4 Jiri Kovalsky 2009-03-30 13:57:18 UTC
Jan Jancura agreed that he would review and integrate a patch for this issue contributed by the NetFIX [1] team.

[1] http://wiki.netbeans.org/NetFIX
Comment 5 _ tboudreau 2009-07-16 19:54:51 UTC
Very cool, and thank you very much, "dynamite", whoever you are :-)
Comment 6 _ tboudreau 2009-07-16 19:59:15 UTC
FYI, this will be very useful for the simple.project.templates module - which hopefully will eventually become an official API.  It allows you to define a template 
for an entire generated project using a single properties file - i.e.

relative/path/in/project=path/to/template/in/system/filesystems

and a trivial key-naming convention for project.properties and private.properties.  Right now it has special handling code for templating manifest files, and I 
will be very happy to delete that :-)
Comment 7 dynamite 2009-07-21 13:27:32 UTC
Hi Tim,

I'm Daniel Sheppard.  I'm a new member of NetFIX although I am a long-time user of NetBeans (since 3.4) and participant
in NetCAT (4.0, 6.0, 6.5 and 6.7) as well as a NB mailing list moderator.

Whilst I have done nothing to this issue, I think that it may now well work for you!  I installed JavaCard from source,
removed the substitute method from TemplateBasedFileCreator and found that when I created an Extended Applet Project I
got a MANIFEST.MF with the freemarker stuff replaced.  Just to make doubly sure I added some dummy freemarker myself
(Bob: ${BOB}) and added "BOB","job" to the params map and saw the parameters replaced in the generated file as expected.

Tim, could you please verify my observation and let me know if I'm missing something here?
Comment 8 dynamite 2009-07-29 21:19:41 UTC
As I believe that this is now working I suggest that this is closed as WORKSFORME.
Comment 9 _ tboudreau 2009-07-30 02:43:15 UTC
Now working