Re: Unable to instantiate project and file templates in new NB Platform application
geertjan wielenga <[email protected]>
| Newsgroups | gmane.comp.java.netbeans.modules.openide.devel |
|---|---|
| Organization | Oracle Corporation |
| Message-ID | <[email protected]> |
On 20-1-2016 15:58, mkelly1495 wrote: > I am having a very strange issue with my new Netbeans Platform (v8.1) application. I cannot successfully instantiate a new project or file template using my simple Netbeans Platform application. This should be a very easy task, but it will not work no matter what I try. I have created a sample project at https://github.com/mkelly1495/modulesuitebranding to illustrate the problem. The project and file templates are defined in the AppModule of the MyBrandedApp folder. Let me explain the problem in more detail. > > I have a project template that is a zipped folder structure (https://github.com/mkelly1495/modulesuitebranding/tree/master/MyBrandedApp/AppModule/src/mil/navy/cbrd/appmodule/EmptyProject.zip). I'm using the @TemplateRegistration to register the template in the package-info.java file. When I run my application and attempt to create a new Project using the template, the wizard displays the following message: The target filesystem or folder does not exist. > I have tried enabling and disabling modules with no success. I can never get passed the second screen of the wizard. Because you need to have something to show there -- i.e., a panel. Right now, you have no iterator and no panel, hence when you go to the next step... there's no next step. Instead of using package-info.java to register your ZIP, you need an iterator class with an annotation on it, and a panel for the step that you're missing right now, which can all be done for you via the Project Template wizard, as described in the tutorial: https://platform.netbeans.org/tutorials/nbm-projectsamples.html > > I have a file template that is essentially a gzipped xml file (https://github.com/mkelly1495/modulesuitebranding/tree/master/MyBrandedApp/AppModule/src/mil/navy/cbrd/appmodule/EmptyScenario.scn). Once again, I am using the @TemplateRegistration to register the template. When I run my application and use the New File wizard to create a new instance of the template, the new file is corrupted. It does not match the template file. I'm not sure what it is doing, but the generated file is not even a valid gzip file. I'm not sure what is going on here, but nothing I've tried seems to correct the issue. First see if you can get it to work with a normal standard XML file. Gj > > If anyone can help me understand and correct what is going on, I'd be very grateful. > > > >