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.
It is not possible to save project from existing sources as template. To reproduce: - create HTML5 project - add some html and JavaScript files - open new project wizard - select "HTML/JavaScript|HTML Application with Existing Sources" and click Next - browse for site root from previously created project - provide project name and empty folder as project directory - finish wizard - right-click project node and choose "Save as Template" - only project root node is offered but not sources Product Version: NetBeans IDE Dev (Build EaselCSS-504-on-20120815) Java: 1.7.0_06; Java HotSpot(TM) 64-Bit Server VM 23.2-b09 System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)
Will have a look at it.
BTW likely related, issue #216642, comment #3: > Other problem I can imagine is when Site Root is specified outside of Project > Folder - Save as Template will likely fail to offer Site Root files. The question is - what to do with the external Site Root? The proper fix would likely be to add it to the archive and after unpacking, move it to the original location.
(In reply to comment #2) > The question is - what to do with the external Site Root? The proper fix would > likely be to add it to the archive and after unpacking, move it to the original > location. I would not worry about "original location". Let's keep it simple. Project template is just a template, that is list of initial files in a single project directory. If a template is created from external site root that's fine but resulting template will have these sources directly under its "public_html" folder.
OK, agreed, will look at it.
Davide, is there an easy way to do this? I tried it but no success yet, moreover the patch is _very_ ugly so far. Sorry for asking, I do not understand well all these Children, Keys, etc. Thanks for any hint.
Old APIs like Nodes are awful to use - I never know how to use them either. FilterNode.Children sounds like a class to filter children yet Javadoc says that class is not well suited for that??? Anyway, I fixed it the best way I could imagine. Have a look. It will need to be re-tested so thanks in advance Jirka. c8a89dbdae91
Thanks a lot Davide! I just tried it and there are still couple of things to do: - proper relative path in ZIP [1] - proper Site Root value in netbeans-project.properties file I will fix that. [1] java.lang.NullPointerException at java.util.zip.ZipEntry.<init>(ZipEntry.java:56) at org.netbeans.modules.web.clientproject.ui.wizard.CreateSiteTemplate.writeChildren(CreateSiteTemplate.java:712)
Now it should be fixed. Not nice but works... http://hg.netbeans.org/web-main/rev/a35ea9bfb500
Gosh! I forgot to test creation of a template - sorry about that; that just could not work. :-) Thanks for finishing it.
Integrated into 'main-golden', will be available in build *201211090001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/c8a89dbdae91 User: David Konecny <dkonecny@netbeans.org> Log: #216949 - Save as template ignores source roots for project from existing sources
(In reply to comment #9) > Gosh! I forgot to test creation of a template - sorry about that; that just > could not work. :-) Thanks for finishing it. No problem, it was easy (not nice, but easy ;).