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.
When SiteTemplateImplementation.apply method is called, the project is not yet initialized. I think, that there are 2 options: 1. This is a bug (project should be already initialized) 2. This is OK, but some utility methods are missing in the API (ClientSideProjectUtilities.initializeProject?)
Related to issue 217632.
Reassigning back, David is the right person to answer/solve this issue. What I have found out is that some templates initializes the project themselves [1] and I don't know whether it is OK or not. I would prefer the project to be always initialized before calling apply() method (perhaps template should be able to tell what the site root, config and test directories are so the project can be properly initialized). Thanks. [1] see SiteHelper, line 217
New project wizard creates a new blank project and let's site template to initialize it. That's the job of site template. If site template does not setup Site Root then project will create default structure with public_html, test, and config folders. To me that looks OK and there is no need for anything else. The question is, and this relates back to issue 217632, whether PhoneGap should be integrated into clientproject via site template or whether clientside project should provide PhoneGap some special hook so that PhoneGap can be enabled in any project regardless what site template or libraries it is using.
(In reply to comment #3) > New project wizard creates a new blank project and let's site template to > initialize it. That's the job of site template. If site template does not setup > Site Root then project will create default structure with public_html, test, > and config folders. To me that looks OK and there is no need for anything else. IMHO it would be better if the whole project init was done only by the project itself (personally, I don't like the idea that any site template could set/store any properties of the project; project should ask for them) and _before_ calling the apply() method (then, the project is "ready" for the template and also the phase INIT is clearly separated from phase APPLY). That is why I wrote that template can tell project "hey, this is your site root" etc. (preferably via some class with properties) if project asks. Sorry if it already works so :)
What you say sounds reasonable Tomas. Do you want to fix it that way? Note: originally the site templates were only "public_html" content but after introduction of configuration and tests folders the site template should be able to say which folder is config and which test. Try this: make a project and customize locations of tests and config and then save project as template and try to recreate project from this template. As long as that works I'm happy. Thanks.
I will have a look at it.
Fixed. There is a new method configure(ProjectProperties), see Javadoc in the SiteTemplateImplementation class. http://hg.netbeans.org/web-main/rev/24bbc25bd0b4
I forgot - Láďo, please test that creating a new project with any site template (ZIP, online) works as expected. Thanks.
Integrated into 'main-golden', will be available in build *201210191216* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/24bbc25bd0b4 User: Tomas Mysik <tmysik@netbeans.org> Log: #217661 - Unclear how to implement SiteTemplateImplementation