Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 298974

Summary: Aliasing system is needed for facet id and facet version
Product: [WebTools] WTP Common Tools Reporter: Konstantin Komissarchik <konstantin>
Component: Faceted Project FrameworkAssignee: Konstantin Komissarchik <konstantin>
Status: RESOLVED FIXED QA Contact: Konstantin Komissarchik <konstantin>
Severity: enhancement    
Priority: P3 CC: yurykats
Version: unspecifiedKeywords: plan
Target Milestone: 3.2 M5   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Konstantin Komissarchik CLA 2010-01-06 12:56:28 EST
We need a system for facilitating smooth transition when for whatever reason either the facet id or the facet version or both need to be changed. The idea is to be able to assign aliases and have these aliases resolve to the same IProjectFacet or IProjectFacetVersion object as the actual string.

Aliases will be defined via a new extension point. Here is an example of the syntax:

<extension point="org.eclipse.wst.common.project.facet.core.aliases">
  <facet-alias facet="java" alias="jst.java"/>
  <facet-version-alias facet="java" version="1.5" alias="5.0"/>
  <facet-version-alias facet="java" version="1.6" alias="6.0"/>
</extension>

The aliases come into play for the following two methods:

ProjectFacetsManager.getProjectFacet( <id> )
IProjectFacet.getVersion( <verstr> )

In both of those cases you can either pass in the actual id/ver string or the alias. In either case, the returned object will be the same.

The aliasing system is designed to exist at the lowest level of the system. As such, you can use aliases in all places where you reference facet id or facet version, including various extension points.

The only way to run into trouble with aliases is to compare the id or version string of the returned object to the string that was passed into one of the above getter methods.
Comment 1 Konstantin Komissarchik CLA 2010-01-13 12:17:14 EST
Released changes to 3.2 M5 stream and fproj.