| Summary: | [API] Support more flexible facet group enlistment | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [WebTools] WTP Common Tools | Reporter: | Tim deBoer <deboer> | ||||
| Component: | Faceted Project Framework | Assignee: | Konstantin Komissarchik <konstantin> | ||||
| Status: | CLOSED FIXED | QA Contact: | Konstantin Komissarchik <konstantin> | ||||
| Severity: | enhancement | ||||||
| Priority: | P3 | CC: | paul.fullbright, raghunathan.srinivasan | ||||
| Version: | unspecified | Flags: | konstantin:
pmc_approved?
(david_williams) raghunathan.srinivasan: pmc_approved+ konstantin: pmc_approved? (naci.dai) konstantin: pmc_approved? (deboer) konstantin: pmc_approved? (neil.hauge) konstantin: pmc_approved? (kaloyan) |
||||
| Target Milestone: | 3.2 M7 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | PMC_approved | ||||||
| Attachments: |
|
||||||
|
Description
Tim deBoer
Changing the bug title to focus on the chosen implementation strategy. Created attachment 165836 [details]
Patch
This patch implements more flexible facility for enlisting facets into groups. Previously, facets could only be enlisted into groups at the time there were defined, which limited group enlistment to facet authors. This patch retains the existing facility, but also makes it possible for third parties to enlist facets into groups.
The following example taken from the documentation for the new extension point shows the syntax and semantics.
<extension point="org.eclipse.wst.common.project.facet.core.groups">
<!--
Groups do not have to be explicitly defined. They come into existence when the
first member is added, however explicit definition is recommended as that's the
only way to specify a label and a description for the group. You can also
enlist facets into the group as part of that group's definition.
-->
<group id="gr">
<label>Test Group</label>
<description>Test group of facets.</description>
<include facet="a"/>
<include facet="b" versions="1.2"/>
<include facet="c" versions="[1.3-2.0)"/>
</group>
<!--
This is the most flexible way of enlisting facets into the group. This
declaration can be made by a third party that is neither the facet author
nor the group creator.
-->
<members group="gr">
<include facet="d" versions="2.3,2.4,2.7"/>
<include facet="e"/>
</members>
</extension>
<!-- Facet can be enlisted into one or more group as part of facet definition. -->
<extension point="org.eclipse.wst.common.project.facet.core.facets">
<project-facet id="f">
...
</project-facet>
<project-facet-version facet="f" version="1.0">
...
<group-member id="gr"/>
...
</project-facet-version>
</extension>
This change adds new API and deprecates a portion of existing API, so raising for PMC review. There is no impact on UI.
============
* Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such.
This functionality has been requested by an adopter to solve an adopter product use case.
* Is there a work-around? If so, why do you believe the work-around is insufficient?
No.
* How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added?
The attached patch includes a new unit test specifically designed to test the new feature. The existing suite of unit tests also touches on the affected area. Unit tests and manual smoke tests pass.
* Give a brief technical overview. Who has reviewed this fix?
See Comment #2.
* What is the risk associated with this fix?
Low risk.
Released equivalent changes to fproj code stream. WTP PMC approval is necessary to release to WTP 3.2 code stream. Since I requested the change, I'll try to abstain from voting. :) The fundamental problem is that facet dependencies are not extendible - if an adopter creates a new facet that will work with a WTP facet, there is usually no way to extend the requires 'one of' set. This extension provides a simple (and hence lower risk) mechanism for adopters to add facets into a group defined by WTP. I will start testing with the patch immediately, but what Konstantin describes solves the problem. Neil may get a bit of tingling in the back of his head re: bug 234383. If the approval and testing goes well I'll submit a minor patch to Dali so that we could take advantage of this. Testing complete - both elements of the new extension point are working great, as well as interaction with the existing group and constraints elements. In other words, everything I've tested is working perfectly and it solves the problem. Thanks, Konstantin! Changes released to 3.2 M7 code stream. (Re)verified in RC1, working great. Thanks again. |