Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 315031 - Adopt faceted project framework in pdt
Summary: Adopt faceted project framework in pdt
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: PHP UI CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 530694
  Show dependency tree
 
Reported: 2010-05-31 02:52 EDT by Jacek Pospychala CLA
Modified: 2020-05-14 10:15 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jacek Pospychala CLA 2010-05-31 02:52:58 EDT
There's more and more extensions for php projects. To name a few, there is: PHPUnit, PHP frameworks (e.g. Zend Framework, Cake PHP), and possibly all general-web related frameworks (e.g. javascript, tag libraries).

Currently there's no common way to add/remove such extensions to PDT project, so user has to spend considerable time figuring out the right place in Project Properties dialog. 

It would be great to standardize around one mature solution.

The option that I like the most is faceted project framework, because:
1. it's documented (http://www.eclipse.org/articles/Article-BuildingProjectFacets/tutorial.html)
2. supports such nuances as multiple versions of the same library
3. it's ready to use


PDT 2.3 would be a good time to implement this.
Comment 1 Konstantin Komissarchik CLA 2010-06-02 12:20:58 EDT
Let me know if I can help answer any questions. :)
Comment 2 Robert Gruendler CLA 2012-07-14 11:53:30 EDT
I've been looking into this now for the PDT extensions project too. 

I think it makes absolutely sense to add support in PDT. Here's a couple of use cases:


1. Create a regular PHP project, but add Twig + Composer facets to the project. The facets would add the corresponding natures/builders and create an initial composer.json file.

2. Create a PHP project, and add a Symfony facet-preset to the project. The facet will create the initial file structure and add the corresponding natures/builders to the project. 

3. Create a PHP project and add the php-maven facet to it. The facet will then install an initial pom.xml and add builders/natures 


At the moment, you need to extend the PHP project wizard if you want to do anything of the above.

What needs to be thought of is how we can remove any Java-related facets from the facet dialog, and only show the PHP stuff. 

I've already a quick-and-dirty patch here which adds the facet feature to the PHP project wizard. It's far from production ready, but if you want i can attach it so you can have a look what would need to be done.
Comment 3 Martin Eisengardt CLA 2012-07-14 13:10:51 EDT
> Can we have php facets separate from webtools facets?
We should try it. Maybe via requesting a patch to webtools. Some kind to mark a project that only php-able facets are respected.

> key thing: what example facets can you think of?
Frameworks, Special non-framework libraries (f.e. Smarty), 

> does it make sense to have symfony or zendframework facet?
Yes

> What happens when user removes facet, eg symfony one?
If it is possible we should devide fixed facets (created during project creation or programmatically, f.e. "convert to symfony project") from dynamical facets (added/removed by user). If one removes the symfony facets the project templates should remain unchanged because it would be more difficult to remove files. The user should fix it by himself. And maybe the users intention is to remove the facet but keep the files.

> Or maybe it'd be better to focus on some project templates framework...?
I don't think so. The project template is only one aspect of faceted projects. F.e. smarty will allow you to create new smarty templates as files. So it registers a builder/validator and a "new smarty template" as context menu
Comment 4 Jacek Pospychala CLA 2012-07-16 03:25:44 EDT
in PDT we can have following:
- newly created PDT projects would add faceted project nature, so that they could be configured later.
- PDT new project wizard would show a button/or separate page to configure facets, if there are any available

(In reply to comment #2)
> What needs to be thought of is how we can remove any Java-related facets from
> the facet dialog, and only show the PHP stuff. 

Robert, can you open a bug with this question against component: WebTools/WTP Common Tools/Faceted Project Framework?
Comment 5 Martin Eisengardt CLA 2012-07-16 03:39:02 EDT
Don't forget to ask if wtp is able to programmatically install faceted plugins or would add this feature one day. Or should this topic be asked in another bug?
Comment 6 Konstantin Komissarchik CLA 2012-07-16 11:05:24 EDT
Hi guys. No need to open additional bugs. I can answer your questions on this thread.

> What needs to be thought of is how we can remove any Java-related facets from
> the facet dialog, and only show the PHP stuff. 

The faceted project UI filters out facets that are incompatible with project's fixed facets. So all you need is for the php facet to specify that it conflicts with java facet. 

> Don't forget to ask if wtp is able to programmatically install faceted plugins 
> or would add this feature one day. Or should this topic be asked in another 
> bug?

The faceted project framework does not get involved in installing Eclipse plugins, but I can certainly see the appeal of having another way for users to discover plugins. Perhaps someone on this thread would be interested in developing this functionality and contributing it to the framework?
Comment 7 Martin Eisengardt CLA 2012-07-16 12:45:10 EDT
(In reply to comment #6)
> The faceted project UI filters out facets that are incompatible with project's
> fixed facets. So all you need is for the php facet to specify that it conflicts
> with java facet. 

That's it. Thanks to clearify it :-)

> The faceted project framework does not get involved in installing Eclipse
> plugins, but I can certainly see the appeal of having another way for users to
> discover plugins. Perhaps someone on this thread would be interested in
> developing this functionality and contributing it to the framework?

I will give it a try.
Comment 8 Jacek Pospychala CLA 2012-07-16 13:00:32 EDT
> The faceted project UI filters out facets that are incompatible with project's
> fixed facets. So all you need is for the php facet to specify that it conflicts
> with java facet. 

great, I wonder what if project is not created yet (e.g. in new project wizard), but I guess it's possible as well.

I'm looking forward to seeing your patch Robert & Martin. I'd be happy to review it and commit.
Let me know if you have any questions.
Comment 9 Robert Gruendler CLA 2012-07-16 13:02:02 EDT
(In reply to comment #7)
> (In reply to comment #6)
> > The faceted project framework does not get involved in installing Eclipse
> > plugins, but I can certainly see the appeal of having another way for users to
> > discover plugins. Perhaps someone on this thread would be interested in
> > developing this functionality and contributing it to the framework?
> 
> I will give it a try.

Not sure if this is a misunderstanding, but i think installing eclipse plugins is already very well implemented through the p2 provisioning mechanism and even easier through the marketplace client.

I think the faceted project framework itself would make it easier for PDT extenders to hook into the project creation process, so end-users can select a couple of facets during project creation (framework addition, templating language suppport, ORM feature, etc).
Comment 10 Martin Eisengardt CLA 2012-07-16 13:21:49 EDT
> Not sure if this is a misunderstanding, but i think installing eclipse plugins
> is already very well implemented through the p2 provisioning mechanism and even
> easier through the marketplace client.
> 
> I think the faceted project framework itself would make it easier for PDT
> extenders to hook into the project creation process, so end-users can select a
> couple of facets during project creation (framework addition, templating
> language suppport, ORM feature, etc).

I am thinking of the following situation: Have an existing PDT/Webtools eclipse.
Checkout some project from version control where facet A and facet B is activated. Your local installation knows of facet A but it does not know anything about facet B.
The scenario is similar to: Get some dialog telling that this checkout will not be ok because of missing plugins.

M2E already has this kind of dialog. If you checkout a project with unknown build plugins in the pom.xml it complains and notifies that you should give a try discovering the eclipse plugins.

Of course you should always be able to install plugins via marketplace or any other ways.

The benefit: pdt itself can stay small for both, those that want to create projects (they will install plugins manually by drag&drop etc.) and those that want to work on existing projects (they will be forced to discover/install at checkout).
Comment 11 Robert Gruendler CLA 2012-07-16 13:30:26 EDT
ok, i see the use case. however, i think we should try to keep things simple in the beginning as we have very limited man-power and a lot of tasks on our todo list ;)
Comment 12 Jacek Pospychala CLA 2012-07-23 14:51:43 EDT
Robert/Martin,
are you still looking at this one? Is there anything I can help you with? We can start with something simple and then grow it as needed
Comment 13 Robert Gruendler CLA 2012-07-23 15:34:43 EDT
(In reply to comment #12)
> Robert/Martin,
> are you still looking at this one? Is there anything I can help you with? We
> can start with something simple and then grow it as needed

yeah, it's still on my radar - just a little busy atm. 

@Martin: are you planning to work on this as well? if so, we should probably coordinate.

(having PDT on git would definitely help in such a scenario ;) )
Comment 14 Martin Eisengardt CLA 2012-07-23 16:00:09 EDT
I am working on a webtools patch for finding and activating facets programmatically. Focused on the use case what happens during checkout or re-importing projects within a new eclipse installation.
You could both work on the needed pdt extensions.
Comment 15 Jacek Pospychala CLA 2012-07-24 02:31:34 EDT
(In reply to comment #13)
> (having PDT on git would definitely help in such a scenario ;) )
see bug 385810 soon you'll have no more excuses :-)

(In reply to comment #14)
> I am working on a webtools patch for finding and activating facets
> programmatically. [...]
Great, now you should really open bug with Faceted project and explain there what you're up to. Somebody might be willing to help or discuss some technical details before you'll have patch ready.
Please post that bug number here as well.
Comment 16 Michal Niewrzal CLA 2016-09-07 05:43:30 EDT
What we really need to add support for facets?
Comment 17 Dawid Pakula CLA 2016-09-07 06:08:52 EDT
In theory is is (was) already adopted. But isn't user and adopter friendly for now.

Probably best could be available framework (facet) list on second wizard page. But not old way (removed in 4.0) with facet sets, but direct, facet list. In theory they should be able to inject own wizard pages when needed.