Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Boldt2018-07-29 10:17:51 -0400
committernickboldt2018-08-01 16:22:52 -0400
commit49060e54a5b1124c21b105d32d2408b7c5233a94 (patch)
tree302d044d7f69f3fa3f2fb8a81c37820e93560b76
parent288920142846fd9168547bb2cd651d346d386d0d (diff)
downloadwebtools.jsf-49060e54a5b1124c21b105d32d2408b7c5233a94.tar.gz
webtools.jsf-49060e54a5b1124c21b105d32d2408b7c5233a94.tar.xz
webtools.jsf-49060e54a5b1124c21b105d32d2408b7c5233a94.zip
[532336] - Add support for JSF 2.3
Submitted by https://github.com/lak-proddev Change-Id: I24e35e1c0a01940442059309f98a5e403d9e30dd
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.core/plugin.properties3
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.core/plugin.xml58
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/IJSFCoreConstants.java9
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/JSFVersion.java12
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFUtilFactory.java2
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFUtils23.java58
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/plugin.xml6
7 files changed, 146 insertions, 2 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/plugin.properties b/jsf/plugins/org.eclipse.jst.jsf.core/plugin.properties
index 82f808220..0cda30ee9 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.core/plugin.properties
+++ b/jsf/plugins/org.eclipse.jst.jsf.core/plugin.properties
@@ -29,6 +29,9 @@ JSFv21PresetDesc=Configures a Dynamic Web application to use JSF v2.1
JSFv22Project=JavaServer Faces v2.2 Project
JSFv22PresetDesc=Configures a Dynamic Web application to use JSF v2.2
+
+JSFv23Project=JavaServer Faces v2.3 Project
+JSFv23PresetDesc=Configures a Dynamic Web application to use JSF v2.3
# ====================================================================
pluginName = Constraints Model
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/plugin.xml b/jsf/plugins/org.eclipse.jst.jsf.core/plugin.xml
index 954bdfd8a..f2056083f 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.core/plugin.xml
+++ b/jsf/plugins/org.eclipse.jst.jsf.core/plugin.xml
@@ -86,6 +86,13 @@
</and>
</constraint>
</project-facet-version>
+ <project-facet-version facet="jst.jsf" version="2.3">
+ <constraint>
+ <and>
+ <requires facet="jst.web" version="[2.5" />
+ </and>
+ </constraint>
+ `</project-facet-version>
<action id="jst.jsf.v11.install" facet="jst.jsf" type="INSTALL" version="1.1">
<delegate class="org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetInstallDelegate"/>
@@ -150,6 +157,30 @@
class="org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetUninstallDelegate">
</delegate>
</action>
+ <action
+ facet="jst.jsf"
+ id="jst.jsf.v23.install"
+ type="INSTALL"
+ version="2.3">
+ <delegate
+ class="org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetInstallDelegate">
+ </delegate>
+ <config-factory
+ class="org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetInstallDataModelProvider">
+ </config-factory>
+ </action>
+ <action
+ facet="jst.jsf"
+ id="jst.jsf.v23.uninstall"
+ type="UNINSTALL"
+ version="2.3">
+ <config-factory
+ class="org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetUninstallConfig$Factory">
+ </config-factory>
+ <delegate
+ class="org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetUninstallDelegate">
+ </delegate>
+ </action>
</extension>
@@ -245,12 +276,21 @@
%JSFv22PresetDesc
</description>
</static-preset>
+
+ <static-preset extends="default.configuration" id="preset.jst.jsf.v2_3">
+ <label>%JSFv23Project</label>
+ <facet id="jst.java" version="1.8" />
+ <facet id="jst.web" version="4.0" />
+ <facet id="jst.jsf" version="2.3" />
+ <description>%JSFv23PresetDesc</description>
+ </static-preset>
+
</extension>
<extension point="org.eclipse.wst.common.project.facet.core.runtimes">
<supported>
<runtime-component any="true"/>
- <facet id="jst.jsf" version="1.1,1.2,2.0,2.1,2.2"/>
+ <facet id="jst.jsf" version="1.1,1.2,2.0,2.1,2.2,2.3"/>
</supported>
</extension>
@@ -557,6 +597,22 @@
<extension
point="org.eclipse.jst.common.project.facet.core.downloadableLibraries">
<import-definitions
+ url="http://www.eclipse.org/webtools/jsf/jsf-library/jsf-2.3-downloadable-libraries.xml">
+ <enablement>
+ <with
+ variable="requestingProjectFacet">
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.wst.common.project.facet.core.projectFacet"
+ value="jst.jsf:2.3">
+ </test>
+ </with>
+ </enablement>
+ </import-definitions>
+ </extension>
+ <extension
+ point="org.eclipse.jst.common.project.facet.core.downloadableLibraries">
+ <import-definitions
url="http://www.eclipse.org/webtools/jsf/jsf-library/jsf-2.2-downloadable-libraries.xml">
<enablement>
<with
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/IJSFCoreConstants.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/IJSFCoreConstants.java
index 6dacd29cb..1fd0480c7 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/IJSFCoreConstants.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/IJSFCoreConstants.java
@@ -82,6 +82,15 @@ public final class IJSFCoreConstants
*/
public static final String JSF_VERSION_2_2 = FACET_VERSION_2_2;
+ /**
+ * The facet version for a JSF 2.3 project
+ */
+ public static final String FACET_VERSION_2_3 = "2.3"; //$NON-NLS-1$
+ /**
+ * The version string for a JSF 2.3 project
+ */
+ public static final String JSF_VERSION_2_3 = FACET_VERSION_2_3;
+
/**
* @param facet
* @return true if the facet is a jsf facet.
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/JSFVersion.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/JSFVersion.java
index 54118a9bd..cf6c3e695 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/JSFVersion.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/JSFVersion.java
@@ -54,7 +54,11 @@ public enum JSFVersion {
/**
* Supports JSF Version 2.2
*/
- V2_2;
+ V2_2,
+ /**
+ * Supports JSF Version 2.3
+ */
+ V2_3;
// WARNING: you MUST add newer versions to the end; the ordinal value of
// of the version is used in compareTo.
@@ -74,6 +78,8 @@ public enum JSFVersion {
return IJSFCoreConstants.JSF_VERSION_2_1;
case V2_2:
return IJSFCoreConstants.JSF_VERSION_2_2;
+ case V2_3:
+ return IJSFCoreConstants.JSF_VERSION_2_3;
case UNKNOWN:
return "unknown"; //$NON-NLS-1$
default:
@@ -111,6 +117,10 @@ public enum JSFVersion {
{
return V2_2;
}
+ else if (IJSFCoreConstants.JSF_VERSION_2_3.equals(valueAsString))
+ {
+ return V2_3;
+ }
else if ("unknown".equals(valueAsString)) //$NON-NLS-1$
{
return UNKNOWN;
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFUtilFactory.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFUtilFactory.java
index fe7cb5821..02002365b 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFUtilFactory.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFUtilFactory.java
@@ -65,6 +65,8 @@ public class JSFUtilFactory
return new JSFUtils21(modelProvider);
case V2_2:
return new JSFUtils22(modelProvider);
+ case V2_3:
+ return new JSFUtils23(modelProvider);
default:
throw new IllegalArgumentException("Unknown version: "+version); //$NON-NLS-1$
}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFUtils23.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFUtils23.java
new file mode 100644
index 000000000..cf7b59c84
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFUtils23.java
@@ -0,0 +1,58 @@
+package org.eclipse.jst.jsf.core.internal.project.facet;
+
+import java.io.PrintWriter;
+
+import org.eclipse.jst.j2ee.model.IModelProvider;
+import org.eclipse.jst.jsf.core.JSFVersion;
+
+/**
+ * JSF Utils instance for JSF 2.3.
+ *
+ */
+class JSFUtils23 extends JSFUtils22 {
+
+ /**
+ * @param modelProvider
+ */
+ protected JSFUtils23(final IModelProvider modelProvider) {
+ super(JSFVersion.V2_3, modelProvider);
+ }
+
+ /**
+ * @param jsfVersion
+ * @param modelProvider
+ */
+ protected JSFUtils23(final JSFVersion jsfVersion, final IModelProvider modelProvider) {
+ super(jsfVersion, modelProvider);
+ if (jsfVersion.compareTo(JSFVersion.V2_3) < 0) {
+ throw new IllegalArgumentException("JSF Version must be at least 2.3"); //$NON-NLS-1$
+ }
+ }
+
+ @Override
+ public void doVersionSpecificConfigFile(PrintWriter pw) {
+ final String QUOTE = new String(new char[] { '"' });
+ final String schemaVersionString = getVersion().toString().replaceAll("\\.", "_"); //$NON-NLS-1$//$NON-NLS-2$
+ pw.write("<?xml version=" + //$NON-NLS-1$
+ QUOTE + "1.0" + QUOTE + //$NON-NLS-1$
+ " encoding=" + //$NON-NLS-1$
+ QUOTE + "UTF-8" + QUOTE + //$NON-NLS-1$
+ "?>\n"); //$NON-NLS-1$
+ pw.write("<faces-config\n"); //$NON-NLS-1$
+ pw.write(" xmlns=" + //$NON-NLS-1$
+ QUOTE + "http://xmlns.jcp.org/xml/ns/javaee" + QUOTE + //$NON-NLS-1$
+ "\n"); //$NON-NLS-1$
+ pw.write(" xmlns:xsi=" + //$NON-NLS-1$
+ QUOTE + "http://www.w3.org/2001/XMLSchema-instance" + QUOTE + //$NON-NLS-1$
+ "\n"); //$NON-NLS-1$
+ pw.write(" xsi:schemaLocation=" + //$NON-NLS-1$
+ QUOTE
+ + String.format(
+ "http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_%s.xsd", //$NON-NLS-1$
+ schemaVersionString)
+ + QUOTE + "\n"); //$NON-NLS-1$
+ pw.write(" version=" + //$NON-NLS-1$
+ QUOTE + getVersion().toString() + QUOTE + ">\n\n"); //$NON-NLS-1$
+ pw.write("</faces-config>\n"); //$NON-NLS-1$
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/plugin.xml b/jsf/plugins/org.eclipse.jst.jsf.ui/plugin.xml
index 1e33adc85..6048e44c0 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/plugin.xml
+++ b/jsf/plugins/org.eclipse.jst.jsf.ui/plugin.xml
@@ -74,6 +74,12 @@
class="org.eclipse.jst.jsf.ui.internal.project.facet.JSFFacetInstallPage">
</page>
</wizard-pages>
+ <wizard-pages
+ action="jst.jsf.v23.install">
+ <page
+ class="org.eclipse.jst.jsf.ui.internal.project.facet.JSFFacetInstallPage">
+ </page>
+ </wizard-pages>
</extension>
<extension point="org.eclipse.wst.sse.ui.editorConfiguration">

Back to the top