summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl Anderson2013-05-01 16:18:59 (EDT)
committer Roberto Sanchez2013-05-01 16:18:59 (EDT)
commit50cf07a157a273afddccc9847f6f286cc8d594ff (patch)
treea20d23b2740989e5139104b8be90aaaacd873e28
parent5e2b4349a92be2a625eb72237c69cef44e027b49 (diff)
downloadwebtools.javaee-50cf07a157a273afddccc9847f6f286cc8d594ff.zip
webtools.javaee-50cf07a157a273afddccc9847f6f286cc8d594ff.tar.gz
webtools.javaee-50cf07a157a273afddccc9847f6f286cc8d594ff.tar.bz2
[405873] "Generate Deployment Descriptor Stub" generates incorrect web.xml for web 3.1
-rw-r--r--plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEConstants.java1
-rw-r--r--plugins/org.eclipse.jst.jee.web/web/org/eclipse/jst/jee/model/internal/Web25ModelProvider.java10
-rw-r--r--plugins/org.eclipse.jst.jee.web/web/org/eclipse/jst/jee/model/internal/WebFragment30ModelProvider.java9
-rw-r--r--plugins/org.eclipse.jst.jee/jeecreation/org/eclipse/jst/jee/model/internal/AppClient5ModelProvider.java7
-rw-r--r--plugins/org.eclipse.jst.jee/jeecreation/org/eclipse/jst/jee/model/internal/Connector16ModelProvider.java9
-rw-r--r--plugins/org.eclipse.jst.jee/jeecreation/org/eclipse/jst/jee/model/internal/EAR5ModelProvider.java6
6 files changed, 33 insertions, 9 deletions
diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEConstants.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEConstants.java
index ccabece..0a39de0 100644
--- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEConstants.java
+++ b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEConstants.java
@@ -207,6 +207,7 @@ public interface J2EEConstants extends J2EEVersionConstants {
String J2EE_NS_URL = "http://java.sun.com/xml/ns/j2ee"; //$NON-NLS-1$
String JAVAEE_NS_URL = "http://java.sun.com/xml/ns/javaee"; //$NON-NLS-1$ //EJB3
+ String JAVAEE7_NS_URL = "http://xmlns.jcp.org/xml/ns/javaee"; //$NON-NLS-1$
String J2EE_1_4_XSD_SHORT_NAME = "j2ee_1_4.xsd"; //$NON-NLS-1$
String JAVAEE_5_XSD_SHORT_NAME = "javaee_5.xsd"; //$NON-NLS-1$ //EJB3
String XSI_NS_URL = "http://www.w3.org/2001/XMLSchema-instance"; //$NON-NLS-1$
diff --git a/plugins/org.eclipse.jst.jee.web/web/org/eclipse/jst/jee/model/internal/Web25ModelProvider.java b/plugins/org.eclipse.jst.jee.web/web/org/eclipse/jst/jee/model/internal/Web25ModelProvider.java
index e0cf417..751d02a 100644
--- a/plugins/org.eclipse.jst.jee.web/web/org/eclipse/jst/jee/model/internal/Web25ModelProvider.java
+++ b/plugins/org.eclipse.jst.jee.web/web/org/eclipse/jst/jee/model/internal/Web25ModelProvider.java
@@ -66,10 +66,16 @@ public class Web25ModelProvider extends JEE5ModelProvider {
dd.getXSISchemaLocation().put(J2EEConstants.JAVAEE_NS_URL, J2EEConstants.WEB_APP_SCHEMA_LOC_2_5);
war.setVersion(WebAppVersionType._25_LITERAL);
}
- else
- {
+ else if(version != null && version.equals(J2EEVersionConstants.VERSION_3_0_TEXT)) {
dd.getXSISchemaLocation().put(J2EEConstants.JAVAEE_NS_URL, J2EEConstants.WEB_APP_SCHEMA_LOC_3_0);
war.setVersion(WebAppVersionType._30_LITERAL);
+ }
+ else
+ {
+ dd.getXMLNSPrefixMap().put("", J2EEConstants.JAVAEE7_NS_URL); //$NON-NLS-1$
+ dd.getXSISchemaLocation().put(J2EEConstants.JAVAEE7_NS_URL, J2EEConstants.WEB_APP_SCHEMA_LOC_3_1);
+ // note that later EMF generations remove the _LITERAL from the enum
+ war.setVersion(WebAppVersionType._31);
}
dd.setWebApp(war);
res.getContents().add((EObject) dd);
diff --git a/plugins/org.eclipse.jst.jee.web/web/org/eclipse/jst/jee/model/internal/WebFragment30ModelProvider.java b/plugins/org.eclipse.jst.jee.web/web/org/eclipse/jst/jee/model/internal/WebFragment30ModelProvider.java
index c97570b..5e9f4d0 100644
--- a/plugins/org.eclipse.jst.jee.web/web/org/eclipse/jst/jee/model/internal/WebFragment30ModelProvider.java
+++ b/plugins/org.eclipse.jst.jee.web/web/org/eclipse/jst/jee/model/internal/WebFragment30ModelProvider.java
@@ -66,7 +66,14 @@ public class WebFragment30ModelProvider extends JEE5ModelProvider {
if(version != null && version.equals(J2EEVersionConstants.VERSION_3_0_TEXT)) {
dd.getXSISchemaLocation().put(J2EEConstants.JAVAEE_NS_URL, J2EEConstants.WEBFRAGMENT_SCHEMA_LOC_3_0);
webFragment.setVersion(WebAppVersionType._30_LITERAL);
- }
+ }
+ else
+ {
+ dd.getXMLNSPrefixMap().put("", J2EEConstants.JAVAEE7_NS_URL); //$NON-NLS-1$
+ dd.getXSISchemaLocation().put(J2EEConstants.JAVAEE7_NS_URL, J2EEConstants.WEBFRAGMENT_SCHEMA_LOC_3_1);
+ // note that later EMF generations remove the _LITERAL from the enum
+ webFragment.setVersion(WebAppVersionType._31);
+ }
dd.setWebFragment(webFragment);
res.getContents().add((EObject) dd);
}
diff --git a/plugins/org.eclipse.jst.jee/jeecreation/org/eclipse/jst/jee/model/internal/AppClient5ModelProvider.java b/plugins/org.eclipse.jst.jee/jeecreation/org/eclipse/jst/jee/model/internal/AppClient5ModelProvider.java
index 135cb45..4974ad3 100644
--- a/plugins/org.eclipse.jst.jee/jeecreation/org/eclipse/jst/jee/model/internal/AppClient5ModelProvider.java
+++ b/plugins/org.eclipse.jst.jee/jeecreation/org/eclipse/jst/jee/model/internal/AppClient5ModelProvider.java
@@ -64,10 +64,15 @@ public class AppClient5ModelProvider extends JEE5ModelProvider {
dd.getXSISchemaLocation().put(J2EEConstants.JAVAEE_NS_URL, J2EEConstants.APP_CLIENT_SCHEMA_LOC_5);
client.setVersion(J2EEVersionConstants.VERSION_5_TEXT);
}
- else {
+ else if(version != null && version.equals(J2EEVersionConstants.VERSION_6_0_TEXT)) {
dd.getXSISchemaLocation().put(J2EEConstants.JAVAEE_NS_URL, J2EEConstants.APP_CLIENT_SCHEMA_LOC_6);
client.setVersion(J2EEVersionConstants.VERSION_6_TEXT);
}
+ else {
+ dd.getXMLNSPrefixMap().put("", J2EEConstants.JAVAEE7_NS_URL); //$NON-NLS-1$
+ dd.getXSISchemaLocation().put(J2EEConstants.JAVAEE7_NS_URL, J2EEConstants.APP_CLIENT_SCHEMA_LOC_7);
+ client.setVersion(J2EEVersionConstants.VERSION_7_TEXT);
+ }
dd.setApplicationClient(client);
res.getContents().add((EObject) dd);
diff --git a/plugins/org.eclipse.jst.jee/jeecreation/org/eclipse/jst/jee/model/internal/Connector16ModelProvider.java b/plugins/org.eclipse.jst.jee/jeecreation/org/eclipse/jst/jee/model/internal/Connector16ModelProvider.java
index 2546b4d..5dfd42f 100644
--- a/plugins/org.eclipse.jst.jee/jeecreation/org/eclipse/jst/jee/model/internal/Connector16ModelProvider.java
+++ b/plugins/org.eclipse.jst.jee/jeecreation/org/eclipse/jst/jee/model/internal/Connector16ModelProvider.java
@@ -65,11 +65,12 @@ public class Connector16ModelProvider extends JEE5ModelProvider {
dd.getXSISchemaLocation().put(J2EEConstants.JAVAEE_NS_URL, J2EEConstants.CONNECTOR_SCHEMA_LOC_1_6);
connector.setVersion(J2EEVersionConstants.VERSION_1_6_TEXT);
}
- else
+ else
{
- // default to 1.6 for now
- dd.getXSISchemaLocation().put(J2EEConstants.JAVAEE_NS_URL, J2EEConstants.CONNECTOR_SCHEMA_LOC_1_6);
- connector.setVersion(J2EEVersionConstants.VERSION_1_6_TEXT);
+ // default to 1.7 for now
+ dd.getXMLNSPrefixMap().put("", J2EEConstants.JAVAEE7_NS_URL); //$NON-NLS-1$
+ dd.getXSISchemaLocation().put(J2EEConstants.JAVAEE7_NS_URL, J2EEConstants.CONNECTOR_SCHEMA_LOC_1_7);
+ connector.setVersion(J2EEVersionConstants.VERSION_1_7_TEXT);
}
dd.setConnector(connector);
res.getContents().add((EObject) dd);
diff --git a/plugins/org.eclipse.jst.jee/jeecreation/org/eclipse/jst/jee/model/internal/EAR5ModelProvider.java b/plugins/org.eclipse.jst.jee/jeecreation/org/eclipse/jst/jee/model/internal/EAR5ModelProvider.java
index 46f938b..6b37b75 100644
--- a/plugins/org.eclipse.jst.jee/jeecreation/org/eclipse/jst/jee/model/internal/EAR5ModelProvider.java
+++ b/plugins/org.eclipse.jst.jee/jeecreation/org/eclipse/jst/jee/model/internal/EAR5ModelProvider.java
@@ -102,9 +102,13 @@ public class EAR5ModelProvider extends JEE5ModelProvider implements IEARModelPro
dd.getXSISchemaLocation().put(J2EEConstants.JAVAEE_NS_URL, J2EEConstants.APPLICATION_SCHEMA_LOC_5);
ear.setVersion(J2EEVersionConstants.VERSION_5_TEXT);
}
- else {
+ else if(version != null && version.equals(J2EEVersionConstants.VERSION_6_0_TEXT)) {
dd.getXSISchemaLocation().put(J2EEConstants.JAVAEE_NS_URL, J2EEConstants.APPLICATION_SCHEMA_LOC_6);
ear.setVersion(J2EEVersionConstants.VERSION_6_TEXT);
+ } else {
+ dd.getXMLNSPrefixMap().put("", J2EEConstants.JAVAEE7_NS_URL); //$NON-NLS-1$
+ dd.getXSISchemaLocation().put(J2EEConstants.JAVAEE7_NS_URL, J2EEConstants.APPLICATION_SCHEMA_LOC_7);
+ ear.setVersion(J2EEVersionConstants.VERSION_7_TEXT);
}
dd.setApplication(ear);