sdedic commented on issue #3678:
URL: https://github.com/apache/netbeans/issues/3678#issuecomment-1192254004

   OK; the second link is supposed to lead to the template the file was created 
from. An the file exists (on the nbfs) in fact:
   ```
                   <folder name="JavaApp">
                       <folder name="src">
                           <folder name="main">
                               <folder name="java">
                                   <folder name="${packagePath}">
                                       <file name="${mainClassName}.java" 
url="nbresloc:/org/netbeans/modules/maven/resources/App.java.template">
                                           <attr 
name="javax.script.ScriptEngine" stringvalue="freemarker"/>
                                           <attr name="template.openFile" 
boolvalue="true"/>
                                       </file>
                                   </folder>
                               </folder>
                           </folder>
                       </folder>
                   </folder>
   ```
   So the templating engine (or the template) should be enhanced to properly 
URLencode special chars (which it does not do at the moment). The replaceable 
tokens are intentionally in the path to allow substitution from API call 
parameters.
   
   The other issue is that the entire Java Project structure is not shown in 
Templates - this should be (somehow) fixed. "Somehow" means that the template 
UI (Tools | Templates dialog) isn't actually prepared for structured templates, 
where the user could eventually add conent etc - so some tweak will be needed 
to **present** the Maven-main-class template.
   
   The reason why the Wizard does not use the "main" template is because the 
template instantiation call would invoke another New From Template wizard -- 
this is how those templates are registered at the moment, and that Wizard does 
not support being parametrized from outside *and run headless*. That *might* be 
fixed as well - but will be probably more tough.
   
   I can take as a Friday project the first two items (URL encoding / link fix 
+ Templates UI appearance). I cannot promise the last at the moment - although 
it would be cool to be able to reuse other templates in project structure 
template.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to