diff --git a/contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/JpaSupportImpl.java b/contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/JpaSupportImpl.java index ab1b2f4f47f8..6b054f15b09a 100644 --- a/contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/JpaSupportImpl.java +++ b/contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/JpaSupportImpl.java @@ -38,26 +38,37 @@ public JpaSupportImpl(JBJ2eePlatformFactory.J2eePlatformImplImpl platformImpl) { @Override public JpaProvider getDefaultProvider() { String defaultProvider = platformImpl.getDefaultJpaProvider(); - boolean jpa2 = platformImpl.isJpa2Available(); - return JpaProviderFactory.createJpaProvider(defaultProvider, true, true, jpa2, false, false, false, false, false); + final boolean isDefault = true, isJpa10 = true; + boolean isJpa20 = platformImpl.isJpa2Available(); + final boolean isJpa21 = false, isJpa22 = false, isJpa30 = false, isJpa31 = false, isJpa32 = false, isJpa40 = false; + return JpaProviderFactory.createJpaProvider(defaultProvider, isDefault, + isJpa10, isJpa20, isJpa21, isJpa22, isJpa30, isJpa31, isJpa32, isJpa40); } @Override public Set getProviders() { String defaultProvider = platformImpl.getDefaultJpaProvider(); - boolean jpa2 = platformImpl.isJpa2Available(); - Set providers = new HashSet(); + final boolean isJpa10 = true; + boolean isJpa20 = platformImpl.isJpa2Available(); + final boolean isJpa21 = false, isJpa22 = false, isJpa30 = false, isJpa31 = false, isJpa32 = false, isJpa40 = false; + Set providers = new HashSet<>(8); if (platformImpl.containsPersistenceProvider(JBJ2eePlatformFactory.HIBERNATE_JPA_PROVIDER)) { - providers.add(JpaProviderFactory.createJpaProvider(JBJ2eePlatformFactory.HIBERNATE_JPA_PROVIDER, - JBJ2eePlatformFactory.HIBERNATE_JPA_PROVIDER.equals(defaultProvider), true, jpa2, false, false, false, false, false)); + providers.add(JpaProviderFactory.createJpaProvider( + JBJ2eePlatformFactory.HIBERNATE_JPA_PROVIDER, + JBJ2eePlatformFactory.HIBERNATE_JPA_PROVIDER.equals(defaultProvider), + isJpa10, isJpa20, isJpa21, isJpa22, isJpa30, isJpa31, isJpa32, isJpa40)); } if (platformImpl.containsPersistenceProvider(JBJ2eePlatformFactory.TOPLINK_JPA_PROVIDER)) { - providers.add(JpaProviderFactory.createJpaProvider(JBJ2eePlatformFactory.TOPLINK_JPA_PROVIDER, - JBJ2eePlatformFactory.TOPLINK_JPA_PROVIDER.equals(defaultProvider), true, false, false, false, false, false, false)); + providers.add(JpaProviderFactory.createJpaProvider( + JBJ2eePlatformFactory.TOPLINK_JPA_PROVIDER, + JBJ2eePlatformFactory.TOPLINK_JPA_PROVIDER.equals(defaultProvider), + isJpa10, isJpa20, isJpa21, isJpa22, isJpa30, isJpa31, isJpa32, isJpa40)); } if (platformImpl.containsPersistenceProvider(JBJ2eePlatformFactory.KODO_JPA_PROVIDER)) { - providers.add(JpaProviderFactory.createJpaProvider(JBJ2eePlatformFactory.KODO_JPA_PROVIDER, - JBJ2eePlatformFactory.KODO_JPA_PROVIDER.equals(defaultProvider), true, false, false, false, false, false, false)); + providers.add(JpaProviderFactory.createJpaProvider( + JBJ2eePlatformFactory.KODO_JPA_PROVIDER, + JBJ2eePlatformFactory.KODO_JPA_PROVIDER.equals(defaultProvider), + isJpa10, isJpa20, isJpa21, isJpa22, isJpa30, isJpa31, isJpa32, isJpa40)); } return providers; } diff --git a/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/j2ee/JpaSupportImpl.java b/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/j2ee/JpaSupportImpl.java index 0e31bae10c67..740458b917bf 100644 --- a/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/j2ee/JpaSupportImpl.java +++ b/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/j2ee/JpaSupportImpl.java @@ -38,20 +38,30 @@ public JpaSupportImpl(WLJ2eePlatformFactory.J2eePlatformImplImpl platformImpl) { @Override public JpaProvider getDefaultProvider() { String defaultProvider = platformImpl.getDefaultJpaProvider(); - return JpaProviderFactory.createJpaProvider(defaultProvider, true, true, - platformImpl.isJpa2Available(), platformImpl.isJpa21Available(), false, false, false, false); + final boolean isDefault = true, isJpa10 = true; + final boolean isJpa20 = platformImpl.isJpa2Available(); + final boolean isJpa21 = platformImpl.isJpa21Available(); + final boolean isJpa22 = false, isJpa30 = false, isJpa31 = false, isJpa32 = false, isJpa40 = false; + return JpaProviderFactory.createJpaProvider(defaultProvider, isDefault, + isJpa10, isJpa20, isJpa21, isJpa22, isJpa30, isJpa31, isJpa32, isJpa40); } @Override public Set getProviders() { String defaultProvider = platformImpl.getDefaultJpaProvider(); - Set providers = new HashSet(); - providers.add(JpaProviderFactory.createJpaProvider(WLJ2eePlatformFactory.OPENJPA_JPA_PROVIDER, - WLJ2eePlatformFactory.OPENJPA_JPA_PROVIDER.equals(defaultProvider), true, false, false, false, false, false, false)); + final boolean isJpa10 = true; + final boolean isJpa20 = platformImpl.isJpa2Available(); + final boolean isJpa21 = platformImpl.isJpa21Available(); + final boolean isJpa22 = false, isJpa30 = false, isJpa31 = false, isJpa32 = false, isJpa40 = false; + Set providers = new HashSet<>(4); + providers.add(JpaProviderFactory.createJpaProvider( + WLJ2eePlatformFactory.OPENJPA_JPA_PROVIDER, + WLJ2eePlatformFactory.OPENJPA_JPA_PROVIDER.equals(defaultProvider), + isJpa10, isJpa20, isJpa21, isJpa22, isJpa30, isJpa31, isJpa32, isJpa40)); providers.add(JpaProviderFactory.createJpaProvider( WLJ2eePlatformFactory.ECLIPSELINK_JPA_PROVIDER, WLJ2eePlatformFactory.ECLIPSELINK_JPA_PROVIDER.equals(defaultProvider), - true, platformImpl.isJpa2Available(), platformImpl.isJpa21Available(), false, false, false, false)); + isJpa10, isJpa20, isJpa21, isJpa22, isJpa30, isJpa31, isJpa32, isJpa40)); return providers; } diff --git a/enterprise/glassfish.common/nbproject/project.properties b/enterprise/glassfish.common/nbproject/project.properties index 1b5e7c63cc12..f1d59bed2e5d 100644 --- a/enterprise/glassfish.common/nbproject/project.properties +++ b/enterprise/glassfish.common/nbproject/project.properties @@ -16,7 +16,7 @@ # under the License. javac.compilerargs=-Xlint -Xlint:-serial -javac.release=11 +javac.release=17 test.config.stableBTD.includes=**/*Test.class test.config.stableBTD.excludes=\ diff --git a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/Bundle.properties b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/Bundle.properties index a83f6d4bcdd6..629d699e898f 100644 --- a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/Bundle.properties +++ b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/Bundle.properties @@ -194,6 +194,7 @@ STR_7024_SERVER_NAME=GlassFish Server 7.0.24 STR_7025_SERVER_NAME=GlassFish Server 7.0.25 STR_710_SERVER_NAME=GlassFish Server 7.1.0 STR_800_SERVER_NAME=GlassFish Server 8.0.0 +STR_900_SERVER_NAME=GlassFish Server 9.0.0 # CommonServerSupport.java MSG_FLAKEY_NETWORK=Network communication problem
Could not establish \ diff --git a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/GlassfishInstanceProvider.java b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/GlassfishInstanceProvider.java index 081be2bca9f8..208ade0070df 100644 --- a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/GlassfishInstanceProvider.java +++ b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/GlassfishInstanceProvider.java @@ -70,6 +70,7 @@ public final class GlassfishInstanceProvider implements ServerInstanceProvider, public static final String JAKARTAEE91_DEPLOYER_FRAGMENT = "deployer:gfv610ee9"; public static final String JAKARTAEE10_DEPLOYER_FRAGMENT = "deployer:gfv700ee10"; public static final String JAKARTAEE11_DEPLOYER_FRAGMENT = "deployer:gfv800ee11"; + public static final String JAKARTAEE12_DEPLOYER_FRAGMENT = "deployer:gfv900ee12"; public static final String EE6WC_DEPLOYER_FRAGMENT = "deployer:gfv3ee6wc"; // NOI18N public static final String PRELUDE_DEPLOYER_FRAGMENT = "deployer:gfv3"; // NOI18N private static String EE6_INSTANCES_PATH = "/GlassFishEE6/Instances"; // NOI18N @@ -80,6 +81,7 @@ public final class GlassfishInstanceProvider implements ServerInstanceProvider, private static String JAKARTAEE91_INSTANCES_PATH = "/GlassFishJakartaEE91/Instances"; // NOI18N private static String JAKARTAEE10_INSTANCES_PATH = "/GlassFishJakartaEE10/Instances"; // NOI18N private static String JAKARTAEE11_INSTANCES_PATH = "/GlassFishJakartaEE11/Instances"; // NOI18N + private static String JAKARTAEE12_INSTANCES_PATH = "/GlassFishJakartaEE12/Instances"; // NOI18N private static String EE6WC_INSTANCES_PATH = "/GlassFishEE6WC/Instances"; // NOI18N public static String PRELUDE_DEFAULT_NAME = "GlassFish_v3_Prelude"; //NOI18N @@ -105,12 +107,12 @@ public static GlassfishInstanceProvider getProvider() { EE7_DEPLOYER_FRAGMENT, EE8_DEPLOYER_FRAGMENT, JAKARTAEE8_DEPLOYER_FRAGMENT, JAKARTAEE9_DEPLOYER_FRAGMENT, JAKARTAEE91_DEPLOYER_FRAGMENT, JAKARTAEE10_DEPLOYER_FRAGMENT, - JAKARTAEE11_DEPLOYER_FRAGMENT}, + JAKARTAEE11_DEPLOYER_FRAGMENT, JAKARTAEE12_DEPLOYER_FRAGMENT}, new String[]{EE6_INSTANCES_PATH, EE6WC_INSTANCES_PATH, EE7_INSTANCES_PATH, EE8_INSTANCES_PATH, JAKARTAEE8_INSTANCES_PATH, JAKARTAEE9_INSTANCES_PATH, JAKARTAEE91_INSTANCES_PATH, JAKARTAEE10_INSTANCES_PATH, - JAKARTAEE11_INSTANCES_PATH}, + JAKARTAEE11_INSTANCES_PATH, JAKARTAEE12_INSTANCES_PATH}, null, true, new String[]{"--nopassword"}, // NOI18N diff --git a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/ServerDetails.java b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/ServerDetails.java index d301c678532c..dea9323b8f9d 100644 --- a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/ServerDetails.java +++ b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/ServerDetails.java @@ -587,6 +587,17 @@ public enum ServerDetails { "https://repo.maven.apache.org/maven2/org/glassfish/main/distributions/glassfish/8.0.0/glassfish-8.0.0.zip", // NOI18N "https://repo.maven.apache.org/maven2/org/glassfish/main/distributions/glassfish/8.0.0/glassfish-8.0.0.zip", // NOI18N "http://www.eclipse.org/legal/epl-2.0" //NOI18N + ), + + /** + * details for an instance of GlassFish Server 9.0.0 + */ + GLASSFISH_SERVER_9_0_0(NbBundle.getMessage(ServerDetails.class, "STR_900_SERVER_NAME", new Object[]{}), // NOI18N + GlassfishInstanceProvider.JAKARTAEE12_DEPLOYER_FRAGMENT, + GlassFishVersion.GF_9_0_0, + "https://repo.maven.apache.org/maven2/org/glassfish/main/distributions/glassfish/9.0.0-M1/glassfish-9.0.0-M1.zip", // NOI18N + "https://repo.maven.apache.org/maven2/org/glassfish/main/distributions/glassfish/9.0.0-M1/glassfish-9.0.0-M1.zip", // NOI18N + "http://www.eclipse.org/legal/epl-2.0" //NOI18N ); /** diff --git a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/registration/AutomaticRegistration.java b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/registration/AutomaticRegistration.java index 5c906f0f9a8e..ede06ac97d10 100644 --- a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/registration/AutomaticRegistration.java +++ b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/registration/AutomaticRegistration.java @@ -84,7 +84,10 @@ private static int autoregisterGlassFishInstance(String clusterDirValue, String String deployer = "deployer:gfv3ee6"; String defaultDisplayNamePrefix = "GlassFish Server "; GlassFishVersion version = ServerUtils.getServerVersion(glassfishRoot); - if (GlassFishVersion.ge(version, GlassFishVersion.GF_8_0_0)) { + if (GlassFishVersion.ge(version, GlassFishVersion.GF_9_0_0)) { + deployer = "deployer:gfv900ee12"; + config = "GlassFishJakartaEE12/Instances"; + } else if (GlassFishVersion.ge(version, GlassFishVersion.GF_8_0_0)) { deployer = "deployer:gfv800ee11"; config = "GlassFishJakartaEE11/Instances"; } else if (GlassFishVersion.ge(version, GlassFishVersion.GF_7_0_0)) { diff --git a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/Bundle.properties b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/Bundle.properties index a7f84f8b939e..475c10eae215 100644 --- a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/Bundle.properties +++ b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/Bundle.properties @@ -198,6 +198,9 @@ STR_710_SERVER_NAME=GlassFish Server 7.1.0 STR_V8_FAMILY_NAME=GlassFish Server STR_800_SERVER_NAME=GlassFish Server 8.0.0 +STR_V9_FAMILY_NAME=GlassFish Server +STR_900_SERVER_NAME=GlassFish Server 9.0.0 + LBL_SELECT_BITS=Select LBL_ChooseOne=Choose server to download: diff --git a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/GlassfishWizardProvider.java b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/GlassfishWizardProvider.java index e095842f864a..198b1327dacf 100644 --- a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/GlassfishWizardProvider.java +++ b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/GlassfishWizardProvider.java @@ -85,6 +85,13 @@ public static GlassfishWizardProvider createJakartaEe11() { "STR_V8_FAMILY_NAME", new Object[]{}) // NOI18N ); } + + public static GlassfishWizardProvider createJakartaEe12() { + return new GlassfishWizardProvider( + org.openide.util.NbBundle.getMessage(GlassfishWizardProvider.class, + "STR_V9_FAMILY_NAME", new Object[]{}) // NOI18N + ); + } private final String displayName; diff --git a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/spi/ServerUtilities.java b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/spi/ServerUtilities.java index e81b108df9f2..47333a2ce44a 100644 --- a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/spi/ServerUtilities.java +++ b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/spi/ServerUtilities.java @@ -118,6 +118,12 @@ public static ServerUtilities getJakartaEe11Utilities() { return null == gip ? null : new ServerUtilities(gip, GlassfishWizardProvider.createJakartaEe11()); } + + public static ServerUtilities getJakartaEe12Utilities() { + GlassfishInstanceProvider gip = GlassfishInstanceProvider.getProvider(); + return null == gip ? null : new ServerUtilities(gip, + GlassfishWizardProvider.createJakartaEe12()); + } // public static ServerUtilities getEe6WCUtilities() { // GlassfishInstanceProvider gip = GlassfishInstanceProvider.getProvider(); diff --git a/enterprise/glassfish.common/test/unit/src/org/netbeans/modules/glassfish/common/registration/AutomaticRegistrationTest.java b/enterprise/glassfish.common/test/unit/src/org/netbeans/modules/glassfish/common/registration/AutomaticRegistrationTest.java index 37e1a77d83ad..e13a43ddc0bc 100644 --- a/enterprise/glassfish.common/test/unit/src/org/netbeans/modules/glassfish/common/registration/AutomaticRegistrationTest.java +++ b/enterprise/glassfish.common/test/unit/src/org/netbeans/modules/glassfish/common/registration/AutomaticRegistrationTest.java @@ -28,6 +28,22 @@ */ public class AutomaticRegistrationTest { + @Test + public void testRegistrationGF9() { + GlassFishVersion version = GlassFishVersion.GF_9_0_0; + if (GlassFishVersion.ge(version, GlassFishVersion.GF_9_0_0)) { + assertTrue("Success!", true); + } else if (GlassFishVersion.ge(version, GlassFishVersion.GF_6)) { + fail("GF_6"); + } else if (GlassFishVersion.ge(version, GlassFishVersion.GF_5_1_0)) { + fail("GF_5_1_0"); + } else if (GlassFishVersion.ge(version, GlassFishVersion.GF_5)) { + fail("GF_5"); + } else if (GlassFishVersion.ge(version, GlassFishVersion.GF_3_1)) { + fail("GF_3_1"); + } + } + @Test public void testRegistrationGF8() { GlassFishVersion version = GlassFishVersion.GF_8_0_0; diff --git a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/AppClientVersion.java b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/AppClientVersion.java index 7f52b529793c..e374b6447908 100644 --- a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/AppClientVersion.java +++ b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/AppClientVersion.java @@ -88,6 +88,13 @@ public final class AppClientVersion extends J2EEBaseVersion { "11.0", 11000, // NOI18N "11.0", 11000 // NOI18N ); + + /** Represents application-client version 12.0 + */ + public static final AppClientVersion APP_CLIENT_12_0 = new AppClientVersion( + "12.0", 12000, // NOI18N + "12.0", 12000 // NOI18N + ); /** Creates a new instance of AppClientVersion */ @@ -102,6 +109,7 @@ private AppClientVersion(String version, int nv, String specVersion, int nsv) { * than the version passed in as an argument. * @throws ClassCastException if obj is not a AppClientVersion object. */ + @Override public int compareTo(Object obj) { AppClientVersion target = (AppClientVersion) obj; return numericCompare(target); @@ -128,6 +136,8 @@ public static AppClientVersion getAppClientVersion(String version) { result = APP_CLIENT_10_0; } else if(APP_CLIENT_11_0.toString().equals(version)) { result = APP_CLIENT_11_0; + } else if(APP_CLIENT_12_0.toString().equals(version)) { + result = APP_CLIENT_12_0; } return result; diff --git a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/ApplicationVersion.java b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/ApplicationVersion.java index d39b320562c5..1dcc0af1403f 100644 --- a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/ApplicationVersion.java +++ b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/ApplicationVersion.java @@ -88,6 +88,13 @@ public final class ApplicationVersion extends J2EEBaseVersion { "11.0", 11000, // NOI18N "11.0", 11000 // NOI18N ); + + /** Represents application version 12.0 + */ + public static final ApplicationVersion APPLICATION_12_0 = new ApplicationVersion( + "12.0", 12000, // NOI18N + "12.0", 12000 // NOI18N + ); /** Creates a new instance of ApplicationVersion */ @@ -102,6 +109,7 @@ private ApplicationVersion(String version, int nv, String specVersion, int nsv) * than the version passed in as an argument. * @throws ClassCastException if obj is not a ApplicationVersion object. */ + @Override public int compareTo(Object obj) { ApplicationVersion target = (ApplicationVersion) obj; return numericCompare(target); @@ -124,8 +132,12 @@ public static ApplicationVersion getApplicationVersion(String version) { result = APPLICATION_8_0; } else if(APPLICATION_9_0.toString().equals(version)) { result = APPLICATION_9_0; - }else if(APPLICATION_10_0.toString().equals(version)) { + } else if(APPLICATION_10_0.toString().equals(version)) { result = APPLICATION_10_0; + } else if(APPLICATION_11_0.toString().equals(version)) { + result = APPLICATION_11_0; + } else if(APPLICATION_12_0.toString().equals(version)) { + result = APPLICATION_12_0; } return result; diff --git a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/EjbJarVersion.java b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/EjbJarVersion.java index b8ca518b4f50..70fc060850dc 100644 --- a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/EjbJarVersion.java +++ b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/EjbJarVersion.java @@ -89,6 +89,14 @@ public final class EjbJarVersion extends J2EEBaseVersion { "4.0.1", 4010, // NOI18N "10.0", 10000 // NOI18N ); + + /** + * Represents ejbjar version 4.1 + */ + public static final EjbJarVersion EJBJAR_4_1 = new EjbJarVersion( + "4.1", 4100, // NOI18N + "12.0", 12000 // NOI18N + ); /** Creates a new instance of EjbJarVersion */ @@ -126,6 +134,10 @@ public static EjbJarVersion getEjbJarVersion(String version) { result = EJBJAR_3_2_6; } else if(EJBJAR_4_0.toString().equals(version)) { result = EJBJAR_4_0; + } else if(EJBJAR_4_0_1.toString().equals(version)) { + result = EJBJAR_4_0_1; + } else if(EJBJAR_4_1.toString().equals(version)) { + result = EJBJAR_4_1; } return result; diff --git a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/GlassfishConfiguration.java b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/GlassfishConfiguration.java index 3b85965f52ff..a5035f00446a 100644 --- a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/GlassfishConfiguration.java +++ b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/GlassfishConfiguration.java @@ -70,7 +70,7 @@ import org.openide.util.RequestProcessor; /** - * Basic Java/Jakarta EE server configuration API support for V2-V8 plugins. + * Basic Java/Jakarta EE server configuration API support for V2-V9 plugins. *

* @author Peter Williams, Tomas Kraus */ @@ -489,7 +489,8 @@ void internalSetAppServerVersion(ASDDVersion asVersion) { "gfv6ee9", "gfv610ee9", "gfv700ee10", - "gfv800ee11" + "gfv800ee11", + "gfv900ee12" }; protected ASDDVersion getTargetAppServerVersion() { @@ -542,7 +543,13 @@ static ASDDVersion getInstalledAppServerVersionFromDirectory(File asInstallFolde boolean geGF6 = false; boolean geGF7 = false; boolean geGF8 = false; - if(schemaFolder.exists()){ + boolean geGF9 = false; + if(schemaFolder.exists()) { + if(new File(schemaFolder, "jakartaee12.xsd").exists() && + new File(dtdFolder, "glassfish-web-app_3_0-1.dtd").exists()){ + geGF9 = true; + return ASDDVersion.GLASSFISH_9; + } if(new File(schemaFolder, "jakartaee11.xsd").exists() && new File(dtdFolder, "glassfish-web-app_3_0-1.dtd").exists()){ geGF8 = true; @@ -564,7 +571,7 @@ static ASDDVersion getInstalledAppServerVersionFromDirectory(File asInstallFolde return ASDDVersion.GLASSFISH_5_1; } } - if (!geGF5 && !geGF6 && !geGF7 && !geGF8 && dtdFolder.exists()) { + if (!geGF5 && !geGF6 && !geGF7 && !geGF8 && !geGF9 && dtdFolder.exists()) { if (new File(dtdFolder, "glassfish-web-app_3_0-1.dtd").exists()) { return ASDDVersion.SUN_APPSERVER_10_1; } diff --git a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/J2EEVersion.java b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/J2EEVersion.java index 3ef27a3bdc62..100b6b75c49a 100644 --- a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/J2EEVersion.java +++ b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/J2EEVersion.java @@ -97,6 +97,12 @@ public final class J2EEVersion extends J2EEBaseVersion { public static final J2EEVersion JAKARTAEE_11_0 = new J2EEVersion( "11.0.0", 110000, // NOI18N "11.0.0", 110000); // NOI18N + + /** Represents Jakarta EE version 12.0.0 + */ + public static final J2EEVersion JAKARTAEE_12_0 = new J2EEVersion( + "12.0.0", 120000, // NOI18N + "12.0.0", 120000); // NOI18N /** Creates a new instance of J2EEVersion */ @@ -141,6 +147,8 @@ public static J2EEVersion getJ2EEVersion(String version) { result = JAKARTAEE_10_0; } else if(JAKARTAEE_11_0.toString().equals(version)) { result = JAKARTAEE_11_0; + } else if(JAKARTAEE_12_0.toString().equals(version)) { + result = JAKARTAEE_12_0; } return result; diff --git a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/J2eeModuleHelper.java b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/J2eeModuleHelper.java index dcd0dd32683b..6d7c45abd7aa 100644 --- a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/J2eeModuleHelper.java +++ b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/J2eeModuleHelper.java @@ -55,13 +55,13 @@ public abstract class J2eeModuleHelper { private static final Map gfhelperMap; static { - Map map = new HashMap(); + Map map = new HashMap<>(8); map.put(J2eeModule.Type.WAR, new WebDDHelper()); map.put(J2eeModule.Type.EJB, new EjbDDHelper()); map.put(J2eeModule.Type.EAR, new EarDDHelper()); map.put(J2eeModule.Type.CAR, new ClientDDHelper()); helperMap = Collections.unmodifiableMap(map); - map = new HashMap(); + map = new HashMap(8); map.put(J2eeModule.Type.WAR, new WebDDHelper(GF_WEB_XML_V2, null)); map.put(J2eeModule.Type.EJB, new EjbDDHelper("META-INF/glassfish-ejb-jar.xml", "META-INF/glassfish-cmp-mappings.xml")); map.put(J2eeModule.Type.EAR, new EarDDHelper("META-INF/glassfish-application.xml", null)); @@ -208,6 +208,8 @@ protected ASDDVersion getMinASVersion(String j2eeModuleVersion, ASDDVersion defa result = ASDDVersion.GLASSFISH_7; } else if (ServletVersion.SERVLET_6_1.equals(servletVersion)) { result = ASDDVersion.GLASSFISH_8; + } else if (ServletVersion.SERVLET_6_2.equals(servletVersion)) { + result = ASDDVersion.GLASSFISH_9; } return result; } @@ -244,6 +246,8 @@ protected ASDDVersion getMinASVersion(String j2eeModuleVersion, ASDDVersion defa result = ASDDVersion.GLASSFISH_7; } else if (ServletVersion.SERVLET_6_1.equals(servletVersion)) { result = ASDDVersion.GLASSFISH_8; + } else if (ServletVersion.SERVLET_6_2.equals(servletVersion)) { + result = ASDDVersion.GLASSFISH_9; } return result; } @@ -285,6 +289,8 @@ protected ASDDVersion getMinASVersion(String j2eeModuleVersion, ASDDVersion defa result = ASDDVersion.GLASSFISH_7; } else if (EjbJarVersion.EJBJAR_4_0_1.equals(ejbJarVersion)) { result = ASDDVersion.GLASSFISH_8; + } else if (EjbJarVersion.EJBJAR_4_1.equals(ejbJarVersion)) { + result = ASDDVersion.GLASSFISH_9; } return result; } @@ -326,6 +332,8 @@ protected ASDDVersion getMinASVersion(String j2eeModuleVersion, ASDDVersion defa result = ASDDVersion.GLASSFISH_7; } else if (ApplicationVersion.APPLICATION_11_0.equals(applicationVersion)) { result = ASDDVersion.GLASSFISH_8; + } else if (ApplicationVersion.APPLICATION_12_0.equals(applicationVersion)) { + result = ASDDVersion.GLASSFISH_9; } return result; } @@ -367,6 +375,8 @@ protected ASDDVersion getMinASVersion(String j2eeModuleVersion, ASDDVersion defa result = ASDDVersion.GLASSFISH_7; } else if (AppClientVersion.APP_CLIENT_11_0.equals(appClientVersion)) { result = ASDDVersion.GLASSFISH_8; + } else if (AppClientVersion.APP_CLIENT_12_0.equals(appClientVersion)) { + result = ASDDVersion.GLASSFISH_9; } return result; } @@ -374,5 +384,4 @@ protected ASDDVersion getMinASVersion(String j2eeModuleVersion, ASDDVersion defa } - } diff --git a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/ServletVersion.java b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/ServletVersion.java index 84308b0b5e4d..bf2a0e6c5689 100644 --- a/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/ServletVersion.java +++ b/enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/config/ServletVersion.java @@ -88,6 +88,13 @@ public final class ServletVersion extends J2EEBaseVersion { "6.1", 6100, // NOI18N "11.0", 11000 // NOI18N ); + + /** Represents servlet version 6.2 + */ + public static final ServletVersion SERVLET_6_2 = new ServletVersion( + "6.2", 6200, // NOI18N + "12.0", 12000 // NOI18N + ); /** Creates a new instance of ServletVersion */ @@ -126,6 +133,10 @@ public static ServletVersion getServletVersion(String version) { result = SERVLET_5_0; } else if(SERVLET_6_0.toString().equals(version)) { result = SERVLET_6_0; + } else if(SERVLET_6_1.toString().equals(version)) { + result = SERVLET_6_1; + } else if(SERVLET_6_2.toString().equals(version)) { + result = SERVLET_6_2; } return result; diff --git a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/AbstractHk2ConfigurationFactory.java b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/AbstractHk2ConfigurationFactory.java index 0e4c91c26bd7..591f30520e00 100644 --- a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/AbstractHk2ConfigurationFactory.java +++ b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/AbstractHk2ConfigurationFactory.java @@ -106,74 +106,57 @@ public ModuleConfiguration create(final @NonNull J2eeModule module, final GlassFishVersion version = instance != null ? instance.getVersion() : null; try { + Hk2DeploymentManager evaluatedDm = null; - if(version != null && GlassFishVersion.ge(version, GlassFishVersion.GF_8_0_0)) { - evaluatedDm = (Hk2DeploymentManager) Hk2DeploymentFactory.createJakartaEe11() - .getDisconnectedDeploymentManager(instanceUrl); - } else if(version != null && GlassFishVersion.ge(version, GlassFishVersion.GF_7_0_0)) { - evaluatedDm = (Hk2DeploymentManager) Hk2DeploymentFactory.createJakartaEe10() - .getDisconnectedDeploymentManager(instanceUrl); - } else if(version != null && GlassFishVersion.ge(version, GlassFishVersion.GF_6_1_0)) { - evaluatedDm = (Hk2DeploymentManager) Hk2DeploymentFactory.createJakartaEe91() - .getDisconnectedDeploymentManager(instanceUrl); - } else if(version != null && GlassFishVersion.ge(version, GlassFishVersion.GF_6)) { - evaluatedDm = (Hk2DeploymentManager) Hk2DeploymentFactory.createJakartaEe9() - .getDisconnectedDeploymentManager(instanceUrl); - } else if(version != null && GlassFishVersion.ge(version, GlassFishVersion.GF_5_1_0)) { - evaluatedDm = (Hk2DeploymentManager) Hk2DeploymentFactory.createJakartaEe8() - .getDisconnectedDeploymentManager(instanceUrl); - } else if(version != null && GlassFishVersion.ge(version, GlassFishVersion.GF_5)) { - evaluatedDm = (Hk2DeploymentManager) Hk2DeploymentFactory.createEe8() - .getDisconnectedDeploymentManager(instanceUrl); - } else if(version != null && GlassFishVersion.ge(version, GlassFishVersion.GF_4)) { - evaluatedDm = (Hk2DeploymentManager) Hk2DeploymentFactory.createEe7() - .getDisconnectedDeploymentManager(instanceUrl); - } else if(version != null && GlassFishVersion.ge(version, GlassFishVersion.GF_3_1)) { - evaluatedDm = (Hk2DeploymentManager) Hk2DeploymentFactory.createEe6() - .getDisconnectedDeploymentManager(instanceUrl); + if (null != version) { + if(GlassFishVersion.ge(version, GlassFishVersion.GF_9_0_0)) { + evaluatedDm = (Hk2DeploymentManager) Hk2DeploymentFactory.createJakartaEe12() + .getDisconnectedDeploymentManager(instanceUrl); + } else if(GlassFishVersion.ge(version, GlassFishVersion.GF_8_0_0)) { + evaluatedDm = (Hk2DeploymentManager) Hk2DeploymentFactory.createJakartaEe11() + .getDisconnectedDeploymentManager(instanceUrl); + } else if(GlassFishVersion.ge(version, GlassFishVersion.GF_7_0_0)) { + evaluatedDm = (Hk2DeploymentManager) Hk2DeploymentFactory.createJakartaEe10() + .getDisconnectedDeploymentManager(instanceUrl); + } else if(GlassFishVersion.ge(version, GlassFishVersion.GF_6_1_0)) { + evaluatedDm = (Hk2DeploymentManager) Hk2DeploymentFactory.createJakartaEe91() + .getDisconnectedDeploymentManager(instanceUrl); + } else if(GlassFishVersion.ge(version, GlassFishVersion.GF_6)) { + evaluatedDm = (Hk2DeploymentManager) Hk2DeploymentFactory.createJakartaEe9() + .getDisconnectedDeploymentManager(instanceUrl); + } else if(GlassFishVersion.ge(version, GlassFishVersion.GF_5_1_0)) { + evaluatedDm = (Hk2DeploymentManager) Hk2DeploymentFactory.createJakartaEe8() + .getDisconnectedDeploymentManager(instanceUrl); + } else if(GlassFishVersion.ge(version, GlassFishVersion.GF_5)) { + evaluatedDm = (Hk2DeploymentManager) Hk2DeploymentFactory.createEe8() + .getDisconnectedDeploymentManager(instanceUrl); + } else if(GlassFishVersion.ge(version, GlassFishVersion.GF_4)) { + evaluatedDm = (Hk2DeploymentManager) Hk2DeploymentFactory.createEe7() + .getDisconnectedDeploymentManager(instanceUrl); + } else if(GlassFishVersion.ge(version, GlassFishVersion.GF_3_1)) { + evaluatedDm = (Hk2DeploymentManager) Hk2DeploymentFactory.createEe6() + .getDisconnectedDeploymentManager(instanceUrl); + } } else { evaluatedDm = (Hk2DeploymentManager) Hk2DeploymentFactory.createEe8() .getDisconnectedDeploymentManager(instanceUrl); } + final Hk2DeploymentManager dm = hk2dm != null ? hk2dm : evaluatedDm; - if (version != null - && GlassFishVersion.ge(version, GlassFishVersion.GF_8_0_0)) { - retVal = new ModuleConfigurationImpl( - module, new Hk2Configuration(module, version), dm); - } else if (version != null - && GlassFishVersion.ge(version, GlassFishVersion.GF_7_0_0)) { - retVal = new ModuleConfigurationImpl( - module, new Hk2Configuration(module, version), dm); - } else if (version != null - && GlassFishVersion.ge(version, GlassFishVersion.GF_6_1_0)) { - retVal = new ModuleConfigurationImpl( - module, new Hk2Configuration(module, version), dm); - } else if (version != null - && GlassFishVersion.ge(version, GlassFishVersion.GF_6)) { - retVal = new ModuleConfigurationImpl( - module, new Hk2Configuration(module, version), dm); - } else if (version != null - && GlassFishVersion.ge(version, GlassFishVersion.GF_5_1_0)) { - retVal = new ModuleConfigurationImpl( - module, new Hk2Configuration(module, version), dm); - } else if (version != null - && GlassFishVersion.ge(version, GlassFishVersion.GF_5)) { - retVal = new ModuleConfigurationImpl( - module, new Hk2Configuration(module, version), dm); - } else if (version != null - && GlassFishVersion.ge(version, GlassFishVersion.GF_4)) { - retVal = new ModuleConfigurationImpl( - module, new Hk2Configuration(module, version), dm); - } else if (version != null - && GlassFishVersion.ge(version, GlassFishVersion.GF_3_1)) { - retVal = new ModuleConfigurationImpl( - module, new Three1Configuration(module, version), dm); + if (null != version) { + if (GlassFishVersion.ge(version, GlassFishVersion.GF_4)) { + retVal = new ModuleConfigurationImpl(module, new Hk2Configuration(module, version), dm); + } else if (GlassFishVersion.ge(version, GlassFishVersion.GF_3_1)) { + retVal = new ModuleConfigurationImpl(module, new Three1Configuration(module, version), dm); + } else { + retVal = new ModuleConfigurationImpl(module, new Hk2Configuration(module, version), dm); + } } else { - retVal = new ModuleConfigurationImpl( - module, new Hk2Configuration(module, version), dm); + retVal = new ModuleConfigurationImpl(module, new Hk2Configuration(module, version), dm); } + } catch (ConfigurationException ce) { throw ce; } catch (Exception ex) { diff --git a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Bundle.properties b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Bundle.properties index bbb293440dce..ed7aa0bcdeef 100644 --- a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Bundle.properties +++ b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Bundle.properties @@ -51,6 +51,7 @@ LBL_V610ServerLibraries=GlassFish Server 6.1 Libraries LBL_V620ServerLibraries=GlassFish Server 6.2 Libraries LBL_V700ServerLibraries=GlassFish Server 7.0.0 Libraries LBL_V800ServerLibraries=GlassFish Server 8.0.0 Libraries +LBL_V900ServerLibraries=GlassFish Server 9.0.0 Libraries MSG_V1ServerPlatform=Unsupported GlassFish Server 1 Platform MSG_V2ServerPlatform=Unsupported GlassFish Server 2 Platform @@ -63,6 +64,7 @@ MSG_V610ServerPlatform=GlassFish Server 6.1 Platform MSG_V620ServerPlatform=GlassFish Server 6.2 Platform MSG_V700ServerPlatform=GlassFish Server 7.0.0 Platform MSG_V800ServerPlatform=GlassFish Server 8.0.0 Platform +MSG_V900ServerPlatform=GlassFish Server 9.0.0 Platform LBL_V3RunTimeDDCatalog=GlassFish Server 3 Catalog DESC_V3RunTimeDDCatalog=List of all the runtime descriptors DTDs for GlassFish Server 3 diff --git a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2DeploymentFactory.java b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2DeploymentFactory.java index 1b1b6e5214d2..ec8fbe474fc5 100644 --- a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2DeploymentFactory.java +++ b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2DeploymentFactory.java @@ -43,6 +43,7 @@ public class Hk2DeploymentFactory implements DeploymentFactory { private static Hk2DeploymentFactory jakartaee91Instance; private static Hk2DeploymentFactory jakartaee10Instance; private static Hk2DeploymentFactory jakartaee11Instance; + private static Hk2DeploymentFactory jakartaee12Instance; private String[] uriFragments; private String version; private String displayName; @@ -185,6 +186,22 @@ public static synchronized DeploymentFactory createJakartaEe11() { } return jakartaee11Instance; } + + /** + * + * @return + */ + public static synchronized DeploymentFactory createJakartaEe12() { + // FIXME -- these strings should come from some constant place + if (jakartaee12Instance == null) { + ServerUtilities tmp = ServerUtilities.getJakartaEe12Utilities(); + jakartaee12Instance = new Hk2DeploymentFactory(new String[]{"deployer:gfv900ee12:", "deployer:gfv9"}, "1.0", // NOI18N + NbBundle.getMessage(Hk2DeploymentFactory.class, "TXT_FactoryDisplayName")); // NOI18N + DeploymentFactoryManager.getInstance().registerDeploymentFactory(jakartaee12Instance); + jakartaee12Instance.setServerUtilities(tmp); + } + return jakartaee12Instance; + } /** * diff --git a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JavaEEPlatformFactory.java b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JavaEEPlatformFactory.java index cadb1d532d6f..2b3f779f56f3 100644 --- a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JavaEEPlatformFactory.java +++ b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JavaEEPlatformFactory.java @@ -67,6 +67,9 @@ public class Hk2JavaEEPlatformFactory extends J2eePlatformFactory { /** GlassFish V8 JakartaEE platform lookup key. */ private static final String V8_LOOKUP_KEY = "J2EE/DeploymentPlugins/gfv800ee11/Lookup"; + + /** GlassFish V9 JakartaEE platform lookup key. */ + private static final String V9_LOOKUP_KEY = "J2EE/DeploymentPlugins/gfv900ee12/Lookup"; /** GlassFish JavaEE platform factory singleton object. */ private static volatile Hk2JavaEEPlatformFactory instance; @@ -99,7 +102,10 @@ public static Hk2JavaEEPlatformFactory getFactory() { */ private static String getDisplayName(final GlassFishVersion version) { final int ord = version.ordinal(); - if(ord >= GlassFishVersion.GF_8_0_0.ordinal()) { + if(ord >= GlassFishVersion.GF_9_0_0.ordinal()) { + return NbBundle.getMessage( + Hk2JavaEEPlatformFactory.class, "MSG_V900ServerPlatform"); + } else if(ord >= GlassFishVersion.GF_8_0_0.ordinal()) { return NbBundle.getMessage( Hk2JavaEEPlatformFactory.class, "MSG_V800ServerPlatform"); } else if(ord >= GlassFishVersion.GF_7_0_0.ordinal()) { @@ -145,7 +151,10 @@ private static String getDisplayName(final GlassFishVersion version) { */ private static String getLibraryName(final GlassFishVersion version) { final int ord = version.ordinal(); - if (ord >= GlassFishVersion.GF_8_0_0.ordinal()) { + if (ord >= GlassFishVersion.GF_9_0_0.ordinal()) { + return NbBundle.getMessage( + Hk2JavaEEPlatformFactory.class, "LBL_V900ServerLibraries"); + } else if (ord >= GlassFishVersion.GF_8_0_0.ordinal()) { return NbBundle.getMessage( Hk2JavaEEPlatformFactory.class, "LBL_V800ServerLibraries"); } else if (ord >= GlassFishVersion.GF_7_0_0.ordinal()) { @@ -191,7 +200,9 @@ private static String getLibraryName(final GlassFishVersion version) { */ private static String getLookupKey(final GlassFishVersion version) { final int ord = version.ordinal(); - if (ord >= GlassFishVersion.GF_8_0_0.ordinal()){ + if (ord >= GlassFishVersion.GF_9_0_0.ordinal()){ + return V9_LOOKUP_KEY; + } else if (ord >= GlassFishVersion.GF_8_0_0.ordinal()){ return V8_LOOKUP_KEY; } else if (ord >= GlassFishVersion.GF_7_0_0.ordinal()){ return V7_LOOKUP_KEY; diff --git a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JavaEEPlatformImpl.java b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JavaEEPlatformImpl.java index e095df40b4d5..1199588d9bb5 100644 --- a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JavaEEPlatformImpl.java +++ b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JavaEEPlatformImpl.java @@ -211,6 +211,10 @@ public static Profile[] nbJavaEEProfiles( break; case v11_0_0: profiles[index++] = Profile.JAKARTA_EE_11_FULL; break; + case v12_0_0_web: profiles[index++] = Profile.JAKARTA_EE_12_WEB; + break; + case v12_0_0: profiles[index++] = Profile.JAKARTA_EE_12_FULL; + break; } } else { profiles = new Profile[0]; diff --git a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JpaSupportImpl.java b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JpaSupportImpl.java index e7a518630e82..f5020d511f20 100644 --- a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JpaSupportImpl.java +++ b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JpaSupportImpl.java @@ -49,10 +49,12 @@ private static class JpaSupportVector { * @param jpa_3_0 JPA 3.0 supported. * @param jpa_3_1 JPA 3.1 supported. * @param jpa_3_2 JPA 3.2 supported. + * @param jpa_4_0 JPA 3.2 supported. */ JpaSupportVector(boolean jpa_1_0, boolean jpa_2_0, boolean jpa_2_1, boolean jpa_2_2, - boolean jpa_3_0, boolean jpa_3_1, boolean jpa_3_2) { + boolean jpa_3_0, boolean jpa_3_1, + boolean jpa_3_2, boolean jpa_4_0) { _1_0 = jpa_1_0; _2_0 = jpa_2_0; _2_1 = jpa_2_1; @@ -60,6 +62,7 @@ private static class JpaSupportVector { _3_0 = jpa_3_0; _3_1 = jpa_3_1; _3_2 = jpa_3_2; + _4_0 = jpa_4_0; } /** JPA 1.0 supported. */ @@ -82,6 +85,9 @@ private static class JpaSupportVector { /** JPA 3.2 supported. */ boolean _3_2; + + /** JPA 4.0 supported. */ + boolean _4_0; } // Class attributes // @@ -95,14 +101,15 @@ private static class JpaSupportVector { * GlassFish JPA support matrix:

* * - * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * *
GlassFishJPA 1.0JPA 2.0JPA 2.1JPA 2.2JPA 3.0JPA 3.1JPA 3.2
V1YESNONONONONONO
V2YESNONONONONONO
V3YESYESNONONONONO
V4YESYESYESNONONONO
V5YESYESYESYESNONONO
V6NONONONOYESNONO
V7NONONONOYESYESNO
V8NONONONOYESYESYES
V1YESNONONONONONONO
V2YESNONONONONONONO
V3YESYESNONONONONONO
V4YESYESYESNONONONONO
V5YESYESYESYESNONONONO
V6NONONONOYESNONONO
V7NONONONOYESYESNONO
V8NONONONOYESYESYESNO
V9NONONONOYESYESYESYES
*/ private static final JpaSupportVector jpaSupport[] @@ -118,7 +125,8 @@ private static class JpaSupportVector { GlassFishVersion.lt(version, GlassFishVersion.GF_6) && GlassFishVersion.ge(version, GlassFishVersion.GF_5), GlassFishVersion.lt(version, GlassFishVersion.GF_7_0_0) && GlassFishVersion.ge(version, GlassFishVersion.GF_6), GlassFishVersion.lt(version, GlassFishVersion.GF_8_0_0) && GlassFishVersion.ge(version, GlassFishVersion.GF_7_0_0), - GlassFishVersion.ge(version, GlassFishVersion.GF_8_0_0) + GlassFishVersion.lt(version, GlassFishVersion.GF_9_0_0) && GlassFishVersion.ge(version, GlassFishVersion.GF_8_0_0), + GlassFishVersion.ge(version, GlassFishVersion.GF_9_0_0) ); } } @@ -189,7 +197,8 @@ public JpaProvider getDefaultProvider() { instanceJpaSupport._2_2, instanceJpaSupport._3_0, instanceJpaSupport._3_1, - instanceJpaSupport._3_2); + instanceJpaSupport._3_2, + instanceJpaSupport._4_0); } } return defaultProvider; diff --git a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2OptionalFactory.java b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2OptionalFactory.java index 8fb55ba79adf..2c8ad356de3d 100644 --- a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2OptionalFactory.java +++ b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2OptionalFactory.java @@ -109,6 +109,12 @@ public static Hk2OptionalFactory createJakartaEe11() { return null == t ? null : new Hk2OptionalFactory(Hk2DeploymentFactory.createJakartaEe11(), t, true); } + + public static Hk2OptionalFactory createJakartaEe12() { + ServerUtilities t = ServerUtilities.getJakartaEe12Utilities(); + return null == t ? null : new Hk2OptionalFactory(Hk2DeploymentFactory.createJakartaEe12(), + t, true); + } @Override public StartServer getStartServer(DeploymentManager dm) { diff --git a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/JavaEEDecoratorFactory.java b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/JavaEEDecoratorFactory.java index 7cd4e3bb7008..7a59dc10f845 100644 --- a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/JavaEEDecoratorFactory.java +++ b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/JavaEEDecoratorFactory.java @@ -231,7 +231,7 @@ public Map getAllDecorators() { @Override public String getCmdPropertyName() { return "jndi_name"; } }; - private static final Map decoratorMap = new HashMap(); + private static final Map decoratorMap = new HashMap<>(32); static { // !PW XXX need to put in correct strings, then define as static diff --git a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/JavaEEServerModuleFactory.java b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/JavaEEServerModuleFactory.java index 3e77dc5538b5..6a2d6a6a2a32 100644 --- a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/JavaEEServerModuleFactory.java +++ b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/JavaEEServerModuleFactory.java @@ -72,15 +72,10 @@ public boolean isModuleSupported(String glassfishHome, Properties asenvProps) { // Do some moderate sanity checking to see if this v3 build looks ok. File jar = ServerUtilities.getJarName(glassfishHome, ServerUtilities.GFV3_JAR_MATCHER); - if (jar==null) { return false; } - if (jar.exists()) { - return true; - } - - return false; + return jar.exists(); } private static final RequestProcessor RP = new RequestProcessor("JavaEEServerModuleFactory"); @@ -124,7 +119,7 @@ public Object createModule(Lookup instanceLookup) { RP.post(new Runnable() { @Override public void run() { - ensureEclipseLinkSupport(glassfishRoot); + ensureEclipseLinkSupport(glassfishRoot, commonModule.getInstance().getVersion()); ensureCometSupport(glassfishRoot); ensureGlassFishApiSupport(commonModule.getInstance()); // lookup the javadb register service here and use it. @@ -156,43 +151,75 @@ public void run() { private static final String PERSISTENCE_API_JAR_MATCHER_1 = "javax.javaee" + ServerUtilities.GFV3_VERSION_MATCHER; // NOI18N private static final String PERSISTENCE_API_JAR_MATCHER_2 = "javax.persistence" + ServerUtilities.GFV3_VERSION_MATCHER; // NOI18N - - private static final String PERSISTENCE_JAVADOC = "javaee-doc-api.jar"; // NOI18N + private static final String PERSISTENCE_API_JAR_MATCHER_3 = "jakarta.persistence" + ServerUtilities.GFV3_VERSION_MATCHER; // NOI18N - private static boolean ensureEclipseLinkSupport(String installRoot) { - List libraryList = new ArrayList(); - List docList = new ArrayList(); + private static boolean ensureEclipseLinkSupport(String installRoot, GlassFishVersion version) { + List libraryList = new ArrayList<>(); + List docList = new ArrayList<>(); try { File f = ServerUtilities.getJarName(installRoot, EL_CORE_JAR_MATCHER); if (f != null && f.exists()) { libraryList.add(ServerUtilities.fileToUrl(f)); - } else {// we are in the final V3 Prelude jar name structure + } else { + // we are in the final V3 Prelude jar name structure // find the org.eclipse.persistence*.jar files and add them for (File candidate : new File(installRoot, "modules").listFiles()) {// NOI18N - if (candidate.getName().indexOf("org.eclipse.persistence") != -1) {// NOI18N + if (candidate.getName().contains("org.eclipse.persistence")) {// NOI18N libraryList.add(ServerUtilities.fileToUrl(candidate)); } } } - f = ServerUtilities.getJarName(installRoot, PERSISTENCE_API_JAR_MATCHER_1); - if (f != null && f.exists()) { - libraryList.add(ServerUtilities.fileToUrl(f)); - } else { + + if (GlassFishVersion.ge(version, GlassFishVersion.GF_6)) { + f = ServerUtilities.getJarName(installRoot, PERSISTENCE_API_JAR_MATCHER_3); + if (f != null && f.exists()) { + libraryList.add(ServerUtilities.fileToUrl(f)); + } + } else if (GlassFishVersion.ge(version, GlassFishVersion.GF_3)) { f = ServerUtilities.getJarName(installRoot, PERSISTENCE_API_JAR_MATCHER_2); if (f != null && f.exists()) { libraryList.add(ServerUtilities.fileToUrl(f)); } + } else { + f = ServerUtilities.getJarName(installRoot, PERSISTENCE_API_JAR_MATCHER_1); + if (f != null && f.exists()) { + libraryList.add(ServerUtilities.fileToUrl(f)); + } } - // TODO: add support for JPA 3.x - - File j2eeDoc = InstalledFileLocator.getDefault().locate( - "docs/" + PERSISTENCE_JAVADOC, + + File j2eeDoc = null; + if (GlassFishVersion.ge(version, GlassFishVersion.GF_9_0_0)) { + j2eeDoc = InstalledFileLocator.getDefault().locate( + "docs/" + JAKARTA_EE_12_JAVADOC, + Hk2LibraryProvider.JAVAEE_DOC_CODE_BASE, false); + } else if (GlassFishVersion.ge(version, GlassFishVersion.GF_8_0_0)) { + j2eeDoc = InstalledFileLocator.getDefault().locate( + "docs/" + JAKARTA_EE_11_JAVADOC, + Hk2LibraryProvider.JAVAEE_DOC_CODE_BASE, false); + } else if (GlassFishVersion.ge(version, GlassFishVersion.GF_7_0_0)) { + j2eeDoc = InstalledFileLocator.getDefault().locate( + "docs/" + JAKARTA_EE_10_JAVADOC, + Hk2LibraryProvider.JAVAEE_DOC_CODE_BASE, false); + } else if (GlassFishVersion.ge(version, GlassFishVersion.GF_6)) { + j2eeDoc = InstalledFileLocator.getDefault().locate( + "docs/" + JAKARTA_EE_9_JAVADOC, Hk2LibraryProvider.JAVAEE_DOC_CODE_BASE, false); + } else if (GlassFishVersion.ge(version, GlassFishVersion.GF_5_1_0)) { + j2eeDoc = InstalledFileLocator.getDefault().locate( + "docs/" + JAKARTA_EE_8_JAVADOC, + Hk2LibraryProvider.JAVAEE_DOC_CODE_BASE, false); + } else if (GlassFishVersion.ge(version, GlassFishVersion.GF_3)) { + j2eeDoc = InstalledFileLocator.getDefault().locate( + "docs/" + JAVA_EE_JAVADOC, + Hk2LibraryProvider.JAVAEE_DOC_CODE_BASE, false); + } + if (j2eeDoc != null) { docList.add(ServerUtilities.fileToUrl(j2eeDoc)); } else { - LOG.log(Level.WARNING, "Warning: Java EE documentation not found when registering EclipseLink library."); + LOG.log(Level.WARNING, "Warning: Java/Jakarta EE documentation not found when registering EclipseLink library."); } + } catch (MalformedURLException ex) { LOG.log(Level.WARNING, ex.getLocalizedMessage(), ex); return false; @@ -206,6 +233,7 @@ private static boolean ensureEclipseLinkSupport(String installRoot) { NbBundle.getMessage(JavaEEServerModuleFactory.class, "DNAME_GF_ECLIPSELINK"), // NOI18N NbBundle.getMessage(JavaEEServerModuleFactory.class, "DESC_GF_ECLIPSELINK")); // NOI18N } + private static final String COMET_LIB = "Comet-GlassFish-v3-Prelude"; // NOI18N private static final String COMET_LIB_2 = "Comet-GlassFish-v3"; // NOI18N private static final String COMET_JAR_MATCHER = "grizzly-module" + ServerUtilities.GFV3_VERSION_MATCHER; // NOI18N @@ -213,7 +241,7 @@ private static boolean ensureEclipseLinkSupport(String installRoot) { private static final String GRIZZLY_OPTIONAL_JAR_MATCHER = "grizzly-optional" + ServerUtilities.GFV3_VERSION_MATCHER; // NOI18N private static boolean ensureCometSupport(String installRoot) { - List libraryList = new ArrayList(); + List libraryList = new ArrayList<>(); String name = COMET_LIB; File f = ServerUtilities.getJarName(installRoot, GRIZZLY_OPTIONAL_JAR_MATCHER); if (f == null || !f.exists()) { @@ -253,11 +281,12 @@ private static boolean ensureCometSupport(String installRoot) { private static final String JAKARTA_EE_9_JAVADOC = "jakartaee9-doc-api.jar"; // NOI18N private static final String JAKARTA_EE_10_JAVADOC = "jakartaee10-doc-api.jar"; // NOI18N private static final String JAKARTA_EE_11_JAVADOC = "jakartaee11-doc-api.jar"; // NOI18N + private static final String JAKARTA_EE_12_JAVADOC = "jakartaee12-doc-api.jar"; // NOI18N private static boolean ensureGlassFishApiSupport(GlassFishServer server) { String installRoot = server.getServerRoot(); List libraryList = Hk2LibraryProvider.getProvider(server).getJavaEEClassPathURLs(); - List docList = new ArrayList(); + List docList = new ArrayList<>(); String name = JAVA_EE_5_LIB; File f = ServerUtilities.getJarName(installRoot, "gmbal" + ServerUtilities.GFV3_VERSION_MATCHER); @@ -266,7 +295,11 @@ private static boolean ensureGlassFishApiSupport(GlassFishServer server) { } File j2eeDoc; - if (GlassFishVersion.ge(server.getVersion(), GlassFishVersion.GF_8_0_0)) { + if (GlassFishVersion.ge(server.getVersion(), GlassFishVersion.GF_9_0_0)) { + j2eeDoc = InstalledFileLocator.getDefault().locate( + "docs/" + JAKARTA_EE_12_JAVADOC, + Hk2LibraryProvider.JAVAEE_DOC_CODE_BASE, false); + } else if (GlassFishVersion.ge(server.getVersion(), GlassFishVersion.GF_8_0_0)) { j2eeDoc = InstalledFileLocator.getDefault().locate( "docs/" + JAKARTA_EE_11_JAVADOC, Hk2LibraryProvider.JAVAEE_DOC_CODE_BASE, false); diff --git a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/RunTimeDDCatalog.java b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/RunTimeDDCatalog.java index e8041c3e4544..a3470075854c 100644 --- a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/RunTimeDDCatalog.java +++ b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/RunTimeDDCatalog.java @@ -139,6 +139,7 @@ public class RunTimeDDCatalog extends GrammarQueryManager implements CatalogRead "SCHEMA:http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd" , "ejb-jar_3_1", "SCHEMA:http://xmlns.jcp.org/xml/ns/javaee/ejb-jar_3_2.xsd" , "ejb-jar_3_2", "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/ejb-jar_4_0.xsd" , "ejb-jar_4_0", + "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/ejb-jar_4_1.xsd" , "ejb-jar_4_1", "SCHEMA:http://java.sun.com/xml/ns/j2ee/application-client_1_4.xsd" , "application-client_1_4", "SCHEMA:http://java.sun.com/xml/ns/j2ee/application_1_4.xsd" , "application_1_4", "SCHEMA:http://java.sun.com/xml/ns/javaee/application-client_5.xsd" , "application-client_5", @@ -155,12 +156,15 @@ public class RunTimeDDCatalog extends GrammarQueryManager implements CatalogRead "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/application_10.xsd" , "application_10", "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/application-client_11.xsd" , "application-client_11", "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/application_11.xsd" , "application_11", + "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/application-client_12.xsd" , "application-client_12", + "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/application_12.xsd" , "application_12", "SCHEMA:http://java.sun.com/xml/ns/j2ee/jax-rpc-ri-config.xsd" , "jax-rpc-ri-config", "SCHEMA:http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd" , "connector_1_5", "SCHEMA:http://java.sun.com/xml/ns/javaee/connector_1_6.xsd" , "connector_1_6", "SCHEMA:http://xmlns.jcp.org/xml/ns/javaee/connector_1_7.xsd" , "connector_1_7", "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/connector_2_0.xsd" , "connector_2_0", "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/connector_2_1.xsd" , "connector_2_1", + "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/connector_2_2.xsd" , "connector_2_2", //"SCHEMA:http://java.sun.com/xml/ns/j2ee/jsp_2_0.xsd" , "jsp_2_0.xsd", //"SCHEMA:http://java.sun.com/xml/ns/j2ee/datatypes.dtd" , "datatypes", //"SCHEMA:http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" , "web-app_2_4", @@ -184,12 +188,14 @@ public class RunTimeDDCatalog extends GrammarQueryManager implements CatalogRead "SCHEMA:https://jakarta.ee/xml/ns/persistence/orm/orm_3_0.xsd" , "orm_3_0", "SCHEMA:https://jakarta.ee/xml/ns/persistence/orm/orm_3_1.xsd" , "orm_3_1", "SCHEMA:https://jakarta.ee/xml/ns/persistence/orm/orm_3_2.xsd" , "orm_3_2", + "SCHEMA:https://jakarta.ee/xml/ns/persistence/orm/orm_4_0.xsd" , "orm_4_0", "SCHEMA:http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" , "persistence_1_0", "SCHEMA:http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" , "persistence_2_0", "SCHEMA:http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd" , "persistence_2_1", "SCHEMA:http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd" , "persistence_2_2", "SCHEMA:https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd" , "persistence_3_0", "SCHEMA:https://jakarta.ee/xml/ns/persistence/persistence_3_2.xsd" , "persistence_3_2", + "SCHEMA:https://jakarta.ee/xml/ns/persistence/persistence_4_0.xsd" , "persistence_4_0", }; private static final String JavaEE6SchemaToURLMap[] = { @@ -499,6 +505,10 @@ public String getShortDescription() { private static final String EJBJAR_4_0_XSD="ejb-jar_4_0.xsd"; // NOI18N private static final String EJBJAR_4_0 = JAKARTAEE_NS+"/"+EJBJAR_4_0_XSD; // NOI18N public static final String EJBJAR_4_0_ID = "SCHEMA:"+EJBJAR_4_0; // NOI18N + + private static final String EJBJAR_4_1_XSD="ejb-jar_4_1.xsd"; // NOI18N + private static final String EJBJAR_4_1 = JAKARTAEE_NS+"/"+EJBJAR_4_1_XSD; // NOI18N + public static final String EJBJAR_4_1_ID = "SCHEMA:"+EJBJAR_4_1; // NOI18N private static final String APP_TAG="application"; //NOI18N private static final String APP_1_4_XSD="application_1_4.xsd"; // NOI18N @@ -532,6 +542,10 @@ public String getShortDescription() { private static final String APP_11_XSD="application_11.xsd"; // NOI18N private static final String APP_11= JAKARTAEE_NS+"/"+APP_11_XSD; // NOI18N public static final String APP_11_ID = "SCHEMA:"+APP_11; // NOI18N + + private static final String APP_12_XSD="application_12.xsd"; // NOI18N + private static final String APP_12= JAKARTAEE_NS+"/"+APP_12_XSD; // NOI18N + public static final String APP_12_ID = "SCHEMA:"+APP_12; // NOI18N private static final String APPCLIENT_TAG="application-client"; //NOI18N private static final String APPCLIENT_1_4_XSD="application-client_1_4.xsd"; // NOI18N @@ -565,6 +579,10 @@ public String getShortDescription() { private static final String APPCLIENT_11_XSD="application-client_11.xsd"; // NOI18N private static final String APPCLIENT_11= JAKARTAEE_NS+"/"+APPCLIENT_11_XSD; // NOI18N public static final String APPCLIENT_11_ID = "SCHEMA:"+APPCLIENT_11; // NOI18N + + private static final String APPCLIENT_12_XSD="application-client_12.xsd"; // NOI18N + private static final String APPCLIENT_12= JAKARTAEE_NS+"/"+APPCLIENT_12_XSD; // NOI18N + public static final String APPCLIENT_12_ID = "SCHEMA:"+APPCLIENT_12; // NOI18N private static final String WEBSERVICES_TAG="webservices"; //NOI18N private static final String WEBSERVICES_1_1_XSD="j2ee_web_services_1_1.xsd"; // NOI18N @@ -683,6 +701,18 @@ public String getShortDescription() { private static final String WEBFRAGMENT_6_1_XSD="web-fragment_6_1.xsd"; // NOI18N private static final String WEBFRAGMENT_6_1 = JAKARTAEE_NS+"/"+WEBFRAGMENT_6_1_XSD; // NOI18N public static final String WEBFRAGMENT_6_1_ID = "SCHEMA:"+WEBFRAGMENT_6_1; // NOI18N + + private static final String WEBAPP_6_2_XSD="web-app_6_2.xsd"; // NOI18N + private static final String WEBAPP_6_2 = JAKARTAEE_NS+"/"+WEBAPP_6_2_XSD; // NOI18N + public static final String WEBAPP_6_2_ID = "SCHEMA:"+WEBAPP_6_2; // NOI18N + + private static final String WEBCOMMON_6_2_XSD="web-common_6_2.xsd"; // NOI18N + private static final String WEBCOMMON_6_2 = JAKARTAEE_NS+"/"+WEBCOMMON_6_2_XSD; // NOI18N + public static final String WEBCOMMON_6_2_ID = "SCHEMA:"+WEBCOMMON_6_2; // NOI18N + + private static final String WEBFRAGMENT_6_2_XSD="web-fragment_6_2.xsd"; // NOI18N + private static final String WEBFRAGMENT_6_2 = JAKARTAEE_NS+"/"+WEBFRAGMENT_6_2_XSD; // NOI18N + public static final String WEBFRAGMENT_6_2_ID = "SCHEMA:"+WEBFRAGMENT_6_2; // NOI18N public static final String PERSISTENCE_NS = "http://java.sun.com/xml/ns/persistence"; // NOI18N public static final String NEW_PERSISTENCE_NS = "http://xmlns.jcp.org/xml/ns/persistence"; // NOI18N @@ -716,6 +746,10 @@ public String getShortDescription() { private static final String PERSISTENCE_3_2_XSD="persistence_3_2.xsd"; // NOI18N private static final String PERSISTENCE_3_2 = JAKARTA_PERSISTENCE_NS+"/"+PERSISTENCE_3_2_XSD; // NOI18N public static final String PERSISTENCE_3_2_ID = "SCHEMA:"+PERSISTENCE_3_2; // NOI18N + + private static final String PERSISTENCE_4_0_XSD="persistence_4_0.xsd"; // NOI18N + private static final String PERSISTENCE_4_0 = JAKARTA_PERSISTENCE_NS+"/"+PERSISTENCE_4_0_XSD; // NOI18N + public static final String PERSISTENCE_4_0_ID = "SCHEMA:"+PERSISTENCE_4_0; // NOI18N public static final String PERSISTENCEORM_NS = "http://java.sun.com/xml/ns/persistence/orm"; // NOI18N public static final String NEW_PERSISTENCEORM_NS = "http://xmlns.jcp.org/xml/ns/persistence/orm"; // NOI18N @@ -749,15 +783,20 @@ public String getShortDescription() { private static final String PERSISTENCEORM_3_2_XSD="orm_3_2.xsd"; // NOI18N private static final String PERSISTENCEORM_3_2 = JAKARTA_PERSISTENCEORM_NS+"/"+PERSISTENCEORM_3_2_XSD; // NOI18N yes not ORM NS!!! public static final String PERSISTENCEORM_3_2_ID = "SCHEMA:"+PERSISTENCEORM_3_2; // NOI18N + + private static final String PERSISTENCEORM_4_0_XSD="orm_4_0.xsd"; // NOI18N + private static final String PERSISTENCEORM_4_0 = JAKARTA_PERSISTENCEORM_NS+"/"+PERSISTENCEORM_4_0_XSD; // NOI18N yes not ORM NS!!! + public static final String PERSISTENCEORM_4_0_ID = "SCHEMA:"+PERSISTENCEORM_4_0; // NOI18N private static final String[] SUPPORTED_SCHEMAS = new String[]{ // ejb - EJBJAR_2_1_XSD, EJBJAR_3_0_XSD, EJBJAR_3_1_XSD, EJBJAR_3_2_XSD, EJBJAR_4_0_XSD, + EJBJAR_2_1_XSD, EJBJAR_3_0_XSD, EJBJAR_3_1_XSD, EJBJAR_3_2_XSD, EJBJAR_4_0_XSD, EJBJAR_4_1_XSD, // application & application-client APP_1_4_XSD, APPCLIENT_1_4_XSD, APP_5_XSD, APPCLIENT_5_XSD, APP_6_XSD, APPCLIENT_6_XSD, APP_7_XSD, APPCLIENT_7_XSD, APP_8_XSD, APPCLIENT_8_XSD, APP_9_XSD, APPCLIENT_9_XSD, APP_10_XSD, APPCLIENT_10_XSD, APP_11_XSD, APPCLIENT_11_XSD, + APP_12_XSD, APPCLIENT_12_XSD, //web-app, web-common & web-fragment WEBAPP_2_5_XSD, WEBAPP_3_0_XSD, WEBFRAGMENT_3_0_XSD, WEBCOMMON_3_0_XSD, @@ -766,6 +805,7 @@ public String getShortDescription() { WEBAPP_5_0_XSD, WEBFRAGMENT_5_0_XSD, WEBCOMMON_5_0_XSD, WEBAPP_6_0_XSD, WEBFRAGMENT_6_0_XSD, WEBCOMMON_6_0_XSD, WEBAPP_6_1_XSD, WEBFRAGMENT_6_1_XSD, WEBCOMMON_6_1_XSD, + WEBAPP_6_2_XSD, WEBFRAGMENT_6_2_XSD, WEBCOMMON_6_2_XSD, //persistence & orm PERSISTENCE_XSD, PERSISTENCEORM_XSD, PERSISTENCE_2_0_XSD, PERSISTENCEORM_2_0_XSD, @@ -774,6 +814,7 @@ public String getShortDescription() { PERSISTENCE_3_0_XSD, PERSISTENCEORM_3_0_XSD, PERSISTENCE_3_1_XSD, PERSISTENCEORM_3_1_XSD, PERSISTENCE_3_2_XSD, PERSISTENCEORM_3_2_XSD, + PERSISTENCE_4_0_XSD, PERSISTENCEORM_4_0_XSD, //webservice & webservice-client WEBSERVICES_1_1_XSD, WEBSERVICES_CLIENT_1_1_XSD, WEBSERVICES_1_2_XSD, WEBSERVICES_CLIENT_1_2_XSD, @@ -846,7 +887,7 @@ public InputSource resolveEntity(String publicId, String systemId) throws SAXExc } @Override - public Enumeration enabled(GrammarEnvironment ctx) { + public Enumeration enabled(GrammarEnvironment ctx) { if (ctx.getFileObject() == null) return null; Enumeration en = ctx.getDocumentChildren(); while (en.hasMoreElements()) { @@ -908,6 +949,9 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { return null; } switch (mimeType) { + case "text/x-dd-ejbjar4.1": // NOI18N + inputSource = resolver.resolveEntity(EJBJAR_4_1_ID, ""); + break; case "text/x-dd-ejbjar4.0": // NOI18N inputSource = resolver.resolveEntity(EJBJAR_4_0_ID, ""); break; @@ -923,6 +967,9 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { case "text/x-dd-ejbjar2.1": // NOI18N inputSource = resolver.resolveEntity(EJBJAR_2_1_ID, ""); break; + case "text/x-dd-application12.0": // NOI18N + inputSource = resolver.resolveEntity(APP_12_ID, ""); + break; case "text/x-dd-application11.0": // NOI18N inputSource = resolver.resolveEntity(APP_11_ID, ""); break; @@ -947,6 +994,9 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { case "text/x-dd-application1.4": // NOI18N inputSource = resolver.resolveEntity(APP_1_4_ID, ""); break; + case "text/x-dd-client12.0": // NOI18N + inputSource = resolver.resolveEntity(APPCLIENT_12_ID, ""); + break; case "text/x-dd-client11.0": // NOI18N inputSource = resolver.resolveEntity(APPCLIENT_11_ID, ""); break; @@ -971,6 +1021,9 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { case "text/x-dd-client1.4": // NOI18N inputSource = resolver.resolveEntity(APPCLIENT_1_4_ID, ""); break; + case "text/x-dd-servlet6.2": // NOI18N + inputSource = resolver.resolveEntity(WEBAPP_6_2_ID, ""); + break; case "text/x-dd-servlet6.1": // NOI18N inputSource = resolver.resolveEntity(WEBAPP_6_1_ID, ""); break; @@ -992,6 +1045,9 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { case "text/x-dd-servlet2.5": // NOI18N inputSource = resolver.resolveEntity(WEBAPP_2_5_ID, ""); break; + case "text/x-dd-servlet-fragment6.2": // NOI18N + inputSource = resolver.resolveEntity(WEBFRAGMENT_6_2_ID, ""); + break; case "text/x-dd-servlet-fragment6.1": // NOI18N inputSource = resolver.resolveEntity(WEBFRAGMENT_6_1_ID, ""); break; @@ -1010,6 +1066,9 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { case "text/x-dd-servlet-fragment3.0": // NOI18N inputSource = resolver.resolveEntity(WEBFRAGMENT_3_0_ID, ""); break; + case "text/x-persistence4.0": // NOI18N + inputSource = resolver.resolveEntity(PERSISTENCE_4_0_ID, ""); + break; case "text/x-persistence3.2": // NOI18N inputSource = resolver.resolveEntity(PERSISTENCE_3_2_ID, ""); break; @@ -1031,6 +1090,9 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { case "text/x-persistence1.0": // NOI18N inputSource = resolver.resolveEntity(PERSISTENCE_ID, ""); break; + case "text/x-orm4.0": // NOI18N + inputSource = resolver.resolveEntity(PERSISTENCEORM_4_0_ID, ""); + break; case "text/x-orm3.2": // NOI18N inputSource = resolver.resolveEntity(PERSISTENCEORM_3_2_ID, ""); break; diff --git a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/layer.xml b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/layer.xml index 8e55afc6fcd9..433c113e09fd 100644 --- a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/layer.xml +++ b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/layer.xml @@ -529,6 +529,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/nbdepjakartaee12.xml b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/nbdepjakartaee12.xml new file mode 100644 index 000000000000..9a57c448a528 --- /dev/null +++ b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/nbdepjakartaee12.xml @@ -0,0 +1,54 @@ + + + + org/netbeans/modules/glassfish/common/resources/server + + + deployer:gfv900ee12 + + + + + / + contextRoot + + + \ No newline at end of file diff --git a/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/data/GlassFishVersion.java b/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/data/GlassFishVersion.java index 93b3b2488500..7bcdce7b40e3 100644 --- a/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/data/GlassFishVersion.java +++ b/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/data/GlassFishVersion.java @@ -149,7 +149,9 @@ public enum GlassFishVersion { /** GlassFish 7.1.0 */ GF_7_1_0 ((short) 7, (short) 1, (short) 0, (short) 0, GlassFishVersion.GF_7_1_0_STR), /** GlassFish 8.0.0 */ - GF_8_0_0 ((short) 8, (short) 0, (short) 0, (short) 0, GlassFishVersion.GF_8_0_0_STR); + GF_8_0_0 ((short) 8, (short) 0, (short) 0, (short) 0, GlassFishVersion.GF_8_0_0_STR), + /** GlassFish 9.0.0 */ + GF_9_0_0 ((short) 9, (short) 0, (short) 0, (short) 0, GlassFishVersion.GF_9_0_0_STR); // Class attributes // /** GlassFish version enumeration length. */ public static final int length = GlassFishVersion.values().length; @@ -436,6 +438,11 @@ public enum GlassFishVersion { static final String GF_8_0_0_STR = "8.0.0"; /** Additional {@code String} representations of GF_8_0_0 value. */ static final String GF_8_0_0_STR_NEXT[] = {"8.0.0", "8.0.0.0"}; + + /** A {@code String} representation of GF_9_0_0 value. */ + static final String GF_9_0_0_STR = "9.0.0"; + /** Additional {@code String} representations of GF_9_0_0 value. */ + static final String GF_9_0_0_STR_NEXT[] = {"9.0.0", "9.0.0.0"}; /** * Stored String values for backward String @@ -501,6 +508,7 @@ public enum GlassFishVersion { initStringValuesMapFromArray(GF_7_0_25, GF_7_0_25_STR_NEXT); initStringValuesMapFromArray(GF_7_1_0, GF_7_1_0_STR_NEXT); initStringValuesMapFromArray(GF_8_0_0, GF_8_0_0_STR_NEXT); + initStringValuesMapFromArray(GF_9_0_0, GF_9_0_0_STR_NEXT); } // Static methods // diff --git a/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/ConfigBuilderProvider.java b/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/ConfigBuilderProvider.java index c0f8cafe85a6..e4b4f1eafbba 100644 --- a/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/ConfigBuilderProvider.java +++ b/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/ConfigBuilderProvider.java @@ -250,6 +250,11 @@ public class ConfigBuilderProvider { private static final Config.Next CONFIG_V8_0_0 = new Config.Next(GlassFishVersion.GF_8_0_0, ConfigBuilderProvider.class.getResource("GlassFishV8_0_0.xml")); + + /** Library builder configuration since GlassFish 9.0.0. */ + private static final Config.Next CONFIG_V9_0_0 + = new Config.Next(GlassFishVersion.GF_9_0_0, + ConfigBuilderProvider.class.getResource("GlassFishV9_0_0.xml")); /** Library builder configuration for GlassFish cloud. */ private static final Config config @@ -266,7 +271,7 @@ public class ConfigBuilderProvider { CONFIG_V7_0_18, CONFIG_V7_0_19, CONFIG_V7_0_20, CONFIG_V7_0_21, CONFIG_V7_0_22, CONFIG_V7_0_23, CONFIG_V7_0_24, CONFIG_V7_0_25, CONFIG_V7_1_0, - CONFIG_V8_0_0); + CONFIG_V8_0_0, CONFIG_V9_0_0); /** Builders array for each server instance. */ private static final ConcurrentMap builders diff --git a/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/GlassFishV9_0_0.xml b/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/GlassFishV9_0_0.xml new file mode 100644 index 000000000000..02c96289513a --- /dev/null +++ b/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/GlassFishV9_0_0.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/JavaEEProfile.java b/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/JavaEEProfile.java index f97f4371dd61..486e86e6a80f 100644 --- a/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/JavaEEProfile.java +++ b/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/JavaEEProfile.java @@ -87,7 +87,13 @@ public enum JavaEEProfile { v11_0_0_web(Version.v11_0_0, Type.WEB, "11.0.0-web"), /** JakartaEE 11 full profile. */ - v11_0_0(Version.v11_0_0, Type.FULL, "11.0.0"); + v11_0_0(Version.v11_0_0, Type.FULL, "11.0.0"), + + /** JakartaEE 12 web profile. */ + v12_0_0_web(Version.v12_0_0, Type.WEB, "12.0.0-web"), + + /** JakartaEE 11 full profile. */ + v12_0_0(Version.v12_0_0, Type.FULL, "12.0.0"); // Inner enums // /** JavaEE profile type. */ @@ -146,7 +152,9 @@ public enum Version { /** JakartaEE 10 */ v10_0_0("10.0.0"), /** JakartaEE 11 */ - v11_0_0("11.0.0"); + v11_0_0("11.0.0"), + /** JakartaEE 12 */ + v12_0_0("12.0.0"); /** JavaEE profile type name. */ private final String name; diff --git a/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/JavaSEPlatform.java b/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/JavaSEPlatform.java index 7ae41df0d4a4..e4bad245f1b7 100644 --- a/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/JavaSEPlatform.java +++ b/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/JavaSEPlatform.java @@ -76,7 +76,9 @@ public enum JavaSEPlatform { /** JavaSE 25. */ v25, /** JavaSE 26. */ - v26; + v26, + /** JavaSE 27. */ + v27; // Class attributes // /** GlassFish JavaEE platform enumeration length. */ @@ -90,7 +92,7 @@ public enum JavaSEPlatform { * conversion. */ private static final Map stringValuesMap - = new HashMap<>(values().length); + = new HashMap<>(64); // Initialize backward String conversion Map. static { diff --git a/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/ModuleType.java b/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/ModuleType.java index a7d50c6ce319..37c0cd95cb53 100644 --- a/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/ModuleType.java +++ b/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/ModuleType.java @@ -64,7 +64,7 @@ public enum ModuleType { * conversion. */ private static final Map stringValuesMap - = new HashMap<>(2 * values().length); + = new HashMap<>(8); // Initialize backward String conversion Map. static { diff --git a/enterprise/glassfish.tooling/test/unit/src/org/netbeans/modules/glassfish/tooling/data/GlassFishVersionTest.java b/enterprise/glassfish.tooling/test/unit/src/org/netbeans/modules/glassfish/tooling/data/GlassFishVersionTest.java index 27573e844e8d..493e1547b57b 100644 --- a/enterprise/glassfish.tooling/test/unit/src/org/netbeans/modules/glassfish/tooling/data/GlassFishVersionTest.java +++ b/enterprise/glassfish.tooling/test/unit/src/org/netbeans/modules/glassfish/tooling/data/GlassFishVersionTest.java @@ -147,6 +147,8 @@ public void testToValue() { GlassFishVersion.GF_7_1_0_STR_NEXT); verifyToValueFromAdditionalArray(GlassFishVersion.GF_8_0_0, GlassFishVersion.GF_8_0_0_STR_NEXT); + verifyToValueFromAdditionalArray(GlassFishVersion.GF_9_0_0, + GlassFishVersion.GF_9_0_0_STR_NEXT); } /** @@ -181,7 +183,8 @@ public void testToValueIncomplete() { GlassFishVersion.GF_7_0_20, GlassFishVersion.GF_7_0_21, GlassFishVersion.GF_7_0_22, GlassFishVersion.GF_7_0_23, GlassFishVersion.GF_7_0_24, GlassFishVersion.GF_7_0_25, - GlassFishVersion.GF_7_1_0, GlassFishVersion.GF_8_0_0 + GlassFishVersion.GF_7_1_0, GlassFishVersion.GF_8_0_0, + GlassFishVersion.GF_9_0_0 }; String strings[] = { "1.0.1.4", "2.0.1.5", "2.1.0.3", "2.1.1.7", @@ -197,7 +200,7 @@ public void testToValueIncomplete() { "7.0.14.0", "7.0.15.0", "7.0.16.0", "7.0.17.0", "7.0.18.0", "7.0.19.0", "7.0.20.0", "7.0.21.0", "7.0.22.0", "7.0.23.0", "7.0.24.0", "7.0.25.0", - "7.1.0.0", "8.0.0.0" + "7.1.0.0", "8.0.0.0", "9.0.0.0" }; for (int i = 0; i < versions.length; i++) { GlassFishVersion version = GlassFishVersion.toValue(strings[i]); diff --git a/enterprise/glassfish.tooling/test/unit/src/org/netbeans/modules/glassfish/tooling/utils/EnumUtilsTest.java b/enterprise/glassfish.tooling/test/unit/src/org/netbeans/modules/glassfish/tooling/utils/EnumUtilsTest.java index 34a27b3ee9ca..d6ca755cd60e 100644 --- a/enterprise/glassfish.tooling/test/unit/src/org/netbeans/modules/glassfish/tooling/utils/EnumUtilsTest.java +++ b/enterprise/glassfish.tooling/test/unit/src/org/netbeans/modules/glassfish/tooling/utils/EnumUtilsTest.java @@ -23,6 +23,7 @@ import static org.netbeans.modules.glassfish.tooling.data.GlassFishVersion.GF_6_2_5; import static org.netbeans.modules.glassfish.tooling.data.GlassFishVersion.GF_7_1_0; import static org.netbeans.modules.glassfish.tooling.data.GlassFishVersion.GF_8_0_0; +import static org.netbeans.modules.glassfish.tooling.data.GlassFishVersion.GF_9_0_0; import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertTrue; import org.testng.annotations.Test; @@ -48,6 +49,8 @@ public class EnumUtilsTest { */ @Test public void testEq() { + assertFalse(EnumUtils.eq(GF_9_0_0, GF_8_0_0), "Equals for a > b shall be false."); + assertTrue(EnumUtils.eq(GF_9_0_0, GF_9_0_0), "Equals for a == b shall be true."); assertFalse(EnumUtils.eq(GF_8_0_0, GF_7_1_0), "Equals for a > b shall be false."); assertTrue(EnumUtils.eq(GF_8_0_0, GF_8_0_0), "Equals for a == b shall be true."); assertFalse(EnumUtils.eq(GF_7_1_0, GF_6_2_5), "Equals for a > b shall be false."); @@ -72,6 +75,8 @@ public void testEq() { */ @Test public void testNe() { + assertTrue(EnumUtils.ne(GF_9_0_0, GF_8_0_0), "Not equals for a > b shall be true."); + assertFalse(EnumUtils.ne(GF_9_0_0, GF_9_0_0), "Not equals for a == b shall be false."); assertTrue(EnumUtils.ne(GF_8_0_0, GF_7_1_0), "Not equals for a > b shall be true."); assertFalse(EnumUtils.ne(GF_8_0_0, GF_8_0_0), "Not equals for a == b shall be false."); assertTrue(EnumUtils.ne(GF_7_1_0, GF_6_2_5), "Not equals for a > b shall be true."); @@ -96,6 +101,8 @@ public void testNe() { */ @Test public void testLt() { + assertFalse(EnumUtils.lt(GF_9_0_0, GF_8_0_0), "Less than for a > b shall be false."); + assertFalse(EnumUtils.lt(GF_9_0_0, GF_9_0_0), "Less than for a == b shall be false."); assertFalse(EnumUtils.lt(GF_8_0_0, GF_7_1_0), "Less than for a > b shall be false."); assertFalse(EnumUtils.lt(GF_8_0_0, GF_8_0_0), "Less than for a == b shall be false."); assertFalse(EnumUtils.lt(GF_7_1_0, GF_6_2_5), "Less than for a > b shall be false."); @@ -120,6 +127,8 @@ public void testLt() { */ @Test public void testLe() { + assertFalse(EnumUtils.le(GF_9_0_0, GF_8_0_0), "Less than or equal for a > b shall be false."); + assertTrue(EnumUtils.le(GF_9_0_0, GF_9_0_0), "Less than or equal for a == b shall be true."); assertFalse(EnumUtils.le(GF_8_0_0, GF_7_1_0), "Less than or equal for a > b shall be false."); assertTrue(EnumUtils.le(GF_8_0_0, GF_8_0_0), "Less than or equal for a == b shall be true."); assertFalse(EnumUtils.le(GF_7_1_0, GF_6_2_5), "Less than or equal for a > b shall be false."); @@ -144,6 +153,8 @@ public void testLe() { */ @Test public void testGt() { + assertTrue(EnumUtils.gt(GF_9_0_0, GF_8_0_0), "Greater than for a > b shall be true."); + assertFalse(EnumUtils.gt(GF_9_0_0, GF_9_0_0), "Greater than for a == b shall be false."); assertTrue(EnumUtils.gt(GF_8_0_0, GF_7_1_0), "Greater than for a > b shall be true."); assertFalse(EnumUtils.gt(GF_8_0_0, GF_8_0_0), "Greater than for a == b shall be false."); assertTrue(EnumUtils.gt(GF_7_1_0, GF_6_2_5), "Greater than for a > b shall be true."); @@ -168,6 +179,8 @@ public void testGt() { */ @Test public void testGe() { + assertTrue(EnumUtils.ge(GF_9_0_0, GF_8_0_0), "Greater than or equal for a > b shall be true."); + assertTrue(EnumUtils.ge(GF_9_0_0, GF_9_0_0), "Greater than or equal for a == b shall be true."); assertTrue(EnumUtils.ge(GF_8_0_0, GF_7_1_0), "Greater than or equal for a > b shall be true."); assertTrue(EnumUtils.ge(GF_8_0_0, GF_8_0_0), "Greater than or equal for a == b shall be true."); assertTrue(EnumUtils.ge(GF_7_1_0, GF_6_2_5), "Greater than or equal for a > b shall be true."); diff --git a/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/GradleJavaEEProjectSettings.java b/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/GradleJavaEEProjectSettings.java index fc9c65609541..9a543e2d0d32 100644 --- a/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/GradleJavaEEProjectSettings.java +++ b/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/GradleJavaEEProjectSettings.java @@ -55,6 +55,8 @@ public class GradleJavaEEProjectSettings implements JavaEEProjectSettingsImpleme static final Map PROFILE_DEPENDENCIES = new LinkedHashMap<>(); static { + PROFILE_DEPENDENCIES.put("jakarta.platform:jakarta.jakartaee-api:12.*", JAKARTA_EE_12_FULL); + PROFILE_DEPENDENCIES.put("jakarta.platform:jakarta.jakartaee-web-api:12.*", JAKARTA_EE_12_WEB); PROFILE_DEPENDENCIES.put("jakarta.platform:jakarta.jakartaee-api:11.*", JAKARTA_EE_11_FULL); PROFILE_DEPENDENCIES.put("jakarta.platform:jakarta.jakartaee-web-api:11.*", JAKARTA_EE_11_WEB); PROFILE_DEPENDENCIES.put("jakarta.platform:jakarta.jakartaee-api:10.*", JAKARTA_EE_10_FULL); diff --git a/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/web/newproject/ServerSelectionPanelVisual.java b/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/web/newproject/ServerSelectionPanelVisual.java index ecbfba272074..656766f333ca 100644 --- a/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/web/newproject/ServerSelectionPanelVisual.java +++ b/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/web/newproject/ServerSelectionPanelVisual.java @@ -154,17 +154,11 @@ private void cbServerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRS Set availableProfiles = new TreeSet<>(Profile.UI_COMPARATOR); for (Profile profile : platform.getSupportedProfiles(type)) { if (type == J2eeModule.Type.WAR) { - if (profile == Profile.JAVA_EE_6_FULL || profile == Profile.JAVA_EE_7_FULL - || profile == Profile.JAVA_EE_8_FULL || profile == Profile.JAKARTA_EE_8_FULL - || profile == Profile.JAKARTA_EE_9_FULL || profile == Profile.JAKARTA_EE_9_1_FULL - || profile == Profile.JAKARTA_EE_10_FULL || profile == Profile.JAKARTA_EE_11_FULL) { + if (profile.isFullProfile()) { continue; } } else { - if (profile == Profile.JAVA_EE_6_WEB || profile == Profile.JAVA_EE_7_WEB - || profile == Profile.JAVA_EE_8_WEB || profile == Profile.JAKARTA_EE_8_WEB - || profile == Profile.JAKARTA_EE_9_WEB || profile == Profile.JAKARTA_EE_9_1_WEB - || profile == Profile.JAKARTA_EE_10_WEB || profile == Profile.JAKARTA_EE_11_WEB) { + if (profile.isWebProfile()) { continue; } } diff --git a/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/web/newproject/WebApplicationProjectWizard.java b/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/web/newproject/WebApplicationProjectWizard.java index c02263e1cad2..0fa29cfa9afc 100644 --- a/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/web/newproject/WebApplicationProjectWizard.java +++ b/enterprise/gradle.javaee/src/org/netbeans/modules/gradle/javaee/web/newproject/WebApplicationProjectWizard.java @@ -109,6 +109,12 @@ public String getLicensePath() { private static List webDependencies(String profileId) { Profile profile = Profile.fromPropertiesString(profileId); List ret = new LinkedList<>(); + if (profile == Profile.JAKARTA_EE_12_WEB) { + ret.add("providedCompile 'jakarta.platform:jakarta.jakartaee-web-api:12.0.0'"); + } + if (profile == Profile.JAKARTA_EE_12_FULL) { + ret.add("providedCompile 'jakarta.platform:jakarta.jakartaee-api:12.0.0'"); + } if (profile == Profile.JAKARTA_EE_11_WEB) { ret.add("providedCompile 'jakarta.platform:jakarta.jakartaee-web-api:11.0.0'"); } diff --git a/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/AppClientProvider.java b/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/AppClientProvider.java index 2aea1b1edc1f..c76bab30ca3c 100644 --- a/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/AppClientProvider.java +++ b/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/AppClientProvider.java @@ -167,7 +167,7 @@ public File[] getRequiredLibraries() { ClassPath cp = ClassPathFactory.createClassPath( ProjectClassPathSupport.createPropertyBasedClassPathImplementation( FileUtil.toFile(project.getProjectDirectory()), project.evaluator(), new String[]{"javac.classpath"})); - List files = new ArrayList(); + List files = new ArrayList<>(); for (FileObject fo : cp.getRoots()) { if (FileUtil.getArchiveFile(fo) == null) { continue; @@ -352,6 +352,9 @@ public String getModuleVersion() { return AppClient.VERSION_6_0; } switch (p) { + case JAKARTA_EE_12_FULL: + case JAKARTA_EE_12_WEB: + return AppClient.VERSION_12_0; case JAKARTA_EE_11_FULL: case JAKARTA_EE_11_WEB: return AppClient.VERSION_11_0; diff --git a/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/api/AppClientProjectGenerator.java b/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/api/AppClientProjectGenerator.java index ccebb909b204..312d46c3387f 100644 --- a/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/api/AppClientProjectGenerator.java +++ b/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/api/AppClientProjectGenerator.java @@ -164,6 +164,10 @@ private static AntProjectHelper createProjectImpl(final AppClientProjectCreateDa resource = "org-netbeans-modules-j2ee-clientproject/application-client-6.xml"; // NOI18N } else { switch (j2eeProfile) { + case JAKARTA_EE_12_FULL: + case JAKARTA_EE_12_WEB: + resource = "org-netbeans-modules-j2ee-clientproject/application-client-12.xml"; // NOI18N + break; case JAKARTA_EE_11_FULL: case JAKARTA_EE_11_WEB: resource = "org-netbeans-modules-j2ee-clientproject/application-client-11.xml"; // NOI18N @@ -411,6 +415,10 @@ public Void run() throws Exception { resource = "org-netbeans-modules-j2ee-clientproject/application-client-6.xml"; // NOI18N } else { switch (j2eeProfile) { + case JAKARTA_EE_12_FULL: + case JAKARTA_EE_12_WEB: + resource = "org-netbeans-modules-j2ee-clientproject/application-client-12.xml"; // NOI18N + break; case JAKARTA_EE_11_FULL: case JAKARTA_EE_11_WEB: resource = "org-netbeans-modules-j2ee-clientproject/application-client-11.xml"; // NOI18N diff --git a/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/ui/customizer/AppClientProjectProperties.java b/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/ui/customizer/AppClientProjectProperties.java index 8c8f571a8943..b2ed127c1fd7 100644 --- a/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/ui/customizer/AppClientProjectProperties.java +++ b/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/ui/customizer/AppClientProjectProperties.java @@ -263,14 +263,15 @@ public final class AppClientProjectProperties { public static final String JAVA_SOURCE_BASED = "java.source.based"; - private final List optionListeners = new CopyOnWriteArrayList(); + private final List optionListeners = new CopyOnWriteArrayList<>(); AppClientProject getProject() { return project; } /** Creates a new instance of J2SEUIProperties and initializes them */ - AppClientProjectProperties( AppClientProject project, UpdateHelper updateHelper, PropertyEvaluator evaluator, ReferenceHelper refHelper, GeneratedFilesHelper genFileHelper ) { + AppClientProjectProperties( AppClientProject project, UpdateHelper updateHelper, + PropertyEvaluator evaluator, ReferenceHelper refHelper, GeneratedFilesHelper genFileHelper ) { this.project = project; this.updateHelper = updateHelper; this.evaluator = evaluator; @@ -324,6 +325,9 @@ private void init() { SpecificationVersion minimalSourceLevel = null; Profile profile = Profile.fromPropertiesString(evaluator.getProperty(J2EE_PLATFORM)); switch (profile) { + case JAKARTA_EE_12_FULL: + minimalSourceLevel = new SpecificationVersion("21"); + break; case JAKARTA_EE_11_FULL: minimalSourceLevel = new SpecificationVersion("17"); break; diff --git a/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/ui/resources/layer.xml b/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/ui/resources/layer.xml index f94dd78e480b..88383a775900 100644 --- a/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/ui/resources/layer.xml +++ b/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/ui/resources/layer.xml @@ -57,6 +57,8 @@ + + diff --git a/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/wsclient/AppClientProjectJAXWSClientSupport.java b/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/wsclient/AppClientProjectJAXWSClientSupport.java index 6a09706ecd45..cba0435710ee 100644 --- a/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/wsclient/AppClientProjectJAXWSClientSupport.java +++ b/enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/wsclient/AppClientProjectJAXWSClientSupport.java @@ -23,7 +23,6 @@ import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; -import org.netbeans.api.j2ee.core.Profile; import org.netbeans.api.java.project.JavaProjectConstants; import org.netbeans.api.project.ProjectUtils; import org.netbeans.api.project.SourceGroup; @@ -115,6 +114,9 @@ protected String getProjectJavaEEVersion() { case JAKARTA_EE_11_WEB: case JAKARTA_EE_11_FULL: return JAKARTA_EE_VERSION_11; + case JAKARTA_EE_12_WEB: + case JAKARTA_EE_12_FULL: + return JAKARTA_EE_VERSION_12; case JAVA_EE_5: return JAVA_EE_VERSION_15; default: diff --git a/enterprise/j2ee.common/licenseinfo.xml b/enterprise/j2ee.common/licenseinfo.xml index 60333ee39d25..8ee9ecc941bf 100644 --- a/enterprise/j2ee.common/licenseinfo.xml +++ b/enterprise/j2ee.common/licenseinfo.xml @@ -29,11 +29,13 @@ src/org/netbeans/modules/j2ee/common/dd/resources/beans-3.0.xml src/org/netbeans/modules/j2ee/common/dd/resources/beans-4.0.xml src/org/netbeans/modules/j2ee/common/dd/resources/beans-4.1.xml + src/org/netbeans/modules/j2ee/common/dd/resources/beans-5.0.xml src/org/netbeans/modules/j2ee/common/dd/resources/constraint.xml src/org/netbeans/modules/j2ee/common/dd/resources/constraint-1.1.xml src/org/netbeans/modules/j2ee/common/dd/resources/constraint-2.0.xml src/org/netbeans/modules/j2ee/common/dd/resources/constraint-3.0.xml src/org/netbeans/modules/j2ee/common/dd/resources/constraint-3.1.xml + src/org/netbeans/modules/j2ee/common/dd/resources/constraint-4.0.xml src/org/netbeans/modules/j2ee/common/dd/resources/ear-1.3.xml src/org/netbeans/modules/j2ee/common/dd/resources/ear-1.4.xml src/org/netbeans/modules/j2ee/common/dd/resources/ear-5.xml @@ -43,11 +45,13 @@ src/org/netbeans/modules/j2ee/common/dd/resources/ear-9.xml src/org/netbeans/modules/j2ee/common/dd/resources/ear-10.xml src/org/netbeans/modules/j2ee/common/dd/resources/ear-11.xml + src/org/netbeans/modules/j2ee/common/dd/resources/ear-12.xml src/org/netbeans/modules/j2ee/common/dd/resources/validation.xml src/org/netbeans/modules/j2ee/common/dd/resources/validation-1.1.xml src/org/netbeans/modules/j2ee/common/dd/resources/validation-2.0.xml src/org/netbeans/modules/j2ee/common/dd/resources/validation-3.0.xml src/org/netbeans/modules/j2ee/common/dd/resources/validation-3.1.xml + src/org/netbeans/modules/j2ee/common/dd/resources/validation-4.0.xml src/org/netbeans/modules/j2ee/common/dd/resources/web-2.3.xml src/org/netbeans/modules/j2ee/common/dd/resources/web-2.4.xml src/org/netbeans/modules/j2ee/common/dd/resources/web-2.5.xml @@ -57,12 +61,14 @@ src/org/netbeans/modules/j2ee/common/dd/resources/web-5.0.xml src/org/netbeans/modules/j2ee/common/dd/resources/web-6.0.xml src/org/netbeans/modules/j2ee/common/dd/resources/web-6.1.xml + src/org/netbeans/modules/j2ee/common/dd/resources/web-6.2.xml src/org/netbeans/modules/j2ee/common/dd/resources/web-fragment-3.0.xml src/org/netbeans/modules/j2ee/common/dd/resources/web-fragment-3.1.xml src/org/netbeans/modules/j2ee/common/dd/resources/web-fragment-4.0.xml src/org/netbeans/modules/j2ee/common/dd/resources/web-fragment-5.0.xml src/org/netbeans/modules/j2ee/common/dd/resources/web-fragment-6.0.xml src/org/netbeans/modules/j2ee/common/dd/resources/web-fragment-6.1.xml + src/org/netbeans/modules/j2ee/common/dd/resources/web-fragment-6.2.xml test/unit/src/templates/Class.template test/unit/src/templates/Interface.template diff --git a/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/J2eeProjectCapabilities.java b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/J2eeProjectCapabilities.java index 6fdcfd672e2d..76df6e564fb6 100644 --- a/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/J2eeProjectCapabilities.java +++ b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/J2eeProjectCapabilities.java @@ -181,6 +181,34 @@ public boolean isEjb40LiteSupported() { return isEjb40Supported() || (J2eeModule.Type.WAR.equals(moduleType) && ee9Web); } + /** + * EJB 4.1 functionality is supported in EjbJar and Web project which is targeting + * full platform profile for Jakarta EE 12. + * + * @return {@code true} if the project is targeting full Jakarta EE 12 or newer platform + * @since 1.76 + */ + public boolean isEjb41Supported() { + J2eeModule.Type moduleType = provider.getJ2eeModule().getType(); + boolean ee12 = ejbJarProfile != null && ejbJarProfile.isFullProfile() && + ejbJarProfile.isAtLeast(Profile.JAKARTA_EE_12_FULL); + return ee12 && (J2eeModule.Type.EJB.equals(moduleType) || J2eeModule.Type.WAR.equals(moduleType)); + } + + /** + * EJB 4.1 Lite functionality is supported in Web projects targeting + * Jakarta EE 12 web profile, and wherever full EJB 4.1 is supported. + * + * @return {@code true} if the project is targeting full or web profile Jakarta EE 12 or newer platform + * @since 1.76 + */ + public boolean isEjb41LiteSupported() { + J2eeModule.Type moduleType = provider.getJ2eeModule().getType(); + boolean ee12 = ejbJarProfile != null && + ejbJarProfile.isAtLeast(Profile.JAKARTA_EE_12_WEB); + return isEjb41Supported() || (J2eeModule.Type.WAR.equals(moduleType) && ee12); + } + /** * Is CDI 1.0 supported in this project? * @return {@code true} if the project targets EE6 profile, {@code false} otherwise @@ -261,6 +289,18 @@ public boolean isCdi41Supported() { || Profile.JAKARTA_EE_11_WEB.equals(webProfile) || Profile.JAKARTA_EE_11_FULL.equals(carProfile); } + + /** + * Is CDI 5.0 supported in this project? + * + * @return {@code true} if the project targets Jakarta EE 12 profile, + * {@code false} otherwise + */ + public boolean isCdi50Supported() { + return Profile.JAKARTA_EE_12_FULL.equals(ejbJarProfile) + || Profile.JAKARTA_EE_12_WEB.equals(webProfile) + || Profile.JAKARTA_EE_12_FULL.equals(carProfile); + } /** * Returns true if the server used by project supports EJB lite. @@ -286,7 +326,7 @@ public boolean hasDefaultPersistenceProvider() { return false; } - Set profiles = new HashSet(platform.getSupportedProfiles(provider.getJ2eeModule().getType())); + Set profiles = new HashSet<>(platform.getSupportedProfiles(provider.getJ2eeModule().getType())); profiles.remove(Profile.J2EE_13); profiles.remove(Profile.J2EE_14); if (profiles.isEmpty()) { diff --git a/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/DDHelper.java b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/DDHelper.java index c59d22b16300..9d43ca067de1 100644 --- a/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/DDHelper.java +++ b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/DDHelper.java @@ -66,7 +66,9 @@ public static FileObject createWebXml(Profile j2eeProfile, FileObject dir) throw */ public static FileObject createWebXml(Profile j2eeProfile, boolean webXmlRequired, FileObject dir) throws IOException { String template = null; - if ((Profile.JAKARTA_EE_11_FULL == j2eeProfile || Profile.JAKARTA_EE_11_WEB == j2eeProfile) && webXmlRequired) { + if ((Profile.JAKARTA_EE_12_FULL == j2eeProfile || Profile.JAKARTA_EE_12_WEB == j2eeProfile) && webXmlRequired) { + template = "web-6.2.xml"; //NOI18N + } else if ((Profile.JAKARTA_EE_11_FULL == j2eeProfile || Profile.JAKARTA_EE_11_WEB == j2eeProfile) && webXmlRequired) { template = "web-6.1.xml"; //NOI18N } else if ((Profile.JAKARTA_EE_10_FULL == j2eeProfile || Profile.JAKARTA_EE_10_WEB == j2eeProfile) && webXmlRequired) { template = "web-6.0.xml"; //NOI18N @@ -87,15 +89,16 @@ public static FileObject createWebXml(Profile j2eeProfile, boolean webXmlRequire } else if (Profile.J2EE_13 == j2eeProfile) { template = "web-2.3.xml"; //NOI18N } - if (template == null) + if (template == null) { return null; - + } MakeFileCopy action = new MakeFileCopy(RESOURCE_FOLDER + template, dir, "web.xml"); FileUtil.runAtomicAction(action); - if (action.getException() != null) + if (action.getException() != null) { throw action.getException(); - else + } else { return action.getResult(); + } } /** @@ -107,30 +110,52 @@ public static FileObject createWebXml(Profile j2eeProfile, boolean webXmlRequire */ public static FileObject createWebFragmentXml(Profile j2eeProfile, FileObject dir) throws IOException { String template = null; - if (Profile.JAKARTA_EE_11_FULL == j2eeProfile || Profile.JAKARTA_EE_11_WEB == j2eeProfile) { - template = "web-fragment-6.1.xml"; //NOI18N - } else if (Profile.JAKARTA_EE_10_FULL == j2eeProfile || Profile.JAKARTA_EE_10_WEB == j2eeProfile) { - template = "web-fragment-6.0.xml"; //NOI18N - } else if (Profile.JAKARTA_EE_9_1_FULL == j2eeProfile || Profile.JAKARTA_EE_9_1_WEB == j2eeProfile || - Profile.JAKARTA_EE_9_FULL == j2eeProfile || Profile.JAKARTA_EE_9_WEB == j2eeProfile) { - template = "web-fragment-5.0.xml"; //NOI18N - } else if (Profile.JAKARTA_EE_8_FULL == j2eeProfile || Profile.JAKARTA_EE_8_WEB == j2eeProfile || - Profile.JAVA_EE_8_FULL == j2eeProfile || Profile.JAVA_EE_8_WEB == j2eeProfile) { - template = "web-fragment-4.0.xml"; //NOI18N - } else if (Profile.JAVA_EE_7_FULL == j2eeProfile || Profile.JAVA_EE_7_WEB == j2eeProfile) { - template = "web-fragment-3.1.xml"; //NOI18N - } else if (Profile.JAVA_EE_6_FULL == j2eeProfile || Profile.JAVA_EE_6_WEB == j2eeProfile) { - template = "web-fragment-3.0.xml"; //NOI18N + if (null != j2eeProfile) switch (j2eeProfile) { + case JAKARTA_EE_12_FULL: + case JAKARTA_EE_12_WEB: + template = "web-fragment-6.2.xml"; //NOI18N + break; + case JAKARTA_EE_11_FULL: + case JAKARTA_EE_11_WEB: + template = "web-fragment-6.1.xml"; //NOI18N + break; + case JAKARTA_EE_10_FULL: + case JAKARTA_EE_10_WEB: + template = "web-fragment-6.0.xml"; //NOI18N + break; + case JAKARTA_EE_9_1_FULL: + case JAKARTA_EE_9_1_WEB: + case JAKARTA_EE_9_FULL: + case JAKARTA_EE_9_WEB: + template = "web-fragment-5.0.xml"; //NOI18N + break; + case JAKARTA_EE_8_FULL: + case JAKARTA_EE_8_WEB: + case JAVA_EE_8_FULL: + case JAVA_EE_8_WEB: + template = "web-fragment-4.0.xml"; //NOI18N + break; + case JAVA_EE_7_FULL: + case JAVA_EE_7_WEB: + template = "web-fragment-3.1.xml"; //NOI18N + break; + case JAVA_EE_6_FULL: + case JAVA_EE_6_WEB: + template = "web-fragment-3.0.xml"; //NOI18N + break; + default: + break; } - if (template == null) + if (template == null) { return null; - + } MakeFileCopy action = new MakeFileCopy(RESOURCE_FOLDER + template, dir, "web-fragment.xml"); FileUtil.runAtomicAction(action); - if (action.getException() != null) + if (action.getException() != null) { throw action.getException(); - else + } else { return action.getResult(); + } } /** @@ -146,7 +171,7 @@ public static FileObject createBeansXml(Profile j2eeProfile, FileObject dir) thr } /** - * Creates beans.xml deployment descriptor. + * Creates beans.xml deployment descriptor (CDI). * @param j2eeProfile Java EE/Jakarta EE profile to specify which version of beans.xml should be created * @param dir Directory where beans.xml should be created * @param name name of configuration file to create; should be always "beans" for now @@ -156,31 +181,53 @@ public static FileObject createBeansXml(Profile j2eeProfile, FileObject dir) thr */ public static FileObject createBeansXml(Profile j2eeProfile, FileObject dir, String name) throws IOException { String template = null; - if (Profile.JAKARTA_EE_11_FULL == j2eeProfile || Profile.JAKARTA_EE_11_WEB == j2eeProfile) { - template = "beans-4.1.xml"; //NOI18N - } else if (Profile.JAKARTA_EE_10_FULL == j2eeProfile || Profile.JAKARTA_EE_10_WEB == j2eeProfile) { - template = "beans-4.0.xml"; //NOI18N - } else if (Profile.JAKARTA_EE_9_1_FULL == j2eeProfile || Profile.JAKARTA_EE_9_1_WEB == j2eeProfile || - Profile.JAKARTA_EE_9_FULL == j2eeProfile || Profile.JAKARTA_EE_9_WEB == j2eeProfile) { - template = "beans-3.0.xml"; //NOI18N - } else if (Profile.JAKARTA_EE_8_FULL == j2eeProfile || Profile.JAKARTA_EE_8_WEB == j2eeProfile || - Profile.JAVA_EE_8_FULL == j2eeProfile || Profile.JAVA_EE_8_WEB == j2eeProfile) { - template = "beans-2.0.xml"; //NOI18N - } else if (Profile.JAVA_EE_7_FULL == j2eeProfile || Profile.JAVA_EE_7_WEB == j2eeProfile) { - template = "beans-1.1.xml"; //NOI18N - } else if (Profile.JAVA_EE_6_FULL == j2eeProfile || Profile.JAVA_EE_6_WEB == j2eeProfile) { - template = "beans-1.0.xml"; //NOI18N + if (null != j2eeProfile) switch (j2eeProfile) { + case JAKARTA_EE_12_FULL: + case JAKARTA_EE_12_WEB: + template = "beans-5.0.xml"; //NOI18N + break; + case JAKARTA_EE_11_FULL: + case JAKARTA_EE_11_WEB: + template = "beans-4.1.xml"; //NOI18N + break; + case JAKARTA_EE_10_FULL: + case JAKARTA_EE_10_WEB: + template = "beans-4.0.xml"; //NOI18N + break; + case JAKARTA_EE_9_1_FULL: + case JAKARTA_EE_9_1_WEB: + case JAKARTA_EE_9_FULL: + case JAKARTA_EE_9_WEB: + template = "beans-3.0.xml"; //NOI18N + break; + case JAKARTA_EE_8_FULL: + case JAKARTA_EE_8_WEB: + case JAVA_EE_8_FULL: + case JAVA_EE_8_WEB: + template = "beans-2.0.xml"; //NOI18N + break; + case JAVA_EE_7_FULL: + case JAVA_EE_7_WEB: + template = "beans-1.1.xml"; //NOI18N + break; + case JAVA_EE_6_FULL: + case JAVA_EE_6_WEB: + template = "beans-1.0.xml"; //NOI18N + break; + default: + break; } - if (template == null) + if (template == null) { return null; - + } MakeFileCopy action = new MakeFileCopy(RESOURCE_FOLDER + template, dir, name+".xml"); FileUtil.runAtomicAction(action); - if (action.getException() != null) + if (action.getException() != null) { throw action.getException(); - else + } else { return action.getResult(); + } } /** @@ -206,29 +253,50 @@ public static FileObject createValidationXml(Profile j2eeProfile, FileObject dir */ public static FileObject createValidationXml(Profile j2eeProfile, FileObject dir, String name) throws IOException { String template = null; - if (Profile.JAVA_EE_6_FULL == j2eeProfile || Profile.JAVA_EE_6_WEB == j2eeProfile) { - template = "validation.xml"; //NOI18N - } else if (Profile.JAVA_EE_7_FULL == j2eeProfile || Profile.JAVA_EE_7_WEB == j2eeProfile) { - template = "validation-1.1.xml"; //NOI18N - } else if (Profile.JAVA_EE_8_FULL == j2eeProfile || Profile.JAVA_EE_8_WEB == j2eeProfile - || Profile.JAKARTA_EE_8_FULL == j2eeProfile || Profile.JAKARTA_EE_8_WEB == j2eeProfile) { - template = "validation-2.0.xml"; //NOI18N - } else if (Profile.JAKARTA_EE_9_FULL == j2eeProfile || Profile.JAKARTA_EE_9_WEB == j2eeProfile - || Profile.JAKARTA_EE_9_1_FULL == j2eeProfile || Profile.JAKARTA_EE_9_1_WEB == j2eeProfile - || Profile.JAKARTA_EE_10_FULL == j2eeProfile || Profile.JAKARTA_EE_10_WEB == j2eeProfile) { - template = "validation-3.0.xml"; //NOI18N - } else if (Profile.JAKARTA_EE_11_FULL == j2eeProfile || Profile.JAKARTA_EE_11_WEB == j2eeProfile) { - template = "validation-3.1.xml"; //NOI18N + if (null != j2eeProfile) switch (j2eeProfile) { + case JAVA_EE_6_FULL: + case JAVA_EE_6_WEB: + template = "validation.xml"; //NOI18N + break; + case JAVA_EE_7_FULL: + case JAVA_EE_7_WEB: + template = "validation-1.1.xml"; //NOI18N + break; + case JAVA_EE_8_FULL: + case JAVA_EE_8_WEB: + case JAKARTA_EE_8_FULL: + case JAKARTA_EE_8_WEB: + template = "validation-2.0.xml"; //NOI18N + break; + case JAKARTA_EE_9_FULL: + case JAKARTA_EE_9_WEB: + case JAKARTA_EE_9_1_FULL: + case JAKARTA_EE_9_1_WEB: + case JAKARTA_EE_10_FULL: + case JAKARTA_EE_10_WEB: + template = "validation-3.0.xml"; //NOI18N + break; + case JAKARTA_EE_11_FULL: + case JAKARTA_EE_11_WEB: + template = "validation-3.1.xml"; //NOI18N + break; + case JAKARTA_EE_12_FULL: + case JAKARTA_EE_12_WEB: + template = "validation-4.0.xml"; //NOI18N + break; + default: + break; } if (template == null) return null; MakeFileCopy action = new MakeFileCopy(RESOURCE_FOLDER + template, dir, name+".xml"); FileUtil.runAtomicAction(action); - if (action.getException() != null) + if (action.getException() != null) { throw action.getException(); - else + } else { return action.getResult(); + } } /** @@ -254,29 +322,50 @@ public static FileObject createConstraintXml(Profile j2eeProfile, FileObject dir */ public static FileObject createConstraintXml(Profile j2eeProfile, FileObject dir, String name) throws IOException { String template = null; - if (Profile.JAVA_EE_6_FULL == j2eeProfile || Profile.JAVA_EE_6_WEB == j2eeProfile) { - template = "constraint.xml"; //NOI18N - } else if (Profile.JAVA_EE_7_FULL == j2eeProfile || Profile.JAVA_EE_7_WEB == j2eeProfile) { - template = "constraint-1.1.xml"; //NOI18N - } else if (Profile.JAVA_EE_8_FULL == j2eeProfile || Profile.JAVA_EE_8_WEB == j2eeProfile - || Profile.JAKARTA_EE_8_FULL == j2eeProfile || Profile.JAKARTA_EE_8_WEB == j2eeProfile) { - template = "constraint-2.0.xml"; //NOI18N - } else if (Profile.JAKARTA_EE_9_FULL == j2eeProfile || Profile.JAKARTA_EE_9_WEB == j2eeProfile - || Profile.JAKARTA_EE_9_1_FULL == j2eeProfile || Profile.JAKARTA_EE_9_1_WEB == j2eeProfile - || Profile.JAKARTA_EE_10_FULL == j2eeProfile || Profile.JAKARTA_EE_10_WEB == j2eeProfile) { - template = "constraint-3.0.xml"; //NOI18N - } else if (Profile.JAKARTA_EE_11_FULL == j2eeProfile || Profile.JAKARTA_EE_11_WEB == j2eeProfile) { - template = "constraint-3.1.xml"; //NOI18N + if (null != j2eeProfile) switch (j2eeProfile) { + case JAVA_EE_6_FULL: + case JAVA_EE_6_WEB: + template = "constraint.xml"; //NOI18N + break; + case JAVA_EE_7_FULL: + case JAVA_EE_7_WEB: + template = "constraint-1.1.xml"; //NOI18N + break; + case JAVA_EE_8_FULL: + case JAVA_EE_8_WEB: + case JAKARTA_EE_8_FULL: + case JAKARTA_EE_8_WEB: + template = "constraint-2.0.xml"; //NOI18N + break; + case JAKARTA_EE_9_FULL: + case JAKARTA_EE_9_WEB: + case JAKARTA_EE_9_1_FULL: + case JAKARTA_EE_9_1_WEB: + case JAKARTA_EE_10_FULL: + case JAKARTA_EE_10_WEB: + template = "constraint-3.0.xml"; //NOI18N + break; + case JAKARTA_EE_11_FULL: + case JAKARTA_EE_11_WEB: + template = "constraint-3.1.xml"; //NOI18N + break; + case JAKARTA_EE_12_FULL: + case JAKARTA_EE_12_WEB: + template = "constraint-4.0.xml"; //NOI18N + break; + default: + break; } - if (template == null) + if (template == null) { return null; - + } MakeFileCopy action = new MakeFileCopy(RESOURCE_FOLDER + template, dir, name+".xml"); FileUtil.runAtomicAction(action); - if (action.getException() != null) + if (action.getException() != null) { throw action.getException(); - else + } else { return action.getResult(); + } } /** @@ -295,7 +384,9 @@ public static FileObject createApplicationXml(final Profile profile, final FileO boolean forceCreation) throws IOException { String template = null; - if (profile != null && profile.equals(Profile.JAKARTA_EE_11_FULL) && forceCreation) { + if (profile != null && profile.equals(Profile.JAKARTA_EE_12_FULL) && forceCreation) { + template = "ear-12.xml"; // NOI18N + } else if (profile != null && profile.equals(Profile.JAKARTA_EE_11_FULL) && forceCreation) { template = "ear-11.xml"; // NOI18N } else if (profile != null && profile.equals(Profile.JAKARTA_EE_10_FULL) && forceCreation) { template = "ear-10.xml"; // NOI18N diff --git a/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/beans-5.0.xml b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/beans-5.0.xml new file mode 100644 index 000000000000..2b5a4a4225d7 --- /dev/null +++ b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/beans-5.0.xml @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/constraint-4.0.xml b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/constraint-4.0.xml new file mode 100644 index 000000000000..357d467b519b --- /dev/null +++ b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/constraint-4.0.xml @@ -0,0 +1,10 @@ + + + + + diff --git a/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/ear-12.xml b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/ear-12.xml new file mode 100644 index 000000000000..dde5df25077a --- /dev/null +++ b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/ear-12.xml @@ -0,0 +1,7 @@ + + + + diff --git a/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/validation-4.0.xml b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/validation-4.0.xml new file mode 100644 index 000000000000..21a3a60338f2 --- /dev/null +++ b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/validation-4.0.xml @@ -0,0 +1,10 @@ + + + + + \ No newline at end of file diff --git a/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/web-6.2.xml b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/web-6.2.xml new file mode 100644 index 000000000000..75486704f337 --- /dev/null +++ b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/web-6.2.xml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/web-fragment-6.2.xml b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/web-fragment-6.2.xml new file mode 100644 index 000000000000..598ee53610b7 --- /dev/null +++ b/enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/resources/web-fragment-6.2.xml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/enterprise/j2ee.common/test/unit/src/org/netbeans/modules/j2ee/common/J2eeProjectCapabilitiesTest.java b/enterprise/j2ee.common/test/unit/src/org/netbeans/modules/j2ee/common/J2eeProjectCapabilitiesTest.java index eedb3c6bf08d..ea11ad55c503 100644 --- a/enterprise/j2ee.common/test/unit/src/org/netbeans/modules/j2ee/common/J2eeProjectCapabilitiesTest.java +++ b/enterprise/j2ee.common/test/unit/src/org/netbeans/modules/j2ee/common/J2eeProjectCapabilitiesTest.java @@ -60,6 +60,8 @@ public void testIsEjbSupported() throws Exception { assertFalse(cap.isEjb32LiteSupported()); assertFalse(cap.isEjb40Supported()); assertFalse(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); p = createProject(Profile.JAVA_EE_6_FULL, Type.EJB); cap = J2eeProjectCapabilities.forProject(p); @@ -70,6 +72,8 @@ public void testIsEjbSupported() throws Exception { assertFalse(cap.isEjb32LiteSupported()); assertFalse(cap.isEjb40Supported()); assertFalse(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); p = createProject(Profile.JAVA_EE_6_WEB, Type.EJB); cap = J2eeProjectCapabilities.forProject(p); @@ -80,6 +84,8 @@ public void testIsEjbSupported() throws Exception { assertFalse(cap.isEjb32LiteSupported()); assertFalse(cap.isEjb40Supported()); assertFalse(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); p = createProject(Profile.JAVA_EE_7_FULL, Type.EJB); cap = J2eeProjectCapabilities.forProject(p); @@ -90,6 +96,8 @@ public void testIsEjbSupported() throws Exception { assertTrue(cap.isEjb32LiteSupported()); assertFalse(cap.isEjb40Supported()); assertFalse(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); p = createProject(Profile.JAVA_EE_7_WEB, Type.EJB); cap = J2eeProjectCapabilities.forProject(p); @@ -100,6 +108,8 @@ public void testIsEjbSupported() throws Exception { // assertTrue(cap.isEjb32LiteSupported()); assertFalse(cap.isEjb40Supported()); assertFalse(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); p = createProject(Profile.JAVA_EE_8_FULL, Type.EJB); cap = J2eeProjectCapabilities.forProject(p); @@ -110,6 +120,8 @@ public void testIsEjbSupported() throws Exception { assertTrue(cap.isEjb32LiteSupported()); assertFalse(cap.isEjb40Supported()); assertFalse(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); p = createProject(Profile.JAVA_EE_8_WEB, Type.EJB); cap = J2eeProjectCapabilities.forProject(p); @@ -120,6 +132,8 @@ public void testIsEjbSupported() throws Exception { // assertTrue(cap.isEjb32LiteSupported()); assertFalse(cap.isEjb40Supported()); assertFalse(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); p = createProject(Profile.JAKARTA_EE_8_FULL, Type.EJB); cap = J2eeProjectCapabilities.forProject(p); @@ -130,6 +144,8 @@ public void testIsEjbSupported() throws Exception { assertTrue(cap.isEjb32LiteSupported()); assertFalse(cap.isEjb40Supported()); assertFalse(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); p = createProject(Profile.JAKARTA_EE_8_WEB, Type.EJB); cap = J2eeProjectCapabilities.forProject(p); @@ -140,6 +156,8 @@ public void testIsEjbSupported() throws Exception { // assertTrue(cap.isEjb32LiteSupported()); assertFalse(cap.isEjb40Supported()); assertFalse(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); p = createProject(Profile.JAKARTA_EE_9_FULL, Type.EJB); cap = J2eeProjectCapabilities.forProject(p); @@ -150,6 +168,9 @@ public void testIsEjbSupported() throws Exception { assertFalse(cap.isEjb32LiteSupported()); assertTrue(cap.isEjb40Supported()); assertTrue(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); + p = createProject(Profile.JAKARTA_EE_9_WEB, Type.EJB); cap = J2eeProjectCapabilities.forProject(p); @@ -160,6 +181,8 @@ public void testIsEjbSupported() throws Exception { assertFalse(cap.isEjb32LiteSupported()); assertFalse(cap.isEjb40Supported()); // assertTrue(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); p = createProject(Profile.JAKARTA_EE_9_1_FULL, Type.EJB); cap = J2eeProjectCapabilities.forProject(p); @@ -170,6 +193,8 @@ public void testIsEjbSupported() throws Exception { assertFalse(cap.isEjb32LiteSupported()); assertTrue(cap.isEjb40Supported()); assertTrue(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); p = createProject(Profile.JAKARTA_EE_9_1_WEB, Type.EJB); cap = J2eeProjectCapabilities.forProject(p); @@ -180,6 +205,8 @@ public void testIsEjbSupported() throws Exception { assertFalse(cap.isEjb32LiteSupported()); assertFalse(cap.isEjb40Supported()); // assertTrue(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); p = createProject(Profile.JAKARTA_EE_10_FULL, Type.EJB); cap = J2eeProjectCapabilities.forProject(p); @@ -190,6 +217,8 @@ public void testIsEjbSupported() throws Exception { assertFalse(cap.isEjb32LiteSupported()); assertTrue(cap.isEjb40Supported()); assertTrue(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); p = createProject(Profile.JAKARTA_EE_10_WEB, Type.EJB); cap = J2eeProjectCapabilities.forProject(p); @@ -200,7 +229,10 @@ public void testIsEjbSupported() throws Exception { assertFalse(cap.isEjb32LiteSupported()); assertFalse(cap.isEjb40Supported()); // assertTrue(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); + // Jakarta EE 11 p = createProject(Profile.JAKARTA_EE_11_FULL, Type.EJB); cap = J2eeProjectCapabilities.forProject(p); assertFalse(cap.isEjb30Supported()); @@ -210,6 +242,8 @@ public void testIsEjbSupported() throws Exception { assertFalse(cap.isEjb32LiteSupported()); assertTrue(cap.isEjb40Supported()); assertTrue(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); p = createProject(Profile.JAKARTA_EE_11_WEB, Type.EJB); cap = J2eeProjectCapabilities.forProject(p); @@ -220,7 +254,35 @@ public void testIsEjbSupported() throws Exception { assertFalse(cap.isEjb32LiteSupported()); assertFalse(cap.isEjb40Supported()); // assertTrue(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); + + // Jakarta EE 12 + p = createProject(Profile.JAKARTA_EE_12_FULL, Type.EJB); + cap = J2eeProjectCapabilities.forProject(p); + assertFalse(cap.isEjb30Supported()); + assertFalse(cap.isEjb31Supported()); + assertFalse(cap.isEjb31LiteSupported()); + assertFalse(cap.isEjb32Supported()); + assertFalse(cap.isEjb32LiteSupported()); + assertFalse(cap.isEjb40Supported()); + assertFalse(cap.isEjb40LiteSupported()); + assertTrue(cap.isEjb41Supported()); + assertTrue(cap.isEjb41LiteSupported()); + + p = createProject(Profile.JAKARTA_EE_12_WEB, Type.EJB); + cap = J2eeProjectCapabilities.forProject(p); + assertFalse(cap.isEjb30Supported()); + assertFalse(cap.isEjb31Supported()); + assertFalse(cap.isEjb31LiteSupported()); + assertFalse(cap.isEjb32Supported()); + assertFalse(cap.isEjb32LiteSupported()); + assertFalse(cap.isEjb40Supported()); +// assertTrue(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); + // WAR p = createProject(Profile.JAVA_EE_5, Type.WAR); cap = J2eeProjectCapabilities.forProject(p); assertFalse(cap.isEjb30Supported()); @@ -230,6 +292,8 @@ public void testIsEjbSupported() throws Exception { assertFalse(cap.isEjb32LiteSupported()); assertFalse(cap.isEjb40Supported()); assertFalse(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); p = createProject(Profile.JAVA_EE_6_WEB, Type.WAR); cap = J2eeProjectCapabilities.forProject(p); @@ -240,6 +304,8 @@ public void testIsEjbSupported() throws Exception { assertFalse(cap.isEjb32LiteSupported()); assertFalse(cap.isEjb40Supported()); assertFalse(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); p = createProject(Profile.JAVA_EE_6_FULL, Type.WAR); cap = J2eeProjectCapabilities.forProject(p); @@ -250,6 +316,8 @@ public void testIsEjbSupported() throws Exception { assertFalse(cap.isEjb32LiteSupported()); assertFalse(cap.isEjb40Supported()); assertFalse(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); p = createProject(Profile.JAVA_EE_7_FULL, Type.WAR); cap = J2eeProjectCapabilities.forProject(p); @@ -260,6 +328,8 @@ public void testIsEjbSupported() throws Exception { assertTrue(cap.isEjb32LiteSupported()); assertFalse(cap.isEjb40Supported()); assertFalse(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); p = createProject(Profile.JAVA_EE_7_WEB, Type.WAR); cap = J2eeProjectCapabilities.forProject(p); @@ -270,6 +340,8 @@ public void testIsEjbSupported() throws Exception { assertTrue(cap.isEjb32LiteSupported()); assertFalse(cap.isEjb40Supported()); assertFalse(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); p = createProject(Profile.JAVA_EE_8_FULL, Type.WAR); cap = J2eeProjectCapabilities.forProject(p); @@ -280,6 +352,8 @@ public void testIsEjbSupported() throws Exception { assertTrue(cap.isEjb32LiteSupported()); assertFalse(cap.isEjb40Supported()); assertFalse(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); p = createProject(Profile.JAVA_EE_8_WEB, Type.WAR); cap = J2eeProjectCapabilities.forProject(p); @@ -290,6 +364,8 @@ public void testIsEjbSupported() throws Exception { assertTrue(cap.isEjb32LiteSupported()); assertFalse(cap.isEjb40Supported()); assertFalse(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); p = createProject(Profile.JAKARTA_EE_8_FULL, Type.WAR); cap = J2eeProjectCapabilities.forProject(p); @@ -300,6 +376,8 @@ public void testIsEjbSupported() throws Exception { assertTrue(cap.isEjb32LiteSupported()); assertFalse(cap.isEjb40Supported()); assertFalse(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); p = createProject(Profile.JAKARTA_EE_8_WEB, Type.WAR); cap = J2eeProjectCapabilities.forProject(p); @@ -310,6 +388,8 @@ public void testIsEjbSupported() throws Exception { assertTrue(cap.isEjb32LiteSupported()); assertFalse(cap.isEjb40Supported()); assertFalse(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); p = createProject(Profile.JAKARTA_EE_9_FULL, Type.WAR); cap = J2eeProjectCapabilities.forProject(p); @@ -320,6 +400,8 @@ public void testIsEjbSupported() throws Exception { assertFalse(cap.isEjb32LiteSupported()); assertTrue(cap.isEjb40Supported()); assertTrue(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); p = createProject(Profile.JAKARTA_EE_9_WEB, Type.WAR); cap = J2eeProjectCapabilities.forProject(p); @@ -330,6 +412,8 @@ public void testIsEjbSupported() throws Exception { assertFalse(cap.isEjb32LiteSupported()); assertFalse(cap.isEjb40Supported()); assertTrue(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); p = createProject(Profile.JAKARTA_EE_9_1_FULL, Type.WAR); cap = J2eeProjectCapabilities.forProject(p); @@ -340,6 +424,8 @@ public void testIsEjbSupported() throws Exception { assertFalse(cap.isEjb32LiteSupported()); assertTrue(cap.isEjb40Supported()); assertTrue(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); p = createProject(Profile.JAKARTA_EE_9_1_WEB, Type.WAR); cap = J2eeProjectCapabilities.forProject(p); @@ -350,6 +436,8 @@ public void testIsEjbSupported() throws Exception { assertFalse(cap.isEjb32LiteSupported()); assertFalse(cap.isEjb40Supported()); assertTrue(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); p = createProject(Profile.JAKARTA_EE_10_FULL, Type.WAR); cap = J2eeProjectCapabilities.forProject(p); @@ -360,6 +448,8 @@ public void testIsEjbSupported() throws Exception { assertFalse(cap.isEjb32LiteSupported()); assertTrue(cap.isEjb40Supported()); assertTrue(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); p = createProject(Profile.JAKARTA_EE_10_WEB, Type.WAR); cap = J2eeProjectCapabilities.forProject(p); @@ -370,6 +460,8 @@ public void testIsEjbSupported() throws Exception { assertFalse(cap.isEjb32LiteSupported()); assertFalse(cap.isEjb40Supported()); assertTrue(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); p = createProject(Profile.JAKARTA_EE_11_FULL, Type.WAR); cap = J2eeProjectCapabilities.forProject(p); @@ -380,6 +472,8 @@ public void testIsEjbSupported() throws Exception { assertFalse(cap.isEjb32LiteSupported()); assertTrue(cap.isEjb40Supported()); assertTrue(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); p = createProject(Profile.JAKARTA_EE_11_WEB, Type.WAR); cap = J2eeProjectCapabilities.forProject(p); @@ -390,6 +484,32 @@ public void testIsEjbSupported() throws Exception { assertFalse(cap.isEjb32LiteSupported()); assertFalse(cap.isEjb40Supported()); assertTrue(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertFalse(cap.isEjb41LiteSupported()); + + p = createProject(Profile.JAKARTA_EE_12_FULL, Type.WAR); + cap = J2eeProjectCapabilities.forProject(p); + assertFalse(cap.isEjb30Supported()); + assertFalse(cap.isEjb31Supported()); + assertFalse(cap.isEjb31LiteSupported()); + assertFalse(cap.isEjb32Supported()); + assertFalse(cap.isEjb32LiteSupported()); + assertFalse(cap.isEjb40Supported()); + assertFalse(cap.isEjb40LiteSupported()); + assertTrue(cap.isEjb41Supported()); + assertTrue(cap.isEjb41LiteSupported()); + + p = createProject(Profile.JAKARTA_EE_12_WEB, Type.WAR); + cap = J2eeProjectCapabilities.forProject(p); + assertFalse(cap.isEjb30Supported()); + assertFalse(cap.isEjb31Supported()); + assertFalse(cap.isEjb31LiteSupported()); + assertFalse(cap.isEjb32Supported()); + assertFalse(cap.isEjb32LiteSupported()); + assertFalse(cap.isEjb40Supported()); + assertFalse(cap.isEjb40LiteSupported()); + assertFalse(cap.isEjb41Supported()); + assertTrue(cap.isEjb41LiteSupported()); } diff --git a/enterprise/j2ee.core/src/org/netbeans/api/j2ee/core/Profile.java b/enterprise/j2ee.core/src/org/netbeans/api/j2ee/core/Profile.java index b8b4d65ef557..ce06349c7e35 100644 --- a/enterprise/j2ee.core/src/org/netbeans/api/j2ee/core/Profile.java +++ b/enterprise/j2ee.core/src/org/netbeans/api/j2ee/core/Profile.java @@ -92,7 +92,13 @@ public enum Profile { JAKARTA_EE_11_WEB("11", "web"), @Messages("JAKARTA_EE_11_FULL.displayName=Jakarta EE 11") - JAKARTA_EE_11_FULL("11"); + JAKARTA_EE_11_FULL("11"), + + @Messages("JAKARTA_EE_12_WEB.displayName=Jakarta EE 12 Web") + JAKARTA_EE_12_WEB("12", "web"), + + @Messages("JAKARTA_EE_12_FULL.displayName=Jakarta EE 12") + JAKARTA_EE_12_FULL("12"); // !!! ATTENTION: BE AWARE OF THE ENUM ORDER! It controls compatibility and UI position. public static final Comparator UI_COMPARATOR = (Profile o1, Profile o2) -> -(o1.ordinal() - o2.ordinal()); diff --git a/enterprise/j2ee.core/test/unit/src/org/netbeans/api/j2ee/core/ProfileTest.java b/enterprise/j2ee.core/test/unit/src/org/netbeans/api/j2ee/core/ProfileTest.java index 65ec47ed7e6d..ace699ef9802 100644 --- a/enterprise/j2ee.core/test/unit/src/org/netbeans/api/j2ee/core/ProfileTest.java +++ b/enterprise/j2ee.core/test/unit/src/org/netbeans/api/j2ee/core/ProfileTest.java @@ -67,6 +67,10 @@ public void testFromPropertiesString() { assertEquals(Profile.JAKARTA_EE_11_FULL, Profile.fromPropertiesString("JAKARTA_EE_11_FULL")); assertEquals(Profile.JAKARTA_EE_11_WEB, Profile.fromPropertiesString("11-web")); assertEquals(Profile.JAKARTA_EE_11_WEB, Profile.fromPropertiesString("JAKARTA_EE_11_WEB")); + assertEquals(Profile.JAKARTA_EE_12_FULL, Profile.fromPropertiesString("12")); + assertEquals(Profile.JAKARTA_EE_12_FULL, Profile.fromPropertiesString("JAKARTA_EE_12_FULL")); + assertEquals(Profile.JAKARTA_EE_12_WEB, Profile.fromPropertiesString("12-web")); + assertEquals(Profile.JAKARTA_EE_12_WEB, Profile.fromPropertiesString("JAKARTA_EE_12_WEB")); assertNull(Profile.fromPropertiesString("something")); assertNull(Profile.fromPropertiesString(null)); } @@ -92,6 +96,8 @@ public void testIsHigherJavaEEVersionJavaEE5() { assertTrue(Profile.JAKARTA_EE_10_FULL.isAtLeast(Profile.JAVA_EE_5)); assertTrue(Profile.JAKARTA_EE_11_WEB.isAtLeast(Profile.JAVA_EE_5)); assertTrue(Profile.JAKARTA_EE_11_FULL.isAtLeast(Profile.JAVA_EE_5)); + assertTrue(Profile.JAKARTA_EE_12_WEB.isAtLeast(Profile.JAVA_EE_5)); + assertTrue(Profile.JAKARTA_EE_12_FULL.isAtLeast(Profile.JAVA_EE_5)); } public void testIsHigherJavaEEVersionJavaEE6full() { @@ -115,6 +121,8 @@ public void testIsHigherJavaEEVersionJavaEE6full() { assertTrue(Profile.JAKARTA_EE_10_FULL.isAtLeast(Profile.JAVA_EE_6_WEB)); assertTrue(Profile.JAKARTA_EE_11_WEB.isAtLeast(Profile.JAVA_EE_6_WEB)); assertTrue(Profile.JAKARTA_EE_11_FULL.isAtLeast(Profile.JAVA_EE_6_WEB)); + assertTrue(Profile.JAKARTA_EE_12_WEB.isAtLeast(Profile.JAVA_EE_6_WEB)); + assertTrue(Profile.JAKARTA_EE_12_FULL.isAtLeast(Profile.JAVA_EE_6_WEB)); } public void testIsHigherJavaEEVersionJavaEE7full() { @@ -138,6 +146,8 @@ public void testIsHigherJavaEEVersionJavaEE7full() { assertTrue(Profile.JAKARTA_EE_10_FULL.isAtLeast(Profile.JAVA_EE_7_WEB)); assertTrue(Profile.JAKARTA_EE_11_WEB.isAtLeast(Profile.JAVA_EE_7_WEB)); assertTrue(Profile.JAKARTA_EE_11_FULL.isAtLeast(Profile.JAVA_EE_7_WEB)); + assertTrue(Profile.JAKARTA_EE_12_WEB.isAtLeast(Profile.JAVA_EE_7_WEB)); + assertTrue(Profile.JAKARTA_EE_12_FULL.isAtLeast(Profile.JAVA_EE_7_WEB)); } public void testIsHigherJavaEEVersionJavaEE8full() { @@ -161,6 +171,8 @@ public void testIsHigherJavaEEVersionJavaEE8full() { assertTrue(Profile.JAKARTA_EE_10_FULL.isAtLeast(Profile.JAVA_EE_8_WEB)); assertTrue(Profile.JAKARTA_EE_11_WEB.isAtLeast(Profile.JAVA_EE_8_WEB)); assertTrue(Profile.JAKARTA_EE_11_FULL.isAtLeast(Profile.JAVA_EE_8_WEB)); + assertTrue(Profile.JAKARTA_EE_12_WEB.isAtLeast(Profile.JAVA_EE_8_WEB)); + assertTrue(Profile.JAKARTA_EE_12_FULL.isAtLeast(Profile.JAVA_EE_8_WEB)); } public void testIsHigherJavaEEVersionJakartaEE8full() { @@ -184,6 +196,8 @@ public void testIsHigherJavaEEVersionJakartaEE8full() { assertTrue(Profile.JAKARTA_EE_10_FULL.isAtLeast(Profile.JAKARTA_EE_8_WEB)); assertTrue(Profile.JAKARTA_EE_11_WEB.isAtLeast(Profile.JAKARTA_EE_8_WEB)); assertTrue(Profile.JAKARTA_EE_11_FULL.isAtLeast(Profile.JAKARTA_EE_8_WEB)); + assertTrue(Profile.JAKARTA_EE_12_WEB.isAtLeast(Profile.JAKARTA_EE_8_WEB)); + assertTrue(Profile.JAKARTA_EE_12_FULL.isAtLeast(Profile.JAKARTA_EE_8_WEB)); } public void testIsHigherJavaEEVersionJakartaEE9full() { @@ -207,6 +221,8 @@ public void testIsHigherJavaEEVersionJakartaEE9full() { assertTrue(Profile.JAKARTA_EE_10_FULL.isAtLeast(Profile.JAKARTA_EE_9_WEB)); assertTrue(Profile.JAKARTA_EE_11_WEB.isAtLeast(Profile.JAKARTA_EE_9_WEB)); assertTrue(Profile.JAKARTA_EE_11_FULL.isAtLeast(Profile.JAKARTA_EE_9_WEB)); + assertTrue(Profile.JAKARTA_EE_12_WEB.isAtLeast(Profile.JAKARTA_EE_9_WEB)); + assertTrue(Profile.JAKARTA_EE_12_FULL.isAtLeast(Profile.JAKARTA_EE_9_WEB)); } public void testIsHigherJavaEEVersionJakartaEE91full() { @@ -230,30 +246,84 @@ public void testIsHigherJavaEEVersionJakartaEE91full() { assertTrue(Profile.JAKARTA_EE_10_FULL.isAtLeast(Profile.JAKARTA_EE_9_1_WEB)); assertTrue(Profile.JAKARTA_EE_11_WEB.isAtLeast(Profile.JAKARTA_EE_9_1_WEB)); assertTrue(Profile.JAKARTA_EE_11_FULL.isAtLeast(Profile.JAKARTA_EE_9_1_WEB)); + assertTrue(Profile.JAKARTA_EE_12_WEB.isAtLeast(Profile.JAKARTA_EE_9_1_WEB)); + assertTrue(Profile.JAKARTA_EE_12_FULL.isAtLeast(Profile.JAKARTA_EE_9_1_WEB)); } public void testIsHigherJavaEEVersionJakartaEE10full() { - assertFalse(Profile.J2EE_13.isAtLeast(Profile.JAKARTA_EE_10_WEB)); - assertFalse(Profile.J2EE_14.isAtLeast(Profile.JAKARTA_EE_10_WEB)); - assertFalse(Profile.JAVA_EE_5.isAtLeast(Profile.JAKARTA_EE_10_WEB)); + assertFalse(Profile.J2EE_13.isAtLeast(Profile.JAKARTA_EE_10_WEB)); + assertFalse(Profile.J2EE_14.isAtLeast(Profile.JAKARTA_EE_10_WEB)); + assertFalse(Profile.JAVA_EE_5.isAtLeast(Profile.JAKARTA_EE_10_WEB)); - assertFalse(Profile.JAVA_EE_6_WEB.isAtLeast(Profile.JAKARTA_EE_10_WEB)); - assertFalse(Profile.JAVA_EE_6_FULL.isAtLeast(Profile.JAKARTA_EE_10_WEB)); - assertFalse(Profile.JAVA_EE_7_WEB.isAtLeast(Profile.JAKARTA_EE_10_WEB)); - assertFalse(Profile.JAVA_EE_7_FULL.isAtLeast(Profile.JAKARTA_EE_10_WEB)); - assertFalse(Profile.JAVA_EE_8_WEB.isAtLeast(Profile.JAKARTA_EE_10_WEB)); - assertFalse(Profile.JAVA_EE_8_FULL.isAtLeast(Profile.JAKARTA_EE_10_WEB)); - assertFalse(Profile.JAKARTA_EE_8_WEB.isAtLeast(Profile.JAKARTA_EE_10_WEB)); - assertFalse(Profile.JAKARTA_EE_8_FULL.isAtLeast(Profile.JAKARTA_EE_10_WEB)); - assertFalse(Profile.JAKARTA_EE_9_WEB.isAtLeast(Profile.JAKARTA_EE_10_WEB)); - assertFalse(Profile.JAKARTA_EE_9_FULL.isAtLeast(Profile.JAKARTA_EE_10_WEB)); - assertFalse(Profile.JAKARTA_EE_9_1_WEB.isAtLeast(Profile.JAKARTA_EE_10_WEB)); - assertFalse(Profile.JAKARTA_EE_9_1_FULL.isAtLeast(Profile.JAKARTA_EE_10_WEB)); - assertTrue(Profile.JAKARTA_EE_10_WEB.isAtLeast(Profile.JAKARTA_EE_10_WEB)); - assertTrue(Profile.JAKARTA_EE_10_FULL.isAtLeast(Profile.JAKARTA_EE_10_WEB)); - assertTrue(Profile.JAKARTA_EE_11_WEB.isAtLeast(Profile.JAKARTA_EE_10_WEB)); - assertTrue(Profile.JAKARTA_EE_11_FULL.isAtLeast(Profile.JAKARTA_EE_10_WEB)); - } + assertFalse(Profile.JAVA_EE_6_WEB.isAtLeast(Profile.JAKARTA_EE_10_WEB)); + assertFalse(Profile.JAVA_EE_6_FULL.isAtLeast(Profile.JAKARTA_EE_10_WEB)); + assertFalse(Profile.JAVA_EE_7_WEB.isAtLeast(Profile.JAKARTA_EE_10_WEB)); + assertFalse(Profile.JAVA_EE_7_FULL.isAtLeast(Profile.JAKARTA_EE_10_WEB)); + assertFalse(Profile.JAVA_EE_8_WEB.isAtLeast(Profile.JAKARTA_EE_10_WEB)); + assertFalse(Profile.JAVA_EE_8_FULL.isAtLeast(Profile.JAKARTA_EE_10_WEB)); + assertFalse(Profile.JAKARTA_EE_8_WEB.isAtLeast(Profile.JAKARTA_EE_10_WEB)); + assertFalse(Profile.JAKARTA_EE_8_FULL.isAtLeast(Profile.JAKARTA_EE_10_WEB)); + assertFalse(Profile.JAKARTA_EE_9_WEB.isAtLeast(Profile.JAKARTA_EE_10_WEB)); + assertFalse(Profile.JAKARTA_EE_9_FULL.isAtLeast(Profile.JAKARTA_EE_10_WEB)); + assertFalse(Profile.JAKARTA_EE_9_1_WEB.isAtLeast(Profile.JAKARTA_EE_10_WEB)); + assertFalse(Profile.JAKARTA_EE_9_1_FULL.isAtLeast(Profile.JAKARTA_EE_10_WEB)); + assertTrue(Profile.JAKARTA_EE_10_WEB.isAtLeast(Profile.JAKARTA_EE_10_WEB)); + assertTrue(Profile.JAKARTA_EE_10_FULL.isAtLeast(Profile.JAKARTA_EE_10_WEB)); + assertTrue(Profile.JAKARTA_EE_11_WEB.isAtLeast(Profile.JAKARTA_EE_10_WEB)); + assertTrue(Profile.JAKARTA_EE_11_FULL.isAtLeast(Profile.JAKARTA_EE_10_WEB)); + assertTrue(Profile.JAKARTA_EE_12_WEB.isAtLeast(Profile.JAKARTA_EE_10_WEB)); + assertTrue(Profile.JAKARTA_EE_12_FULL.isAtLeast(Profile.JAKARTA_EE_10_WEB)); + } + + public void testIsHigherJavaEEVersionJakartaEE11full() { + assertFalse(Profile.J2EE_13.isAtLeast(Profile.JAKARTA_EE_11_WEB)); + assertFalse(Profile.J2EE_14.isAtLeast(Profile.JAKARTA_EE_11_WEB)); + assertFalse(Profile.JAVA_EE_5.isAtLeast(Profile.JAKARTA_EE_11_WEB)); + + assertFalse(Profile.JAVA_EE_6_WEB.isAtLeast(Profile.JAKARTA_EE_11_WEB)); + assertFalse(Profile.JAVA_EE_6_FULL.isAtLeast(Profile.JAKARTA_EE_11_WEB)); + assertFalse(Profile.JAVA_EE_7_WEB.isAtLeast(Profile.JAKARTA_EE_11_WEB)); + assertFalse(Profile.JAVA_EE_7_FULL.isAtLeast(Profile.JAKARTA_EE_11_WEB)); + assertFalse(Profile.JAVA_EE_8_WEB.isAtLeast(Profile.JAKARTA_EE_11_WEB)); + assertFalse(Profile.JAVA_EE_8_FULL.isAtLeast(Profile.JAKARTA_EE_11_WEB)); + assertFalse(Profile.JAKARTA_EE_8_WEB.isAtLeast(Profile.JAKARTA_EE_11_WEB)); + assertFalse(Profile.JAKARTA_EE_8_FULL.isAtLeast(Profile.JAKARTA_EE_11_WEB)); + assertFalse(Profile.JAKARTA_EE_9_WEB.isAtLeast(Profile.JAKARTA_EE_11_WEB)); + assertFalse(Profile.JAKARTA_EE_9_FULL.isAtLeast(Profile.JAKARTA_EE_11_WEB)); + assertFalse(Profile.JAKARTA_EE_9_1_WEB.isAtLeast(Profile.JAKARTA_EE_11_WEB)); + assertFalse(Profile.JAKARTA_EE_9_1_FULL.isAtLeast(Profile.JAKARTA_EE_11_WEB)); + assertFalse(Profile.JAKARTA_EE_10_WEB.isAtLeast(Profile.JAKARTA_EE_11_WEB)); + assertFalse(Profile.JAKARTA_EE_10_FULL.isAtLeast(Profile.JAKARTA_EE_11_WEB)); + assertTrue(Profile.JAKARTA_EE_11_WEB.isAtLeast(Profile.JAKARTA_EE_11_WEB)); + assertTrue(Profile.JAKARTA_EE_11_FULL.isAtLeast(Profile.JAKARTA_EE_11_WEB)); + assertTrue(Profile.JAKARTA_EE_12_WEB.isAtLeast(Profile.JAKARTA_EE_11_WEB)); + assertTrue(Profile.JAKARTA_EE_12_FULL.isAtLeast(Profile.JAKARTA_EE_11_WEB)); + } + + public void testIsHigherJavaEEVersionJakartaEE12full() { + assertFalse(Profile.J2EE_13.isAtLeast(Profile.JAKARTA_EE_12_WEB)); + assertFalse(Profile.J2EE_14.isAtLeast(Profile.JAKARTA_EE_12_WEB)); + assertFalse(Profile.JAVA_EE_5.isAtLeast(Profile.JAKARTA_EE_12_WEB)); + + assertFalse(Profile.JAVA_EE_6_WEB.isAtLeast(Profile.JAKARTA_EE_12_WEB)); + assertFalse(Profile.JAVA_EE_6_FULL.isAtLeast(Profile.JAKARTA_EE_12_WEB)); + assertFalse(Profile.JAVA_EE_7_WEB.isAtLeast(Profile.JAKARTA_EE_12_WEB)); + assertFalse(Profile.JAVA_EE_7_FULL.isAtLeast(Profile.JAKARTA_EE_12_WEB)); + assertFalse(Profile.JAVA_EE_8_WEB.isAtLeast(Profile.JAKARTA_EE_12_WEB)); + assertFalse(Profile.JAVA_EE_8_FULL.isAtLeast(Profile.JAKARTA_EE_12_WEB)); + assertFalse(Profile.JAKARTA_EE_8_WEB.isAtLeast(Profile.JAKARTA_EE_12_WEB)); + assertFalse(Profile.JAKARTA_EE_8_FULL.isAtLeast(Profile.JAKARTA_EE_12_WEB)); + assertFalse(Profile.JAKARTA_EE_9_WEB.isAtLeast(Profile.JAKARTA_EE_12_WEB)); + assertFalse(Profile.JAKARTA_EE_9_FULL.isAtLeast(Profile.JAKARTA_EE_12_WEB)); + assertFalse(Profile.JAKARTA_EE_9_1_WEB.isAtLeast(Profile.JAKARTA_EE_12_WEB)); + assertFalse(Profile.JAKARTA_EE_9_1_FULL.isAtLeast(Profile.JAKARTA_EE_12_WEB)); + assertFalse(Profile.JAKARTA_EE_10_WEB.isAtLeast(Profile.JAKARTA_EE_12_WEB)); + assertFalse(Profile.JAKARTA_EE_10_FULL.isAtLeast(Profile.JAKARTA_EE_11_WEB)); + assertFalse(Profile.JAKARTA_EE_11_WEB.isAtLeast(Profile.JAKARTA_EE_12_WEB)); + assertFalse(Profile.JAKARTA_EE_11_FULL.isAtLeast(Profile.JAKARTA_EE_12_WEB)); + assertTrue(Profile.JAKARTA_EE_12_WEB.isAtLeast(Profile.JAKARTA_EE_12_WEB)); + assertTrue(Profile.JAKARTA_EE_12_FULL.isAtLeast(Profile.JAKARTA_EE_12_WEB)); + } public void testAllEnumsHaveDisplayNames() { for (Profile profile : Profile.values()) { diff --git a/enterprise/j2ee.dd/.gitignore b/enterprise/j2ee.dd/.gitignore index 1c791390b00f..e0233c37082a 100644 --- a/enterprise/j2ee.dd/.gitignore +++ b/enterprise/j2ee.dd/.gitignore @@ -7,6 +7,7 @@ src/org/netbeans/modules/j2ee/dd/impl/application/model_8/* src/org/netbeans/modules/j2ee/dd/impl/application/model_9/* src/org/netbeans/modules/j2ee/dd/impl/application/model_10/* src/org/netbeans/modules/j2ee/dd/impl/application/model_11/* +src/org/netbeans/modules/j2ee/dd/impl/application/model_12/* src/org/netbeans/modules/j2ee/dd/impl/client/model_1_4/* src/org/netbeans/modules/j2ee/dd/impl/client/model_5_0/* src/org/netbeans/modules/j2ee/dd/impl/client/model_6_0/* @@ -15,11 +16,13 @@ src/org/netbeans/modules/j2ee/dd/impl/client/model_8_0/* src/org/netbeans/modules/j2ee/dd/impl/client/model_9_0/* src/org/netbeans/modules/j2ee/dd/impl/client/model_10_0/* src/org/netbeans/modules/j2ee/dd/impl/client/model_11_0/* +src/org/netbeans/modules/j2ee/dd/impl/client/model_12_0/* src/org/netbeans/modules/j2ee/dd/impl/ejb/model_2_1/* src/org/netbeans/modules/j2ee/dd/impl/ejb/model_3_0/* src/org/netbeans/modules/j2ee/dd/impl/ejb/model_3_1/* src/org/netbeans/modules/j2ee/dd/impl/ejb/model_3_2/* src/org/netbeans/modules/j2ee/dd/impl/ejb/model_4_0/* +src/org/netbeans/modules/j2ee/dd/impl/ejb/model_4_1/* src/org/netbeans/modules/j2ee/dd/impl/web/model_2_4/* src/org/netbeans/modules/j2ee/dd/impl/web/model_2_5/* src/org/netbeans/modules/j2ee/dd/impl/web/model_3_0/* @@ -33,4 +36,6 @@ src/org/netbeans/modules/j2ee/dd/impl/web/model_5_0_frag/* src/org/netbeans/modules/j2ee/dd/impl/web/model_6_0/* src/org/netbeans/modules/j2ee/dd/impl/web/model_6_0_frag/* src/org/netbeans/modules/j2ee/dd/impl/web/model_6_1/* -src/org/netbeans/modules/j2ee/dd/impl/web/model_6_1_frag/* \ No newline at end of file +src/org/netbeans/modules/j2ee/dd/impl/web/model_6_1_frag/* +src/org/netbeans/modules/j2ee/dd/impl/web/model_6_2/* +src/org/netbeans/modules/j2ee/dd/impl/web/model_6_2_frag/* \ No newline at end of file diff --git a/enterprise/j2ee.dd/build.xml b/enterprise/j2ee.dd/build.xml index 709c27a90f93..147875bd6535 100644 --- a/enterprise/j2ee.dd/build.xml +++ b/enterprise/j2ee.dd/build.xml @@ -32,17 +32,20 @@ + + + @@ -51,6 +54,7 @@ + @@ -60,6 +64,7 @@ + @@ -229,6 +234,28 @@ rootDir="src" java5="true"/> @org.netbeans.api.annotations.common.SuppressWarnings("NM_SAME_SIMPLE_NAME_AS_INTERFACE") // justification="Generated implementation classes"${line.separator}package org.netbeans.modules.j2ee.dd.impl.web.model_6_1_frag; + + @org.netbeans.api.annotations.common.SuppressWarnings("NM_SAME_SIMPLE_NAME_AS_INTERFACE") // justification="Generated implementation classes"${line.separator}package org.netbeans.modules.j2ee.dd.impl.web.model_6_2; + + @org.netbeans.api.annotations.common.SuppressWarnings("NM_SAME_SIMPLE_NAME_AS_INTERFACE") // justification="Generated implementation classes"${line.separator}package org.netbeans.modules.j2ee.dd.impl.web.model_6_2_frag; org.netbeans.modules.j2ee.dd.api.web.ServletMapping25 @@ -628,6 +655,67 @@ public void setServletName(java.lang.String[] value) { public void setServletNames(java.lang.String[] value) { + + + public java.lang.String[] getUrlPattern() { + public java.lang.String[] getUrlPatterns() { + + + public void setUrlPattern(java.lang.String[] value) { + public void setUrlPatterns(java.lang.String[] value) { + + + org.netbeans.modules.j2ee.dd.api.web.ServletMapping25 + org.netbeans.modules.j2ee.dd.api.web.ServletMapping + + + + public java.lang.String[] getUrlPattern() { + public java.lang.String[] getUrlPatterns() { + + + public void setUrlPattern(java.lang.String[] value) { + public void setUrlPatterns(java.lang.String[] value) { + + + public java.lang.String[] getServletName() { + public java.lang.String[] getServletNames() { + + + public void setServletName(java.lang.String[] value) { + public void setServletNames(java.lang.String[] value) { + + + + org.netbeans.modules.j2ee.dd.api.web.ServletMapping25 + org.netbeans.modules.j2ee.dd.api.web.ServletMapping + + + + public java.lang.String[] getUrlPattern() { + public java.lang.String[] getUrlPatterns() { + + + public void setUrlPattern(java.lang.String[] value) { + public void setUrlPatterns(java.lang.String[] value) { + + + + public java.lang.String[] getUrlPattern() { + public java.lang.String[] getUrlPatterns() { + + + public void setUrlPattern(java.lang.String[] value) { + public void setUrlPatterns(java.lang.String[] value) { + + + public java.lang.String[] getServletName() { + public java.lang.String[] getServletNames() { + + + public void setServletName(java.lang.String[] value) { + public void setServletNames(java.lang.String[] value) { + setDescription(null); setDisplayName(null); @@ -1025,6 +1113,72 @@ setLocaleEncodingMappingList(null); setDistributable(null); + setDescription(null); + setDisplayName(null); + setIcon(null); + setName(null); + setContextParam(null); + setFilter(null); + setFilterMapping(null); + setListener(null); + setServlet(null); + setServletMapping(null); + setSessionConfig(null); + setMimeMapping(null); + setWelcomeFileList(null); + setErrorPage(null); + setJspConfig(null); + setSecurityConstraint(null); + setLoginConfig(null); + setSecurityRole(null); + setEnvEntry(null); + setEjbRef(null); + setEjbLocalRef(null); + setServiceRef(null); + setResourceRef(null); + setResourceEnvRef(null); + setMessageDestinationRef(null); + setPersistenceContextRef(null); + setPersistenceUnitRef(null); + setPostConstruct(null); + setPreDestroy(null); + setMessageDestination(null); + setLocaleEncodingMappingList(null); + setDistributable(null); + + setDescription(null); + setDisplayName(null); + setIcon(null); + setName(null); + setContextParam(null); + setFilter(null); + setFilterMapping(null); + setListener(null); + setServlet(null); + setServletMapping(null); + setSessionConfig(null); + setMimeMapping(null); + setWelcomeFileList(null); + setErrorPage(null); + setJspConfig(null); + setSecurityConstraint(null); + setLoginConfig(null); + setSecurityRole(null); + setEnvEntry(null); + setEjbRef(null); + setEjbLocalRef(null); + setServiceRef(null); + setResourceRef(null); + setResourceEnvRef(null); + setMessageDestinationRef(null); + setPersistenceContextRef(null); + setPersistenceUnitRef(null); + setPostConstruct(null); + setPreDestroy(null); + setMessageDestination(null); + setLocaleEncodingMappingList(null); + setDistributable(null); + @org.netbeans.api.annotations.common.SuppressWarnings("NM_SAME_SIMPLE_NAME_AS_INTERFACE") // justification="Generated implementation classes"${line.separator}package org.netbeans.modules.j2ee.dd.impl.ejb.model_4_0; - + + @org.netbeans.api.annotations.common.SuppressWarnings("NM_SAME_SIMPLE_NAME_AS_INTERFACE") // justification="Generated implementation classes"${line.separator}package org.netbeans.modules.j2ee.dd.impl.ejb.model_4_1; public java.lang.String getVersion() { public java.lang.String getVersionString() { @@ -1161,6 +1325,39 @@ return (EjbRelationshipRole[])this.getValues(EJB_RELATIONSHIP_ROLE) return (EjbRelationshipRole)this.getValue(EJB_RELATIONSHIP_ROLE, 0) + + + public java.lang.String getVersion() { + public java.lang.String getVersionString() { + + + public void setVersion(java.lang.String value) { + public void setVersionString(java.lang.String value) { + + + (getVersion() + (getVersionString() + + + setVersion("4.1"); + setVersionString("4.1"); + + + setEjbRelationshipRole(org.netbeans.modules.j2ee.dd.api.ejb.EjbRelationshipRole[] value) + setEjbRelationshipRole(org.netbeans.modules.j2ee.dd.api.ejb.EjbRelationshipRole value) + + + this.setValue(EJB_RELATIONSHIP_ROLE, value); + this.setValue(EJB_RELATIONSHIP_ROLE, 0, value); + + + org.netbeans.modules.j2ee.dd.api.ejb.EjbRelationshipRole[] getEjbRelationshipRole() + org.netbeans.modules.j2ee.dd.api.ejb.EjbRelationshipRole getEjbRelationshipRole() + + + return (EjbRelationshipRole[])this.getValues(EJB_RELATIONSHIP_ROLE) + return (EjbRelationshipRole)this.getValue(EJB_RELATIONSHIP_ROLE, 0) + @org.netbeans.api.annotations.common.SuppressWarnings("NM_SAME_SIMPLE_NAME_AS_INTERFACE") // justification="Generated implementation classes"${line.separator}package org.netbeans.modules.j2ee.dd.impl.application.model_11; + + @org.netbeans.api.annotations.common.SuppressWarnings("NM_SAME_SIMPLE_NAME_AS_INTERFACE") // justification="Generated implementation classes"${line.separator}package org.netbeans.modules.j2ee.dd.impl.application.model_12; public java.lang.String getVersion() { @@ -1347,6 +1555,23 @@ setVersion("11"); setVersionString("11"); + + + public java.lang.String getVersion() { + public java.lang.String getVersionString() { + + + public void setVersion(java.lang.String value) { + public void setVersionString(java.lang.String value) { + + + (getVersion() + (getVersionString() + + + setVersion("12"); + setVersionString("12"); + @org.netbeans.api.annotations.common.SuppressWarnings("NM_SAME_SIMPLE_NAME_AS_INTERFACE") // justification="Generated implementation classes"${line.separator}package org.netbeans.modules.j2ee.dd.impl.client.model_11_0; + + @org.netbeans.api.annotations.common.SuppressWarnings("NM_SAME_SIMPLE_NAME_AS_INTERFACE") // justification="Generated implementation classes"${line.separator}package org.netbeans.modules.j2ee.dd.impl.client.model_12_0; public java.lang.String getVersion() { @@ -1533,6 +1769,22 @@ setVersion("11"); setVersionString("11"); + + public java.lang.String getVersion() { + public java.lang.String getVersionString() { + + + public void setVersion(java.lang.String value) { + public void setVersionString(java.lang.String value) { + + + (getVersion() + (getVersionString() + + + setVersion("12"); + setVersionString("12"); + @@ -1554,11 +1806,14 @@ + + + @@ -1567,6 +1822,7 @@ + @@ -1575,6 +1831,7 @@ + @@ -1661,6 +1918,18 @@ + + + + + + + + + + + + @@ -1692,6 +1961,12 @@ + + + + + + @@ -1741,6 +2016,12 @@ + + + + + + @@ -1790,6 +2071,12 @@ + + + + + + diff --git a/enterprise/j2ee.dd/licenseinfo.xml b/enterprise/j2ee.dd/licenseinfo.xml index 1afb7a12332f..0bbc27a0ef50 100755 --- a/enterprise/j2ee.dd/licenseinfo.xml +++ b/enterprise/j2ee.dd/licenseinfo.xml @@ -129,18 +129,26 @@ src/org/netbeans/modules/j2ee/dd/impl/resources/application_11.xsd src/org/netbeans/modules/j2ee/dd/impl/resources/application-client_11.mdd src/org/netbeans/modules/j2ee/dd/impl/resources/application-client_11.xsd + src/org/netbeans/modules/j2ee/dd/impl/resources/application_12.mdd + src/org/netbeans/modules/j2ee/dd/impl/resources/application_12.xsd + src/org/netbeans/modules/j2ee/dd/impl/resources/application-client_12.mdd + src/org/netbeans/modules/j2ee/dd/impl/resources/application-client_12.xsd src/org/netbeans/modules/j2ee/dd/impl/resources/connector_2_0.xsd src/org/netbeans/modules/j2ee/dd/impl/resources/connector_2_1.xsd src/org/netbeans/modules/j2ee/dd/impl/resources/ejb-jar_4_0.mdd src/org/netbeans/modules/j2ee/dd/impl/resources/ejb-jar_4_0.xsd + src/org/netbeans/modules/j2ee/dd/impl/resources/ejb-jar_4_1.mdd + src/org/netbeans/modules/j2ee/dd/impl/resources/ejb-jar_4_1.xsd src/org/netbeans/modules/j2ee/dd/impl/resources/jakartaee_9.xsd src/org/netbeans/modules/j2ee/dd/impl/resources/jakartaee_10.xsd src/org/netbeans/modules/j2ee/dd/impl/resources/jakartaee_11.xsd + src/org/netbeans/modules/j2ee/dd/impl/resources/jakartaee_12.xsd src/org/netbeans/modules/j2ee/dd/impl/resources/jakartaee_web_services_2_0.xsd src/org/netbeans/modules/j2ee/dd/impl/resources/jakartaee_web_services_client_2_0.xsd src/org/netbeans/modules/j2ee/dd/impl/resources/jsp_3_0.xsd src/org/netbeans/modules/j2ee/dd/impl/resources/jsp_3_1.xsd src/org/netbeans/modules/j2ee/dd/impl/resources/jsp_4_0.xsd + src/org/netbeans/modules/j2ee/dd/impl/resources/jsp_4_1.xsd src/org/netbeans/modules/j2ee/dd/impl/resources/permissions_9.xsd src/org/netbeans/modules/j2ee/dd/impl/resources/permissions_10.xsd src/org/netbeans/modules/j2ee/dd/impl/resources/web-app_5_0.mdd @@ -158,6 +166,11 @@ src/org/netbeans/modules/j2ee/dd/impl/resources/web-common_6_1.xsd src/org/netbeans/modules/j2ee/dd/impl/resources/web-fragment_6_1.mdd src/org/netbeans/modules/j2ee/dd/impl/resources/web-fragment_6_1.xsd + src/org/netbeans/modules/j2ee/dd/impl/resources/web-app_6_2.mdd + src/org/netbeans/modules/j2ee/dd/impl/resources/web-app_6_2.xsd + src/org/netbeans/modules/j2ee/dd/impl/resources/web-common_6_2.xsd + src/org/netbeans/modules/j2ee/dd/impl/resources/web-fragment_6_2.mdd + src/org/netbeans/modules/j2ee/dd/impl/resources/web-fragment_6_2.xsd diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/application/Application.java b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/application/Application.java index e8f2b7a081df..a11a585c8888 100644 --- a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/application/Application.java +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/application/Application.java @@ -60,6 +60,10 @@ public interface Application extends org.netbeans.modules.j2ee.dd.api.common.Roo * application.xml DD version for Jakarta EE 11 */ public static final String VERSION_11 = "11"; //NOI18N + /** + * application.xml DD version for Jakarta EE 12 + */ + public static final String VERSION_12 = "12"; //NOI18N public static final int STATE_VALID=0; public static final int STATE_INVALID_PARSABLE=1; public static final int STATE_INVALID_UNPARSABLE=2; diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/application/DDProvider.java b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/application/DDProvider.java index 89ba3f2e4610..310c926e0c94 100644 --- a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/application/DDProvider.java +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/application/DDProvider.java @@ -64,7 +64,7 @@ public final class DDProvider { private DDProvider() { //ddMap=new java.util.WeakHashMap(5); - ddMap = new HashMap<>(5); + ddMap = new HashMap<>(8); } /** @@ -234,22 +234,27 @@ private static void setProxyErrorStatus(ApplicationProxy applicationProxy, DDPar private static Application createApplication(DDParse parse) { Application jar = null; String version = parse.getVersion(); - if (Application.VERSION_1_4.equals(version)) { - return new org.netbeans.modules.j2ee.dd.impl.application.model_1_4.Application(parse.getDocument(), Common.USE_DEFAULT_VALUES); - } else if (Application.VERSION_5.equals(version)) { - return new org.netbeans.modules.j2ee.dd.impl.application.model_5.Application(parse.getDocument(), Common.USE_DEFAULT_VALUES); - } else if (Application.VERSION_6.equals(version)) { - return new org.netbeans.modules.j2ee.dd.impl.application.model_6.Application(parse.getDocument(), Common.USE_DEFAULT_VALUES); - } else if (Application.VERSION_7.equals(version)) { - return new org.netbeans.modules.j2ee.dd.impl.application.model_7.Application(parse.getDocument(), Common.USE_DEFAULT_VALUES); - } else if (Application.VERSION_8.equals(version)) { - return new org.netbeans.modules.j2ee.dd.impl.application.model_8.Application(parse.getDocument(), Common.USE_DEFAULT_VALUES); - } else if (Application.VERSION_9.equals(version)) { - return new org.netbeans.modules.j2ee.dd.impl.application.model_9.Application(parse.getDocument(), Common.USE_DEFAULT_VALUES); - } else if (Application.VERSION_10.equals(version)) { - return new org.netbeans.modules.j2ee.dd.impl.application.model_10.Application(parse.getDocument(), Common.USE_DEFAULT_VALUES); - } else if (Application.VERSION_11.equals(version)) { - return new org.netbeans.modules.j2ee.dd.impl.application.model_11.Application(parse.getDocument(), Common.USE_DEFAULT_VALUES); + if (null != version) switch (version) { + case Application.VERSION_1_4: + return new org.netbeans.modules.j2ee.dd.impl.application.model_1_4.Application(parse.getDocument(), Common.USE_DEFAULT_VALUES); + case Application.VERSION_5: + return new org.netbeans.modules.j2ee.dd.impl.application.model_5.Application(parse.getDocument(), Common.USE_DEFAULT_VALUES); + case Application.VERSION_6: + return new org.netbeans.modules.j2ee.dd.impl.application.model_6.Application(parse.getDocument(), Common.USE_DEFAULT_VALUES); + case Application.VERSION_7: + return new org.netbeans.modules.j2ee.dd.impl.application.model_7.Application(parse.getDocument(), Common.USE_DEFAULT_VALUES); + case Application.VERSION_8: + return new org.netbeans.modules.j2ee.dd.impl.application.model_8.Application(parse.getDocument(), Common.USE_DEFAULT_VALUES); + case Application.VERSION_9: + return new org.netbeans.modules.j2ee.dd.impl.application.model_9.Application(parse.getDocument(), Common.USE_DEFAULT_VALUES); + case Application.VERSION_10: + return new org.netbeans.modules.j2ee.dd.impl.application.model_10.Application(parse.getDocument(), Common.USE_DEFAULT_VALUES); + case Application.VERSION_11: + return new org.netbeans.modules.j2ee.dd.impl.application.model_11.Application(parse.getDocument(), Common.USE_DEFAULT_VALUES); + case Application.VERSION_12: + return new org.netbeans.modules.j2ee.dd.impl.application.model_12.Application(parse.getDocument(), Common.USE_DEFAULT_VALUES); + default: + break; } return jar; } @@ -264,25 +269,31 @@ static synchronized DDResolver getInstance() { } @Override public InputSource resolveEntity (String publicId, String systemId) { - if ("http://java.sun.com/xml/ns/j2ee/application_1_4.xsd".equals(systemId)) { - return new InputSource("nbres:/org/netbeans/modules/j2ee/dd/impl/resources/application_1_4.xsd"); //NOI18N - } else if ("http://java.sun.com/xml/ns/javaee/application_5.xsd".equals(systemId)) { - return new InputSource("nbres:/org/netbeans/modules/javaee/dd/impl/resources/application_5.xsd"); //NOI18N - } else if ("http://java.sun.com/xml/ns/javaee/application_6.xsd".equals(systemId)) { - return new InputSource("nbres:/org/netbeans/modules/javaee/dd/impl/resources/application_6.xsd"); //NOI18N - } else if ("http://xmlns.jcp.org/xml/ns/javaee/application_7.xsd".equals(systemId)) { - return new InputSource("nbres:/org/netbeans/modules/javaee/dd/impl/resources/application_7.xsd"); //NOI18N - } else if ("http://xmlns.jcp.org/xml/ns/javaee/application_8.xsd".equals(systemId)) { - return new InputSource("nbres:/org/netbeans/modules/javaee/dd/impl/resources/application_8.xsd"); //NOI18N - } else if ("https://jakarta.ee/xml/ns/jakartaee/application_9.xsd".equals(systemId)) { - return new InputSource("nbres:/org/netbeans/modules/javaee/dd/impl/resources/application_9.xsd"); //NOI18N - } else if ("https://jakarta.ee/xml/ns/jakartaee/application_10.xsd".equals(systemId)) { - return new InputSource("nbres:/org/netbeans/modules/javaee/dd/impl/resources/application_10.xsd"); //NOI18N - } else if ("https://jakarta.ee/xml/ns/jakartaee/application_11.xsd".equals(systemId)) { - return new InputSource("nbres:/org/netbeans/modules/javaee/dd/impl/resources/application_11.xsd"); //NOI18N - } else { + if (null == systemId) { // use the default behaviour return null; + } else switch (systemId) { + case "http://java.sun.com/xml/ns/j2ee/application_1_4.xsd": + return new InputSource("nbres:/org/netbeans/modules/j2ee/dd/impl/resources/application_1_4.xsd"); //NOI18N + case "http://java.sun.com/xml/ns/javaee/application_5.xsd": + return new InputSource("nbres:/org/netbeans/modules/javaee/dd/impl/resources/application_5.xsd"); //NOI18N + case "http://java.sun.com/xml/ns/javaee/application_6.xsd": + return new InputSource("nbres:/org/netbeans/modules/javaee/dd/impl/resources/application_6.xsd"); //NOI18N + case "http://xmlns.jcp.org/xml/ns/javaee/application_7.xsd": + return new InputSource("nbres:/org/netbeans/modules/javaee/dd/impl/resources/application_7.xsd"); //NOI18N + case "http://xmlns.jcp.org/xml/ns/javaee/application_8.xsd": + return new InputSource("nbres:/org/netbeans/modules/javaee/dd/impl/resources/application_8.xsd"); //NOI18N + case "https://jakarta.ee/xml/ns/jakartaee/application_9.xsd": + return new InputSource("nbres:/org/netbeans/modules/javaee/dd/impl/resources/application_9.xsd"); //NOI18N + case "https://jakarta.ee/xml/ns/jakartaee/application_10.xsd": + return new InputSource("nbres:/org/netbeans/modules/javaee/dd/impl/resources/application_10.xsd"); //NOI18N + case "https://jakarta.ee/xml/ns/jakartaee/application_11.xsd": + return new InputSource("nbres:/org/netbeans/modules/javaee/dd/impl/resources/application_11.xsd"); //NOI18N + case "https://jakarta.ee/xml/ns/jakartaee/application_12.xsd": + return new InputSource("nbres:/org/netbeans/modules/javaee/dd/impl/resources/application_12.xsd"); //NOI18N + default: + // use the default behaviour + return null; } } } @@ -382,7 +393,7 @@ public Document getDocument() { */ private void extractVersion () { // This is the default version - version = Application.VERSION_7; + version = Application.VERSION_8; // first check the doc type to see if there is one DocumentType dt = document.getDoctype(); @@ -396,24 +407,39 @@ private void extractVersion () { Node vNode = attrs.getNamedItem("version");//NOI18N if(vNode != null) { String versionValue = vNode.getNodeValue(); - if (Application.VERSION_11.equals(versionValue)) { - version = Application.VERSION_11; - } else if (Application.VERSION_10.equals(versionValue)) { - version = Application.VERSION_10; - } else if (Application.VERSION_9.equals(versionValue)) { - version = Application.VERSION_9; - } else if (Application.VERSION_8.equals(versionValue)) { - version = Application.VERSION_8; - } else if (Application.VERSION_7.equals(versionValue)) { - version = Application.VERSION_7; - } else if (Application.VERSION_6.equals(versionValue)) { - version = Application.VERSION_6; - } else if (Application.VERSION_5.equals(versionValue)) { - version = Application.VERSION_5; - } else if (Application.VERSION_1_4.equals(versionValue)) { - version = Application.VERSION_1_4; - } else { - version = Application.VERSION_7; //default + if (null == versionValue) { + version = Application.VERSION_8; //default + } else switch (versionValue) { + case Application.VERSION_12: + version = Application.VERSION_12; + break; + case Application.VERSION_11: + version = Application.VERSION_11; + break; + case Application.VERSION_10: + version = Application.VERSION_10; + break; + case Application.VERSION_9: + version = Application.VERSION_9; + break; + case Application.VERSION_8: + version = Application.VERSION_8; + break; + case Application.VERSION_7: + version = Application.VERSION_7; + break; + case Application.VERSION_6: + version = Application.VERSION_6; + break; + case Application.VERSION_5: + version = Application.VERSION_5; + break; + case Application.VERSION_1_4: + version = Application.VERSION_1_4; + break; + default: + version = Application.VERSION_8; //default + break; } } } diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/client/AppClient.java b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/client/AppClient.java index d1c26290c623..59d4b9411ebe 100644 --- a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/client/AppClient.java +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/client/AppClient.java @@ -47,6 +47,7 @@ public interface AppClient extends RootInterface { public static final String VERSION_9_0 = "9"; //NOI18N public static final String VERSION_10_0 = "10"; //NOI18N public static final String VERSION_11_0 = "11"; //NOI18N + public static final String VERSION_12_0 = "12"; //NOI18N public static final int STATE_VALID=0; public static final int STATE_INVALID_PARSABLE=1; public static final int STATE_INVALID_UNPARSABLE=2; diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/client/DDProvider.java b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/client/DDProvider.java index 1cf6b483ae5d..6368645d36fb 100644 --- a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/client/DDProvider.java +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/client/DDProvider.java @@ -20,9 +20,7 @@ package org.netbeans.modules.j2ee.dd.api.client; import java.io.File; -import java.io.FileInputStream; import java.io.IOException; -import java.io.InputStream; import java.lang.ref.WeakReference; import java.math.BigDecimal; import java.net.URL; @@ -57,9 +55,9 @@ public final class DDProvider { private final Map errorMap; private DDProvider() { - ddMap = new HashMap>(5); - baseBeanMap = new HashMap>(5); - errorMap = new HashMap(5); + ddMap = new HashMap>(8); + baseBeanMap = new HashMap>(8); + errorMap = new HashMap(8); fileChangeListener = new FCA(); } diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/ejb/DDProvider.java b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/ejb/DDProvider.java index f67ba80f5944..a67a3e5f25ab 100644 --- a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/ejb/DDProvider.java +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/ejb/DDProvider.java @@ -61,6 +61,7 @@ public final class DDProvider { private static final String EJB_31_DOCTYPE = "http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd"; //NOI18N private static final String EJB_32_DOCTYPE = "http://xmlns.jcp.org/xml/ns/javaee/ejb-jar_3_2.xsd"; //NOI18N private static final String EJB_40_DOCTYPE = "https://jakarta.ee/xml/ns/jakartaee/ejb-jar_4_0.xsd"; //NOI18N + private static final String EJB_41_DOCTYPE = "https://jakarta.ee/xml/ns/jakartaee/ejb-jar_4_1.xsd"; //NOI18N private static final DDProvider ddProvider = new DDProvider(); private final Map ddMap; @@ -68,7 +69,7 @@ public final class DDProvider { * Creates a new instance of DDProvider. */ private DDProvider() { - ddMap = new HashMap<>(5); + ddMap = new HashMap<>(8); } /** @@ -197,18 +198,23 @@ public BaseBean getBaseBean(CommonDDBean bean) { } private static EjbJar createEjbJar(String version, Document document) { - if (EjbJar.VERSION_4_0.equals(version)) { - return new org.netbeans.modules.j2ee.dd.impl.ejb.model_4_0.EjbJar(document, Common.USE_DEFAULT_VALUES); - } else if (EjbJar.VERSION_3_2.equals(version)) { - return new org.netbeans.modules.j2ee.dd.impl.ejb.model_3_2.EjbJar(document, Common.USE_DEFAULT_VALUES); - } else if (EjbJar.VERSION_3_1.equals(version)) { - return new org.netbeans.modules.j2ee.dd.impl.ejb.model_3_1.EjbJar(document, Common.USE_DEFAULT_VALUES); - } else if (EjbJar.VERSION_3_0.equals(version)) { - return new org.netbeans.modules.j2ee.dd.impl.ejb.model_3_0.EjbJar(document, Common.USE_DEFAULT_VALUES); - } else if (EjbJar.VERSION_2_1.equals(version)) { - return new org.netbeans.modules.j2ee.dd.impl.ejb.model_2_1.EjbJar(document, Common.USE_DEFAULT_VALUES); - } else { + if (null == version) { return null; + } else switch (version) { + case EjbJar.VERSION_4_1: + return new org.netbeans.modules.j2ee.dd.impl.ejb.model_4_1.EjbJar(document, Common.USE_DEFAULT_VALUES); + case EjbJar.VERSION_4_0: + return new org.netbeans.modules.j2ee.dd.impl.ejb.model_4_0.EjbJar(document, Common.USE_DEFAULT_VALUES); + case EjbJar.VERSION_3_2: + return new org.netbeans.modules.j2ee.dd.impl.ejb.model_3_2.EjbJar(document, Common.USE_DEFAULT_VALUES); + case EjbJar.VERSION_3_1: + return new org.netbeans.modules.j2ee.dd.impl.ejb.model_3_1.EjbJar(document, Common.USE_DEFAULT_VALUES); + case EjbJar.VERSION_3_0: + return new org.netbeans.modules.j2ee.dd.impl.ejb.model_3_0.EjbJar(document, Common.USE_DEFAULT_VALUES); + case EjbJar.VERSION_2_1: + return new org.netbeans.modules.j2ee.dd.impl.ejb.model_2_1.EjbJar(document, Common.USE_DEFAULT_VALUES); + default: + return null; } } @@ -230,16 +236,21 @@ private static String extractVersion(Document document) { } } if (id != null) { - if(EJB_40_DOCTYPE.equals(id)) { - return EjbJar.VERSION_4_0; - } else if(EJB_32_DOCTYPE.equals(id)) { - return EjbJar.VERSION_3_2; - } else if (EJB_31_DOCTYPE.equals(id)) { - return EjbJar.VERSION_3_1; - } else if (EJB_30_DOCTYPE.equals(id)) { - return EjbJar.VERSION_3_0; - } else if (EJB_21_DOCTYPE.equals(id)) { - return EjbJar.VERSION_2_1; + switch (id) { + case EJB_41_DOCTYPE: + return EjbJar.VERSION_4_1; + case EJB_40_DOCTYPE: + return EjbJar.VERSION_4_0; + case EJB_32_DOCTYPE: + return EjbJar.VERSION_3_2; + case EJB_31_DOCTYPE: + return EjbJar.VERSION_3_1; + case EJB_30_DOCTYPE: + return EjbJar.VERSION_3_0; + case EJB_21_DOCTYPE: + return EjbJar.VERSION_2_1; + default: + break; } } return EjbJar.VERSION_3_2; @@ -277,18 +288,29 @@ static synchronized DDResolver getInstance() { @Override public InputSource resolveEntity(String publicId, String systemId) { String resource; - if (EJB_40_DOCTYPE.equals(systemId)) { - resource = "/org/netbeans/modules/j2ee/dd/impl/resources/ejb-jar_4_0.xsd"; //NOI18N - } else if (EJB_32_DOCTYPE.equals(systemId)) { - resource = "/org/netbeans/modules/j2ee/dd/impl/resources/ejb-jar_3_2.xsd"; //NOI18N - } else if (EJB_31_DOCTYPE.equals(systemId)) { - resource = "/org/netbeans/modules/j2ee/dd/impl/resources/ejb-jar_3_1.xsd"; //NOI18N - } else if (EJB_30_DOCTYPE.equals(systemId)) { - resource = "/org/netbeans/modules/j2ee/dd/impl/resources/ejb-jar_3_0.xsd"; //NOI18N - } else if (EJB_21_DOCTYPE.equals(systemId)) { - resource = "/org/netbeans/modules/j2ee/dd/impl/resources/ejb-jar_2_1.xsd"; //NOI18N - } else { + if (null == systemId) { return null; + } else switch (systemId) { + case EJB_41_DOCTYPE: + resource = "/org/netbeans/modules/j2ee/dd/impl/resources/ejb-jar_4_1.xsd"; //NOI18N + break; + case EJB_40_DOCTYPE: + resource = "/org/netbeans/modules/j2ee/dd/impl/resources/ejb-jar_4_0.xsd"; //NOI18N + break; + case EJB_32_DOCTYPE: + resource = "/org/netbeans/modules/j2ee/dd/impl/resources/ejb-jar_3_2.xsd"; //NOI18N + break; + case EJB_31_DOCTYPE: + resource = "/org/netbeans/modules/j2ee/dd/impl/resources/ejb-jar_3_1.xsd"; //NOI18N + break; + case EJB_30_DOCTYPE: + resource = "/org/netbeans/modules/j2ee/dd/impl/resources/ejb-jar_3_0.xsd"; //NOI18N + break; + case EJB_21_DOCTYPE: + resource = "/org/netbeans/modules/j2ee/dd/impl/resources/ejb-jar_2_1.xsd"; //NOI18N + break; + default: + return null; } URL url = this.getClass().getResource(resource); return new InputSource(url.toString()); diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/ejb/EjbJar.java b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/ejb/EjbJar.java index b1215a378c88..6774ac9e37a2 100644 --- a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/ejb/EjbJar.java +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/ejb/EjbJar.java @@ -44,6 +44,10 @@ public interface EjbJar extends org.netbeans.modules.j2ee.dd.api.common.RootInte */ public static final String VERSION_3_2 = "3.2"; //NOI18N public static final String VERSION_4_0 = "4.0"; //NOI18N + /** + * ejb-jar.xml DD version for Jakarta EE 12 + */ + public static final String VERSION_4_1 = "4.1"; //NOI18N public static final int STATE_VALID=0; public static final int STATE_INVALID_PARSABLE=1; public static final int STATE_INVALID_UNPARSABLE=2; diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/web/WebApp.java b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/web/WebApp.java index 7cc6d0818240..9748b3cab69d 100644 --- a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/web/WebApp.java +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/web/WebApp.java @@ -69,6 +69,11 @@ public interface WebApp extends org.netbeans.modules.j2ee.dd.api.common.RootInte * web.xml, web-fragment.xml DD version for Jakarta EE 11 */ static final String VERSION_6_1 = "6.1"; //NOI18N + /** + * web.xml, web-fragment.xml DD version for Jakarta EE 12 + */ + static final String VERSION_6_2 = "6.2"; //NOI18N + static final int STATE_VALID = 0; static final int STATE_INVALID_PARSABLE = 1; static final int STATE_INVALID_UNPARSABLE = 2; diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/web/WebFragmentProvider.java b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/web/WebFragmentProvider.java index 3b5feac01988..9b1aa07e5ef1 100644 --- a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/web/WebFragmentProvider.java +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/web/WebFragmentProvider.java @@ -79,33 +79,39 @@ public WebFragment getWebFragmentRoot(FileObject fo) throws IOException, FileNot private WebFragment createWebFragment(FileObject fo, String version) throws IOException, SAXException { try { - if (WebFragment.VERSION_6_1.equals(version)) { - try (InputStream inputStream = fo.getInputStream()) { - return org.netbeans.modules.j2ee.dd.impl.web.model_6_1_frag.WebFragment.createGraph(inputStream); - } - } else - if (WebFragment.VERSION_6_0.equals(version)) { - try (InputStream inputStream = fo.getInputStream()) { - return org.netbeans.modules.j2ee.dd.impl.web.model_6_0_frag.WebFragment.createGraph(inputStream); - } - } else if (WebFragment.VERSION_5_0.equals(version)) { - try (InputStream inputStream = fo.getInputStream()) { - return org.netbeans.modules.j2ee.dd.impl.web.model_5_0_frag.WebFragment.createGraph(inputStream); - } - } else if (WebFragment.VERSION_4_0.equals(version)) { - try (InputStream inputStream = fo.getInputStream()) { - return org.netbeans.modules.j2ee.dd.impl.web.model_4_0_frag.WebFragment.createGraph(inputStream); - } - } else if (WebFragment.VERSION_3_1.equals(version)) { - try (InputStream inputStream = fo.getInputStream()) { - return org.netbeans.modules.j2ee.dd.impl.web.model_3_1_frag.WebFragment.createGraph(inputStream); - } - } else if (WebFragment.VERSION_3_0.equals(version)) { - try (InputStream inputStream = fo.getInputStream()) { - return org.netbeans.modules.j2ee.dd.impl.web.model_3_0_frag.WebFragment.createGraph(inputStream); - } - } else { + if (null == version) { throw new IOException("Unsupported version of web-fragment.xml found! Version: "+version); + } else switch (version) { + case WebFragment.VERSION_6_2: + try (InputStream inputStream = fo.getInputStream()) { + return org.netbeans.modules.j2ee.dd.impl.web.model_6_2_frag.WebFragment.createGraph(inputStream); + } + case WebFragment.VERSION_6_1: + try (InputStream inputStream = fo.getInputStream()) { + return org.netbeans.modules.j2ee.dd.impl.web.model_6_1_frag.WebFragment.createGraph(inputStream); + } + case WebFragment.VERSION_6_0: + try (InputStream inputStream = fo.getInputStream()) { + return org.netbeans.modules.j2ee.dd.impl.web.model_6_0_frag.WebFragment.createGraph(inputStream); + } + case WebFragment.VERSION_5_0: + try (InputStream inputStream = fo.getInputStream()) { + return org.netbeans.modules.j2ee.dd.impl.web.model_5_0_frag.WebFragment.createGraph(inputStream); + } + case WebFragment.VERSION_4_0: + try (InputStream inputStream = fo.getInputStream()) { + return org.netbeans.modules.j2ee.dd.impl.web.model_4_0_frag.WebFragment.createGraph(inputStream); + } + case WebFragment.VERSION_3_1: + try (InputStream inputStream = fo.getInputStream()) { + return org.netbeans.modules.j2ee.dd.impl.web.model_3_1_frag.WebFragment.createGraph(inputStream); + } + case WebFragment.VERSION_3_0: + try (InputStream inputStream = fo.getInputStream()) { + return org.netbeans.modules.j2ee.dd.impl.web.model_3_0_frag.WebFragment.createGraph(inputStream); + } + default: + throw new IOException("Unsupported version of web-fragment.xml found! Version: "+version); } } catch (RuntimeException ex) { throw new SAXException(ex); diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/client/ClientParseUtils.java b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/client/ClientParseUtils.java index 6a47f866bf76..4f2b4a7477ee 100644 --- a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/client/ClientParseUtils.java +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/client/ClientParseUtils.java @@ -49,11 +49,8 @@ public static String getVersion(java.io.InputStream is) throws java.io.IOExcepti /** Parsing just for detecting the version SAX parser used */ public static String getVersion(FileObject fo) throws java.io.IOException, SAXException { - InputStream inputStream = fo.getInputStream(); - try { + try (InputStream inputStream = fo.getInputStream()) { return ParseUtils.getVersion(inputStream, new VersionHandler(), DDResolver.getInstance()); - } finally { - inputStream.close(); } } @@ -106,6 +103,18 @@ public InputSource resolveEntity(String publicId, String systemId) { return new InputSource("nbres:/org/netbeans/modules/j2ee/dd/impl/resources/application-client_5.xsd"); //NOI18N } else if ("http://java.sun.com/xml/ns/javaee/application-client_6.xsd".equals(systemId)) { return new InputSource("nbres:/org/netbeans/modules/j2ee/dd/impl/resources/application-client_6.xsd"); //NOI18N + } else if ("http://xmlns.jcp.org/xml/ns/javaee/application-client_7.xsd".equals(systemId)) { + return new InputSource("nbres:/org/netbeans/modules/j2ee/dd/impl/resources/application-client_7.xsd"); //NOI18N + } else if ("http://xmlns.jcp.org/xml/ns/javaee/application-client_8.xsd".equals(systemId)) { + return new InputSource("nbres:/org/netbeans/modules/j2ee/dd/impl/resources/application-client_8.xsd"); //NOI18N + } else if ("https://jakarta.ee/xml/ns/jakartaee/application-client_9.xsd".equals(systemId)) { + return new InputSource("nbres:/org/netbeans/modules/j2ee/dd/impl/resources/application-client_9.xsd"); //NOI18N + } else if ("https://jakarta.ee/xml/ns/jakartaee/application-client_10.xsd".equals(systemId)) { + return new InputSource("nbres:/org/netbeans/modules/j2ee/dd/impl/resources/application-client_10.xsd"); //NOI18N + } else if ("https://jakarta.ee/xml/ns/jakartaee/application-client_11.xsd".equals(systemId)) { + return new InputSource("nbres:/org/netbeans/modules/j2ee/dd/impl/resources/application-client_11.xsd"); //NOI18N + } else if ("https://jakarta.ee/xml/ns/jakartaee/application-client_12.xsd".equals(systemId)) { + return new InputSource("nbres:/org/netbeans/modules/j2ee/dd/impl/resources/application-client_12.xsd"); //NOI18N } else { // use the default behaviour return null; @@ -116,11 +125,8 @@ public InputSource resolveEntity(String publicId, String systemId) { public static SAXParseException parse(FileObject fo) throws org.xml.sax.SAXException, java.io.IOException { - InputStream inputStream = fo.getInputStream(); - try { + try (InputStream inputStream = fo.getInputStream()) { return parse(new InputSource(inputStream)); - } finally { - inputStream.close(); } } diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/common/DDUtils.java b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/common/DDUtils.java index 5a74cbfc8d1d..18aa89ce442f 100644 --- a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/common/DDUtils.java +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/common/DDUtils.java @@ -111,24 +111,29 @@ public static void merge(EjbJarProxy ejbJarProxy, Reader reader) { public static WebApp createWebApp(InputStream is, String version) throws IOException, SAXException { try { - if (WebApp.VERSION_2_4.equals(version)) { - return org.netbeans.modules.j2ee.dd.impl.web.model_2_4.WebApp.createGraph(is); - } else if (WebApp.VERSION_2_5.equals(version)) { - return org.netbeans.modules.j2ee.dd.impl.web.model_2_5.WebApp.createGraph(is); - } else if (WebApp.VERSION_3_0.equals(version)) { - return org.netbeans.modules.j2ee.dd.impl.web.model_3_0.WebApp.createGraph(is); - } else if (WebApp.VERSION_3_1.equals(version)) { - return org.netbeans.modules.j2ee.dd.impl.web.model_3_1.WebApp.createGraph(is); - } else if (WebApp.VERSION_4_0.equals(version)) { - return org.netbeans.modules.j2ee.dd.impl.web.model_4_0.WebApp.createGraph(is); - } else if (WebApp.VERSION_5_0.equals(version)) { - return org.netbeans.modules.j2ee.dd.impl.web.model_5_0.WebApp.createGraph(is); - } else if (WebApp.VERSION_6_0.equals(version)) { - return org.netbeans.modules.j2ee.dd.impl.web.model_6_0.WebApp.createGraph(is); - } else if (WebApp.VERSION_6_1.equals(version)) { - return org.netbeans.modules.j2ee.dd.impl.web.model_6_1.WebApp.createGraph(is); - } else { + if (null == version) { return null; + } else switch (version) { + case WebApp.VERSION_2_4: + return org.netbeans.modules.j2ee.dd.impl.web.model_2_4.WebApp.createGraph(is); + case WebApp.VERSION_2_5: + return org.netbeans.modules.j2ee.dd.impl.web.model_2_5.WebApp.createGraph(is); + case WebApp.VERSION_3_0: + return org.netbeans.modules.j2ee.dd.impl.web.model_3_0.WebApp.createGraph(is); + case WebApp.VERSION_3_1: + return org.netbeans.modules.j2ee.dd.impl.web.model_3_1.WebApp.createGraph(is); + case WebApp.VERSION_4_0: + return org.netbeans.modules.j2ee.dd.impl.web.model_4_0.WebApp.createGraph(is); + case WebApp.VERSION_5_0: + return org.netbeans.modules.j2ee.dd.impl.web.model_5_0.WebApp.createGraph(is); + case WebApp.VERSION_6_0: + return org.netbeans.modules.j2ee.dd.impl.web.model_6_0.WebApp.createGraph(is); + case WebApp.VERSION_6_1: + return org.netbeans.modules.j2ee.dd.impl.web.model_6_1.WebApp.createGraph(is); + case WebApp.VERSION_6_2: + return org.netbeans.modules.j2ee.dd.impl.web.model_6_2.WebApp.createGraph(is); + default: + return null; } } catch (RuntimeException ex) { throw new SAXException(ex); @@ -159,6 +164,8 @@ public static AppClient createAppClient(InputStream is, String version) throws I return org.netbeans.modules.j2ee.dd.impl.client.model_10_0.ApplicationClient.createGraph(is); } else if (AppClient.VERSION_11_0.equals(version)) { return org.netbeans.modules.j2ee.dd.impl.client.model_11_0.ApplicationClient.createGraph(is); + } else if (AppClient.VERSION_12_0.equals(version)) { + return org.netbeans.modules.j2ee.dd.impl.client.model_12_0.ApplicationClient.createGraph(is); } } catch (RuntimeException ex) { throw new SAXException(ex); diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/ejb/EjbJarProxy.java b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/ejb/EjbJarProxy.java index b273a568b5ba..37620b0a49e5 100644 --- a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/ejb/EjbJarProxy.java +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/ejb/EjbJarProxy.java @@ -453,26 +453,39 @@ public Object clone() { else { EjbJar clonedEjbJar=(EjbJar)ejbJar.clone(); proxy = new EjbJarProxy(clonedEjbJar,version); - if (EjbJar.VERSION_4_0.equals(version)) { - ((org.netbeans.modules.j2ee.dd.impl.ejb.model_4_0.EjbJar)clonedEjbJar)._setSchemaLocation - ("https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/ejb-jar_4_0.xsd"); - clonedEjbJar.setVersion(new java.math.BigDecimal(EjbJar.VERSION_3_2)); - } else if (EjbJar.VERSION_3_2.equals(version)) { - ((org.netbeans.modules.j2ee.dd.impl.ejb.model_3_2.EjbJar)clonedEjbJar)._setSchemaLocation - ("http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/ejb-jar_3_2.xsd"); - clonedEjbJar.setVersion(new java.math.BigDecimal(EjbJar.VERSION_3_2)); - } else if (EjbJar.VERSION_3_1.equals(version)) { - ((org.netbeans.modules.j2ee.dd.impl.ejb.model_3_1.EjbJar)clonedEjbJar)._setSchemaLocation - ("http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/j2ee/ejb-jar_3_1.xsd"); - clonedEjbJar.setVersion(new java.math.BigDecimal(EjbJar.VERSION_3_1)); - } else if (EjbJar.VERSION_3_0.equals(version)) { - ((org.netbeans.modules.j2ee.dd.impl.ejb.model_3_0.EjbJar)clonedEjbJar)._setSchemaLocation - ("http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/j2ee/ejb-jar_3_0.xsd"); - clonedEjbJar.setVersion(new java.math.BigDecimal(EjbJar.VERSION_3_0)); - } else if (EjbJar.VERSION_2_1.equals(version)) { - ((org.netbeans.modules.j2ee.dd.impl.ejb.model_2_1.EjbJar)clonedEjbJar)._setSchemaLocation - ("http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd"); - clonedEjbJar.setVersion(new java.math.BigDecimal(EjbJar.VERSION_2_1)); + if (null != version) switch (version) { + case EjbJar.VERSION_4_1: + ((org.netbeans.modules.j2ee.dd.impl.ejb.model_4_1.EjbJar)clonedEjbJar)._setSchemaLocation + ("https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/ejb-jar_4_1.xsd"); + clonedEjbJar.setVersion(new java.math.BigDecimal(EjbJar.VERSION_4_1)); + break; + case EjbJar.VERSION_4_0: + ((org.netbeans.modules.j2ee.dd.impl.ejb.model_4_0.EjbJar)clonedEjbJar)._setSchemaLocation + ("https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/ejb-jar_4_0.xsd"); + clonedEjbJar.setVersion(new java.math.BigDecimal(EjbJar.VERSION_4_0)); + break; + case EjbJar.VERSION_3_2: + ((org.netbeans.modules.j2ee.dd.impl.ejb.model_3_2.EjbJar)clonedEjbJar)._setSchemaLocation + ("http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/ejb-jar_3_2.xsd"); + clonedEjbJar.setVersion(new java.math.BigDecimal(EjbJar.VERSION_3_2)); + break; + case EjbJar.VERSION_3_1: + ((org.netbeans.modules.j2ee.dd.impl.ejb.model_3_1.EjbJar)clonedEjbJar)._setSchemaLocation + ("http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/j2ee/ejb-jar_3_1.xsd"); + clonedEjbJar.setVersion(new java.math.BigDecimal(EjbJar.VERSION_3_1)); + break; + case EjbJar.VERSION_3_0: + ((org.netbeans.modules.j2ee.dd.impl.ejb.model_3_0.EjbJar)clonedEjbJar)._setSchemaLocation + ("http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/j2ee/ejb-jar_3_0.xsd"); + clonedEjbJar.setVersion(new java.math.BigDecimal(EjbJar.VERSION_3_0)); + break; + case EjbJar.VERSION_2_1: + ((org.netbeans.modules.j2ee.dd.impl.ejb.model_2_1.EjbJar)clonedEjbJar)._setSchemaLocation + ("http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd"); + clonedEjbJar.setVersion(new java.math.BigDecimal(EjbJar.VERSION_2_1)); + break; + default: + break; } } proxy.setError(error); diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/application-client_12.mdd b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/application-client_12.mdd new file mode 100644 index 000000000000..48b4353d4987 --- /dev/null +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/application-client_12.mdd @@ -0,0 +1,385 @@ + + + + + application-client + https://jakarta.ee/xml/ns/jakartaee + ApplicationClient + org.netbeans.modules.j2ee.dd.api.client.AppClient + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + public org.xml.sax.SAXParseException getError() { + return null; + } + public int getStatus() { + return STATE_VALID; + } + public void setVersion(java.math.BigDecimal value) { + setAttributeValue(VERSION, value.toString()); + } + public java.math.BigDecimal getVersion() { + return new java.math.BigDecimal(getAttributeValue(VERSION)); + } + + + + env-entryType + https://jakarta.ee/xml/ns/jakartaee + EnvEntry + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.EnvEntry, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "EnvEntryName"; } + + + + ejb-refType + https://jakarta.ee/xml/ns/jakartaee + EjbRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.EjbRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "EjbRefName"; } + + + + resource-refType + https://jakarta.ee/xml/ns/jakartaee + ResourceRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.ResourceRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "ResRefName"; } + + + + resource-env-refType + https://jakarta.ee/xml/ns/jakartaee + ResourceEnvRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.ResourceEnvRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "ResourceEnvRefName"; } + + + + message-destination-refType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.MessageDestinationRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "MessageDestinationRefName"; } + + + + persistence-context-refType + https://jakarta.ee/xml/ns/jakartaee + PersistenceContextRefType + + + persistence-unit-refType + https://jakarta.ee/xml/ns/jakartaee + PersistenceUnitRefType + + + lifecycle-callbackType + https://jakarta.ee/xml/ns/jakartaee + LifecycleCallbackType + + + fully-qualified-classType + https://jakarta.ee/xml/ns/jakartaee + FullyQualifiedClass + java.lang.String + + + message-destinationType + https://jakarta.ee/xml/ns/jakartaee + MessageDestination + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.MessageDestination, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "MessageDestinationName"; } + + + + string + https://jakarta.ee/xml/ns/jakartaee + String + java.lang.String + + + xsdStringType + https://jakarta.ee/xml/ns/jakartaee + XsdStringType + java.lang.String + + + descriptionType + https://jakarta.ee/xml/ns/jakartaee + DescriptionType + java.lang.String + + + display-nameType + https://jakarta.ee/xml/ns/jakartaee + DisplayNameType + java.lang.String + + + iconType + https://jakarta.ee/xml/ns/jakartaee + Icon + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + + org.netbeans.modules.j2ee.dd.api.common.Icon + + + + pathType + https://jakarta.ee/xml/ns/jakartaee + PathType + java.lang.String + + + java-identifierType + https://jakarta.ee/xml/ns/jakartaee + JavaIdentifierType + java.lang.String + + + jndi-nameType + https://jakarta.ee/xml/ns/jakartaee + JndiNameType + java.lang.String + + + injection-targetType + https://jakarta.ee/xml/ns/jakartaee + InjectionTarget + org.netbeans.modules.j2ee.dd.api.common.InjectionTarget + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + + + persistence-context-typeType + https://jakarta.ee/xml/ns/jakartaee + PersistenceContextTypeType + java.lang.String + + + message-destination-typeType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationTypeType + java.lang.String + + + message-destination-usageType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationUsageType + java.lang.String + + + message-destination-linkType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationLinkType + java.lang.String + + + res-authType + https://jakarta.ee/xml/ns/jakartaee + ResAuthType + java.lang.String + + + res-sharing-scopeType + https://jakarta.ee/xml/ns/jakartaee + ResSharingScopeType + java.lang.String + + + service-refType + https://jakarta.ee/xml/ns/jakartaee + ServiceRef + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.ServiceRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "ServiceRefName"; } + + + + xsdAnyURIType + https://jakarta.ee/xml/ns/jakartaee + XsdAnyURIType + java.net.URI + + + xsdQNameType + https://jakarta.ee/xml/ns/jakartaee + XsdQNameType + java.lang.String + + + port-component-refType + https://jakarta.ee/xml/ns/jakartaee + PortComponentRef + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + + org.netbeans.modules.j2ee.dd.api.common.PortComponentRef + + + + service-ref_handlerType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandler + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandler, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "HandlerName"; } + + + + service-ref_handler-chainsType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandlerChains + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandlerChains + + + service-ref_handler-chainType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandlerChainType + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandlerChain + + + service-ref_qname-pattern + https://jakarta.ee/xml/ns/jakartaee + ServiceRefQnamePattern + java.lang.String + + + service-ref_protocol-bindingListType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefProtocolBindingListType + String + + + param-valueType + https://jakarta.ee/xml/ns/jakartaee + InitParam + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.InitParam, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "ParamName"; } + + + + true-falseType + https://jakarta.ee/xml/ns/jakartaee + TrueFalseType + boolean + + + ejb-ref-nameType + https://jakarta.ee/xml/ns/jakartaee + EjbRefNameType + java.lang.String + + + ejb-ref-typeType + https://jakarta.ee/xml/ns/jakartaee + EjbRefTypeType + java.lang.String + + + homeType + https://jakarta.ee/xml/ns/jakartaee + HomeType + java.lang.String + + + remoteType + https://jakarta.ee/xml/ns/jakartaee + RemoteType + java.lang.String + + + ejb-linkType + https://jakarta.ee/xml/ns/jakartaee + EjbLinkType + java.lang.String + + + env-entry-type-valuesType + https://jakarta.ee/xml/ns/jakartaee + EnvEntryTypeValuesType + java.lang.String + + + + + + handlerType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandler + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandler, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "HandlerName"; } + + + + handler-chainsType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandlerChains + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandlerChains + + + handler-chainType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandlerChainType + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandlerChain + + + dewey-versionType + https://jakarta.ee/xml/ns/jakartaee + version + java.math.BigDecimal + + diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/application-client_12.xsd b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/application-client_12.xsd new file mode 100644 index 000000000000..5433eb316966 --- /dev/null +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/application-client_12.xsd @@ -0,0 +1,252 @@ + + + + + + Copyright (c) 2009, 2021 Oracle and/or its affiliates. All rights reserved. + + This program and the accompanying materials are made available under the + terms of the Eclipse Public License v. 2.0, which is available at + http://www.eclipse.org/legal/epl-2.0. + + This Source Code may also be made available under the following Secondary + Licenses when the conditions for such availability set forth in the + Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + version 2 with the GNU Classpath Exception, which is available at + https://www.gnu.org/software/classpath/license.html. + + SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + + + + + + + + ... + + + The instance documents may indicate the published version of + the schema using the xsi:schemaLocation attribute for Jakarta EE + namespace with the following location: + + https://jakarta.ee/xml/ns/jakartaee/application-client_12.xsd + + ]]> + + + + + + + The following conventions apply to all Jakarta EE + deployment descriptor elements unless indicated otherwise. + + - In elements that specify a pathname to a file within the + same JAR file, relative filenames (i.e., those not + starting with "/") are considered relative to the root of + the JAR file's namespace. Absolute filenames (i.e., those + starting with "/") also specify names in the root of the + JAR file's namespace. In general, relative names are + preferred. The exception is .war files where absolute + names are preferred for consistency with the Servlet API. + + + + + + + + + + + + + + The application-client element is the root element of an + application client deployment descriptor. The application + client deployment descriptor describes the enterprise bean + components and external resources referenced by the + application client. + + + + + + + + The env-entry-name element contains the name of an + application client's environment entry. The name is a JNDI + name relative to the java:comp/env context. The name must + be unique within an application client. + + + + + + + + + + + The ejb-ref-name element contains the name of an enterprise bean + reference. The enterprise bean reference is an entry + in the application client's environment and is relative to the + java:comp/env context. The name must be unique within the + application client. + + It is recommended that name is prefixed with "ejb/". + + + + + + + + + + + The res-ref-name element specifies the name of a + resource manager connection factory reference.The name + is a JNDI name relative to the java:comp/env context. + The name must be unique within an application client. + + + + + + + + + + + The resource-env-ref-name element specifies the name of + a resource environment reference; its value is the + environment entry name used in the application client + code. The name is a JNDI name relative to the + java:comp/env context and must be unique within an + application client. + + + + + + + + + + + The message-destination-ref-name element specifies the + name of a message destination reference; its value is + the message destination reference name used in the + application client code. The name is a JNDI name + relative to the java:comp/env context and must be unique + within an application client. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The callback-handler element names a class provided by + the application. The class must have a no args + constructor and must implement the + jakarta.security.auth.callback.CallbackHandler + interface. The class will be instantiated by the + application client container and used by the container + to collect authentication information from the user. + + + + + + + + + + + + + + + + + The required value for the version is 12. + + + + + + + + + The metadata-complete attribute defines whether this + deployment descriptor and other related deployment + descriptors for this module (e.g., web service + descriptors) are complete, or whether the class + files available to this module and packaged with + this application should be examined for annotations + that specify deployment information. + + If metadata-complete is set to "true", the deployment + tool must ignore any annotations that specify deployment + information, which might be present in the class files + of the application. + + If metadata-complete is not specified or is set to + "false", the deployment tool must examine the class + files of the application for annotations, as + specified by the specifications. + + + + + + + + diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/application_12.mdd b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/application_12.mdd new file mode 100644 index 000000000000..f6d1653101a0 --- /dev/null +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/application_12.mdd @@ -0,0 +1,111 @@ + + + + + application + https://jakarta.ee/xml/ns/jakartaee + Application + org.netbeans.modules.j2ee.dd.api.application.Application + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + public org.xml.sax.SAXParseException getError() { + return null; + } + public int getStatus() { + return STATE_VALID; + } + public void setVersion(java.math.BigDecimal value) { + setAttributeValue(VERSION, value.toString()); + } + public java.math.BigDecimal getVersion() { + return new java.math.BigDecimal(getAttributeValue(VERSION)); + } + + + + moduleType + https://jakarta.ee/xml/ns/jakartaee + Module + org.netbeans.modules.j2ee.dd.api.application.Module + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + + + security-roleType + https://jakarta.ee/xml/ns/jakartaee + SecurityRole + org.netbeans.modules.j2ee.dd.api.common.SecurityRole + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + + pathType + https://jakarta.ee/xml/ns/jakartaee + Path + java.lang.String + + + descriptionType + https://jakarta.ee/xml/ns/jakartaee + Description + java.lang.String + + + xsdStringType + https://jakarta.ee/xml/ns/jakartaee + XsdString + java.lang.String + + + role-nameType + https://jakarta.ee/xml/ns/jakartaee + RoleName + java.lang.String + + + webType + https://jakarta.ee/xml/ns/jakartaee + Web + org.netbeans.modules.j2ee.dd.api.application.Web + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + + public String getWebUriId() throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException { + throw new org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException(org.netbeans.modules.j2ee.dd.api.application.Application.VERSION_12); + } + public void setWebUriId(String value) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException { + throw new org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException(org.netbeans.modules.j2ee.dd.api.application.Application.VERSION_12); + } + + + + string + https://jakarta.ee/xml/ns/jakartaee + String + java.lang.String + + + display-nameType + https://jakarta.ee/xml/ns/jakartaee + DisplayName + java.lang.String + + + iconType + https://jakarta.ee/xml/ns/jakartaee + Icon + org.netbeans.modules.j2ee.dd.api.common.Icon + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + + diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/application_12.xsd b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/application_12.xsd new file mode 100644 index 000000000000..80f4dc171646 --- /dev/null +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/application_12.xsd @@ -0,0 +1,390 @@ + + + + + + + Copyright (c) 2009, 2023 Oracle and/or its affiliates and others. + All rights reserved. + + This program and the accompanying materials are made available under the + terms of the Eclipse Public License v. 2.0, which is available at + http://www.eclipse.org/legal/epl-2.0. + + This Source Code may also be made available under the following Secondary + Licenses when the conditions for such availability set forth in the + Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + version 2 with the GNU Classpath Exception, which is available at + https://www.gnu.org/software/classpath/license.html. + + SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + + + + + + + + ... + + + The instance documents may indicate the published version of + the schema using the xsi:schemaLocation attribute for Jakarta EE + namespace with the following location: + + https://jakarta.ee/xml/ns/jakartaee/application_12.xsd + + ]]> + + + + + + + The following conventions apply to all Jakarta EE + deployment descriptor elements unless indicated otherwise. + + - In elements that specify a pathname to a file within the + same JAR file, relative filenames (i.e., those not + starting with "/") are considered relative to the root of + the JAR file's namespace. Absolute filenames (i.e., those + starting with "/") also specify names in the root of the + JAR file's namespace. In general, relative names are + preferred. The exception is .war files where absolute + names are preferred for consistency with the Servlet API. + + + + + + + + + + + + + + + + The application element is the root element of a Jakarta EE + application deployment descriptor. + + + + + + + + + The context-root element content must be unique + in the ear. + + + + + + + + + + + + The security-role-name element content + must be unique in the ear. + + + + + + + + + + + + + + + + The applicationType defines the structure of the + application. + + + + + + + + + + + If initialize-in-order is true, modules must be initialized + in the order they're listed in this deployment descriptor, + with the exception of application client modules, which can + be initialized in any order. + If initialize-in-order is not set or set to false, the order + of initialization is unspecified and may be product-dependent. + + + + + + + + The application deployment descriptor must have one + module element for each Jakarta EE module in the + application package. A module element is defined + by moduleType definition. + + + + + + + + + + The library-directory element specifies the pathname + of a directory within the application package, relative + to the top level of the application package. All files + named "*.jar" in this directory must be made available + in the class path of all components included in this + application package. If this element isn't specified, + the directory named "lib" is searched. An empty element + may be used to disable searching. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The required value for the version is 12. + + + + + + + + + + + + + + + The moduleType defines a single Jakarta EE module and contains a + connector, ejb, java, or web element, which indicates the + module type and contains a path to the module file, and an + optional alt-dd element, which specifies an optional URI to + the post-assembly version of the deployment descriptor. + + + + + + + + + + + The connector element specifies the URI of a + resource adapter archive file, relative to the + top level of the application package. + + + + + + + + + The ejb element specifies the URI of an ejb-jar, + relative to the top level of the application + package. + + + + + + + + + The java element specifies the URI of a java + application client module, relative to the top + level of the application package. + + + + + + + + + + + The alt-dd element specifies an optional URI to the + post-assembly version of the deployment descriptor + file for a particular Jakarta EE module. The URI must + specify the full pathname of the deployment + descriptor file relative to the application's root + directory. If alt-dd is not specified, the deployer + must read the deployment descriptor from the default + location and file name required by the respective + component specification. + + + + + + + + + + + + + + + The webType defines the web-uri and context-root of + a web application module. + + + + + + + + + The web-uri element specifies the URI of a web + application file, relative to the top level of the + application package. + + + + + + + + + + The context-root element specifies the context root + of a web application. + + + + + + + + diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/beans_5_0.xsd b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/beans_5_0.xsd new file mode 100644 index 000000000000..5fd85caa5e34 --- /dev/null +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/beans_5_0.xsd @@ -0,0 +1,372 @@ + + + + + + + + + + ... + + + The deployment descriptor may indicate the published version of + the schema using the xsi:schemaLocation attribute for the Java EE + namespace with the following location: + + https://jakarta.ee/xml/ns/jakartaee/beans_5_0.xsd + + ]]> + + + + + + + Bean classes of enabled beans must be + deployed in bean archives. A library jar, EJB jar, + application client jar or rar archive is a bean archive if + it has a file named beans.xml in the META-INF directory. The + WEB-INF/classes directory of a war is a bean archive if + there is a file named beans.xml in the WEB-INF directory of + the war. A directory in the JVM classpath is a bean archive + if it has a file named beans.xml in the META-INF directory. + + When running in a CDI Lite environment, the bean-discovery-mode + attribute is the only configuration value read from a beans.xml file. + + + + + + + + + + + + + + The version of CDI this beans.xml is for. If the version is "5.0" (or + later), then the attribute bean-discovery-mode must be added. + + + + + + + + + + + + It is strongly recommended you use "annotated". This is now the default and it + is also the default as of 5.0 when an empty beans.xml file is seen. When running + in a CDI Lite environment, this is the only aspect of the beans.xml file that + is used. + + If the bean discovery mode is "all", then all types in this + archive will be considered. If the bean discovery mode is + "annotated", then only those types with bean defining annotations will be + considered. If the bean discovery mode is "none", then no + types will be considered. + + + + + + + + Only those types with bean defining annotations will be + considered. + + + + + + + All types in this archive will be considered. + + + + + + + This archive will be ignored. + + + + + + + + + + + + + element allows exclusion of classes and packages from consideration. Various filters may be applied, and may be conditionally activated.]]> + + + + + + + + would exclude all classes and subpackages of com.acme.]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + would exclude all classes and subpackages of com.acme.]]> + + + + + + + + + + + + + + + + + + By default, a bean archive has no enabled + interceptors bound via interceptor bindings. An interceptor + must be explicitly enabled by listing its class under the + <interceptors> element of the beans.xml file of the + bean archive. The order of the interceptor declarations + determines the interceptor ordering. Interceptors which + occur earlier in the list are called first. If the same + class is listed twice under the <interceptors> + element, the container automatically detects the problem and + treats it as a deployment problem. + + + + + + + + Each child <class> element + must specify the name of an interceptor class. If + there is no class with the specified name, or if + the class with the specified name is not an + interceptor class, the container automatically + detects the problem and treats it as a deployment + problem. + + + + + + + + + + + By default, a bean archive has no enabled + decorators. A decorator must be explicitly enabled by + listing its bean class under the <decorators> element + of the beans.xml file of the bean archive. The order of the + decorator declarations determines the decorator ordering. + Decorators which occur earlier in the list are called first. + If the same class is listed twice under the + <decorators> element, the container automatically + detects the problem and treats it as a deployment problem. + + + + + + + + Each child <class> element + must specify the name of a decorator class. If + there is no class with the specified name, or if + the class with the specified name is not a + decorator class, the container automatically + detects the problem and treats it as a deployment + problem. + + + + + + + + + + + An alternative is a bean that must be + explicitly declared in the beans.xml file if it should be + available for lookup, injection or EL resolution. By + default, a bean archive has no selected alternatives. An + alternative must be explicitly declared using the + <alternatives> element of the beans.xml file of the + bean archive. The <alternatives> element contains a + list of bean classes and stereotypes. An alternative is + selected for the bean archive if either: the alternative is + a managed bean or session bean and the bean class of the + bean is listed, or the alternative is a producer method, + field or resource, and the bean class that declares the + method or field is listed, or any @Alternative stereotype of + the alternative is listed. + + + + + + + + Each child <class> element + must specify the name of an alternative bean class. + If there is no class with the specified name, or if + the class with the specified name is not an + alternative bean class, the container automatically + detects the problem and treats it as a deployment + problem. If the same class is listed twice under + the <alternatives> element, the container + automatically detects the problem and treats it as + a deployment problem. + + + + + + + + Each child <stereotype> + element must specify the name of an @Alternative + stereotype annotation. If there is no annotation + with the specified name, or the annotation is not + an @Alternative stereotype, the container + automatically detects the problem and treats it as + a deployment problem. If the same stereotype is + listed twice under the <alternatives> + element, the container automatically detects the + problem and treats it as a deployment problem. + + + + + + + + + + If an explicit bean archive contains the <trim/< element in its beans.xml file, types that don’t have + either a bean defining annotation (as defined in Bean defining annotations) or any scope annotation, + are removed from the set of discovered types. + + + + + diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/ejb-jar_4_1.mdd b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/ejb-jar_4_1.mdd new file mode 100644 index 000000000000..26db9bafc2fb --- /dev/null +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/ejb-jar_4_1.mdd @@ -0,0 +1,732 @@ + + + + + ejb-jar + https://jakarta.ee/xml/ns/jakartaee + EjbJar + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.api.ejb.EjbJar + + public org.xml.sax.SAXParseException getError() { + return null; + } + public int getStatus() { + return STATE_VALID; + } + public String getSingleEjbClientJar() { + return getEjbClientJar(); + } + public org.netbeans.modules.j2ee.dd.api.ejb.AssemblyDescriptor getSingleAssemblyDescriptor() { + return getAssemblyDescriptor(); + } + public org.netbeans.modules.j2ee.dd.api.ejb.Relationships getSingleRelationships() { + return getRelationships(); + } + public void setVersion(java.math.BigDecimal value) { + setAttributeValue(VERSION, value.toString()); + } + public java.math.BigDecimal getVersion() { + return new java.math.BigDecimal(getAttributeValue(VERSION)); + } + public Object clone() { + org.netbeans.modules.j2ee.dd.api.ejb.EjbJar ejbJar = + (org.netbeans.modules.j2ee.dd.api.ejb.EjbJar) super.clone(); + ejbJar.setVersion( getVersion()); + return ejbJar; + } + + + + enterprise-beansType + https://jakarta.ee/xml/ns/jakartaee + EnterpriseBeans + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.api.ejb.EnterpriseBeans + org.netbeans.modules.j2ee.dd.impl.common.GetAllEjbs + + + interceptorsType + https://jakarta.ee/xml/ns/jakartaee + Interceptors + org.netbeans.modules.j2ee.dd.api.ejb.Interceptors + + + relationshipsType + https://jakarta.ee/xml/ns/jakartaee + Relationships + org.netbeans.modules.j2ee.dd.api.ejb.Relationships + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + + assembly-descriptorType + https://jakarta.ee/xml/ns/jakartaee + AssemblyDescriptor + org.netbeans.modules.j2ee.dd.api.ejb.AssemblyDescriptor + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + + + pathType + https://jakarta.ee/xml/ns/jakartaee + Path + java.lang.String + + + security-roleType + https://jakarta.ee/xml/ns/jakartaee + SecurityRole + org.netbeans.modules.j2ee.dd.api.common.SecurityRole + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple e + + + method-permissionType + https://jakarta.ee/xml/ns/jakartaee + MethodPermission + org.netbeans.modules.j2ee.dd.api.ejb.MethodPermission + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + + container-transactionType + https://jakarta.ee/xml/ns/jakartaee + ContainerTransaction + org.netbeans.modules.j2ee.dd.api.ejb.ContainerTransaction + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + + interceptor-bindingType + https://jakarta.ee/xml/ns/jakartaee + InterceptorBinding + org.netbeans.modules.j2ee.dd.api.ejb.InterceptorBinding + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + + message-destinationType + https://jakarta.ee/xml/ns/jakartaee + MessageDestination + org.netbeans.modules.j2ee.dd.api.common.MessageDestination + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + + exclude-listType + https://jakarta.ee/xml/ns/jakartaee + ExcludeList + org.netbeans.modules.j2ee.dd.api.ejb.ExcludeList + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + + application-exceptionType + https://jakarta.ee/xml/ns/jakartaee + ApplicationException + org.netbeans.modules.j2ee.dd.api.ejb.ApplicationException + + + fully-qualified-classType + https://jakarta.ee/xml/ns/jakartaee + FullyQualifiedClass + java.lang.String + + + true-falseType + https://jakarta.ee/xml/ns/jakartaee + TrueFalse + boolean + + + descriptionType + https://jakarta.ee/xml/ns/jakartaee + Description + java.lang.String + + + xsdStringType + https://jakarta.ee/xml/ns/jakartaee + XsdString + java.lang.String + + + methodType + https://jakarta.ee/xml/ns/jakartaee + Method + org.netbeans.modules.j2ee.dd.api.ejb.Method + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + + ejb-nameType + https://jakarta.ee/xml/ns/jakartaee + EjbName + java.lang.String + + + method-intfType + https://jakarta.ee/xml/ns/jakartaee + MethodIntf + java.lang.String + + + method-nameType + https://jakarta.ee/xml/ns/jakartaee + MethodName + java.lang.String + + + method-paramsType + https://jakarta.ee/xml/ns/jakartaee + MethodParams + org.netbeans.modules.j2ee.dd.api.ejb.MethodParams + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + + + java-typeType + https://jakarta.ee/xml/ns/jakartaee + JavaType + java.lang.String + + + string + https://jakarta.ee/xml/ns/jakartaee + String + java.lang.String + + + display-nameType + https://jakarta.ee/xml/ns/jakartaee + DisplayName + java.lang.String + + + iconType + https://jakarta.ee/xml/ns/jakartaee + Icon + org.netbeans.modules.j2ee.dd.api.common.Icon + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + + + named-methodType + https://jakarta.ee/xml/ns/jakartaee + NamedMethod + org.netbeans.modules.j2ee.dd.api.ejb.NamedMethod + + + interceptor-orderType + https://jakarta.ee/xml/ns/jakartaee + InterceptorOrder + org.netbeans.modules.j2ee.dd.api.ejb.InterceptorOrder + + + trans-attributeType + https://jakarta.ee/xml/ns/jakartaee + TransAttribute + java.lang.String + + + role-nameType + https://jakarta.ee/xml/ns/jakartaee + RoleName + java.lang.String + + + emptyType + https://jakarta.ee/xml/ns/jakartaee + Empty + boolean + + + + ejb-relationType + https://jakarta.ee/xml/ns/jakartaee + EjbRelation + org.netbeans.modules.j2ee.dd.api.ejb.EjbRelation + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + @Override + public void setEjbRelationshipRole2(org.netbeans.modules.j2ee.dd.api.ejb.EjbRelationshipRole value) { + this.setValue(EJB_RELATIONSHIP_ROLE, 1, value); + } + + @Override + public org.netbeans.modules.j2ee.dd.api.ejb.EjbRelationshipRole getEjbRelationshipRole2() { + return (EjbRelationshipRole)this.getValue(EJB_RELATIONSHIP_ROLE, 1); + } + + + + ejb-relationship-roleType + https://jakarta.ee/xml/ns/jakartaee + EjbRelationshipRole + org.netbeans.modules.j2ee.dd.api.ejb.EjbRelationshipRole + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + + multiplicityType + https://jakarta.ee/xml/ns/jakartaee + Multiplicity + java.lang.String + + + relationship-role-sourceType + https://jakarta.ee/xml/ns/jakartaee + RelationshipRoleSource + org.netbeans.modules.j2ee.dd.api.ejb.RelationshipRoleSource + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + + cmr-fieldType + https://jakarta.ee/xml/ns/jakartaee + CmrField + org.netbeans.modules.j2ee.dd.api.ejb.CmrField + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + + cmr-field-typeType + https://jakarta.ee/xml/ns/jakartaee + CmrFieldType + java.lang.String + + + interceptorType + https://jakarta.ee/xml/ns/jakartaee + Interceptor + org.netbeans.modules.j2ee.dd.api.ejb.Interceptor + + + around-invokeType + https://jakarta.ee/xml/ns/jakartaee + AroundInvoke + org.netbeans.modules.j2ee.dd.api.ejb.AroundInvoke + + + lifecycle-callbackType + https://jakarta.ee/xml/ns/jakartaee + LifecycleCallback + org.netbeans.modules.j2ee.dd.api.ejb.LifecycleCallback + + + java-identifierType + https://jakarta.ee/xml/ns/jakartaee + JavaIdentifier + java.lang.String + + + env-entryType + https://jakarta.ee/xml/ns/jakartaee + EnvEntry + org.netbeans.modules.j2ee.dd.api.common.EnvEntry + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + + ejb-refType + https://jakarta.ee/xml/ns/jakartaee + EjbRef + org.netbeans.modules.j2ee.dd.api.common.EjbRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + + ejb-local-refType + https://jakarta.ee/xml/ns/jakartaee + EjbLocalRef + org.netbeans.modules.j2ee.dd.api.common.EjbLocalRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + + resource-refType + https://jakarta.ee/xml/ns/jakartaee + ResourceRef + org.netbeans.modules.j2ee.dd.api.common.ResourceRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + + resource-env-refType + https://jakarta.ee/xml/ns/jakartaee + ResourceEnvRef + org.netbeans.modules.j2ee.dd.api.common.ResourceEnvRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + + message-destination-refType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationRef + org.netbeans.modules.j2ee.dd.api.common.MessageDestinationRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + + persistence-context-refType + https://jakarta.ee/xml/ns/jakartaee + PersistenceContextRef + org.netbeans.modules.j2ee.dd.api.ejb.PersistenceContextRef + + + persistence-unit-refType + https://jakarta.ee/xml/ns/jakartaee + PersistenceUnitRef + org.netbeans.modules.j2ee.dd.api.ejb.PersistenceUnitRef + + + jndi-nameType + https://jakarta.ee/xml/ns/jakartaee + JndiName + java.lang.String + + + injection-targetType + https://jakarta.ee/xml/ns/jakartaee + InjectionTarget + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + org.netbeans.modules.j2ee.dd.api.common.InjectionTarget + + + persistence-context-typeType + https://jakarta.ee/xml/ns/jakartaee + PersistenceContextType + java.lang.String + + + propertyType + https://jakarta.ee/xml/ns/jakartaee + Property + org.netbeans.modules.j2ee.dd.api.ejb.Property + + + message-destination-typeType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationType + java.lang.String + + + message-destination-usageType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationUsage + java.lang.String + + + message-destination-linkType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationLink + java.lang.String + + + res-authType + https://jakarta.ee/xml/ns/jakartaee + ResAuth + java.lang.String + + + res-sharing-scopeType + https://jakarta.ee/xml/ns/jakartaee + ResSharingScope + java.lang.String + + + service-refType + https://jakarta.ee/xml/ns/jakartaee + ServiceRef + org.netbeans.modules.j2ee.dd.api.common.ServiceRef + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + + xsdAnyURIType + https://jakarta.ee/xml/ns/jakartaee + XsdAnyURI + java.net.URI + + + xsdQNameType + https://jakarta.ee/xml/ns/jakartaee + XsdQName + java.lang.String + + + port-component-refType + https://jakarta.ee/xml/ns/jakartaee + PortComponentRef + org.netbeans.modules.j2ee.dd.api.common.PortComponentRef + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + + + service-ref_handlerType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandler + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandler + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + + service-ref_handler-chainsType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandlerChains + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandlerChains + + + service-ref_handler-chainType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandlerChain + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandlerChain + + + service-ref_qname-pattern + https://jakarta.ee/xml/ns/jakartaee + ServiceRefQnamePattern + java.lang.String + + + service-ref_protocol-bindingListType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefProtocolBindingList + String + + + param-valueType + https://jakarta.ee/xml/ns/jakartaee + InitParam + org.netbeans.modules.j2ee.dd.api.common.InitParam + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + + ejb-ref-nameType + https://jakarta.ee/xml/ns/jakartaee + EjbRefName + java.lang.String + + + ejb-ref-typeType + https://jakarta.ee/xml/ns/jakartaee + EjbRefType + java.lang.String + + + local-homeType + https://jakarta.ee/xml/ns/jakartaee + LocalHome + java.lang.String + + + localType + https://jakarta.ee/xml/ns/jakartaee + Local + java.lang.String + + + ejb-linkType + https://jakarta.ee/xml/ns/jakartaee + EjbLink + java.lang.String + + + homeType + https://jakarta.ee/xml/ns/jakartaee + Home + java.lang.String + + + remoteType + https://jakarta.ee/xml/ns/jakartaee + Remote + java.lang.String + + + env-entry-type-valuesType + https://jakarta.ee/xml/ns/jakartaee + EnvEntryTypeValues + java.lang.String + + + session-beanType + https://jakarta.ee/xml/ns/jakartaee + SessionBean + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.api.ejb.Session,org.netbeans.modules.j2ee.dd.impl.common.KeyBean + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + public String getKeyProperty() { + return "EjbName"; + } + public org.netbeans.modules.j2ee.dd.api.ejb.EjbJar getRoot() { + return (org.netbeans.modules.j2ee.dd.api.ejb.EjbJar) _getRoot(); + } + + + + entity-beanType + https://jakarta.ee/xml/ns/jakartaee + EntityBean + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.api.ejb.Entity,org.netbeans.modules.j2ee.dd.impl.common.KeyBean + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + public String getKeyProperty() { + return "EjbName"; + } + public org.netbeans.modules.j2ee.dd.api.ejb.EjbJar getRoot() { + return (org.netbeans.modules.j2ee.dd.api.ejb.EjbJar) _getRoot(); + } + + + + message-driven-beanType + https://jakarta.ee/xml/ns/jakartaee + MessageDrivenBean + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.api.ejb.MessageDriven,org.netbeans.modules.j2ee.dd.impl.common.KeyBean + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + public org.netbeans.modules.j2ee.dd.api.ejb.EjbJar getRoot() { + return (org.netbeans.modules.j2ee.dd.api.ejb.EjbJar) _getRoot(); + } + // not needed for with 3.1 + public String getKeyProperty() { + return "EjbName"; + } + + + + ejb-classType + https://jakarta.ee/xml/ns/jakartaee + EjbClass + java.lang.String + + + transaction-typeType + https://jakarta.ee/xml/ns/jakartaee + TransactionType + java.lang.String + + + activation-configType + https://jakarta.ee/xml/ns/jakartaee + ActivationConfig + org.netbeans.modules.j2ee.dd.api.ejb.ActivationConfig + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + + security-identityType + https://jakarta.ee/xml/ns/jakartaee + SecurityIdentity + org.netbeans.modules.j2ee.dd.api.ejb.SecurityIdentity + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + + run-asType + https://jakarta.ee/xml/ns/jakartaee + RunAs + org.netbeans.modules.j2ee.dd.api.common.RunAs + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + + activation-config-propertyType + https://jakarta.ee/xml/ns/jakartaee + ActivationConfigProperty + org.netbeans.modules.j2ee.dd.api.ejb.ActivationConfigProperty + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + + persistence-typeType + https://jakarta.ee/xml/ns/jakartaee + PersistenceType + java.lang.String + + + cmp-versionType + https://jakarta.ee/xml/ns/jakartaee + CmpVersion + java.lang.String + + + cmp-fieldType + https://jakarta.ee/xml/ns/jakartaee + CmpField + org.netbeans.modules.j2ee.dd.api.ejb.CmpField + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + + security-role-refType + https://jakarta.ee/xml/ns/jakartaee + SecurityRoleRef + org.netbeans.modules.j2ee.dd.api.common.SecurityRoleRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + + queryType + https://jakarta.ee/xml/ns/jakartaee + Query + org.netbeans.modules.j2ee.dd.api.ejb.Query + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanSingle + + + query-methodType + https://jakarta.ee/xml/ns/jakartaee + QueryMethod + org.netbeans.modules.j2ee.dd.api.ejb.QueryMethod + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + + + result-type-mappingType + https://jakarta.ee/xml/ns/jakartaee + ResultTypeMapping + java.lang.String + + + session-typeType + https://jakarta.ee/xml/ns/jakartaee + SessionType + java.lang.String + + + init-methodType + https://jakarta.ee/xml/ns/jakartaee + InitMethod + org.netbeans.modules.j2ee.dd.api.ejb.InitMethod + + + remove-methodType + https://jakarta.ee/xml/ns/jakartaee + RemoveMethod + org.netbeans.modules.j2ee.dd.api.ejb.RemoveMethod + + + + + + handlerType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandler + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandler, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "HandlerName"; } + + + + handler-chainsType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandlerChains + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandlerChains + + + handler-chainType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandlerChainType + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandlerChain + + + dewey-versionType + https://jakarta.ee/xml/ns/jakartaee + version + java.math.BigDecimal + + diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/ejb-jar_4_1.xsd b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/ejb-jar_4_1.xsd new file mode 100644 index 000000000000..75a695d07410 --- /dev/null +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/ejb-jar_4_1.xsd @@ -0,0 +1,3351 @@ + + + + + + Copyright (c) 2009, 2021 Oracle and/or its affiliates. All rights reserved. + + This program and the accompanying materials are made available under the + terms of the Eclipse Public License v. 2.0, which is available at + http://www.eclipse.org/legal/epl-2.0. + + This Source Code may also be made available under the following Secondary + Licenses when the conditions for such availability set forth in the + Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + version 2 with the GNU Classpath Exception, which is available at + https://www.gnu.org/software/classpath/license.html. + + SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + + + + + + + + ... + + + The instance documents may indicate the published version of + the schema using the xsi:schemaLocation attribute for the + Jakarta EE namespace with the following location: + + https://jakarta.ee/xml/ns/jakartaee/ejb-jar_4_1.xsd + + ]]> + + + + + + + The following conventions apply to all Jakarta EE + deployment descriptor elements unless indicated otherwise. + + - In elements that specify a pathname to a file within the + same JAR file, relative filenames (i.e., those not + starting with "/") are considered relative to the root of + the JAR file's namespace. Absolute filenames (i.e., those + starting with "/") also specify names in the root of the + JAR file's namespace. In general, relative names are + preferred. The exception is .war files where absolute + names are preferred for consistency with the Servlet API. + + + + + + + + + + + + + + This is the root of the ejb-jar deployment descriptor. + + + + + + + + The ejb-name element contains the name of an enterprise + bean. The name must be unique within the ejb-jar file or + .war file. + + + + + + + + + + + The keyref indicates the references from + relationship-role-source must be to a specific ejb-name + defined within the scope of enterprise-beans element. + + + + + + + + + + + A role-name-key is specified to allow the references + from the security-role-refs. + + + + + + + + + + + The keyref indicates the references from + security-role-ref to a specified role-name. + + + + + + + + + + + + + + + + The access-timeoutType represents the maximum amount of + time (in a given time unit) that the container should wait for + a concurrency lock before throwing a timeout exception to the + client. + + A timeout value of 0 means concurrent access is not permitted. + + A timeout value of -1 means wait indefinitely to acquire a lock. + + + + + + + + + + + + + + + + + + The async-methodType element specifies that a session + bean method has asynchronous invocation semantics. + + + + + + + + + + + + + + + + + + The activation-configType defines information about the + expected configuration properties of the message-driven bean + in its operational environment. This may include information + about message acknowledgement, message selector, expected + destination type, destination or connection factory lookup + string, subscription name, etc. + + The configuration information is expressed in terms of + name/value configuration properties. + + The properties that are recognized for a particular + message-driven bean are determined by the messaging type. + + + + + + + + + + + + + + + + + + The activation-config-propertyType contains a name/value + configuration property pair for a message-driven bean. + + The properties that are recognized for a particular + message-driven bean are determined by the messaging type. + + + + + + + + + The activation-config-property-name element contains + the name for an activation configuration property of + a message-driven bean. + + For Jakarta Messaging message-driven beans, the following property + names are recognized: acknowledgeMode, + messageSelector, destinationType, subscriptionDurability, + destinationLookup, connectionFactoryLookup, subscriptionName, + and clientId. + + + + + + + + + The activation-config-property-value element + contains the value for an activation configuration + property of a message-driven bean. + + + + + + + + + + + + + + + + The around-invoke type specifies a method on a + class to be called during the around invoke portion of an + ejb invocation. Note that each class may have only one + around invoke method and that the method may not be + overloaded. + + If the class element is missing then + the class defining the callback is assumed to be the + interceptor class or component class in scope at the + location in the descriptor in which the around invoke + definition appears. + + + + + + + + + + + + + + + + + The around-timeout type specifies a method on a + class to be called during the around-timeout portion of + a timer timeout callback. Note that each class may have + only one around-timeout method and that the method may not + be overloaded. + + If the class element is missing then + the class defining the callback is assumed to be the + interceptor class or component class in scope at the + location in the descriptor in which the around-timeout + definition appears. + + + + + + + + + + + + + + + + + The assembly-descriptorType defines + application-assembly information. + + The application-assembly information consists of the + following parts: the definition of security roles, the + definition of method permissions, the definition of + transaction attributes for enterprise beans with + container-managed transaction demarcation, the definition + of interceptor bindings, a list of + methods to be excluded from being invoked, and a list of + exception types that should be treated as application exceptions. + + All the parts are optional in the sense that they are + omitted if the lists represented by them are empty. + + Providing an assembly-descriptor in the deployment + descriptor is optional for the ejb-jar file or .war file producer. + + + + + + + + + + + + + + + + + + + + + + + The cmp-fieldType describes a container-managed field. The + cmp-fieldType contains an optional description of the field, + and the name of the field. + + + + + + + + + + The field-name element specifies the name of a + container managed field. + + The name of the cmp-field of an entity bean with + cmp-version 2.x must begin with a lowercase + letter. This field is accessed by methods whose + names consists of the name of the field specified by + field-name in which the first letter is uppercased, + prefixed by "get" or "set". + + The name of the cmp-field of an entity bean with + cmp-version 1.x must denote a public field of the + enterprise bean class or one of its superclasses. + + Support for entity beans is optional as of Enterprise Beans 3.2. + + + + + + + + + + + + + + + + The cmp-versionType specifies the version of an entity bean + with container-managed persistence. It is used by + cmp-version elements. + + The value must be one of the two following: + + 1.x + 2.x + + Support for entity beans is optional as of Enterprise Beans 3.2. + + + + + + + + + + + + + + + + + + + The cmr-fieldType describes the Bean Provider's view of + a relationship. It consists of an optional description, and + the name and the class type of a field in the source of a + role of a relationship. The cmr-field-name element + corresponds to the name used for the get and set accessor + methods for the relationship. The cmr-field-type element is + used only for collection-valued cmr-fields. It specifies the + type of the collection that is used. + + Support for entity beans is optional as of Enterprise Beans 3.2. + + + + + + + + + + The cmr-field-name element specifies the name of a + logical relationship field in the entity bean + class. The name of the cmr-field must begin with a + lowercase letter. This field is accessed by methods + whose names consist of the name of the field + specified by cmr-field-name in which the first + letter is uppercased, prefixed by "get" or "set". + + Support for entity beans is optional as of Enterprise Beans 3.2. + + + + + + + + + + + + + + + + + The cmr-field-type element specifies the class of a + collection-valued logical relationship field in the entity + bean class. The value of an element using cmr-field-typeType + must be either: java.util.Collection or java.util.Set. + + + + + + + + + + + + + + + + + + + The concurrency-management-typeType specifies the way concurrency + is managed for a singleton or stateful session bean. + + The concurrency management type must be one of the following: + + Bean + Container + + Bean managed concurrency can only be specified for a singleton bean. + + + + + + + + + + + + + + + + + + + The concurrent-lock-typeType specifies how the container must + manage concurrent access to a method of a Singleton bean + with container-managed concurrency. + + The container managed concurrency lock type must be one + of the following : + + Read + Write + + + + + + + + + + + + + + + + + + + The concurrent-methodType specifies information about a method + of a bean with container managed concurrency. + + The optional lock element specifies the kind of concurrency + lock asssociated with the method. + + The optional access-timeout element specifies the amount of + time (in a given time unit) the container should wait for a + concurrency lock before throwing an exception to the client. + + + + + + + + + + + + + + + + + + + The container-transactionType specifies how the container + must manage transaction scopes for the enterprise bean's + method invocations. It defines an optional description, a + list of method elements, and a transaction attribute. The + transaction attribute is to be applied to all the specified + methods. + + + + + + + + + + + + + + + + + + + The depends-onType is used to express initialization + ordering dependencies between Singleton components. + The depends-onType specifies the names of one or more + Singleton beans in the same application as the referring + Singleton, each of which must be initialized before + the referring bean. + + Each dependent bean is expressed using ejb-link syntax. + The order in which dependent beans are initialized at + runtime is not guaranteed to match the order in which + they are listed. + + + + + + + + + + + + + + + + com.wombat.empl.EmployeeServiceBean + + ]]> + + + + + + + + + + + + + + + The ejb-jarType defines the root element of the Enterprise Beans + deployment descriptor. It contains + + - an optional description of the ejb-jar file + - an optional display name + - an optional icon that contains a small and a large + icon file name + - an optional module name. Only applicable to + stand-alone ejb-jars or ejb-jars packaged in an ear. + Ignored if specified for an ejb-jar.xml within a .war file. + In that case, standard .war file module-name rules apply. + - structural information about all included + enterprise beans that is not specified through + annotations + - structural information about interceptor classes + - a descriptor for container managed relationships, + if any. + - an optional application-assembly descriptor + - an optional name of an ejb-client-jar file for the + ejb-jar. + + + + + + + + + + + + + + The ejb-relation-name contains the name of a + relation. The name must be unique within + relationships. + + + + + + + + + + + + Providing an assembly-descriptor in the deployment + descriptor is optional for the ejb-jar file or .war file + producer. + + + + + + + + employee_service_client.jar + + + ]]> + + + + + + + + + The version specifies the version of the + Enterprise Beans specification that the instance document must + comply with. This information enables deployment tools + to validate a particular Enterprise Beans Deployment + Descriptor with respect to a specific version of the Enterprise Beans + schema. + + + + + + + + + The metadata-complete attribute defines whether this + deployment descriptor and other related deployment + descriptors for this module (e.g., web service + descriptors) are complete, or whether the class + files available to this module and packaged with + this application should be examined for annotations + that specify deployment information. + + If metadata-complete is set to "true", the deployment + tool must ignore any annotations that specify deployment + information, which might be present in the class files + of the application. + + If metadata-complete is not specified or is set to + "false", the deployment tool must examine the class + files of the application for annotations, as + specified by the specifications. + + + + + + + + + + + + + + EmployeeService + + ]]> + + + + + + + + + + + + + + + The ejb-relationType describes a relationship between two + entity beans with container-managed persistence. It is used + by ejb-relation elements. It contains a description; an + optional ejb-relation-name element; and exactly two + relationship role declarations, defined by the + ejb-relationship-role elements. The name of the + relationship, if specified, is unique within the ejb-jar + file. + + Support for entity beans is optional as of Enterprise Beans 3.2. + + + + + + + + + + The ejb-relation-name element provides a unique name + within the ejb-jar file for a relationship. + + + + + + + + + + + + + + + + + Product-LineItem + + product-has-lineitems + + One + + ProductEJB + + + + + Support for entity beans is optional as of Enterprise Beans 3.2. + + ]]> + + + + + + + + + The ejb-relationship-role-name element defines a + name for a role that is unique within an + ejb-relation. Different relationships can use the + same name for a role. + + + + + + + + + + The cascade-delete element specifies that, within a + particular relationship, the lifetime of one or more + entity beans is dependent upon the lifetime of + another entity bean. The cascade-delete element can + only be specified for an ejb-relationship-role + element contained in an ejb-relation element in + which the other ejb-relationship-role + element specifies a multiplicity of One. + + Support for entity beans is optional as of Enterprise Beans 3.2. + + + + + + + + + + + + + + + + + + The enterprise-beansType declares one or more enterprise + beans. Each bean can be a session, entity or message-driven + bean. + + + + + + + + + + The ejb-ref-name element contains the name of + an enterprise bean reference. The enterprise bean reference is an entry in + the component's environment and is relative to the + java:comp/env context. The name must be unique within + the component. + + It is recommended that name be prefixed with "ejb/". + + + + + + + + + + + The ejb-ref-name element contains the name of an enterprise bean + reference. The enterprise bean reference is an entry in the + component's environment and is relative to the + java:comp/env context. The name must be unique + within the component. + + It is recommended that name is prefixed with "ejb/". + + + + + + + + + + + The resource-env-ref-name element specifies the name + of a resource environment reference; its value is + the environment entry name used in the component + code. The name is a JNDI name relative to the + java:comp/env context and must be unique within an + component. + + + + + + + + + + + The message-destination-ref-name element specifies the name + of a message destination reference; its value is + the message destination reference name used in the component + code. The name is a JNDI name relative to the + java:comp/env context and must be unique within an + component. + + + + + + + + + + + The res-ref-name element specifies the name of a + resource manager connection factory reference. The name + is a JNDI name relative to the java:comp/env context. + The name must be unique within an component. + + + + + + + + + + + The env-entry-name element contains the name of a + component's environment entry. The name is a JNDI + name relative to the java:comp/env context. The + name must be unique within an component. + + + + + + + + + + + + + The ejb-ref-name element contains the name of + an enterprise bean reference. The enterprise bean reference is an entry in + the component's environment and is relative to the + java:comp/env context. The name must be unique within + the component. + + It is recommended that name be prefixed with "ejb/". + + + + + + + + + + + The ejb-ref-name element contains the name of an enterprise bean + reference. The enterprise bean reference is an entry in the + component's environment and is relative to the + java:comp/env context. The name must be unique + within the component. + + It is recommended that name is prefixed with "ejb/". + + + + + + + + + + + The resource-env-ref-name element specifies the name + of a resource environment reference; its value is + the environment entry name used in the component + code. The name is a JNDI name relative to the + java:comp/env context and must be unique within an + component. + + + + + + + + + + + The message-destination-ref-name element specifies the name + of a message destination reference; its value is + the message destination reference name used in the component + code. The name is a JNDI name relative to the + java:comp/env context and must be unique within an + component. + + + + + + + + + + + The res-ref-name element specifies the name of a + resource manager connection factory reference. The name + is a JNDI name relative to the java:comp/env context. + The name must be unique within an component. + + + + + + + + + + + The env-entry-name element contains the name of a + component's environment entry. The name is a JNDI + name relative to the java:comp/env context. The + name must be unique within an component. + + + + + + + + + + + + + The ejb-ref-name element contains the name of + an enterprise bean reference. The enterprise bean reference is an entry in + the component's environment and is relative to the + java:comp/env context. The name must be unique within + the component. + + It is recommended that name be prefixed with "ejb/". + + + + + + + + + + + The ejb-ref-name element contains the name of an enterprise bean + reference. The enterprise bean reference is an entry in the + component's environment and is relative to the + java:comp/env context. The name must be unique + within the component. + + It is recommended that name is prefixed with "ejb/". + + + + + + + + + + + The resource-env-ref-name element specifies the name + of a resource environment reference; its value is + the environment entry name used in the component + code. The name is a JNDI name relative to the + java:comp/env context and must be unique within an + component. + + + + + + + + + + + The message-destination-ref-name element specifies the name + of a message destination reference; its value is + the message destination reference name used in the component + code. The name is a JNDI name relative to the + java:comp/env context and must be unique within an + component. + + + + + + + + + + + The res-ref-name element specifies the name of a + resource manager connection factory reference. The name + is a JNDI name relative to the java:comp/env context. + The name must be unique within an component. + + + + + + + + + + + The env-entry-name element contains the name of a + component's environment entry. The name is a JNDI + name relative to the java:comp/env context. The + name must be unique within an component. + + + + + + + + + + + + + + + + + + + Support for entity beans is optional as of Enterprise Beans 3.2. + + The entity-beanType declares an entity bean. The declaration + consists of: + + - an optional description + - an optional display name + - an optional icon element that contains a small and a large + icon file name + - a unique name assigned to the enterprise bean + in the deployment descriptor + - an optional mapped-name element that can be used to provide + vendor-specific deployment information such as the physical + jndi-name of the entity bean's remote home interface. This + element is not required to be supported by all implementations. + Any use of this element is non-portable. + - the names of the entity bean's remote home + and remote interfaces, if any + - the names of the entity bean's local home and local + interfaces, if any + - the entity bean's implementation class + - the optional entity bean's persistence management type. If + this element is not specified it is defaulted to Container. + - the entity bean's primary key class name + - an indication of the entity bean's reentrancy + - an optional specification of the + entity bean's cmp-version + - an optional specification of the entity bean's + abstract schema name + - an optional list of container-managed fields + - an optional specification of the primary key + field + - an optional declaration of the bean's environment + entries + - an optional declaration of the bean's enterprise bean + references + - an optional declaration of the bean's local enterprise bean + references + - an optional declaration of the bean's web + service references + - an optional declaration of the security role + references + - an optional declaration of the security identity + to be used for the execution of the bean's methods + - an optional declaration of the bean's + resource manager connection factory references + - an optional declaration of the bean's + resource environment references + - an optional declaration of the bean's message + destination references + - an optional set of query declarations + for finder and select methods for an entity + bean with cmp-version 2.x. + + The optional abstract-schema-name element must be specified + for an entity bean with container-managed persistence and + cmp-version 2.x. + + The optional primkey-field may be present in the descriptor + if the entity's persistence-type is Container. + + The optional cmp-version element may be present in the + descriptor if the entity's persistence-type is Container. If + the persistence-type is Container and the cmp-version + element is not specified, its value defaults to 2.x. + + The optional home and remote elements must be specified if + the entity bean cmp-version is 1.x. + + The optional home and remote elements must be specified if + the entity bean has a remote home and remote interface. + + The optional local-home and local elements must be specified + if the entity bean has a local home and local interface. + + Either both the local-home and the local elements or both + the home and the remote elements must be specified. + + The optional query elements must be present if the + persistence-type is Container and the cmp-version is 2.x and + query methods other than findByPrimaryKey have been defined + for the entity bean. + + The other elements that are optional are "optional" in the + sense that they are omitted if the lists represented by them + are empty. + + At least one cmp-field element must be present in the + descriptor if the entity's persistence-type is Container and + the cmp-version is 1.x, and none must not be present if the + entity's persistence-type is Bean. + + + + + + + + + + + + + + + + + + The prim-key-class element contains the + fully-qualified name of an + entity bean's primary key class. + + If the definition of the primary key class is + deferred to deployment time, the prim-key-class + element should specify java.lang.Object. + + Support for entity beans is optional as of Enterprise Beans 3.2. + + + + + + + + + The reentrant element specifies whether an entity + bean is reentrant or not. + + The reentrant element must be one of the two + following: true or false + + + + + + + + + + The abstract-schema-name element specifies the name + of the abstract schema type of an entity bean with + cmp-version 2.x. It is used in Enterprise Beans QL queries. + + For example, the abstract-schema-name for an entity + bean whose local interface is + com.acme.commerce.Order might be Order. + + Support for entity beans is optional as of Enterprise Beans 3.2. + + + + + + + + + + The primkey-field element is used to specify the + name of the primary key field for an entity with + container-managed persistence. + + The primkey-field must be one of the fields declared + in the cmp-field element, and the type of the field + must be the same as the primary key type. + + The primkey-field element is not used if the primary + key maps to multiple container-managed fields + (i.e. the key is a compound key). In this case, the + fields of the primary key class must be public, and + their names must correspond to the field names of + the entity bean class that comprise the key. + + Support for entity beans is optional as of Enterprise Beans 3.2. + + + + + + + + + + + + + + + + + + + + The exclude-listType specifies one or more methods which + the Assembler marks to be uncallable. + + If the method permission relation contains methods that are + in the exclude list, the Deployer should consider those + methods to be uncallable. + + + + + + + + + + + + + + + + + + The application-exceptionType declares an application + exception. The declaration consists of: + + - the exception class. When the container receives + an exception of this type, it is required to + forward this exception as an applcation exception + to the client regardless of whether it is a checked + or unchecked exception. + - an optional rollback element. If this element is + set to true, the container must rollback the current + transaction before forwarding the exception to the + client. If not specified, it defaults to false. + - an optional inherited element. If this element is + set to true, subclasses of the exception class type + are also automatically considered application + exceptions (unless overriden at a lower level). + If set to false, only the exception class type is + considered an application-exception, not its + exception subclasses. If not specified, this + value defaults to true. + + + + + + + + + + + + + + + + + + + The interceptorsType element declares one or more interceptor + classes used by components within this ejb-jar file or .war file. The declaration + consists of : + + - An optional description. + - One or more interceptor elements. + + + + + + + + + + + + + + + + + + The interceptorType element declares information about a single + interceptor class. It consists of : + + - An optional description. + - The fully-qualified name of the interceptor class. + - An optional list of around invoke methods declared on the + interceptor class and/or its super-classes. + - An optional list of around timeout methods declared on the + interceptor class and/or its super-classes. + - An optional list environment dependencies for the interceptor + class and/or its super-classes. + - An optional list of post-activate methods declared on the + interceptor class and/or its super-classes. + - An optional list of pre-passivate methods declared on the + interceptor class and/or its super-classes. + + + + + + + + + + + + + + + + + + + + + + + + * + INTERCEPTOR + + + Specifying the ejb-name as the wildcard value "*" designates + default interceptors (interceptors that apply to all session and + message-driven beans contained in the ejb-jar file or .war file). + + 2. + + EJBNAME + INTERCEPTOR + + + This style is used to refer to interceptors associated with the + specified enterprise bean(class-level interceptors). + + 3. + + EJBNAME + INTERCEPTOR + + METHOD + + + + This style is used to associate a method-level interceptor with + the specified enterprise bean. If there are multiple methods + with the same overloaded name, the element of this style refers + to all the methods with the overloaded name. Method-level + interceptors can only be associated with business methods of the + bean class. Note that the wildcard value "*" cannot be used + to specify method-level interceptors. + + 4. + + EJBNAME + INTERCEPTOR + + METHOD + + PARAM-1 + PARAM-2 + ... + PARAM-N + + + + + This style is used to associate a method-level interceptor with + the specified method of the specified enterprise bean. This + style is used to refer to a single method within a set of methods + with an overloaded name. The values PARAM-1 through PARAM-N + are the fully-qualified Java types of the method's input parameters + (if the method has no input arguments, the method-params element + contains no method-param elements). Arrays are specified by the + array element's type, followed by one or more pair of square + brackets (e.g. int[][]). + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + The interceptor-orderType element describes a total ordering + of interceptor classes. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The message-driven element declares a message-driven + bean. The declaration consists of: + + - an optional description + - an optional display name + - an optional icon element that contains a small and a large + icon file name. + - a name assigned to the enterprise bean in + the deployment descriptor + - an optional mapped-name element that can be used to provide + vendor-specific deployment information such as the physical + jndi-name of destination from which this message-driven bean + should consume. This element is not required to be supported + by all implementations. Any use of this element is non-portable. + - the message-driven bean's implementation class + - an optional declaration of the bean's messaging + type + - an optional declaration of the bean's timeout method for + handling programmatically created timers + - an optional declaration of timers to be automatically created at + deployment time + - the optional message-driven bean's transaction management + type. If it is not defined, it is defaulted to Container. + - an optional declaration of the bean's + message-destination-type + - an optional declaration of the bean's + message-destination-link + - an optional declaration of the message-driven bean's + activation configuration properties + - an optional list of the message-driven bean class and/or + superclass around-invoke methods. + - an optional list of the message-driven bean class and/or + superclass around-timeout methods. + - an optional declaration of the bean's environment + entries + - an optional declaration of the bean's enterprise bean references + - an optional declaration of the bean's local enterprise bean + references + - an optional declaration of the bean's web service + references + - an optional declaration of the security role + references + - an optional declaration of the security + identity to be used for the execution of the bean's + methods + - an optional declaration of the bean's + resource manager connection factory + references + - an optional declaration of the bean's resource + environment references. + - an optional declaration of the bean's message + destination references + + + + + + + + + + + + The ejb-class element specifies the fully qualified name + of the bean class for this ejb. It is required unless + there is a component-defining annotation for the same + ejb-name. + + + + + + + + + The messaging-type element specifies the message + listener interface of the message-driven bean. + + + + + + + + + The timeout-method element specifies the method that + will receive callbacks for programmatically + created timers. + + + + + + + + + + + + + + + + + + + + + + + + + + + EJBNAME + * + + + This style is used to refer to all of the following methods + of the specified enterprise bean: + business interface methods + home interface methods + component interface methods + web service endpoint interface methods + no-interface view methods + singleton session bean lifecycle callback methods + timeout callback methods + message-driven bean message listener method + + This style may also be used in combination with the + method-intf element that contains LifecycleCallback as + the value to specify transaction attributes of a stateful + session bean PostConstruct, PreDestroy, PrePassivate, + and PostActivate lifecycle callback methods or to override + transaction attributes of a singleton session bean + PostConstruct and PreDestroy lifecycle callback methods. + + 2. + + EJBNAME + METHOD + + + This style is used to refer to the specified method of + the specified enterprise bean. If there are multiple + methods with the same overloaded name, the element of + this style refers to all the methods with the overloaded + name. + + This style may be used to refer to stateful session bean + PostConstruct, PreDestroy, PrePassivate, and PostActivate + lifecycle callback methods to specify their transaction + attributes if any of the following is true: + there is only one method with this name in the specified + enterprise bean + all overloaded methods with this name in the specified + enterprise bean are lifecycle callback methods + method-intf element is specified and it contains + LifecycleCallback as the value + + 3. + + EJBNAME + METHOD + + PARAM-1 + PARAM-2 + ... + PARAM-n + + + + This style is used to refer to a single method within a + set of methods with an overloaded name. PARAM-1 through + PARAM-n are the fully-qualified Java types of the + method's input parameters (if the method has no input + arguments, the method-params element contains no + method-param elements). Arrays are specified by the + array element's type, followed by one or more pair of + square brackets (e.g. int[][]). + If a method with the same name and signature is defined + on more than one interface of an enterprise bean, this + style refers to all those methods. + + Examples: + + Style 1: The following method element refers to all of the + following methods of the EmployeeService bean: + no interface view methods + business interface methods + home interface methods + component business interface methods + singleton session bean lifecycle callback methods, if any + timeout callback methods + web service endpoint interface methods + message-driven bean message listener methods (if the bean + a message-driven bean) + + + EmployeeService + * + + + Style 2: The following method element refers to all the + create methods of the EmployeeService bean's home + interface(s). + + + EmployeeService + create + + + Style 3: The following method element refers to the + create(String firstName, String LastName) method of the + EmployeeService bean's home interface(s). + + + EmployeeService + create + + java.lang.String + java.lang.String + + + + The following example illustrates a Style 3 element with + more complex parameter types. The method + foobar(char s, int i, int[] iar, mypackage.MyClass mycl, + mypackage.MyClass[][] myclaar) would be specified as: + + + EmployeeService + foobar + + char + int + int[] + mypackage.MyClass + mypackage.MyClass[][] + + + + The optional method-intf element can be used when it becomes + necessary to differentiate between a method that is defined + multiple times with the same name and signature across any + of the following methods of an enterprise bean: + business interface methods + home interface methods + component interface methods + web service endpoint methods + no-interface view methods + singleton or stateful session bean lifecycle callback methods + timeout callback methods + message-driven bean message listener methods + + However, if the same method is a method of both the local + business interface, and the local component interface, + the same attribute applies to the method for both interfaces. + Likewise, if the same method is a method of both the remote + business interface and the remote component interface, the same + attribute applies to the method for both interfaces. + + For example, the method element + + + EmployeeService + Remote + create + + java.lang.String + java.lang.String + + + + can be used to differentiate the create(String, String) + method defined in the remote interface from the + create(String, String) method defined in the remote home + interface, which would be defined as + + + EmployeeService + Home + create + + java.lang.String + java.lang.String + + + + and the create method that is defined in the local home + interface which would be defined as + + + EmployeeService + LocalHome + create + + java.lang.String + java.lang.String + + + + The method-intf element can be used with all three Styles + of the method element usage. For example, the following + method element example could be used to refer to all the + methods of the EmployeeService bean's remote home interface + and the remote business interface. + + + EmployeeService + Home + * + + + ]]> + + + + + + + + + + + + + + + + + + + + + The method-intf element allows a method element to + differentiate between the methods with the same name and + signature that are multiply defined across the home and + component interfaces (e.g, in both an enterprise bean's + remote and local interfaces or in both an enterprise bean's + home and remote interfaces, etc.); the component and web + service endpoint interfaces, and so on. + + Local applies to the local component interface, local business + interfaces, and the no-interface view. + + Remote applies to both remote component interface and the remote + business interfaces. + + ServiceEndpoint refers to methods exposed through a web service + endpoint. + + Timer refers to the bean's timeout callback methods. + + MessageEndpoint refers to the methods of a message-driven bean's + message-listener interface. + + LifecycleCallback refers to the PostConstruct and PreDestroy + lifecycle callback methods of a singleton session bean and + to the PostConstruct, PreDestroy, PrePassivate, and PostActivate + lifecycle callback methods of a stateful session bean. + + The method-intf element must be one of the following: + + Home + Remote + LocalHome + Local + ServiceEndpoint + Timer + MessageEndpoint + LifecycleCallback + + + + + + + + + + + + + + + + + + + + + + + + + The method-nameType contains a name of an enterprise + bean method or the asterisk (*) character. The asterisk is + used when the element denotes all the methods of an + enterprise bean's client view interfaces. + + + + + + + + + + + + + + + + The method-paramsType defines a list of the + fully-qualified Java type names of the method parameters. + + + + + + + + + The method-param element contains a primitive + or a fully-qualified Java type name of a method + parameter. + + + + + + + + + + + + + + + + The method-permissionType specifies that one or more + security roles are allowed to invoke one or more enterprise + bean methods. The method-permissionType consists of an + optional description, a list of security role names or an + indicator to state that the method is unchecked for + authorization, and a list of method elements. + + Except as noted below the security roles used in the + method-permissionType must be defined in the security-role + elements of the deployment descriptor, and the methods + must be methods defined in the enterprise bean's no-interface + view, business, home, component and/or web service endpoint + interfaces. + + If the role name "**" is included in the list of allowed + roles, and the application has not defined in its deployment + descriptor an application security role with this name, + then the list of allowed roles includes every and any + authenticated user. + + + + + + + + + + + + The unchecked element specifies that a method is + not checked for authorization by the container + prior to invocation of the method. + + + + + + + + + + + + + + + + + + The multiplicityType describes the multiplicity of the + role that participates in a relation. + + The value must be one of the two following: + + One + Many + + Support for entity beans is optional as of Enterprise Beans 3.2. + + + + + + + + + + + + + + + + + + + The persistence-typeType specifies an entity bean's persistence + management type. + + The persistence-type element must be one of the two following: + + Bean + Container + + Support for entity beans is optional as of Enterprise Beans 3.2. + + + + + + + + + + + + + + + + + + + The queryType defines a finder or select + query. It contains + - an optional description of the query + - the specification of the finder or select + method it is used by + - an optional specification of the result type + mapping, if the query is for a select method + and entity objects are returned. + - the Enterprise Beans QL query string that defines the query. + + Queries that are expressible in Enterprise Beans QL must use the ejb-ql + element to specify the query. If a query is not expressible + in Enterprise Beans QL, the description element should be used to + describe the semantics of the query and the ejb-ql element + should be empty. + + The result-type-mapping is an optional element. It can only + be present if the query-method specifies a select method + that returns entity objects. The default value for the + result-type-mapping element is "Local". + + + + + + + + + + + + + + + + + + + + Method finds large orders + + findLargeOrders + + + + SELECT OBJECT(o) FROM Order o + WHERE o.amount > 1000 + + + + Support for entity beans is optional as of Enterprise Beans 3.2. + + ]]> + + + + + + + + + + + + + + + + + The relationship-role-sourceType designates the source of a + role that participates in a relationship. A + relationship-role-sourceType is used by + relationship-role-source elements to uniquely identify an + entity bean. + + Support for entity beans is optional as of Enterprise Beans 3.2. + + + + + + + + + + + + + + + + + + The relationshipsType describes the relationships in + which entity beans with container-managed persistence + participate. The relationshipsType contains an optional + description; and a list of ejb-relation elements, which + specify the container managed relationships. + + Support for entity beans is optional as of Enterprise Beans 3.2. + + + + + + + + + + + The ejb-relationship-role-name contains the name of a + relationship role. The name must be unique within + a relationship, but can be reused in different + relationships. + + + + + + + + + + + + + + + + + + + The result-type-mappingType is used in the query element to + specify whether an abstract schema type returned by a query + for a select method is to be mapped to an EJBLocalObject or + EJBObject type. + + The value must be one of the following: + + Local + Remote + + + + + + + + + + + + + + + + + + + The security-identityType specifies whether the caller's + security identity is to be used for the execution of the + methods of the enterprise bean or whether a specific run-as + identity is to be used. It contains an optional description + and a specification of the security identity to be used. + + + + + + + + + + + The use-caller-identity element specifies that + the caller's security identity be used as the + security identity for the execution of the + enterprise bean's methods. + + + + + + + + + + + + + + + + + + The session-beanType declares an session bean. The + declaration consists of: + + - an optional description + - an optional display name + - an optional icon element that contains a small and a large + icon file name + - a name assigned to the enterprise bean + in the deployment description + - an optional mapped-name element that can be used to provide + vendor-specific deployment information such as the physical + jndi-name of the session bean's remote home/business interface. + This element is not required to be supported by all + implementations. Any use of this element is non-portable. + - the names of all the remote or local business interfaces, + if any + - the names of the session bean's remote home and + remote interfaces, if any + - the names of the session bean's local home and + local interfaces, if any + - an optional declaration that this bean exposes a + no-interface view + - the name of the session bean's web service endpoint + interface, if any + - the session bean's implementation class + - the session bean's state management type + - an optional declaration of a stateful session bean's timeout value + - an optional declaration of the session bean's timeout method for + handling programmatically created timers + - an optional declaration of timers to be automatically created at + deployment time + - an optional declaration that a Singleton bean has eager + initialization + - an optional declaration of a Singleton/Stateful bean's concurrency + management type + - an optional declaration of the method locking metadata + for a Singleton with container managed concurrency + - an optional declaration of the other Singleton beans in the + application that must be initialized before this bean + - an optional declaration of the session bean's asynchronous + methods + - the optional session bean's transaction management type. + If it is not present, it is defaulted to Container. + - an optional declaration of a stateful session bean's + afterBegin, beforeCompletion, and/or afterCompletion methods + - an optional list of the session bean class and/or + superclass around-invoke methods. + - an optional list of the session bean class and/or + superclass around-timeout methods. + - an optional declaration of the bean's + environment entries + - an optional declaration of the bean's enterprise bean references + - an optional declaration of the bean's local enterprise bean + references + - an optional declaration of the bean's web + service references + - an optional declaration of the security role + references + - an optional declaration of the security identity + to be used for the execution of the bean's methods + - an optional declaration of the bean's resource + manager connection factory references + - an optional declaration of the bean's resource + environment references. + - an optional declaration of the bean's message + destination references + - an optional specification as to whether the stateful + session bean is passivation capable or not. If not + specified, the bean is assumed to be passivation capable + + The elements that are optional are "optional" in the sense + that they are omitted when if lists represented by them are + empty. + + The service-endpoint element may only be specified if the + bean is a stateless session bean. + + + + + + + + + + + + + + + + + + The local-bean element declares that this + session bean exposes a no-interface Local client view. + + + + + + + + + The service-endpoint element contains the + fully-qualified name of the enterprise bean's web + service endpoint interface. The service-endpoint + element may only be specified for a stateless + session bean. The specified interface must be a + valid Jakarta XML RPC service endpoint interface. + + + + + + + + + The ejb-class element specifies the fully qualified name + of the bean class for this ejb. It is required unless + there is a component-defining annotation for the same + ejb-name. + + + + + + + + + + + The timeout-method element specifies the method that + will receive callbacks for programmatically + created timers. + + + + + + + + + + The init-on-startup element specifies that a Singleton + bean has eager initialization. + This element can only be specified for singleton session + beans. + + + + + + + + + + + + The init-method element specifies the mappings for + Enterprise Beans 2.x style create methods for an Enterprise Beans 3.x bean. + This element can only be specified for stateful + session beans. + + + + + + + + + The remove-method element specifies the mappings for + Enterprise Beans 2.x style remove methods for an Enterprise Beans 3.x bean. + This element can only be specified for stateful + session beans. + + + + + + + + + + + + + + + + + + + + + The passivation-capable element specifies whether the + stateful session bean is passivation capable or not. + If not specified, the bean is assumed to be passivation + capable. + + + + + + + + + + + + + + + + The session-typeType describes whether the session bean is a + singleton, stateful or stateless session. It is used by + session-type elements. + + The value must be one of the three following: + + Singleton + Stateful + Stateless + + + + + + + + + + + + + + + + + + + + The stateful-timeoutType represents the amount of time + a stateful session bean can be idle(not receive any client + invocations) before it is eligible for removal by the container. + + A timeout value of 0 means the bean is immediately eligible for removal. + + A timeout value of -1 means the bean will never be removed due to timeout. + + + + + + + + + + + + + + + + + + The time-unit-typeType represents a time duration at a given + unit of granularity. + + The time unit type must be one of the following : + + Days + Hours + Minutes + Seconds + Milliseconds + Microseconds + Nanoseconds + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The timerType specifies an enterprise bean timer. Each + timer is automatically created by the container upon + deployment. Timer callbacks occur based on the + schedule attributes. All callbacks are made to the + timeout-method associated with the timer. + + A timer can have an optional start and/or end date. If + a start date is specified, it takes precedence over the + associated timer schedule such that any matching + expirations prior to the start time will not occur. + Likewise, no matching expirations will occur after any + end date. Start/End dates are specified using the + XML Schema dateTime type, which follows the ISO-8601 + standard for date(and optional time-within-the-day) + representation. + + An optional flag can be used to control whether + this timer has persistent(true) delivery semantics or + non-persistent(false) delivery semantics. If not specified, + the value defaults to persistent(true). + + A time zone can optionally be associated with a timer. + If specified, the timer's schedule is evaluated in the context + of that time zone, regardless of the default time zone in which + the container is executing. Time zones are specified as an + ID string. The set of required time zone IDs is defined by + the Zone Name(TZ) column of the public domain zoneinfo database. + + An optional info string can be assigned to the timer and + retrieved at runtime through the Timer.getInfo() method. + + The timerType can only be specified on stateless session + beans, singleton session beans, and message-driven beans. + + + + + + + + + + + + + + + + + + + + + + + + The trans-attributeType specifies how the container must + manage the transaction boundaries when delegating a method + invocation to an enterprise bean's business method. + + The value must be one of the following: + + NotSupported + Supports + Required + RequiresNew + Mandatory + Never + + + + + + + + + + + + + + + + + + + + + + + The transaction-typeType specifies an enterprise bean's + transaction management type. + + The transaction-type must be one of the two following: + + Bean + Container + + + + + + + + + + + + diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/jakartaee_12.xsd b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/jakartaee_12.xsd new file mode 100644 index 000000000000..a0bc8e1aabea --- /dev/null +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/jakartaee_12.xsd @@ -0,0 +1,3631 @@ + + + + + + + Copyright (c) 2009, 2023 Oracle and/or its affiliates and others. + All rights reserved. + + This program and the accompanying materials are made available under the + terms of the Eclipse Public License v. 2.0, which is available at + http://www.eclipse.org/legal/epl-2.0. + + This Source Code may also be made available under the following Secondary + Licenses when the conditions for such availability set forth in the + Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + version 2 with the GNU Classpath Exception, which is available at + https://www.gnu.org/software/classpath/license.html. + + SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + + + + + + + The following definitions that appear in the common + shareable schema(s) of Jakarta EE deployment descriptors should be + interpreted with respect to the context they are included: + + + Deployment Component may indicate one of the following: + Jakarta EE application; + application client; + web application; + enterprise bean; + resource adapter; + + Deployment File may indicate one of the following: + ear file; + war file; + jar file; + rar file; + + + + + + + + + + + + + + + This group keeps the usage of the contained description related + elements consistent across Jakarta EE deployment descriptors. + + All elements may occur multiple times with different languages, + to support localization of the content. + + + + + + + + + + + + + + + + + This group keeps the usage of the contained JNDI environment + reference elements consistent across Jakarta EE deployment descriptors. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This group collects elements that are common to most + JNDI resource elements. + + + + + + + + + + + + The JNDI name to be looked up to resolve a resource reference. + + + + + + + + + + + + + + + This group collects elements that are common to all the + JNDI resource elements. It does not include the lookup-name + element, that is only applicable to some resource elements. + + + + + + + + + + + + + + + + + + + + + + + + Configuration of an administered object. + + + + + + + + + Description of this administered object. + + + + + + + + + The name element specifies the JNDI name of the + administered object being defined. + + + + + + + + + The administered object's interface type. + + + + + + + + + The administered object's class name. + + + + + + + + + Resource adapter name. + + + + + + + + + Property of the administered object property. This may be a + vendor-specific property. + + + + + + + + + + + + + + + Configuration of a Connector Connection Factory resource. + + + + + + + + + Description of this resource. + + + + + + + + + The name element specifies the JNDI name of the + resource being defined. + + + + + + + + + The fully qualified class name of the connection factory + interface. + + + + + + + + + + Resource adapter name. + + + + + + + + + Maximum number of connections that should be concurrently + allocated for a connection pool. + + + + + + + + + Minimum number of connections that should be concurrently + allocated for a connection pool. + + + + + + + + + The level of transaction support the connection factory + needs to support. + + + + + + + + + Resource property. This may be a vendor-specific + property. + + + + + + + + + + + + + + + Configuration of a ContextService. + + + + + + + + + Description of this ContextService. + + + + + + + + + JNDI name of the ContextService instance being defined. + The JNDI name must be in a valid Jakarta EE namespace, + such as java:comp, java:module, java:app, or java:global. + + + + + + + + + A ContextService injection point annotated with these qualifier annotations + injects a bean that is produced by this context-service element. + Applications can define their own Producers for ContextService injection points + as long as the qualifier annotations on the producer do not conflict with the + non-empty qualifier list of a context-service. + + You can specify a single qualifier element with no value to indicate an + empty list of qualifier annotation classes. + + + + + + + + + Types of context to clear whenever a thread runs a + contextual task or action. The thread's previous context + is restored afterward. Context types that are defined by + the Jakarta EE Concurrency specification include: + Application, Security, Transaction, + and Remaining, which means all available thread context + types that are not specified elsewhere. You can also specify + vendor-specific context types. Absent other configuration, + cleared context defaults to Transaction. You can specify + a single cleared element with no value to indicate an + empty list of context types to clear. If neither + propagated nor unchanged specify (or default to) Remaining, + then Remaining is automatically appended to the list of + cleared context types. + + + + + + + + + Types of context to capture from the requesting thread + and propagate to a thread that runs a contextual task + or action. The captured context is re-established + when threads run the contextual task or action, + with the respective thread's previous context being + restored afterward. Context types that are defined by + the Jakarta EE Concurrency specification include: + Application, Security, + and Remaining, which means all available thread context + types that are not specified elsewhere. You can also specify + vendor-specific context types. Absent other configuration, + propagated context defaults to Remaining. You can specify + a single propagated element with no value to indicate that + no context types should be propagated. + + + + + + + + + Types of context that are left alone when a thread runs a + contextual task or action. Context types that are defined + by the Jakarta EE Concurrency specification include: + Application, Security, Transaction, + and Remaining, which means all available thread context + types that are not specified elsewhere. You can also specify + vendor-specific context types. Absent other configuration, + unchanged context defaults to empty. You can specify + a single unchanged element with no value to indicate that + no context types should be left unchanged. + + + + + + + + + Vendor-specific property. + + + + + + + + + + + + + + + + Configuration of a DataSource. + + + + + + + + + Description of this DataSource. + + + + + + + + + The name element specifies the JNDI name of the + data source being defined. + + + + + + + + + + DataSource, XADataSource or ConnectionPoolDataSource + implementation class. + + + + + + + + + Database server name. + + + + + + + + + Port number where a server is listening for requests. + + + + + + + + + Name of a database on a server. + + + + + + + + url property is specified + along with other standard DataSource properties + such as serverName, databaseName + and portNumber, the more specific properties will + take precedence and url will be ignored. + + ]]> + + + + + + + + User name to use for connection authentication. + + + + + + + + + Password to use for connection authentication. + + + + + + + + + JDBC DataSource property. This may be a vendor-specific + property or a less commonly used DataSource property. + + + + + + + + + Sets the maximum time in seconds that this data source + will wait while attempting to connect to a database. + + + + + + + + + Set to false if connections should not participate in + transactions. + + + + + + + + + Isolation level for connections. + + + + + + + + + Number of connections that should be created when a + connection pool is initialized. + + + + + + + + + Maximum number of connections that should be concurrently + allocated for a connection pool. + + + + + + + + + Minimum number of connections that should be concurrently + allocated for a connection pool. + + + + + + + + + The number of seconds that a physical connection should + remain unused in the pool before the connection is + closed for a connection pool. + + + + + + + + + The total number of statements that a connection pool + should keep open. + + + + + + + + + + + + + + + + The description type is used by a description element to + provide text describing the parent element. The elements + that use this type should include any information that the + Deployment Component's Deployment File file producer wants + to provide to the consumer of the Deployment Component's + Deployment File (i.e., to the Deployer). Typically, the + tools used by such a Deployment File consumer will display + the description when processing the parent element that + contains the description. + + The lang attribute defines the language that the + description is provided in. The default value is "en" (English). + + + + + + + + + + + + + + + + + This type defines a dewey decimal that is used + to describe versions of documents. + + + + + + + + + + + + + + + + Employee Self Service + + + The value of the xml:lang attribute is "en" (English) by default. + + ]]> + + + + + + + + + + + + + + + EmployeeRecord + + ../products/product.jar#ProductEJB + + ]]> + + + + + + + + + + + + + + The ejb-local-refType is used by ejb-local-ref elements for + the declaration of a reference to an enterprise bean's local + home or to the local business interface of a 3.0 bean. + The declaration consists of: + + - an optional description + - the enterprise bean's reference name used in the code of the + Deployment Component that's referencing the enterprise bean. + - the optional expected type of the referenced enterprise bean + - the optional expected local interface of the referenced + enterprise bean or the local business interface of the + referenced enterprise bean. + - the optional expected local home interface of the referenced + enterprise bean. Not applicable if this ejb-local-ref refers + to the local business interface of a 3.0 bean. + - optional ejb-link information, used to specify the + referenced enterprise bean + - optional elements to define injection of the named enterprise + bean into a component field or property. + + + + + + + + + + + + + + + + + + + + + + ejb/Payroll + + ]]> + + + + + + + + + + + + + + The ejb-refType is used by ejb-ref elements for the + declaration of a reference to an enterprise bean's home or + to the remote business interface of a 3.0 bean. + The declaration consists of: + + - an optional description + - the enterprise bean's reference name used in the code of + the Deployment Component that's referencing the enterprise + bean. + - the optional expected type of the referenced enterprise bean + - the optional remote interface of the referenced enterprise bean + or the remote business interface of the referenced enterprise + bean + - the optional expected home interface of the referenced + enterprise bean. Not applicable if this ejb-ref + refers to the remote business interface of a 3.0 bean. + - optional ejb-link information, used to specify the + referenced enterprise bean + - optional elements to define injection of the named enterprise + bean into a component field or property + + + + + + + + + + + + + + + + + + + + + + + + The ejb-ref-typeType contains the expected type of the + referenced enterprise bean. + + The ejb-ref-type designates a value + that must be one of the following: + + Entity + Session + + + + + + + + + + + + + + + + + + This type is used to designate an empty + element when used. + + + + + + + + + + + + + The env-entryType is used to declare an application's + environment entry. The declaration consists of an optional + description, the name of the environment entry, a type + (optional if the value is injected, otherwise required), and + an optional value. + + It also includes optional elements to define injection of + the named resource into fields or JavaBeans properties. + + If a value is not specified and injection is requested, + no injection will occur and no entry of the specified name + will be created. This allows an initial value to be + specified in the source code without being incorrectly + changed when no override has been specified. + + If a value is not specified and no injection is requested, + a value must be supplied during deployment. + + This type is used by env-entry elements. + + + + + + + + + + minAmount + + ]]> + + + + + + + + java.lang.Integer + + ]]> + + + + + + + + 100.00 + + ]]> + + + + + + + + + + + + + + + + java.lang.Boolean + java.lang.Class + com.example.Color + + ]]> + + + + + + + + + + + + + + The elements that use this type designate the name of a + Java class or interface. The name is in the form of a + "binary name", as defined in the JLS. This is the form + of name used in Class.forName(). Tools that need the + canonical name (the name used in source code) will need + to convert this binary name to the canonical name. + + + + + + + + + + + + + + + This type defines four different values which can designate + boolean values. This includes values yes and no which are + not designated by xsd:boolean + + + + + + + + + + + + + + + + + + + + The icon type contains small-icon and large-icon elements + that specify the file names for small and large GIF, JPEG, + or PNG icon images used to represent the parent element in a + GUI tool. + + The xml:lang attribute defines the language that the + icon file names are provided in. Its value is "en" (English) + by default. + + + + + + + + + employee-service-icon16x16.jpg + + ]]> + + + + + + + employee-service-icon32x32.jpg + + ]]> + + + + + + + + + + + + + + + + + + An injection target specifies a class and a name within + that class into which a resource should be injected. + + The injection target class specifies the fully qualified + class name that is the target of the injection. The + Jakarta EE specifications describe which classes can be an + injection target. + + The injection target name specifies the target within + the specified class. The target is first looked for as a + JavaBeans property name. If not found, the target is + looked for as a field name. + + The specified resource will be injected into the target + during initialization of the class by either calling the + set method for the target property or by setting a value + into the named field. + + + + + + + + + + + + + + + + The following transaction isolation levels are allowed + (see documentation for the java.sql.Connection interface): + TRANSACTION_READ_UNCOMMITTED + TRANSACTION_READ_COMMITTED + TRANSACTION_REPEATABLE_READ + TRANSACTION_SERIALIZABLE + + + + + + + + + + + + + + + + + + The java-identifierType defines a Java identifier. + The users of this type should further verify that + the content does not contain Java reserved keywords. + + + + + + + + + + + + + + + + + This is a generic type that designates a Java primitive + type or a fully qualified name of a Java interface/type, + or an array of such types. + + + + + + + + + + + + + + + + : + + Example: + + jdbc:mysql://localhost:3307/testdb + + ]]> + + + + + + + + + + + + + + + + Configuration of a Messaging Connection Factory. + + + + + + + + + Description of this Messaging Connection Factory. + + + + + + + + + The name element specifies the JNDI name of the + messaging connection factory being defined. + + + + + + + + + Fully-qualified name of the messaging connection factory + interface. Permitted values are jakarta.jms.ConnectionFactory, + jakarta.jms.QueueConnectionFactory, or + jakarta.jms.TopicConnectionFactory. If not specified, + jakarta.jms.ConnectionFactory will be used. + + + + + + + + + Fully-qualified name of the messaging connection factory + implementation class. Ignored if a resource adapter + is used. + + + + + + + + + Resource adapter name. If not specified, the application + server will define the default behavior, which may or may + not involve the use of a resource adapter. + + + + + + + + + User name to use for connection authentication. + + + + + + + + + Password to use for connection authentication. + + + + + + + + + Client id to use for connection. + + + + + + + + + Messaging Connection Factory property. This may be a vendor-specific + property or a less commonly used ConnectionFactory property. + + + + + + + + + Set to false if connections should not participate in + transactions. + + + + + + + + + Maximum number of connections that should be concurrently + allocated for a connection pool. + + + + + + + + + Minimum number of connections that should be concurrently + allocated for a connection pool. + + + + + + + + + + + + + + + + Configuration of a Messaging Destination. + + + + + + + + + Description of this Messaging Destination. + + + + + + + + + The name element specifies the JNDI name of the + messaging destination being defined. + + + + + + + + + Fully-qualified name of the messaging destination interface. + Permitted values are jakarta.jms.Queue and jakarta.jms.Topic + + + + + + + + + Fully-qualified name of the messaging destination implementation + class. Ignored if a resource adapter is used unless the + resource adapter defines more than one destination implementation + class for the specified interface. + + + + + + + + + Resource adapter name. If not specified, the application + server will define the default behavior, which may or may + not involve the use of a resource adapter. + + + + + + + + + Name of the queue or topic. + + + + + + + + + Messaging Destination property. This may be a vendor-specific + property or a less commonly used Destination property. + + + + + + + + + + + + + + + + + The jndi-nameType type designates a JNDI name in the + Deployment Component's environment and is relative to the + java:comp/env context. A JNDI name must be unique within the + Deployment Component. + + + + + + + + + + + + + + com.aardvark.payroll.PayrollHome + + ]]> + + + + + + + + + + + + + + + The lifecycle-callback type specifies a method on a + class to be called when a lifecycle event occurs. + Note that each class may have only one lifecycle callback + method for any given event and that the method may not + be overloaded. + + If the lifefycle-callback-class element is missing then + the class defining the callback is assumed to be the + component class in scope at the place in the descriptor + in which the callback definition appears. + + + + + + + + + + + + + + + + The listenerType indicates the deployment properties for a web + application listener bean. + + + + + + + + + + + The listener-class element declares a class in the + application must be registered as a web + application listener bean. The value is the fully + qualified classname of the listener class. + + + + + + + + + + + + + + + The localType defines the fully-qualified name of an + enterprise bean's local interface. + + + + + + + + + + + + + + + The local-homeType defines the fully-qualified + name of an enterprise bean's local home interface. + + + + + + + + + + + + + + + Configuration of a Mail Session resource. + + + + + + + + + Description of this Mail Session resource. + + + + + + + + + The name element specifies the JNDI name of the + Mail Session resource being defined. + + + + + + + + + Storage protocol. + + + + + + + + + Service provider store protocol implementation class + + + + + + + + + Transport protocol. + + + + + + + + + Service provider transport protocol implementation class + + + + + + + + + Mail server host name. + + + + + + + + + Mail server user name. + + + + + + + + + Password. + + + + + + + + + Email address to indicate the message sender. + + + + + + + + + Mail server property. This may be a vendor-specific + property. + + + + + + + + + + + + + + + + Configuration of a ManagedExecutorService. + + + + + + + + + Description of this ManagedExecutorService. + + + + + + + + + JNDI name of the ManagedExecutorService instance being defined. + The JNDI name must be in a valid Jakarta EE namespace, + such as java:comp, java:module, java:app, or java:global. + + + + + + + + + Refers to the name of a ContextServiceDefinition or + context-service deployment descriptor element, + which determines how context is applied to tasks and actions + that run on this executor. + The name must be in a valid Jakarta EE namespace, + such as java:comp, java:module, java:app, or java:global. + In the absence of a configured value, + java:comp/DefaultContextService is used. + + + + + + + + + A ManagedExecutorService injection point annotated with these qualifier annotations + injects a bean that is produced by this managed-executor element. + Applications can define their own Producers for ManagedExecutorService injection points + as long as the qualifier annotations on the producer do not conflict with the + non-empty qualifier list of a managed-executor. + + You can specify a single qualifier element with no value to indicate an + empty list of qualifier annotation classes. + + + + + + + + + Upper bound on contextual tasks and actions that this executor + will simultaneously execute asynchronously. This constraint does + not apply to tasks and actions that the executor runs inline, + such as when a thread requests CompletableFuture.join and the + action runs inline if it has not yet started. + The default is unbounded, although still subject to + resource constraints of the system. + + + + + + + + + The amount of time in milliseconds that a task or action + can execute before it is considered hung. + + + + + + + + + Indicates whether this executor is requested to + create virtual threads for tasks that do not run inline. + When true, the executor can create + virtual threads if it is capable of doing so + and if the request is not overridden by vendor-specific + configuration that restricts the use of virtual threads. + + + + + + + + + Vendor-specific property. + + + + + + + + + + + + + + + + Configuration of a ManagedScheduledExecutorService. + + + + + + + + + Description of this ManagedScheduledExecutorService. + + + + + + + + + JNDI name of the ManagedScheduledExecutorService instance + being defined. + The JNDI name must be in a valid Jakarta EE namespace, + such as java:comp, java:module, java:app, or java:global. + + + + + + + + + Refers to the name of a ContextServiceDefinition or + context-service deployment descriptor element, + which determines how context is applied to tasks and actions + that run on this executor. + The name must be in a valid Jakarta EE namespace, + such as java:comp, java:module, java:app, or java:global. + In the absence of a configured value, + java:comp/DefaultContextService is used. + + + + + + + + + A ManagedScheduledExecutorService injection point annotated with these qualifier annotations + injects a bean that is produced by this managed-scheduled-executor element. + Applications can define their own Producers for ManagedScheduledExecutorService injection points + as long as the qualifier annotations on the producer do not conflict with the + non-empty qualifier list of a managed-scheduled-executor. + + You can specify a single qualifier element with no value to indicate an + empty list of qualifier annotation classes. + + + + + + + + + Upper bound on contextual tasks and actions that this executor + will simultaneously execute asynchronously. This constraint does + not apply to tasks and actions that the executor runs inline, + such as when a thread requests CompletableFuture.join and the + action runs inline if it has not yet started. This constraint also + does not apply to tasks that are scheduled via the schedule methods. + The default is unbounded, although still subject to + resource constraints of the system. + + + + + + + + + The amount of time in milliseconds that a task or action + can execute before it is considered hung. + + + + + + + + + Indicates whether this executor is requested to + create virtual threads for tasks that do not run inline. + When true, the executor can create + virtual threads if it is capable of doing so + and if the request is not overridden by vendor-specific + configuration that restricts the use of virtual threads. + + + + + + + + + Vendor-specific property. + + + + + + + + + + + + + + + + Configuration of a ManagedThreadFactory. + + + + + + + + + Description of this ManagedThreadFactory. + + + + + + + + + JNDI name of the ManagedThreadFactory instance being defined. + The JNDI name must be in a valid Jakarta EE namespace, + such as java:comp, java:module, java:app, or java:global. + + + + + + + + + Refers to the name of a ContextServiceDefinition or + context-service deployment descriptor element, + which determines how context is applied to threads + from this thread factory. + The name must be in a valid Jakarta EE namespace, + such as java:comp, java:module, java:app, or java:global. + In the absence of a configured value, + java:comp/DefaultContextService is used. + + + + + + + + + A ManagedThreadFactory injection point annotated with these qualifier annotations + injects a bean that is produced by this managed-thread-factory element. + Applications can define their own Producers for ManagedThreadFactory injection points + as long as the qualifier annotations on the producer do not conflict with the + non-empty qualifier list of a managed-thread-factory. + + You can specify a single qualifier element with no value to indicate an + empty list of qualifier annotation classes. + + + + + + + + + Priority for threads created by this thread factory. + The default is 5 (java.lang.Thread.NORM_PRIORITY). + + + + + + + + + Indicates whether this executor is requested to + create virtual threads for tasks that do not run inline. + When true, the executor can create + virtual threads if it is capable of doing so + and if the request is not overridden by vendor-specific + configuration that restricts the use of virtual threads. + + + + + + + + + Vendor-specific property. + + + + + + + + + + + + + + + + This type is a general type that can be used to declare + parameter/value lists. + + + + + + + + + + + The param-name element contains the name of a + parameter. + + + + + + + + + + The param-value element contains the value of a + parameter. + + + + + + + + + + + + + + + The elements that use this type designate either a relative + path or an absolute path starting with a "/". + + In elements that specify a pathname to a file within the + same Deployment File, relative filenames (i.e., those not + starting with "/") are considered relative to the root of + the Deployment File's namespace. Absolute filenames (i.e., + those starting with "/") also specify names in the root of + the Deployment File's namespace. In general, relative names + are preferred. The exception is .war files where absolute + names are preferred for consistency with the Servlet API. + + + + + + + + + + + + + + + myPersistenceContext + + + + + myPersistenceContext + + PersistenceUnit1 + + Extended + + + ]]> + + + + + + + + + The persistence-context-ref-name element specifies + the name of a persistence context reference; its + value is the environment entry name used in + Deployment Component code. The name is a JNDI name + relative to the java:comp/env context. + + + + + + + + + The Application Assembler(or BeanProvider) may use the + following syntax to avoid the need to rename persistence + units to have unique names within a Jakarta EE application. + + The Application Assembler specifies the pathname of the + root of the persistence.xml file for the referenced + persistence unit and appends the name of the persistence + unit separated from the pathname by #. The pathname is + relative to the referencing application component jar file. + In this manner, multiple persistence units with the same + persistence unit name may be uniquely identified when the + Application Assembler cannot change persistence unit names. + + + + + + + + + + + + + + Used to specify properties for the container or persistence + provider. Vendor-specific properties may be included in + the set of properties. Properties that are not recognized + by a vendor must be ignored. Entries that make use of the + namespace jakarta.persistence and its subnamespaces must not + be used for vendor-specific properties. The namespace + jakarta.persistence is reserved for use by the specification. + + + + + + + + + + + + + + + + + + + The persistence-context-synchronizationType specifies + whether a container-managed persistence context is automatically + synchronized with the current transaction. + + The value of the persistence-context-synchronization element + must be one of the following: + Synchronized + Unsynchronized + + + + + + + + + + + + + + + + + The persistence-context-typeType specifies the transactional + nature of a persistence context reference. + + The value of the persistence-context-type element must be + one of the following: + Transaction + Extended + + + + + + + + + + + + + + + + + + Specifies a thread priority value in the range of + 1 (java.lang.Thread.MIN_PRIORITY) to 10 (java.lang.Thread.MAX_PRIORITY). + + + + + + + + + + + + + + + + + Specifies a name/value pair. + + + + + + + + + + + + + + + + + + + + myPersistenceUnit + + + + + myPersistenceUnit + + PersistenceUnit1 + + + + ]]> + + + + + + + + + The persistence-unit-ref-name element specifies + the name of a persistence unit reference; its + value is the environment entry name used in + Deployment Component code. The name is a JNDI name + relative to the java:comp/env context. + + + + + + + + + The Application Assembler(or BeanProvider) may use the + following syntax to avoid the need to rename persistence + units to have unique names within a Jakarta EE application. + + The Application Assembler specifies the pathname of the + root of the persistence.xml file for the referenced + persistence unit and appends the name of the persistence + unit separated from the pathname by #. The pathname is + relative to the referencing application component jar file. + In this manner, multiple persistence units with the same + persistence unit name may be uniquely identified when the + Application Assembler cannot change persistence unit names. + + + + + + + + + + + + + + + + + + com.wombat.empl.EmployeeService + + ]]> + + + + + + + + + + + + + + jms/StockQueue + + jakarta.jms.Queue + + + + ]]> + + + + + + + + + + The resource-env-ref-name element specifies the name + of a resource environment reference; its value is + the environment entry name used in + the Deployment Component code. The name is a JNDI + name relative to the java:comp/env context and must + be unique within a Deployment Component. + + + + + + + + + + The resource-env-ref-type element specifies the type + of a resource environment reference. It is the + fully qualified name of a Java language class or + interface. + + + + + + + + + + + + + + + + + + jdbc/EmployeeAppDB + javax.sql.DataSource + Container + Shareable + + + ]]> + + + + + + + + + + The res-ref-name element specifies the name of a + resource manager connection factory reference. + The name is a JNDI name relative to the + java:comp/env context. + The name must be unique within a Deployment File. + + + + + + + + + + The res-type element specifies the type of the data + source. The type is specified by the fully qualified + Java language class or interface + expected to be implemented by the data source. + + + + + + + + + + + + + + + + + + + + + + The res-authType specifies whether the Deployment Component + code signs on programmatically to the resource manager, or + whether the Container will sign on to the resource manager + on behalf of the Deployment Component. In the latter case, + the Container uses information that is supplied by the + Deployer. + + The value must be one of the two following: + + Application + Container + + + + + + + + + + + + + + + + + + The res-sharing-scope type specifies whether connections + obtained through the given resource manager connection + factory reference can be shared. The value, if specified, + must be one of the two following: + + Shareable + Unshareable + + The default value is Shareable. + + + + + + + + + + + + + + + + + + The run-asType specifies the run-as identity to be + used for the execution of a component. It contains an + optional description, and the name of a security role. + + + + + + + + + + + + + + + + + + The role-nameType designates the name of a security role. + + The name must conform to the lexical rules for a token. + + + + + + + + + + + + + + + + + This role includes all employees who are authorized + to access the employee service application. + + employee + + + ]]> + + + + + + + + + + + + + + + + + The security-role-refType contains the declaration of a + security role reference in a component's or a + Deployment Component's code. The declaration consists of an + optional description, the security role name used in the + code, and an optional link to a security role. If the + security role is not specified, the Deployer must choose an + appropriate security role. + + + + + + + + + + + The value of the role-name element must be the String used + as the parameter to the + EJBContext.isCallerInRole(String roleName) method or the + HttpServletRequest.isUserInRole(String role) method. + + + + + + + + + + The role-link element is a reference to a defined + security role. The role-link element must contain + the name of one of the security roles defined in the + security-role elements. + + + + + + + + + + + + + + + This type adds an "id" attribute to xsd:QName. + + + + + + + + + + + + + + + + + This type adds an "id" attribute to xsd:boolean. + + + + + + + + + + + + + + + + + This type adds an "id" attribute to xsd:NMTOKEN. + + + + + + + + + + + + + + + + + This type adds an "id" attribute to xsd:anyURI. + + + + + + + + + + + + + + + + + This type adds an "id" attribute to xsd:integer. + + + + + + + + + + + + + + + + + This type adds an "id" attribute to xsd:positiveInteger. + + + + + + + + + + + + + + + + + This type adds an "id" attribute to xsd:nonNegativeInteger. + + + + + + + + + + + + + + + + + This type adds an "id" attribute to xsd:string. + + + + + + + + + + + + + + + + + This is a special string datatype that is defined by Jakarta EE as + a base type for defining collapsed strings. When schemas + require trailing/leading space elimination as well as + collapsing the existing whitespace, this base type may be + used. + + + + + + + + + + + + + + + + + This simple type designates a boolean with only two + permissible values + + - true + - false + + + + + + + + + + + + + + + + + The url-patternType contains the url pattern of the mapping. + It must follow the rules specified in Section 11.2 of the + Servlet API Specification. This pattern is assumed to be in + URL-decoded form and must not contain CR(#xD) or LF(#xA). + If it contains those characters, the container must inform + the developer with a descriptive error message. + The container must preserve all characters including whitespaces. + + + + + + + + + + + + + + + CorporateStocks + + + + ]]> + + + + + + + + + The message-destination-name element specifies a + name for a message destination. This name must be + unique among the names of message destinations + within the Deployment File. + + + + + + + + + + + + + + + + + The JNDI name to be looked up to resolve the message destination. + + + + + + + + + + + + + + + + jms/StockQueue + + jakarta.jms.Queue + + Consumes + + CorporateStocks + + + + ]]> + + + + + + + + + The message-destination-ref-name element specifies + the name of a message destination reference; its + value is the environment entry name used in + Deployment Component code. + + + + + + + + + + + + + + + + + + + + + + The message-destination-usageType specifies the use of the + message destination indicated by the reference. The value + indicates whether messages are consumed from the message + destination, produced for the destination, or both. The + Assembler makes use of this information in linking producers + of a destination with its consumers. + + The value of the message-destination-usage element must be + one of the following: + Consumes + Produces + ConsumesProduces + + + + + + + + + + + + + + + + + + jakarta.jms.Queue + + + ]]> + + + + + + + + + + + + + + The message-destination-linkType is used to link a message + destination reference or message-driven bean to a message + destination. + + The Assembler sets the value to reflect the flow of messages + between producers and consumers in the application. + + The value must be the message-destination-name of a message + destination in the same Deployment File or in another + Deployment File in the same Jakarta EE application unit. + + Alternatively, the value may be composed of a path name + specifying a Deployment File containing the referenced + message destination with the message-destination-name of the + destination appended and separated from the path name by + "#". The path name is relative to the Deployment File + containing Deployment Component that is referencing the + message destination. This allows multiple message + destinations with the same name to be uniquely identified. + + + + + + + + + + + + + + + The transaction-supportType specifies the level of + transaction support provided by the resource adapter. It is + used by transaction-support elements. + + The value must be one of the following: + + NoTransaction + LocalTransaction + XATransaction + + + + + + + + + + + + + diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/jsp_4_1.xsd b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/jsp_4_1.xsd new file mode 100644 index 000000000000..eb7f61e88af1 --- /dev/null +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/jsp_4_1.xsd @@ -0,0 +1,380 @@ + + + + + + Copyright (c) 2009, 2023 Oracle and/or its affiliates and others. + All rights reserved. + + This program and the accompanying materials are made available under the + terms of the Eclipse Public License v. 2.0, which is available at + http://www.eclipse.org/legal/epl-2.0. + + This Source Code may also be made available under the following Secondary + Licenses when the conditions for such availability set forth in the + Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + version 2 with the GNU Classpath Exception, which is available at + https://www.gnu.org/software/classpath/license.html. + + SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + + + + + + + + This is the XML Schema for the JSP 4.1 deployment descriptor + types. The JSP 4.1 schema contains all the special + structures and datatypes that are necessary to use JSP files + from a web application. + + The contents of this schema is used by the web-common_6_1.xsd + file to define JSP specific content. + + + + + + + + The following conventions apply to all Jakarta EE + deployment descriptor elements unless indicated otherwise. + + - In elements that specify a pathname to a file within the + same JAR file, relative filenames (i.e., those not + starting with "/") are considered relative to the root of + the JAR file's namespace. Absolute filenames (i.e., those + starting with "/") also specify names in the root of the + JAR file's namespace. In general, relative names are + preferred. The exception is .war files where absolute + names are preferred for consistency with the Servlet API. + + + + + + + + + + + + + + + The jsp-configType is used to provide global configuration + information for the JSP files in a web application. It has + two subelements, taglib and jsp-property-group. + + + + + + + + + + + + + + + + + + The jsp-file element contains the full path to a JSP file + within the web application beginning with a `/'. + + + + + + + + + + + + + + + + The jsp-property-groupType is used to group a number of + files so they can be given global property information. + All files so described are deemed to be JSP files. The + following additional properties can be described: + + - Control whether EL is ignored. + - Control whether scripting elements are invalid. + - Indicate pageEncoding information. + - Indicate that a resource is a JSP document (XML). + - Prelude and Coda automatic includes. + - Control whether the character sequence #{ is allowed + when used as a String literal. + - Control whether template text containing only + whitespaces must be removed from the response output. + - Indicate the default contentType information. + - Indicate the default buffering model for JspWriter + - Control whether error should be raised for the use of + undeclared namespaces in a JSP page. + + + + + + + + + + + + Can be used to easily set the isELIgnored + property of a group of JSP pages. By default, the + EL evaluation is enabled for Web Applications using + a Servlet 2.4 or greater web.xml, and disabled + otherwise. + + + + + + + + + Can be used to easily set the errorOnELNotFound + property of a group of JSP pages. By default, this + property is false. + + + + + + + + + The valid values of page-encoding are those of the + pageEncoding page directive. It is a + translation-time error to name different encodings + in the pageEncoding attribute of the page directive + of a JSP page and in a JSP configuration element + matching the page. It is also a translation-time + error to name different encodings in the prolog + or text declaration of a document in XML syntax and + in a JSP configuration element matching the document. + It is legal to name the same encoding through + mulitple mechanisms. + + + + + + + + + Can be used to easily disable scripting in a + group of JSP pages. By default, scripting is + enabled. + + + + + + + + + If true, denotes that the group of resources + that match the URL pattern are JSP documents, + and thus must be interpreted as XML documents. + If false, the resources are assumed to not + be JSP documents, unless there is another + property group that indicates otherwise. + + + + + + + + + The include-prelude element is a context-relative + path that must correspond to an element in the + Web Application. When the element is present, + the given path will be automatically included (as + in an include directive) at the beginning of each + JSP page in this jsp-property-group. + + + + + + + + + The include-coda element is a context-relative + path that must correspond to an element in the + Web Application. When the element is present, + the given path will be automatically included (as + in an include directive) at the end of each + JSP page in this jsp-property-group. + + + + + + + + + The character sequence #{ is reserved for EL expressions. + Consequently, a translation error occurs if the #{ + character sequence is used as a String literal, unless + this element is enabled (true). Disabled (false) by + default. + + + + + + + + + Indicates that template text containing only whitespaces + must be removed from the response output. It has no + effect on JSP documents (XML syntax). Disabled (false) + by default. + + + + + + + + + The valid values of default-content-type are those of the + contentType page directive. It specifies the default + response contentType if the page directive does not include + a contentType attribute. + + + + + + + + + The valid values of buffer are those of the + buffer page directive. It specifies if buffering should be + used for the output to response, and if so, the size of the + buffer to use. + + + + + + + + + The default behavior when a tag with unknown namespace is used + in a JSP page (regular syntax) is to silently ignore it. If + set to true, then an error must be raised during the translation + time when an undeclared tag is used in a JSP page. Disabled + (false) by default. + + + + + + + + + + + + + + + The taglibType defines the syntax for declaring in + the deployment descriptor that a tag library is + available to the application. This can be done + to override implicit map entries from TLD files and + from the container. + + + + + + + + + + A taglib-uri element describes a URI identifying a + tag library used in the web application. The body + of the taglib-uri element may be either an + absolute URI specification, or a relative URI. + There should be no entries in web.xml with the + same taglib-uri value. + + + + + + + + + + the taglib-location element contains the location + (as a resource relative to the root of the web + application) where to find the Tag Library + Description file for the tag library. + + + + + + + + + + diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/web-app_6_2.mdd b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/web-app_6_2.mdd new file mode 100644 index 000000000000..1a749c256bed --- /dev/null +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/web-app_6_2.mdd @@ -0,0 +1,856 @@ + + + + + web-app + https://jakarta.ee/xml/ns/jakartaee + WebApp + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.WebApp + + + public org.xml.sax.SAXParseException getError() { + return null; + } + public int getStatus() { + return STATE_VALID; + } + public void setJspConfig(org.netbeans.modules.j2ee.dd.api.web.JspConfig value) { + if (value==null) setJspConfig(new org.netbeans.modules.j2ee.dd.api.web.JspConfig[]{}); + else setJspConfig(new org.netbeans.modules.j2ee.dd.api.web.JspConfig[]{value}); + } + public org.netbeans.modules.j2ee.dd.api.web.JspConfig getSingleJspConfig() { + org.netbeans.modules.j2ee.dd.api.web.JspConfig[] values = getJspConfig(); + if (values==null || values.length==0) return null; + else return values[0]; + } + public void setWelcomeFileList(org.netbeans.modules.j2ee.dd.api.web.WelcomeFileList value) { + if (value==null) setWelcomeFileList(new org.netbeans.modules.j2ee.dd.api.web.WelcomeFileList[]{}); + setWelcomeFileList(new org.netbeans.modules.j2ee.dd.api.web.WelcomeFileList[]{value}); + } + public org.netbeans.modules.j2ee.dd.api.web.WelcomeFileList getSingleWelcomeFileList() { + org.netbeans.modules.j2ee.dd.api.web.WelcomeFileList[] values = getWelcomeFileList(); + if (values==null || values.length==0) return null; + else return values[0]; + } + public void setSessionConfig(org.netbeans.modules.j2ee.dd.api.web.SessionConfig value) { + if (value==null) setSessionConfig(new org.netbeans.modules.j2ee.dd.api.web.SessionConfig[]{}); + else setSessionConfig(new org.netbeans.modules.j2ee.dd.api.web.SessionConfig[]{value}); + } + public org.netbeans.modules.j2ee.dd.api.web.SessionConfig getSingleSessionConfig() { + org.netbeans.modules.j2ee.dd.api.web.SessionConfig[] values = getSessionConfig(); + if (values==null || values.length==0) return null; + else return values[0]; + } + public void setLoginConfig(org.netbeans.modules.j2ee.dd.api.web.LoginConfig value) { + if (value==null) setLoginConfig(new org.netbeans.modules.j2ee.dd.api.web.LoginConfig[]{}); + else setLoginConfig(new org.netbeans.modules.j2ee.dd.api.web.LoginConfig[]{value}); + } + public org.netbeans.modules.j2ee.dd.api.web.LoginConfig getSingleLoginConfig() { + org.netbeans.modules.j2ee.dd.api.web.LoginConfig[] values = getLoginConfig(); + if (values==null || values.length==0) return null; + else return values[0]; + } + public void setDistributable(boolean value) { + if (value) setDistributable(new EmptyType[]{new EmptyType()}); + else setDistributable(new EmptyType[]{}); + } + public boolean isDistributable() { + EmptyType[] values = getDistributable(); + if (values==null || values.length==0) return false; + else return true; + } + public void setLocaleEncodingMappingList(org.netbeans.modules.j2ee.dd.api.web.LocaleEncodingMappingList value) { + if (value==null) setLocaleEncodingMappingList(new org.netbeans.modules.j2ee.dd.api.web.LocaleEncodingMappingList[]{}); + else setLocaleEncodingMappingList(new org.netbeans.modules.j2ee.dd.api.web.LocaleEncodingMappingList[]{value}); + } + public org.netbeans.modules.j2ee.dd.api.web.LocaleEncodingMappingList getSingleLocaleEncodingMappingList() { + org.netbeans.modules.j2ee.dd.api.web.LocaleEncodingMappingList[] values = getLocaleEncodingMappingList(); + if (values==null || values.length==0) return null; + else return values[0]; + } + public void setName(String[] value) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException { + throw new org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException(WebApp.VERSION_6_2); + } + public String[] getName() throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException { + throw new org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException(WebApp.VERSION_6_2); + } + + + + emptyType + https://jakarta.ee/xml/ns/jakartaee + EmptyType + + + param-valueType + https://jakarta.ee/xml/ns/jakartaee + InitParam + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.InitParam, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "ParamName"; } + + + + filterType + https://jakarta.ee/xml/ns/jakartaee + Filter + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.Filter, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "FilterName"; } + + + + filter-mappingType + https://jakarta.ee/xml/ns/jakartaee + FilterMapping + + org.netbeans.modules.j2ee.dd.api.web.FilterMapping + + + public String getServletName() { + return this.sizeServletName() > 0 ? (String)this.getValue(SERVLET_NAME, 0) : null; + } + + public void setServletName(String value) { + setServletNames(value != null ? new String[]{value} : new String[]{}); + } + + public String getUrlPattern() { + return this.sizeUrlPattern() > 0 ? (String)this.getValue(URL_PATTERN, 0) : null; + } + + public void setUrlPattern(String value) { + setUrlPatterns(value != null ? new String[]{value} : new String[]{}); + } + + + + listenerType + https://jakarta.ee/xml/ns/jakartaee + Listener + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.Listener + + + + servletType + https://jakarta.ee/xml/ns/jakartaee + Servlet + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.Servlet, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "ServletName"; } + + + + servlet-mappingType + https://jakarta.ee/xml/ns/jakartaee + ServletMapping + + org.netbeans.modules.j2ee.dd.api.web.ServletMapping25, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "UrlPattern"; } + + public void setUrlPattern(String value) { + setUrlPatterns(new String[] {value}); + } + + public String getUrlPattern() { + String[] urlPatterns = getUrlPatterns(); + if (urlPatterns != null && urlPatterns.length > 0) { + return urlPatterns[0]; + } + return null; + } + + + + + session-configType + https://jakarta.ee/xml/ns/jakartaee + SessionConfig + org.netbeans.modules.j2ee.dd.impl.common.Comparator + + org.netbeans.modules.j2ee.dd.api.web.SessionConfig + + + + mime-mappingType + https://jakarta.ee/xml/ns/jakartaee + MimeMapping + + org.netbeans.modules.j2ee.dd.api.web.MimeMapping, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "Extension"; } + + + + welcome-file-listType + https://jakarta.ee/xml/ns/jakartaee + WelcomeFileList + + org.netbeans.modules.j2ee.dd.api.web.WelcomeFileList + + + + error-pageType + https://jakarta.ee/xml/ns/jakartaee + ErrorPage + org.netbeans.modules.j2ee.dd.impl.common.Comparator + + org.netbeans.modules.j2ee.dd.api.web.ErrorPage, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "ErrorCode"; } + + + + jsp-configType + https://jakarta.ee/xml/ns/jakartaee + JspConfig + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + + org.netbeans.modules.j2ee.dd.api.web.JspConfig + + + + security-constraintType + https://jakarta.ee/xml/ns/jakartaee + SecurityConstraint + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.SecurityConstraint + + + + login-configType + https://jakarta.ee/xml/ns/jakartaee + LoginConfig + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + + org.netbeans.modules.j2ee.dd.api.web.LoginConfig + + + + security-roleType + https://jakarta.ee/xml/ns/jakartaee + SecurityRole + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.SecurityRole, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "RoleName"; } + + + + message-destinationType + https://jakarta.ee/xml/ns/jakartaee + MessageDestination + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.MessageDestination, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "MessageDestinationName"; } + + + + locale-encoding-mapping-listType + https://jakarta.ee/xml/ns/jakartaee + LocaleEncodingMappingList + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + + org.netbeans.modules.j2ee.dd.api.web.LocaleEncodingMappingList + + + + locale-encoding-mappingType + https://jakarta.ee/xml/ns/jakartaee + LocaleEncodingMapping + + org.netbeans.modules.j2ee.dd.api.web.LocaleEncodingMapping, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "Locale"; } + + + + localeType + https://jakarta.ee/xml/ns/jakartaee + LocaleType + java.lang.String + + + encodingType + https://jakarta.ee/xml/ns/jakartaee + EncodingType + java.lang.String + + + string + https://jakarta.ee/xml/ns/jakartaee + String + java.lang.String + + + descriptionType + https://jakarta.ee/xml/ns/jakartaee + DescriptionType + java.lang.String + + + xsdStringType + https://jakarta.ee/xml/ns/jakartaee + XsdStringType + java.lang.String + + + display-nameType + https://jakarta.ee/xml/ns/jakartaee + DisplayNameType + java.lang.String + + + iconType + https://jakarta.ee/xml/ns/jakartaee + Icon + + org.netbeans.modules.j2ee.dd.api.common.Icon + + + + pathType + https://jakarta.ee/xml/ns/jakartaee + PathType + java.lang.String + + + env-entryType + https://jakarta.ee/xml/ns/jakartaee + EnvEntry + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.EnvEntry, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "EnvEntryName"; } + + + + ejb-refType + https://jakarta.ee/xml/ns/jakartaee + EjbRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.EjbRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "EjbRefName"; } + + + + ejb-local-refType + https://jakarta.ee/xml/ns/jakartaee + EjbLocalRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.EjbLocalRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "EjbRefName"; } + + + + resource-refType + https://jakarta.ee/xml/ns/jakartaee + ResourceRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.ResourceRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "ResRefName"; } + + + + resource-env-refType + https://jakarta.ee/xml/ns/jakartaee + ResourceEnvRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.ResourceEnvRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "ResourceEnvRefName"; } + + + + message-destination-refType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.MessageDestinationRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "MessageDestinationRefName"; } + + + + persistence-context-refType + https://jakarta.ee/xml/ns/jakartaee + PersistenceContextRefType + + + persistence-unit-refType + https://jakarta.ee/xml/ns/jakartaee + PersistenceUnitRefType + + + lifecycle-callbackType + https://jakarta.ee/xml/ns/jakartaee + LifecycleCallbackType + + + fully-qualified-classType + https://jakarta.ee/xml/ns/jakartaee + FullyQualifiedClassType + java.lang.String + + + java-identifierType + https://jakarta.ee/xml/ns/jakartaee + JavaIdentifierType + java.lang.String + + + jndi-nameType + https://jakarta.ee/xml/ns/jakartaee + JndiNameType + java.lang.String + + + persistence-context-typeType + https://jakarta.ee/xml/ns/jakartaee + PersistenceContextTypeType + java.lang.String + + + propertyType + https://jakarta.ee/xml/ns/jakartaee + PropertyType + + + message-destination-typeType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationTypeType + java.lang.String + + + message-destination-usageType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationUsageType + java.lang.String + + + message-destination-linkType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationLinkType + java.lang.String + + + injection-targetType + https://jakarta.ee/xml/ns/jakartaee + InjectionTarget + org.netbeans.modules.j2ee.dd.api.common.InjectionTarget + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + + + res-authType + https://jakarta.ee/xml/ns/jakartaee + ResAuthType + java.lang.String + + + res-sharing-scopeType + https://jakarta.ee/xml/ns/jakartaee + ResSharingScopeType + java.lang.String + + + service-refType + https://jakarta.ee/xml/ns/jakartaee + ServiceRef + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.ServiceRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "ServiceRefName"; } + + + + xsdAnyURIType + https://jakarta.ee/xml/ns/jakartaee + XsdAnyURIType + java.net.URI + + + xsdQNameType + https://jakarta.ee/xml/ns/jakartaee + XsdQNameType + java.lang.String + + + port-component-refType + https://jakarta.ee/xml/ns/jakartaee + PortComponentRef + + org.netbeans.modules.j2ee.dd.api.common.PortComponentRef + + + + service-ref_handlerType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandler + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandler, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "HandlerName"; } + + + + service-ref_handler-chainsType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandlerChains + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandlerChains + + + service-ref_handler-chainType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandlerChain + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandlerChain + + + service-ref_qname-pattern + https://jakarta.ee/xml/ns/jakartaee + ServiceRefQnamePattern + java.lang.String + + + service-ref_protocol-bindingListType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefProtocolBindingListType + String + + + ejb-ref-nameType + https://jakarta.ee/xml/ns/jakartaee + EjbRefNameType + java.lang.String + + + ejb-ref-typeType + https://jakarta.ee/xml/ns/jakartaee + EjbRefTypeType + java.lang.String + + + local-homeType + https://jakarta.ee/xml/ns/jakartaee + LocalHomeType + java.lang.String + + + localType + https://jakarta.ee/xml/ns/jakartaee + LocalType + java.lang.String + + + ejb-linkType + https://jakarta.ee/xml/ns/jakartaee + EjbLinkType + java.lang.String + + + homeType + https://jakarta.ee/xml/ns/jakartaee + HomeType + java.lang.String + + + remoteType + https://jakarta.ee/xml/ns/jakartaee + RemoteType + java.lang.String + + + env-entry-type-valuesType + https://jakarta.ee/xml/ns/jakartaee + EnvEntryTypeValuesType + java.lang.String + + + role-nameType + https://jakarta.ee/xml/ns/jakartaee + RoleNameType + java.lang.String + + + auth-methodType + https://jakarta.ee/xml/ns/jakartaee + AuthMethodType + java.lang.String + + + form-login-configType + https://jakarta.ee/xml/ns/jakartaee + FormLoginConfig + + org.netbeans.modules.j2ee.dd.api.web.FormLoginConfig + + + + war-pathType + https://jakarta.ee/xml/ns/jakartaee + WarPathType + java.lang.String + + + web-resource-collectionType + https://jakarta.ee/xml/ns/jakartaee + WebResourceCollection + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.WebResourceCollection, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "WebResourceName"; } + + + + auth-constraintType + https://jakarta.ee/xml/ns/jakartaee + AuthConstraint + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.AuthConstraint + + + + user-data-constraintType + https://jakarta.ee/xml/ns/jakartaee + UserDataConstraint + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.UserDataConstraint + + + + transport-guaranteeType + https://jakarta.ee/xml/ns/jakartaee + TransportGuaranteeType + java.lang.String + + + url-patternType + https://jakarta.ee/xml/ns/jakartaee + UrlPatternType + java.lang.String + + + http-methodType + https://jakarta.ee/xml/ns/jakartaee + HttpMethodType + java.lang.String + + + taglibType + https://jakarta.ee/xml/ns/jakartaee + Taglib + + org.netbeans.modules.j2ee.dd.api.web.Taglib, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "TaglibUri"; } + + + + jsp-property-groupType + https://jakarta.ee/xml/ns/jakartaee + JspPropertyGroup + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.JspPropertyGroup + + + + true-falseType + https://jakarta.ee/xml/ns/jakartaee + TrueFalseType + boolean + + + error-codeType + https://jakarta.ee/xml/ns/jakartaee + ErrorCodeType + Integer + + + string + http://www.w3.org/2001/XMLSchema + String + java.lang.String + + + mime-typeType + https://jakarta.ee/xml/ns/jakartaee + MimeTypeType + java.lang.String + + + xsdIntegerType + https://jakarta.ee/xml/ns/jakartaee + XsdIntegerType + java.math.BigInteger + + + servlet-nameType + https://jakarta.ee/xml/ns/jakartaee + ServletNameType + java.lang.String + + + nonEmptyStringType + https://jakarta.ee/xml/ns/jakartaee + NonEmptyStringType + java.lang.String + + + load-on-startupType + https://jakarta.ee/xml/ns/jakartaee + LoadOnStartupType + java.math.BigInteger + + + run-asType + https://jakarta.ee/xml/ns/jakartaee + RunAs + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.RunAs + + + + security-role-refType + https://jakarta.ee/xml/ns/jakartaee + SecurityRoleRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.SecurityRoleRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "RoleName"; } + + + + jsp-fileType + https://jakarta.ee/xml/ns/jakartaee + JspFileType + java.lang.String + + + filter-nameType + https://jakarta.ee/xml/ns/jakartaee + FilterNameType + java.lang.String + + + dispatcherType + https://jakarta.ee/xml/ns/jakartaee + DispatcherType + java.lang.String + + + absoluteOrderingType + https://jakarta.ee/xml/ns/jakartaee + AbsoluteOrdering + + org.netbeans.modules.j2ee.dd.api.web.AbsoluteOrdering + + + + + + + handlerType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandler + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandler, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "HandlerName"; } + + + + handler-chainsType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandlerChains + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandlerChains + + + handler-chainType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandlerChainType + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandlerChain + + + dewey-versionType + https://jakarta.ee/xml/ns/jakartaee + version + java.math.BigDecimal + + diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/web-app_6_2.xsd b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/web-app_6_2.xsd new file mode 100644 index 000000000000..949d9dd3531a --- /dev/null +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/web-app_6_2.xsd @@ -0,0 +1,351 @@ + + + + + + + Copyright (c) 2009, 2023 Oracle and/or its affiliates and others. + All rights reserved. + + This program and the accompanying materials are made available under the + terms of the Eclipse Public License v. 2.0, which is available at + http://www.eclipse.org/legal/epl-2.0. + + This Source Code may also be made available under the following Secondary + Licenses when the conditions for such availability set forth in the + Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + version 2 with the GNU Classpath Exception, which is available at + https://www.gnu.org/software/classpath/license.html. + + SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + + + + + + + + ... + + + The instance documents may indicate the published version of + the schema using the xsi:schemaLocation attribute for Jakarta EE + namespace with the following location: + + https://jakarta.ee/xml/ns/jakartaee/web-app_6_2.xsd + + ]]> + + + + + + + The following conventions apply to all Jakarta EE + deployment descriptor elements unless indicated otherwise. + + - In elements that specify a pathname to a file within the + same JAR file, relative filenames (i.e., those not + starting with "/") are considered relative to the root of + the JAR file's namespace. Absolute filenames (i.e., those + starting with "/") also specify names in the root of the + JAR file's namespace. In general, relative names are + preferred. The exception is .war files where absolute + names are preferred for consistency with the Servlet API. + + + + + + + + + + + + + + + The web-app element is the root of the deployment + descriptor for a web application. Note that the sub-elements + of this element can be in the arbitrary order. Because of + that, the multiplicity of the elements of distributable, + session-config, welcome-file-list, jsp-config, login-config, + and locale-encoding-mapping-list was changed from "?" to "*" + in this schema. However, the deployment descriptor instance + file must not contain multiple elements of session-config, + jsp-config, and login-config. When there are multiple elements of + welcome-file-list or locale-encoding-mapping-list, the container + must concatenate the element contents. The multiple occurence + of the element distributable is redundant and the container + treats that case exactly in the same way when there is only + one distributable. + + + + + + + + + The servlet element contains the name of a servlet. + The name must be unique within the web application. + + + + + + + + + + + + The filter element contains the name of a filter. + The name must be unique within the web application. + + + + + + + + + + + + The ejb-local-ref-name element contains the name of an + enterprise bean reference. The enterprise + bean reference is an entry in the web + application's environment and is relative to the + java:comp/env context. The name must be unique within + the web application. + + It is recommended that name is prefixed with "ejb/". + + + + + + + + + + + + The ejb-ref-name element contains the name of an + enterprise bean reference. The enterprise bean + reference is an entry in the web application's environment + and is relative to the java:comp/env context. + The name must be unique within the web application. + + It is recommended that name is prefixed with "ejb/". + + + + + + + + + + + + The resource-env-ref-name element specifies the name of + a resource environment reference; its value is the + environment entry name used in the web application code. + The name is a JNDI name relative to the java:comp/env + context and must be unique within a web application. + + + + + + + + + + + + The message-destination-ref-name element specifies the name of + a message destination reference; its value is the + environment entry name used in the web application code. + The name is a JNDI name relative to the java:comp/env + context and must be unique within a web application. + + + + + + + + + + + + + The res-ref-name element specifies the name of a + resource manager connection factory reference. The name + is a JNDI name relative to the java:comp/env context. + The name must be unique within a web application. + + + + + + + + + + + + The env-entry-name element contains the name of a web + application's environment entry. The name is a JNDI + name relative to the java:comp/env context. The name + must be unique within a web application. + + + + + + + + + + + + + A role-name-key is specified to allow the references + from the security-role-refs. + + + + + + + + + + + + The keyref indicates the references from + security-role-ref to a specified role-name. + + + + + + + + + + + + + + + + + + + When specified, this element provides a default context path + of the web application. An empty value for this element must cause + the web application to be deployed at the root for the container. + Otherwise, the default context path must start with + a "/" character but not end with a "/" character. + Servlet containers may provide vendor specific configuration + options that allows specifying a value that overrides the value + specified here. + + + + + + + + + When specified, this element provides a default request + character encoding of the web application. + + + + + + + + + When specified, this element provides a default response + character encoding of the web application. + + + + + + + + + When specified, this element causes uncovered http methods + to be denied. For every url-pattern that is the target of a + security-constrant, this element causes all HTTP methods that + are NOT covered (by a security constraint) at the url-pattern + to be denied. + + + + + + + + + + + + + + + + Please see section 8.2.2 of the specification for details. + + + + + + + + + + diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/web-common_6_2.xsd b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/web-common_6_2.xsd new file mode 100644 index 000000000000..b72a81252f28 --- /dev/null +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/web-common_6_2.xsd @@ -0,0 +1,1526 @@ + + + + + + + Copyright (c) 2009, 2023 Oracle and/or its affiliates and others. + All rights reserved. + + This program and the accompanying materials are made available under the + terms of the Eclipse Public License v. 2.0, which is available at + http://www.eclipse.org/legal/epl-2.0. + + This Source Code may also be made available under the following Secondary + Licenses when the conditions for such availability set forth in the + Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + version 2 with the GNU Classpath Exception, which is available at + https://www.gnu.org/software/classpath/license.html. + + SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + + + + + + + + ... + + + The instance documents may indicate the published version of + the schema using the xsi:schemaLocation attribute for Jakarta EE + namespace with the following location: + + https://jakarta.ee/xml/ns/jakartaee/web-common_6_2.xsd + + ]]> + + + + + + + The following conventions apply to all Jakarta EE + deployment descriptor elements unless indicated otherwise. + + - In elements that specify a pathname to a file within the + same JAR file, relative filenames (i.e., those not + starting with "/") are considered relative to the root of + the JAR file's namespace. Absolute filenames (i.e., those + starting with "/") also specify names in the root of the + JAR file's namespace. In general, relative names are + preferred. The exception is .war files where absolute + names are preferred for consistency with the Servlet API. + + + + + + + + + + + + + + + + + + + + + The context-param element contains the declaration + of a web application's servlet context + initialization parameters. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The metadata-complete attribute defines whether this + deployment descriptor and other related deployment + descriptors for this module (e.g., web service + descriptors) are complete, or whether the class + files available to this module and packaged with + this application should be examined for annotations + that specify deployment information. + + If metadata-complete is set to "true", the deployment + tool must ignore any annotations that specify deployment + information, which might be present in the class files + of the application. + + If metadata-complete is not specified or is set to + "false", the deployment tool must examine the class + files of the application for annotations, as + specified by the specifications. + + + + + + + + + + + + + This type is a general type that can be used to declare + attribute/value lists. + + + + + + + + + + + The attribute-name element contains the name of an + attribute. + + + + + + + + + + The attribute-value element contains the value of a + attribute. + + + + + + + + + + + + + + + The auth-constraintType indicates the user roles that + should be permitted access to this resource + collection. The role-name used here must either correspond + to the role-name of one of the security-role elements + defined for this web application, or be the specially + reserved role-name "*" that is a compact syntax for + indicating all roles in the web application. If both "*" + and rolenames appear, the container interprets this as all + roles. If no roles are defined, no user is allowed access + to the portion of the web application described by the + containing security-constraint. The container matches + role names case sensitively when determining access. + + + + + + + + + + + + + + + + + + The auth-methodType is used to configure the authentication + mechanism for the web application. As a prerequisite to + gaining access to any web resources which are protected by + an authorization constraint, a user must have authenticated + using the configured mechanism. Legal values are "BASIC", + "DIGEST", "FORM", "CLIENT-CERT", or a vendor-specific + authentication scheme. + + Used in: login-config + + + + + + + + + + + + + + + + The dispatcher has five legal values: FORWARD, REQUEST, + INCLUDE, ASYNC, and ERROR. + + A value of FORWARD means the Filter will be applied under + RequestDispatcher.forward() calls. + A value of REQUEST means the Filter will be applied under + ordinary client calls to the path or servlet. + A value of INCLUDE means the Filter will be applied under + RequestDispatcher.include() calls. + A value of ASYNC means the Filter will be applied under + calls dispatched from an AsyncContext. + A value of ERROR means the Filter will be applied under the + error page mechanism. + + The absence of any dispatcher elements in a filter-mapping + indicates a default of applying filters only under ordinary + client calls to the path or servlet. + + + + + + + + + + + + + + + + + + + + + + The error-code contains an HTTP error code, ex: 404 + + Used in: error-page + + + + + + + + + + + + + + + + + + + The error-pageType contains a mapping between an error code + or exception type to the path of a resource in the web + application. + + Error-page declarations using the exception-type element in + the deployment descriptor must be unique up to the class name of + the exception-type. Similarly, error-page declarations using the + error-code element must be unique in the deployment descriptor + up to the status code. + + If an error-page element in the deployment descriptor does not + contain an exception-type or an error-code element, the error + page is a default error page. + + Used in: web-app + + + + + + + + + + + + The exception-type contains a fully qualified class + name of a Java exception type. + + + + + + + + + + + The location element contains the location of the + resource in the web application relative to the root of + the web application. The value of the location must have + a leading `/'. + + + + + + + + + + + + + + + The filterType is used to declare a filter in the web + application. The filter is mapped to either a servlet or a + URL pattern in the filter-mapping element, using the + filter-name value to reference. Filters can access the + initialization parameters declared in the deployment + descriptor at runtime via the FilterConfig interface. + + Used in: web-app + + + + + + + + + + + + The fully qualified classname of the filter. + + + + + + + + + + + The init-param element contains a name/value pair as + an initialization param of a servlet filter + + + + + + + + + + + + + + + Declaration of the filter mappings in this web + application is done by using filter-mappingType. + The container uses the filter-mapping + declarations to decide which filters to apply to a request, + and in what order. The container matches the request URI to + a Servlet in the normal way. To determine which filters to + apply it matches filter-mapping declarations either on + servlet-name, or on url-pattern for each filter-mapping + element, depending on which style is used. The order in + which filters are invoked is the order in which + filter-mapping declarations that match a request URI for a + servlet appear in the list of filter-mapping elements.The + filter-name value must be the value of the filter-name + sub-elements of one of the filter declarations in the + deployment descriptor. + + + + + + + + + + + + + + + + + + + + + This type defines a string which contains at least one + character. + + + + + + + + + + + + + + + + The logical name of the filter is declare + by using filter-nameType. This name is used to map the + filter. Each filter name is unique within the web + application. + + Used in: filter, filter-mapping + + + + + + + + + + + + + + + + The form-login-configType specifies the login and error + pages that should be used in form based login. If form based + authentication is not used, these elements are ignored. + + Used in: login-config + + + + + + + + + + + The form-login-page element defines the location in the web + app where the page that can be used for login can be + found. The path begins with a leading / and is interpreted + relative to the root of the WAR. + + + + + + + + + + The form-error-page element defines the location in + the web app where the error page that is displayed + when login is not successful can be found. + The path begins with a leading / and is interpreted + relative to the root of the WAR. + + + + + + + + + + + + + + + + + A HTTP method type as defined in HTTP 1.1 section 2.2. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The login-configType is used to configure the authentication + method that should be used, the realm name that should be + used for this application, and the attributes that are + needed by the form login mechanism. + + Used in: web-app + + + + + + + + + + + The realm name element specifies the realm name to + use in HTTP Basic authorization. + + + + + + + + + + + + + + + + The mime-mappingType defines a mapping between an extension + and a mime type. + + Used in: web-app + + + + + + + + + The extension element contains a string describing an + extension. example: "txt" + + + + + + + + + + + + + + + + + The mime-typeType is used to indicate a defined mime type. + + Example: + "text/plain" + + Used in: mime-mapping + + + + + + + + + + + + + + + + + + The security-constraintType is used to associate + security constraints with one or more web resource + collections + + Used in: web-app + + + + + + + + + + + + + + + + + + + + The servletType is used to declare a servlet. + It contains the declarative data of a + servlet. If a jsp-file is specified and the load-on-startup + element is present, then the JSP should be precompiled and + loaded. + + Used in: web-app + + + + + + + + + + + + + The servlet-class element contains the fully + qualified class name of the servlet. + + + + + + + + + + + + + + + The load-on-startup element indicates that this + servlet should be loaded (instantiated and have + its init() called) on the startup of the web + application. The optional contents of these + element must be an integer indicating the order in + which the servlet should be loaded. If the value + is a negative integer, or the element is not + present, the container is free to load the servlet + whenever it chooses. If the value is a positive + integer or 0, the container must load and + initialize the servlet as the application is + deployed. The container must guarantee that + servlets marked with lower integers are loaded + before servlets marked with higher integers. The + container may choose the order of loading of + servlets with the same load-on-start-up value. + + + + + + + + + + + + + + + + + + + + The servlet-mappingType defines a mapping between a + servlet and a url pattern. + + Used in: web-app + + + + + + + + + + + + + + + + + + + The servlet-name element contains the canonical name of the + servlet. Each servlet name is unique within the web + application. + + + + + + + + + + + + + + + + The session-configType defines the session parameters + for this web application. + + Used in: web-app + + + + + + + + + + The session-timeout element defines the default + session timeout interval for all sessions created + in this web application. The specified timeout + must be expressed in a whole number of minutes. + If the timeout is 0 or less, the container ensures + the default behaviour of sessions is never to time + out. If this element is not specified, the container + must set its default timeout period. + + + + + + + + + The cookie-config element defines the configuration of the + session tracking cookies created by this web application. + + + + + + + + + The tracking-mode element defines the tracking modes + for sessions created by this web application + + + + + + + + + + + + + + + The cookie-configType defines the configuration for the + session tracking cookies of this web application. + + Used in: session-config + + + + + + + + + + The name that will be assigned to any session tracking + cookies created by this web application. + The default is JSESSIONID + + + + + + + + + The domain name that will be assigned to any session tracking + cookies created by this web application. + + + + + + + + + The path that will be assigned to any session tracking + cookies created by this web application. + + + + + + + + + The comment that will be assigned to any session tracking + cookies created by this web application. + + + + + + + + + Specifies whether any session tracking cookies created + by this web application will be marked as HttpOnly + + + + + + + + + Specifies whether any session tracking cookies created + by this web application will be marked as secure. + When true, all session tracking cookies must be marked + as secure independent of the nature of the request that + initiated the corresponding session. + When false, the session cookie should only be marked secure + if the request that initiated the session was secure. + + + + + + + + + The lifetime (in seconds) that will be assigned to any + session tracking cookies created by this web application. + Default is -1 + + + + + + + + + The attribute-param element contains a name/value pair to + be added as an attribute to every session cookie. + + + + + + + + + + + + + + + The name that will be assigned to any session tracking + cookies created by this web application. + The default is JSESSIONID + + Used in: cookie-config + + + + + + + + + + + + + + + + The domain name that will be assigned to any session tracking + cookies created by this web application. + + Used in: cookie-config + + + + + + + + + + + + + + + + The path that will be assigned to any session tracking + cookies created by this web application. + + Used in: cookie-config + + + + + + + + + + + + + + + + The comment that will be assigned to any session tracking + cookies created by this web application. + + Used in: cookie-config + + + + + + + + + + + + + + + + The tracking modes for sessions created by this web + application + + Used in: session-config + + + + + + + + + + + + + + + + + + + + The transport-guaranteeType specifies that the communication + between client and server should be NONE, INTEGRAL, or + CONFIDENTIAL. NONE means that the application does not + require any transport guarantees. A value of INTEGRAL means + that the application requires that the data sent between the + client and server be sent in such a way that it can't be + changed in transit. CONFIDENTIAL means that the application + requires that the data be transmitted in a fashion that + prevents other entities from observing the contents of the + transmission. In most cases, the presence of the INTEGRAL or + CONFIDENTIAL flag will indicate that the use of SSL is + required. + + Used in: user-data-constraint + + + + + + + + + + + + + + + + + + + + The user-data-constraintType is used to indicate how + data communicated between the client and container should be + protected. + + Used in: security-constraint + + + + + + + + + + + + + + + + + + The elements that use this type designate a path starting + with a "/" and interpreted relative to the root of a WAR + file. + + + + + + + + + + + + + + + + + This type contains the recognized versions of + web-application supported. It is used to designate the + version of the web application. + + + + + + + + + + + + + + + The web-resource-collectionType is used to identify the + resources and HTTP methods on those resources to which a + security constraint applies. If no HTTP methods are specified, + then the security constraint applies to all HTTP methods. + If HTTP methods are specified by http-method-omission + elements, the security constraint applies to all methods + except those identified in the collection. + http-method-omission and http-method elements are never + mixed in the same collection. + + Used in: security-constraint + + + + + + + + + + The web-resource-name contains the name of this web + resource collection. + + + + + + + + + + + Each http-method names an HTTP method to which the + constraint applies. + + + + + + + Each http-method-omission names an HTTP method to + which the constraint does not apply. + + + + + + + + + + + + + + + The welcome-file-list contains an ordered list of welcome + files elements. + + Used in: web-app + + + + + + + + + + The welcome-file element contains file name to use + as a default welcome file, such as index.html + + + + + + + + + + + + + + + The localeType defines valid locale defined by ISO-639-1 + and ISO-3166. + + + + + + + + + + + + + + + + The encodingType defines IANA character sets. + + + + + + + + + + + + + + + + The locale-encoding-mapping-list contains one or more + locale-encoding-mapping(s). + + + + + + + + + + + + + + + + + The locale-encoding-mapping contains locale name and + encoding name. The locale name must be either "Language-code", + such as "ja", defined by ISO-639 or "Language-code_Country-code", + such as "ja_JP". "Country code" is defined by ISO-3166. + + + + + + + + + + + + + + + + + + This element indicates that the ordering sub-element in which + it was placed should take special action regarding the ordering + of this application resource relative to other application + configuration resources. + See section 8.2.2 of the specification for details. + + + + + + + + + + + + + This element specifies configuration information related to the + handling of multipart/form-data requests. + + + + + + + + The directory location where uploaded files will be stored + + + + + + + The maximum size limit of uploaded files + + + + + + + The maximum size limit of multipart/form-data requests + + + + + + + The size threshold after which an uploaded file will be + written to disk + + + + + + + diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/web-fragment_6_2.mdd b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/web-fragment_6_2.mdd new file mode 100644 index 000000000000..f09d8228877c --- /dev/null +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/web-fragment_6_2.mdd @@ -0,0 +1,910 @@ + + + + + + + + web-fragment + https://jakarta.ee/xml/ns/jakartaee + WebFragment + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.WebFragment + + + public org.xml.sax.SAXParseException getError() { + return null; + } + public int getStatus() { + return STATE_VALID; + } + // due to compatibility with servlet2.3 + public void setTaglib(int index, org.netbeans.modules.j2ee.dd.api.web.Taglib valueInterface) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException { + throw new org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException(VERSION_6_2); + } + public org.netbeans.modules.j2ee.dd.api.web.Taglib getTaglib(int index) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException { + throw new org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException(VERSION_6_2); + } + public void setTaglib(org.netbeans.modules.j2ee.dd.api.web.Taglib[] value) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException { + throw new org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException(VERSION_6_2); + } + public org.netbeans.modules.j2ee.dd.api.web.Taglib[] getTaglib() throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException { + throw new org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException(VERSION_6_2); + } + public int sizeTaglib() throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException { + throw new org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException(VERSION_6_2); + } + public int addTaglib(org.netbeans.modules.j2ee.dd.api.web.Taglib valueInterface) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException { + throw new org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException(VERSION_6_2); + } + public int removeTaglib(org.netbeans.modules.j2ee.dd.api.web.Taglib valueInterface) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException { + throw new org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException(VERSION_6_2); + } + public void setJspConfig(org.netbeans.modules.j2ee.dd.api.web.JspConfig value) { + if (value==null) setJspConfig(new org.netbeans.modules.j2ee.dd.api.web.JspConfig[]{}); + else setJspConfig(new org.netbeans.modules.j2ee.dd.api.web.JspConfig[]{value}); + } + public org.netbeans.modules.j2ee.dd.api.web.JspConfig getSingleJspConfig() { + org.netbeans.modules.j2ee.dd.api.web.JspConfig[] values = getJspConfig(); + if (values==null || values.length==0) return null; + else return values[0]; + } + public void setWelcomeFileList(org.netbeans.modules.j2ee.dd.api.web.WelcomeFileList value) { + if (value==null) setWelcomeFileList(new org.netbeans.modules.j2ee.dd.api.web.WelcomeFileList[]{}); + setWelcomeFileList(new org.netbeans.modules.j2ee.dd.api.web.WelcomeFileList[]{value}); + } + public org.netbeans.modules.j2ee.dd.api.web.WelcomeFileList getSingleWelcomeFileList() { + org.netbeans.modules.j2ee.dd.api.web.WelcomeFileList[] values = getWelcomeFileList(); + if (values==null || values.length==0) return null; + else return values[0]; + } + public void setSessionConfig(org.netbeans.modules.j2ee.dd.api.web.SessionConfig value) { + if (value==null) setSessionConfig(new org.netbeans.modules.j2ee.dd.api.web.SessionConfig[]{}); + else setSessionConfig(new org.netbeans.modules.j2ee.dd.api.web.SessionConfig[]{value}); + } + public org.netbeans.modules.j2ee.dd.api.web.SessionConfig getSingleSessionConfig() { + org.netbeans.modules.j2ee.dd.api.web.SessionConfig[] values = getSessionConfig(); + if (values==null || values.length==0) return null; + else return values[0]; + } + public void setLoginConfig(org.netbeans.modules.j2ee.dd.api.web.LoginConfig value) { + if (value==null) setLoginConfig(new org.netbeans.modules.j2ee.dd.api.web.LoginConfig[]{}); + else setLoginConfig(new org.netbeans.modules.j2ee.dd.api.web.LoginConfig[]{value}); + } + public org.netbeans.modules.j2ee.dd.api.web.LoginConfig getSingleLoginConfig() { + org.netbeans.modules.j2ee.dd.api.web.LoginConfig[] values = getLoginConfig(); + if (values==null || values.length==0) return null; + else return values[0]; + } + public void setDistributable(boolean value) { + if (value) setDistributable(new EmptyType[]{new EmptyType()}); + else setDistributable(new EmptyType[]{}); + } + public boolean isDistributable() { + EmptyType[] values = getDistributable(); + if (values==null || values.length==0) return false; + else return true; + } + public void setLocaleEncodingMappingList(org.netbeans.modules.j2ee.dd.api.web.LocaleEncodingMappingList value) { + if (value==null) setLocaleEncodingMappingList(new org.netbeans.modules.j2ee.dd.api.web.LocaleEncodingMappingList[]{}); + else setLocaleEncodingMappingList(new org.netbeans.modules.j2ee.dd.api.web.LocaleEncodingMappingList[]{value}); + } + public org.netbeans.modules.j2ee.dd.api.web.LocaleEncodingMappingList getSingleLocaleEncodingMappingList() { + org.netbeans.modules.j2ee.dd.api.web.LocaleEncodingMappingList[] values = getLocaleEncodingMappingList(); + if (values==null || values.length==0) return null; + else return values[0]; + } + public org.netbeans.modules.j2ee.dd.api.web.AbsoluteOrdering newAbsoluteOrdering() throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException { + throw new org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException("web-fragment "+VERSION_6_2); + } + public void setAbsoluteOrdering(org.netbeans.modules.j2ee.dd.api.web.AbsoluteOrdering[] value) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException { + throw new org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException("web-fragment "+VERSION_6_2); + } + public org.netbeans.modules.j2ee.dd.api.web.AbsoluteOrdering[] getAbsoluteOrdering() throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException { + throw new org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException("web-fragment "+VERSION_6_2); + } + + + + emptyType + https://jakarta.ee/xml/ns/jakartaee + EmptyType + + + param-valueType + https://jakarta.ee/xml/ns/jakartaee + InitParam + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.InitParam, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "ParamName"; } + + + + filterType + https://jakarta.ee/xml/ns/jakartaee + Filter + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.Filter, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "FilterName"; } + + + + filter-mappingType + https://jakarta.ee/xml/ns/jakartaee + FilterMapping + + org.netbeans.modules.j2ee.dd.api.web.FilterMapping + + + public String getServletName() { + return this.sizeServletName() > 0 ? (String)this.getValue(SERVLET_NAME, 0) : null; + } + + public void setServletName(String value) { + setServletNames(value != null ? new String[]{value} : new String[]{}); + } + + public String getUrlPattern() { + return this.sizeUrlPattern() > 0 ? (String)this.getValue(URL_PATTERN, 0) : null; + } + + public void setUrlPattern(String value) { + setUrlPatterns(value != null ? new String[]{value} : new String[]{}); + } + + + + listenerType + https://jakarta.ee/xml/ns/jakartaee + Listener + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.Listener + + + + servletType + https://jakarta.ee/xml/ns/jakartaee + Servlet + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.Servlet, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "ServletName"; } + + + + servlet-mappingType + https://jakarta.ee/xml/ns/jakartaee + ServletMapping + + org.netbeans.modules.j2ee.dd.api.web.ServletMapping25, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "UrlPattern"; } + + public void setUrlPattern(String value) { + setUrlPatterns(new String[] {value}); + } + + public String getUrlPattern() { + String[] urlPatterns = getUrlPatterns(); + if (urlPatterns != null && urlPatterns.length > 0) { + return urlPatterns[0]; + } + return null; + } + + + + + session-configType + https://jakarta.ee/xml/ns/jakartaee + SessionConfig + org.netbeans.modules.j2ee.dd.impl.common.Comparator + + org.netbeans.modules.j2ee.dd.api.web.SessionConfig + + + + mime-mappingType + https://jakarta.ee/xml/ns/jakartaee + MimeMapping + + org.netbeans.modules.j2ee.dd.api.web.MimeMapping, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "Extension"; } + + + + welcome-file-listType + https://jakarta.ee/xml/ns/jakartaee + WelcomeFileList + + org.netbeans.modules.j2ee.dd.api.web.WelcomeFileList + + + + error-pageType + https://jakarta.ee/xml/ns/jakartaee + ErrorPage + org.netbeans.modules.j2ee.dd.impl.common.Comparator + + org.netbeans.modules.j2ee.dd.api.web.ErrorPage, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "ErrorCode"; } + + + + jsp-configType + https://jakarta.ee/xml/ns/jakartaee + JspConfig + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + + org.netbeans.modules.j2ee.dd.api.web.JspConfig + + + + security-constraintType + https://jakarta.ee/xml/ns/jakartaee + SecurityConstraint + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.SecurityConstraint + + + + login-configType + https://jakarta.ee/xml/ns/jakartaee + LoginConfig + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + + org.netbeans.modules.j2ee.dd.api.web.LoginConfig + + + + security-roleType + https://jakarta.ee/xml/ns/jakartaee + SecurityRole + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.SecurityRole, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "RoleName"; } + + + + message-destinationType + https://jakarta.ee/xml/ns/jakartaee + MessageDestination + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.MessageDestination, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "MessageDestinationName"; } + + + + locale-encoding-mapping-listType + https://jakarta.ee/xml/ns/jakartaee + LocaleEncodingMappingList + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + + org.netbeans.modules.j2ee.dd.api.web.LocaleEncodingMappingList + + + + locale-encoding-mappingType + https://jakarta.ee/xml/ns/jakartaee + LocaleEncodingMapping + + org.netbeans.modules.j2ee.dd.api.web.LocaleEncodingMapping, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "Locale"; } + + + + localeType + https://jakarta.ee/xml/ns/jakartaee + LocaleType + java.lang.String + + + encodingType + https://jakarta.ee/xml/ns/jakartaee + EncodingType + java.lang.String + + + string + https://jakarta.ee/xml/ns/jakartaee + String + java.lang.String + + + descriptionType + https://jakarta.ee/xml/ns/jakartaee + DescriptionType + java.lang.String + + + xsdStringType + https://jakarta.ee/xml/ns/jakartaee + XsdStringType + java.lang.String + + + display-nameType + https://jakarta.ee/xml/ns/jakartaee + DisplayNameType + java.lang.String + + + iconType + https://jakarta.ee/xml/ns/jakartaee + Icon + + org.netbeans.modules.j2ee.dd.api.common.Icon + + + + pathType + https://jakarta.ee/xml/ns/jakartaee + PathType + java.lang.String + + + env-entryType + https://jakarta.ee/xml/ns/jakartaee + EnvEntry + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.EnvEntry, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "EnvEntryName"; } + + + + ejb-refType + https://jakarta.ee/xml/ns/jakartaee + EjbRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.EjbRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "EjbRefName"; } + + + + ejb-local-refType + https://jakarta.ee/xml/ns/jakartaee + EjbLocalRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.EjbLocalRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "EjbRefName"; } + + + + resource-refType + https://jakarta.ee/xml/ns/jakartaee + ResourceRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.ResourceRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "ResRefName"; } + + + + resource-env-refType + https://jakarta.ee/xml/ns/jakartaee + ResourceEnvRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.ResourceEnvRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "ResourceEnvRefName"; } + + + + message-destination-refType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.MessageDestinationRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "MessageDestinationRefName"; } + + + + persistence-context-refType + https://jakarta.ee/xml/ns/jakartaee + PersistenceContextRefType + + + persistence-unit-refType + https://jakarta.ee/xml/ns/jakartaee + PersistenceUnitRefType + + + lifecycle-callbackType + https://jakarta.ee/xml/ns/jakartaee + LifecycleCallbackType + + + fully-qualified-classType + https://jakarta.ee/xml/ns/jakartaee + FullyQualifiedClassType + java.lang.String + + + java-identifierType + https://jakarta.ee/xml/ns/jakartaee + JavaIdentifierType + java.lang.String + + + jndi-nameType + https://jakarta.ee/xml/ns/jakartaee + JndiNameType + java.lang.String + + + persistence-context-typeType + https://jakarta.ee/xml/ns/jakartaee + PersistenceContextTypeType + java.lang.String + + + propertyType + https://jakarta.ee/xml/ns/jakartaee + PropertyType + + + message-destination-typeType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationTypeType + java.lang.String + + + message-destination-usageType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationUsageType + java.lang.String + + + message-destination-linkType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationLinkType + java.lang.String + + + injection-targetType + https://jakarta.ee/xml/ns/jakartaee + InjectionTarget + org.netbeans.modules.j2ee.dd.api.common.InjectionTarget + org.netbeans.modules.j2ee.dd.impl.common.EnclosingBean + + + res-authType + https://jakarta.ee/xml/ns/jakartaee + ResAuthType + java.lang.String + + + res-sharing-scopeType + https://jakarta.ee/xml/ns/jakartaee + ResSharingScopeType + java.lang.String + + + service-refType + https://jakarta.ee/xml/ns/jakartaee + ServiceRef + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.ServiceRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "ServiceRefName"; } + + + + xsdAnyURIType + https://jakarta.ee/xml/ns/jakartaee + XsdAnyURIType + java.net.URI + + + xsdQNameType + https://jakarta.ee/xml/ns/jakartaee + XsdQNameType + java.lang.String + + + port-component-refType + https://jakarta.ee/xml/ns/jakartaee + PortComponentRef + + org.netbeans.modules.j2ee.dd.api.common.PortComponentRef + + + + service-ref_handlerType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandler + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandler, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "HandlerName"; } + + + + service-ref_handler-chainsType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandlerChains + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandlerChains + + + service-ref_handler-chainType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandlerChain + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandlerChain + + + service-ref_qname-pattern + https://jakarta.ee/xml/ns/jakartaee + ServiceRefQnamePattern + java.lang.String + + + service-ref_protocol-bindingListType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefProtocolBindingListType + String + + + ejb-ref-nameType + https://jakarta.ee/xml/ns/jakartaee + EjbRefNameType + java.lang.String + + + ejb-ref-typeType + https://jakarta.ee/xml/ns/jakartaee + EjbRefTypeType + java.lang.String + + + local-homeType + https://jakarta.ee/xml/ns/jakartaee + LocalHomeType + java.lang.String + + + localType + https://jakarta.ee/xml/ns/jakartaee + LocalType + java.lang.String + + + ejb-linkType + https://jakarta.ee/xml/ns/jakartaee + EjbLinkType + java.lang.String + + + homeType + https://jakarta.ee/xml/ns/jakartaee + HomeType + java.lang.String + + + remoteType + https://jakarta.ee/xml/ns/jakartaee + RemoteType + java.lang.String + + + env-entry-type-valuesType + https://jakarta.ee/xml/ns/jakartaee + EnvEntryTypeValuesType + java.lang.String + + + role-nameType + https://jakarta.ee/xml/ns/jakartaee + RoleNameType + java.lang.String + + + auth-methodType + https://jakarta.ee/xml/ns/jakartaee + AuthMethodType + java.lang.String + + + form-login-configType + https://jakarta.ee/xml/ns/jakartaee + FormLoginConfig + + org.netbeans.modules.j2ee.dd.api.web.FormLoginConfig + + + + war-pathType + https://jakarta.ee/xml/ns/jakartaee + WarPathType + java.lang.String + + + web-resource-collectionType + https://jakarta.ee/xml/ns/jakartaee + WebResourceCollection + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.WebResourceCollection, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "WebResourceName"; } + + + + auth-constraintType + https://jakarta.ee/xml/ns/jakartaee + AuthConstraint + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.AuthConstraint + + + + user-data-constraintType + https://jakarta.ee/xml/ns/jakartaee + UserDataConstraint + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.UserDataConstraint + + + + transport-guaranteeType + https://jakarta.ee/xml/ns/jakartaee + TransportGuaranteeType + java.lang.String + + + url-patternType + https://jakarta.ee/xml/ns/jakartaee + UrlPatternType + java.lang.String + + + http-methodType + https://jakarta.ee/xml/ns/jakartaee + HttpMethodType + java.lang.String + + + taglibType + https://jakarta.ee/xml/ns/jakartaee + Taglib + + org.netbeans.modules.j2ee.dd.api.web.Taglib, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "TaglibUri"; } + + + + jsp-property-groupType + https://jakarta.ee/xml/ns/jakartaee + JspPropertyGroup + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.web.JspPropertyGroup + + + + true-falseType + https://jakarta.ee/xml/ns/jakartaee + TrueFalseType + boolean + + + error-codeType + https://jakarta.ee/xml/ns/jakartaee + ErrorCodeType + Integer + + + string + http://www.w3.org/2001/XMLSchema + String + java.lang.String + + + mime-typeType + https://jakarta.ee/xml/ns/jakartaee + MimeTypeType + java.lang.String + + + xsdIntegerType + https://jakarta.ee/xml/ns/jakartaee + XsdIntegerType + java.math.BigInteger + + + servlet-nameType + https://jakarta.ee/xml/ns/jakartaee + ServletNameType + java.lang.String + + + nonEmptyStringType + https://jakarta.ee/xml/ns/jakartaee + NonEmptyStringType + java.lang.String + + + load-on-startupType + https://jakarta.ee/xml/ns/jakartaee + LoadOnStartupType + java.math.BigInteger + + + run-asType + https://jakarta.ee/xml/ns/jakartaee + RunAs + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.RunAs + + + + security-role-refType + https://jakarta.ee/xml/ns/jakartaee + SecurityRoleRef + org.netbeans.modules.j2ee.dd.impl.common.DescriptionBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.SecurityRoleRef, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "RoleName"; } + + + + jsp-fileType + https://jakarta.ee/xml/ns/jakartaee + JspFileType + java.lang.String + + + filter-nameType + https://jakarta.ee/xml/ns/jakartaee + FilterNameType + java.lang.String + + + dispatcherType + https://jakarta.ee/xml/ns/jakartaee + DispatcherType + java.lang.String + + + absoluteOrderingType + https://jakarta.ee/xml/ns/jakartaee + AbsoluteOrdering + + org.netbeans.modules.j2ee.dd.api.web.AbsoluteOrdering + + + + orderingType + https://jakarta.ee/xml/ns/jakartaee + RelativeOrdering + + org.netbeans.modules.j2ee.dd.api.web.RelativeOrdering + + + + ordering-orderingType + https://jakarta.ee/xml/ns/jakartaee + RelativeOrderingItems + + org.netbeans.modules.j2ee.dd.api.web.RelativeOrderingItems + + + + ordering-othersType + https://jakarta.ee/xml/ns/jakartaee + RelativeOrderingOthersItem + + org.netbeans.modules.j2ee.dd.api.web.RelativeOrderingOthersItem + + + + + + + handlerType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandler + org.netbeans.modules.j2ee.dd.impl.common.Comparator + org.netbeans.modules.j2ee.dd.impl.common.ComponentBeanMultiple + + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandler, org.netbeans.modules.j2ee.dd.impl.common.KeyBean + + + public String getKeyProperty() { return "HandlerName"; } + + + + handler-chainsType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandlerChains + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandlerChains + + + handler-chainType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandlerChainType + org.netbeans.modules.j2ee.dd.api.common.ServiceRefHandlerChain + + + dewey-versionType + https://jakarta.ee/xml/ns/jakartaee + version + java.math.BigDecimal + + diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/web-fragment_6_2.xsd b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/web-fragment_6_2.xsd new file mode 100644 index 000000000000..b3d6fc82221b --- /dev/null +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/resources/web-fragment_6_2.xsd @@ -0,0 +1,316 @@ + + + + + + Copyright (c) 2009, 2021 Oracle and/or its affiliates. All rights reserved. + + This program and the accompanying materials are made available under the + terms of the Eclipse Public License v. 2.0, which is available at + http://www.eclipse.org/legal/epl-2.0. + + This Source Code may also be made available under the following Secondary + Licenses when the conditions for such availability set forth in the + Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + version 2 with the GNU Classpath Exception, which is available at + https://www.gnu.org/software/classpath/license.html. + + SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + + + + + + + + ... + + + The instance documents may indicate the published version of + the schema using the xsi:schemaLocation attribute for Jakarta EE + namespace with the following location: + + https://jakarta.ee/xml/ns/jakartaee/web-fragment_6_2.xsd + + ]]> + + + + + + + The following conventions apply to all Jakarta EE + deployment descriptor elements unless indicated otherwise. + + - In elements that specify a pathname to a file within the + same JAR file, relative filenames (i.e., those not + starting with "/") are considered relative to the root of + the JAR file's namespace. Absolute filenames (i.e., those + starting with "/") also specify names in the root of the + JAR file's namespace. In general, relative names are + preferred. The exception is .war files where absolute + names are preferred for consistency with the Servlet API. + + + + + + + + + + + + + + The web-fragment element is the root of the deployment + descriptor for a web fragment. Note that the sub-elements + of this element can be in the arbitrary order. Because of + that, the multiplicity of the elements of distributable, + session-config, welcome-file-list, jsp-config, login-config, + and locale-encoding-mapping-list was changed from "?" to "*" + in this schema. However, the deployment descriptor instance + file must not contain multiple elements of session-config, + jsp-config, and login-config. When there are multiple elements of + welcome-file-list or locale-encoding-mapping-list, the container + must concatenate the element contents. The multiple occurence + of the element distributable is redundant and the container + treats that case exactly in the same way when there is only + one distributable. + + + + + + + + The servlet element contains the name of a servlet. + The name must be unique within the web application. + + + + + + + + + + + The filter element contains the name of a filter. + The name must be unique within the web application. + + + + + + + + + + + The ejb-local-ref-name element contains the name of an + enterprise bean reference. The enterprise bean reference + is an entry in the web application's environment and is relative + to the java:comp/env context. The name must be unique within + the web application. + + It is recommended that name is prefixed with "ejb/". + + + + + + + + + + + The ejb-ref-name element contains the name of an + enterprise bean reference. The enterprise bean reference + is an entry in the web application's environment and is relative + to the java:comp/env context. The name must be unique within + the web application. + + It is recommended that name is prefixed with "ejb/". + + + + + + + + + + + The resource-env-ref-name element specifies the name of + a resource environment reference; its value is the + environment entry name used in the web application code. + The name is a JNDI name relative to the java:comp/env + context and must be unique within a web application. + + + + + + + + + + + The message-destination-ref-name element specifies the name of + a message destination reference; its value is the + environment entry name used in the web application code. + The name is a JNDI name relative to the java:comp/env + context and must be unique within a web application. + + + + + + + + + + + The res-ref-name element specifies the name of a + resource manager connection factory reference. The name + is a JNDI name relative to the java:comp/env context. + The name must be unique within a web application. + + + + + + + + + + + The env-entry-name element contains the name of a web + application's environment entry. The name is a JNDI + name relative to the java:comp/env context. The name + must be unique within a web application. + + + + + + + + + + + A role-name-key is specified to allow the references + from the security-role-refs. + + + + + + + + + + + The keyref indicates the references from + security-role-ref to a specified role-name. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Please see section 8.2.2 of the specification for details. + + + + + + + + + + + + + + + + + This element contains a sequence of "name" elements, each of + which + refers to an application configuration resource by the "name" + declared on its web.xml fragment. This element can also contain + a single "others" element which specifies that this document + comes + before or after other documents within the application. + See section 8.2.2 of the specification for details. + + + + + + + + + + diff --git a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/WebAppProxy.java b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/WebAppProxy.java index e28016222cba..a677db68327f 100644 --- a/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/WebAppProxy.java +++ b/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/WebAppProxy.java @@ -963,6 +963,9 @@ public Object clone() { } else if (WebApp.VERSION_6_1.equals(version)) { ((org.netbeans.modules.j2ee.dd.impl.web.model_6_1.WebApp)clonedWebApp)._setSchemaLocation ("https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_1.xsd"); + } else if (WebApp.VERSION_6_2.equals(version)) { + ((org.netbeans.modules.j2ee.dd.impl.web.model_6_2.WebApp)clonedWebApp)._setSchemaLocation + ("https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_2.xsd"); } } proxy.setError(error); diff --git a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/Bundle.properties b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/Bundle.properties index d6ea216e8080..8329697bd53b 100644 --- a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/Bundle.properties +++ b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/Bundle.properties @@ -32,6 +32,7 @@ Loaders/text/x-dd-application8.0/Factories/org-netbeans-modules-j2ee-ddloaders-w Loaders/text/x-dd-application9.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-application10.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-application11.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files +Loaders/text/x-dd-application12.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-client1.3/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-client1.4/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-client5.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files @@ -41,12 +42,14 @@ Loaders/text/x-dd-client8.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DD Loaders/text/x-dd-client9.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-client10.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-client11.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files +Loaders/text/x-dd-client12.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-ejbjar2.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-ejbjar2.1/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-ejbjar3.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-ejbjar3.1/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-ejbjar3.2/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-ejbjar4.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files +Loaders/text/x-dd-ejbjar4.1/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-servlet2.2/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-servlet2.3/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-servlet2.4/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files @@ -57,12 +60,14 @@ Loaders/text/x-dd-servlet4.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-D Loaders/text/x-dd-servlet5.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-servlet6.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-servlet6.1/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files +Loaders/text/x-dd-servlet6.2/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-servlet-fragment3.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-servlet-fragment3.1/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-servlet-fragment4.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-servlet-fragment5.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-servlet-fragment6.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-servlet-fragment6.1/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files +Loaders/text/x-dd-servlet-fragment6.2/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-web2.5/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd-web3.0/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files Loaders/text/x-dd/Factories/org-netbeans-modules-j2ee-ddloaders-web-DDDataLoader.instance=Deployment Descriptor Files diff --git a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/app/EarDataLoader.java b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/app/EarDataLoader.java index 37db80826b09..b2a54f7d5d94 100644 --- a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/app/EarDataLoader.java +++ b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/app/EarDataLoader.java @@ -51,6 +51,8 @@ public class EarDataLoader extends UniFileLoader { private static final String REQUIRED_MIME_PREFIX_7 = "text/x-dd-application10.0"; // NOI18N private static final String REQUIRED_MIME_PREFIX_8 = "text/x-dd-application11.0"; // NOI18N + + private static final String REQUIRED_MIME_PREFIX_9 = "text/x-dd-application12.0"; // NOI18N public EarDataLoader () { super ("org.netbeans.modules.j2ee.ddloaders.app.EarDataObject"); // NOI18N @@ -78,6 +80,7 @@ protected void initialize () { getExtensions().addMimeType(REQUIRED_MIME_PREFIX_6); getExtensions().addMimeType(REQUIRED_MIME_PREFIX_7); getExtensions().addMimeType(REQUIRED_MIME_PREFIX_8); + getExtensions().addMimeType(REQUIRED_MIME_PREFIX_9); } @Override diff --git a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/catalog/EnterpriseCatalog.java b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/catalog/EnterpriseCatalog.java index ca44a5355870..55d604334d00 100644 --- a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/catalog/EnterpriseCatalog.java +++ b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/catalog/EnterpriseCatalog.java @@ -18,7 +18,6 @@ */ package org.netbeans.modules.j2ee.ddloaders.catalog; -import java.awt.Image; import java.beans.PropertyChangeListener; import java.io.IOException; import java.util.ArrayList; @@ -69,6 +68,7 @@ private void initialize(){ schemas.add(new SchemaInfo("application-client_9.xsd", JAKARTAEE_NS)); schemas.add(new SchemaInfo("application-client_10.xsd", JAKARTAEE_NS)); schemas.add(new SchemaInfo("application-client_11.xsd", JAKARTAEE_NS)); + schemas.add(new SchemaInfo("application-client_12.xsd", JAKARTAEE_NS)); // Application schema schemas.add(new SchemaInfo("application_1_4.xsd", J2EE_NS)); schemas.add(new SchemaInfo("application_5.xsd", JAVAEE_NS)); @@ -78,6 +78,7 @@ private void initialize(){ schemas.add(new SchemaInfo("application_9.xsd", JAKARTAEE_NS)); schemas.add(new SchemaInfo("application_10.xsd", JAKARTAEE_NS)); schemas.add(new SchemaInfo("application_11.xsd", JAKARTAEE_NS)); + schemas.add(new SchemaInfo("application_12.xsd", JAKARTAEE_NS)); // Web services schema schemas.add(new SchemaInfo("j2ee_web_services_1_1.xsd", J2EE_NS)); schemas.add(new SchemaInfo("javaee_web_services_1_2.xsd", JAVAEE_NS)); @@ -102,6 +103,7 @@ private void initialize(){ schemas.add(new SchemaInfo("ejb-jar_3_1.xsd", JAVAEE_NS)); schemas.add(new SchemaInfo("ejb-jar_3_2.xsd", NEW_JAVAEE_NS)); schemas.add(new SchemaInfo("ejb-jar_4_0.xsd", JAKARTAEE_NS)); + schemas.add(new SchemaInfo("ejb-jar_4_1.xsd", JAKARTAEE_NS)); // Web Application Deployment Descriptor schema schemas.add(new SchemaInfo("web-app_2_4.xsd", J2EE_NS)); schemas.add(new SchemaInfo("web-app_2_5.xsd", JAVAEE_NS)); @@ -111,6 +113,7 @@ private void initialize(){ schemas.add(new SchemaInfo("web-app_5_0.xsd", JAKARTAEE_NS)); schemas.add(new SchemaInfo("web-app_6_0.xsd", JAKARTAEE_NS)); schemas.add(new SchemaInfo("web-app_6_1.xsd", JAKARTAEE_NS)); + schemas.add(new SchemaInfo("web-app_6_2.xsd", JAKARTAEE_NS)); // Web Application Deployment Descriptor common definitions schema schemas.add(new SchemaInfo("web-common_3_0.xsd", JAVAEE_NS)); schemas.add(new SchemaInfo("web-common_3_1.xsd", NEW_JAVAEE_NS)); @@ -118,6 +121,7 @@ private void initialize(){ schemas.add(new SchemaInfo("web-common_5_0.xsd", JAKARTAEE_NS)); schemas.add(new SchemaInfo("web-common_6_0.xsd", JAKARTAEE_NS)); schemas.add(new SchemaInfo("web-common_6_1.xsd", JAKARTAEE_NS)); + schemas.add(new SchemaInfo("web-common_6_2.xsd", JAKARTAEE_NS)); // Web Application Deployment Descriptor fragment schema schemas.add(new SchemaInfo("web-fragment_3_0.xsd", JAVAEE_NS)); schemas.add(new SchemaInfo("web-fragment_3_1.xsd", NEW_JAVAEE_NS)); @@ -125,6 +129,7 @@ private void initialize(){ schemas.add(new SchemaInfo("web-fragment_5_0.xsd", JAKARTAEE_NS)); schemas.add(new SchemaInfo("web-fragment_6_0.xsd", JAKARTAEE_NS)); schemas.add(new SchemaInfo("web-fragment_6_1.xsd", JAKARTAEE_NS)); + schemas.add(new SchemaInfo("web-fragment_6_2.xsd", JAKARTAEE_NS)); // JavaServer Pages Deployment Descriptor schema schemas.add(new SchemaInfo("jsp_2_0.xsd", J2EE_NS)); schemas.add(new SchemaInfo("jsp_2_1.xsd", JAVAEE_NS)); @@ -133,6 +138,7 @@ private void initialize(){ schemas.add(new SchemaInfo("jsp_3_0.xsd", JAKARTAEE_NS)); schemas.add(new SchemaInfo("jsp_3_1.xsd", JAKARTAEE_NS)); schemas.add(new SchemaInfo("jsp_4_0.xsd", JAKARTAEE_NS)); + schemas.add(new SchemaInfo("jsp_4_1.xsd", JAKARTAEE_NS)); // J2EE and Java EE definitions file that contains common schema components schemas.add(new SchemaInfo("j2ee_1_4.xsd", J2EE_NS)); schemas.add(new SchemaInfo("javaee_5.xsd", JAVAEE_NS)); @@ -142,6 +148,7 @@ private void initialize(){ schemas.add(new SchemaInfo("jakartaee_9.xsd", JAKARTAEE_NS)); schemas.add(new SchemaInfo("jakartaee_10.xsd", JAKARTAEE_NS)); schemas.add(new SchemaInfo("jakartaee_11.xsd", JAKARTAEE_NS)); + schemas.add(new SchemaInfo("jakartaee_12.xsd", JAKARTAEE_NS)); // web 2.2 and 2.3 dtds schemas.add(new SchemaInfo("web-app_2_2.dtd", "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN", true)); //NO18N schemas.add(new SchemaInfo("web-app_2_3.dtd", "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN", true)); //NO18N @@ -152,6 +159,7 @@ private void initialize(){ schemas.add(new SchemaInfo("beans_3_0.xsd", JAKARTAEE_NS)); schemas.add(new SchemaInfo("beans_4_0.xsd", JAKARTAEE_NS)); schemas.add(new SchemaInfo("beans_4_1.xsd", JAKARTAEE_NS)); + schemas.add(new SchemaInfo("beans_5_0.xsd", JAKARTAEE_NS)); // Java EE application permissions schema schemas.add(new SchemaInfo("permissions_7.xsd", NEW_JAVAEE_NS)); schemas.add(new SchemaInfo("permissions_9.xsd", JAKARTAEE_NS)); @@ -214,7 +222,7 @@ public InputSource resolveEntity(String publicId, String systemId) throws SAXExc } @Override - public Iterator getPublicIDs() { + public Iterator getPublicIDs() { List result = new ArrayList<>(); for (SchemaInfo each : schemas){ result.add(each.getPublicId()); diff --git a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/client/ClientDataLoader.java b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/client/ClientDataLoader.java index d2ab62e606b9..b2cbb40c34eb 100644 --- a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/client/ClientDataLoader.java +++ b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/client/ClientDataLoader.java @@ -43,6 +43,7 @@ public class ClientDataLoader extends UniFileLoader { private static final String REQUIRED_MIME_PREFIX_7 = "text/x-dd-client9.0"; // NOI18N private static final String REQUIRED_MIME_PREFIX_8 = "text/x-dd-client10.0"; // NOI18N private static final String REQUIRED_MIME_PREFIX_9 = "text/x-dd-client11.0"; // NOI18N + private static final String REQUIRED_MIME_PREFIX_10 = "text/x-dd-client12.0"; // NOI18N public ClientDataLoader() { super("org.netbeans.modules.j2ee.ddloaders.client.ClientDataObject"); // NOI18N @@ -70,6 +71,7 @@ protected void initialize() { getExtensions().addMimeType(REQUIRED_MIME_PREFIX_7); getExtensions().addMimeType(REQUIRED_MIME_PREFIX_8); getExtensions().addMimeType(REQUIRED_MIME_PREFIX_9); + getExtensions().addMimeType(REQUIRED_MIME_PREFIX_10); } @Override diff --git a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/ejb/EjbJar40DataLoader.java b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/ejb/EjbJar40DataLoader.java index eaecc2a9784e..17a2699d9289 100644 --- a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/ejb/EjbJar40DataLoader.java +++ b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/ejb/EjbJar40DataLoader.java @@ -30,6 +30,7 @@ public class EjbJar40DataLoader extends EjbJarDataLoader{ private static final long serialVersionUID = 1L; private static final String REQUIRED_MIME_PREFIX_4_0 = "text/x-dd-ejbjar4.0"; // NOI18N + private static final String REQUIRED_MIME_PREFIX_4_1 = "text/x-dd-ejbjar4.1"; // NOI18N public EjbJar40DataLoader () { super ("org.netbeans.modules.j2ee.ddloaders.multiview.EjbJarMultiViewDataObject"); // NOI18N @@ -40,7 +41,7 @@ protected String actionsContext() { } protected String[] getSupportedMimeTypes(){ - return new String[]{REQUIRED_MIME_PREFIX_4_0}; + return new String[]{REQUIRED_MIME_PREFIX_4_0, REQUIRED_MIME_PREFIX_4_1}; } } diff --git a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/resources/dd-loaders-mime-resolver.xml b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/resources/dd-loaders-mime-resolver.xml index c1ae1b7aca7d..4a5fbfa26be1 100644 --- a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/resources/dd-loaders-mime-resolver.xml +++ b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/resources/dd-loaders-mime-resolver.xml @@ -105,6 +105,16 @@ + + + + + + + + + + @@ -165,6 +175,16 @@ + + + + + + + + + + @@ -223,6 +243,16 @@ + + + + + + + + + + @@ -311,6 +341,16 @@ + + + + + + + + + + @@ -391,4 +431,14 @@ + + + + + + + + + + diff --git a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/resources/layer.xml b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/resources/layer.xml index 2707d1bc15c6..6c1ffc99c8f7 100644 --- a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/resources/layer.xml +++ b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/resources/layer.xml @@ -24,6 +24,9 @@ + + + @@ -48,6 +51,9 @@ + + + @@ -75,6 +81,9 @@ + + + @@ -123,6 +132,9 @@ + + + @@ -141,6 +153,9 @@ + + + @@ -733,6 +748,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1225,6 +1322,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1416,6 +1595,18 @@ + + + + + + + + + + + + @@ -1536,6 +1727,18 @@ + + + + + + + + + + + + @@ -1608,6 +1811,18 @@ + + + + + + + + + + + + @@ -1740,6 +1955,18 @@ + + + + + + + + + + + + @@ -1836,6 +2063,18 @@ + + + + + + + + + + + + diff --git a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/web/DDDataObject.java b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/web/DDDataObject.java index 53ce8a87bf8e..991b6bd361a6 100644 --- a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/web/DDDataObject.java +++ b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/web/DDDataObject.java @@ -130,7 +130,8 @@ protected int associateLookup() { DDWeb40DataLoader.REQUIRED_MIME_40, DDWebFragment40DataLoader.REQUIRED_MIME_40, DDWeb50DataLoader.REQUIRED_MIME_50, DDWebFragment50DataLoader.REQUIRED_MIME_50, DDWeb60DataLoader.REQUIRED_MIME_60, DDWebFragment60DataLoader.REQUIRED_MIME_60, - DDWeb60DataLoader.REQUIRED_MIME_61, DDWebFragment60DataLoader.REQUIRED_MIME_61}, + DDWeb60DataLoader.REQUIRED_MIME_61, DDWebFragment60DataLoader.REQUIRED_MIME_61, + DDWeb60DataLoader.REQUIRED_MIME_62, DDWebFragment60DataLoader.REQUIRED_MIME_62}, iconBase="org/netbeans/modules/j2ee/ddloaders/web/resources/DDDataIcon.gif", persistenceType=TopComponent.PERSISTENCE_ONLY_OPENED, preferredID="multiview_xml", diff --git a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/web/DDWeb60DataLoader.java b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/web/DDWeb60DataLoader.java index 4e3f612484c4..d17c83e06c40 100644 --- a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/web/DDWeb60DataLoader.java +++ b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/web/DDWeb60DataLoader.java @@ -35,6 +35,7 @@ public class DDWeb60DataLoader extends DDDataLoader { public static final String REQUIRED_MIME_60 = "text/x-dd-servlet6.0"; // NOI18N public static final String REQUIRED_MIME_61 = "text/x-dd-servlet6.1"; // NOI18N + public static final String REQUIRED_MIME_62 = "text/x-dd-servlet6.2"; // NOI18N public DDWeb60DataLoader() { super("org.netbeans.modules.j2ee.ddloaders.web.DDDataObject"); // NOI18N @@ -47,7 +48,7 @@ protected String actionsContext() { @Override protected String[] getSupportedMimeTypes() { - return new String[]{REQUIRED_MIME_60, REQUIRED_MIME_61}; + return new String[]{REQUIRED_MIME_60, REQUIRED_MIME_61, REQUIRED_MIME_62}; } @Override diff --git a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/web/DDWebFragment60DataLoader.java b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/web/DDWebFragment60DataLoader.java index 0ccbdecc0157..5f9e093ff76d 100644 --- a/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/web/DDWebFragment60DataLoader.java +++ b/enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/web/DDWebFragment60DataLoader.java @@ -35,6 +35,7 @@ public class DDWebFragment60DataLoader extends DDDataLoader { public static final String REQUIRED_MIME_60 = "text/x-dd-servlet-fragment6.0"; // NOI18N public static final String REQUIRED_MIME_61 = "text/x-dd-servlet-fragment6.1"; // NOI18N + public static final String REQUIRED_MIME_62 = "text/x-dd-servlet-fragment6.2"; // NOI18N public DDWebFragment60DataLoader() { super("org.netbeans.modules.j2ee.ddloaders.web.DDFragmentDataObject"); // NOI18N @@ -47,7 +48,7 @@ protected String actionsContext() { @Override protected String[] getSupportedMimeTypes() { - return new String[]{REQUIRED_MIME_60, REQUIRED_MIME_61}; + return new String[]{REQUIRED_MIME_60, REQUIRED_MIME_61, REQUIRED_MIME_62}; } @Override diff --git a/enterprise/j2ee.earproject/src/org/netbeans/modules/j2ee/earproject/ProjectEar.java b/enterprise/j2ee.earproject/src/org/netbeans/modules/j2ee/earproject/ProjectEar.java index 6db2395ed80f..ef4caa8944f3 100644 --- a/enterprise/j2ee.earproject/src/org/netbeans/modules/j2ee/earproject/ProjectEar.java +++ b/enterprise/j2ee.earproject/src/org/netbeans/modules/j2ee/earproject/ProjectEar.java @@ -308,26 +308,31 @@ public J2eeModule.Type getModuleType () { public String getModuleVersion () { Profile p = Profile.fromPropertiesString(project.evaluator().getProperty(EarProjectProperties.J2EE_PLATFORM)); if (p == null) { - p = Profile.JAVA_EE_7_FULL; - } - if (Profile.JAKARTA_EE_11_FULL.equals(p)) { - return Application.VERSION_11; - } else if (Profile.JAKARTA_EE_10_FULL.equals(p)) { - return Application.VERSION_10; - } else if (Profile.JAKARTA_EE_9_1_FULL.equals(p) || Profile.JAKARTA_EE_9_FULL.equals(p)) { - return Application.VERSION_9; - } else if (Profile.JAKARTA_EE_8_FULL.equals(p) || Profile.JAVA_EE_8_FULL.equals(p)) { - return Application.VERSION_8; - } else if (Profile.JAVA_EE_7_FULL.equals(p)) { - return Application.VERSION_7; - } else if (Profile.JAVA_EE_6_FULL.equals(p)) { - return Application.VERSION_6; - } else if (Profile.JAVA_EE_5.equals(p)) { - return Application.VERSION_5; - } else if (Profile.J2EE_14.equals(p)) { - return Application.VERSION_1_4; - } else { - return Application.VERSION_7; + p = Profile.JAKARTA_EE_8_FULL; + } + switch (p) { + case JAKARTA_EE_12_FULL: + return Application.VERSION_12; + case JAKARTA_EE_11_FULL: + return Application.VERSION_11; + case JAKARTA_EE_10_FULL: + return Application.VERSION_10; + case JAKARTA_EE_9_1_FULL: + case JAKARTA_EE_9_FULL: + return Application.VERSION_9; + case JAKARTA_EE_8_FULL: + case JAVA_EE_8_FULL: + return Application.VERSION_8; + case JAVA_EE_7_FULL: + return Application.VERSION_7; + case JAVA_EE_6_FULL: + return Application.VERSION_6; + case JAVA_EE_5: + return Application.VERSION_5; + case J2EE_14: + return Application.VERSION_1_4; + default: + return Application.VERSION_8; } } diff --git a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/Utils.java b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/Utils.java index e73d072a8989..67cc025e1152 100644 --- a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/Utils.java +++ b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/Utils.java @@ -243,6 +243,7 @@ public void run(WorkingCopy workingCopy) throws IOException { final boolean isEjb31LiteSupported = isEjb31LiteSupported(enterpriseProject); final boolean isEjb40LiteSupported = isEjb40LiteSupported(enterpriseProject); + final boolean isEjb41LiteSupported = isEjb41LiteSupported(enterpriseProject); List filteredResults = new ArrayList(allProjects.length); for (int i = 0; i < allProjects.length; i++) { @@ -263,7 +264,8 @@ public void run(WorkingCopy workingCopy) throws IOException { // If the caller project is a freeform project, include caller itself only // If the caller project is a Java EE 6 web project, include itself in the list if ((isEJBModule && !isCallerFreeform) || - (enterpriseProject.equals(allProjects[i]) && (isCallerFreeform || isEjb31LiteSupported || isEjb40LiteSupported) ) ) { + (enterpriseProject.equals(allProjects[i]) && + (isCallerFreeform || isEjb31LiteSupported || isEjb40LiteSupported || isEjb41LiteSupported) ) ) { filteredResults.add(allProjects[i]); } } @@ -277,6 +279,10 @@ public static boolean isEjb31LiteSupported(Project enterpriseProject) { public static boolean isEjb40LiteSupported(Project enterpriseProject) { return J2eeProjectCapabilities.forProject(enterpriseProject).isEjb40LiteSupported(); } + + public static boolean isEjb41LiteSupported(Project enterpriseProject) { + return J2eeProjectCapabilities.forProject(enterpriseProject).isEjb41LiteSupported(); + } public static boolean isAppClient(Project project) { J2eeModuleProvider module = project.getLookup().lookup(J2eeModuleProvider.class); diff --git a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/dd/EjbJarXmlWizardIterator.java b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/dd/EjbJarXmlWizardIterator.java index 6cbf9cf420e2..e4694079d0f1 100644 --- a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/dd/EjbJarXmlWizardIterator.java +++ b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/dd/EjbJarXmlWizardIterator.java @@ -94,7 +94,9 @@ public Set instantiate() throws IOException { String resource; // see #213631 - caused by fact that EJB DD schemas have different numbering than WEB DD schemas // (so Java EE6 Web-DD is of the version 3.0, but Ejb-DD is of the version 3.1) - if (j2eeProfile != null && j2eeProfile.isAtLeast(Profile.JAKARTA_EE_9_WEB)) { + if (j2eeProfile != null && j2eeProfile.isAtLeast(Profile.JAKARTA_EE_12_WEB)) { + resource = "org-netbeans-modules-j2ee-ejbjarproject/ejb-jar-4.1.xml"; + } else if (j2eeProfile != null && j2eeProfile.isAtLeast(Profile.JAKARTA_EE_9_WEB)) { resource = "org-netbeans-modules-j2ee-ejbjarproject/ejb-jar-4.0.xml"; } else if (j2eeProfile != null && j2eeProfile.isAtLeast(Profile.JAVA_EE_7_WEB)) { resource = "org-netbeans-modules-j2ee-ejbjarproject/ejb-jar-3.2.xml"; diff --git a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/mdb/MdbWizard.java b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/mdb/MdbWizard.java index 7d6b1599861a..f2b9d396e9c1 100644 --- a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/mdb/MdbWizard.java +++ b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/mdb/MdbWizard.java @@ -66,7 +66,7 @@ public final class MdbWizard implements WizardDescriptor.InstantiatingIterator { private MdbLocationPanel ejbPanel; private MdbPropertiesPanel propertiesPanel; private WizardDescriptor wiz; - private static final Map MAVEN_JAVAEE_API_LIBS = new HashMap<>(6); + private static final Map MAVEN_JAVAEE_API_LIBS = new HashMap<>(16); private static final String[] MAVEN_JAVAEE_WEB_API_LIBS = new String[]{ "javaee-web-api-6.0", //NOI18N "javaee-web-api-7.0", //NOI18N @@ -75,7 +75,8 @@ public final class MdbWizard implements WizardDescriptor.InstantiatingIterator { "jakarta.jakartaee-web-api-9.0.0", //NOI18N "jakarta.jakartaee-web-api-9.1.0", //NOI18N "jakarta.jakartaee-web-api-10.0.0", //NOI18N - "jakarta.jakartaee-web-api-11.0.0" //NOI18N + "jakarta.jakartaee-web-api-11.0.0", //NOI18N + "jakarta.jakartaee-web-api-12.0.0" //NOI18N }; private static final String[] SESSION_STEPS = new String[]{ NbBundle.getMessage(MdbWizard.class, "LBL_SpecifyEJBInfo"), //NOI18N @@ -91,6 +92,7 @@ public final class MdbWizard implements WizardDescriptor.InstantiatingIterator { MAVEN_JAVAEE_API_LIBS.put(Profile.JAKARTA_EE_9_1_FULL, "jakarta.jakartaee-api-9.1.0"); //NOI18N MAVEN_JAVAEE_API_LIBS.put(Profile.JAKARTA_EE_10_FULL, "jakarta.jakartaee-api-10.0.0"); //NOI18N MAVEN_JAVAEE_API_LIBS.put(Profile.JAKARTA_EE_11_FULL, "jakarta.jakartaee-api-11.0.0"); //NOI18N + MAVEN_JAVAEE_API_LIBS.put(Profile.JAKARTA_EE_12_FULL, "jakarta.jakartaee-api-12.0.0"); //NOI18N } @Override @@ -188,7 +190,9 @@ private boolean isJmsOnClasspath() throws IOException { private Profile getTargetFullProfile() { Profile profile = JavaEEProjectSettings.getProfile(Templates.getProject(wiz)); if (profile != null) { - if (profile.isAtLeast(Profile.JAKARTA_EE_11_WEB)) { + if (profile.isAtLeast(Profile.JAKARTA_EE_12_WEB)) { + return Profile.JAKARTA_EE_12_FULL; + } else if (profile.isAtLeast(Profile.JAKARTA_EE_11_WEB)) { return Profile.JAKARTA_EE_11_FULL; } else if (profile.isAtLeast(Profile.JAKARTA_EE_10_WEB)) { return Profile.JAKARTA_EE_10_FULL; diff --git a/enterprise/j2ee.ejbjarproject/licenseinfo.xml b/enterprise/j2ee.ejbjarproject/licenseinfo.xml index fa89d6d1808f..d9891b6059be 100644 --- a/enterprise/j2ee.ejbjarproject/licenseinfo.xml +++ b/enterprise/j2ee.ejbjarproject/licenseinfo.xml @@ -29,6 +29,7 @@ src/org/netbeans/modules/j2ee/ejbjarproject/ui/resources/ejb-jar-3.1.xml src/org/netbeans/modules/j2ee/ejbjarproject/ui/resources/ejb-jar-3.2.xml src/org/netbeans/modules/j2ee/ejbjarproject/ui/resources/ejb-jar-4.0.xml + src/org/netbeans/modules/j2ee/ejbjarproject/ui/resources/ejb-jar-4.1.xml diff --git a/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/EjbJarJPAModuleInfo.java b/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/EjbJarJPAModuleInfo.java index 3627ada5f8df..fee6b9d9f17c 100644 --- a/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/EjbJarJPAModuleInfo.java +++ b/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/EjbJarJPAModuleInfo.java @@ -19,7 +19,10 @@ package org.netbeans.modules.j2ee.ejbjarproject; +import java.util.logging.Level; +import java.util.logging.Logger; import org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment; +import org.netbeans.modules.j2ee.deployment.devmodules.api.InstanceRemovedException; import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eePlatform; import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleProvider; import org.netbeans.modules.j2ee.persistence.dd.common.Persistence; @@ -53,21 +56,26 @@ public String getVersion() { @Override public Boolean isJPAVersionSupported(String version) { J2eeModuleProvider j2eeModuleProvider = project.getLookup().lookup(J2eeModuleProvider.class); - J2eePlatform platform = Deployment.getDefault().getJ2eePlatform(j2eeModuleProvider.getServerInstanceID()); - - if (platform == null) { - return null; - } - JpaSupport support = JpaSupport.getInstance(platform); - JpaProvider provider = support.getDefaultProvider(); - if (provider != null) { - return (Persistence.VERSION_3_2.equals(version) && provider.isJpa32Supported() - || (Persistence.VERSION_3_1.equals(version) && provider.isJpa31Supported()) - || (Persistence.VERSION_3_0.equals(version) && provider.isJpa30Supported()) - || (Persistence.VERSION_2_2.equals(version) && provider.isJpa22Supported()) - || (Persistence.VERSION_2_1.equals(version) && provider.isJpa21Supported()) - || (Persistence.VERSION_2_0.equals(version) && provider.isJpa2Supported()) - || (Persistence.VERSION_1_0.equals(version) && provider.isJpa1Supported())); + final String serverInstanceID = j2eeModuleProvider.getServerInstanceID(); + try { + J2eePlatform platform = Deployment.getDefault().getServerInstance(serverInstanceID).getJ2eePlatform(); + if (platform == null) { + return null; + } + JpaSupport support = JpaSupport.getInstance(platform); + JpaProvider provider = support.getDefaultProvider(); + if (provider != null) { + return (Persistence.VERSION_4_0.equals(version) && provider.isJpa40Supported() + || Persistence.VERSION_3_2.equals(version) && provider.isJpa32Supported() + || (Persistence.VERSION_3_1.equals(version) && provider.isJpa31Supported()) + || (Persistence.VERSION_3_0.equals(version) && provider.isJpa30Supported()) + || (Persistence.VERSION_2_2.equals(version) && provider.isJpa22Supported()) + || (Persistence.VERSION_2_1.equals(version) && provider.isJpa21Supported()) + || (Persistence.VERSION_2_0.equals(version) && provider.isJpa2Supported()) + || (Persistence.VERSION_1_0.equals(version) && provider.isJpa1Supported())); + } + } catch (InstanceRemovedException ex) { + Logger.getLogger(EjbJarJPAModuleInfo.class.getName()).log(Level.FINE, "The instance is not available anymore", ex); } return null; } diff --git a/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/jaxws/EjbProjectJAXWSClientSupport.java b/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/jaxws/EjbProjectJAXWSClientSupport.java index 32246b994fa2..4c8bcb2d113d 100644 --- a/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/jaxws/EjbProjectJAXWSClientSupport.java +++ b/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/jaxws/EjbProjectJAXWSClientSupport.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; -import org.netbeans.api.j2ee.core.Profile; import org.netbeans.api.project.SourceGroup; import org.netbeans.modules.j2ee.api.ejbjar.EjbJar; import org.netbeans.modules.j2ee.core.api.support.SourceGroups; @@ -112,6 +111,8 @@ protected String getProjectJavaEEVersion() { case JAKARTA_EE_11_WEB: case JAKARTA_EE_11_FULL: return JAKARTA_EE_VERSION_11; + case JAKARTA_EE_12_FULL: + return JAKARTA_EE_VERSION_12; case JAVA_EE_5: return JAVA_EE_VERSION_15; default: diff --git a/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/jaxws/EjbProjectJAXWSSupport.java b/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/jaxws/EjbProjectJAXWSSupport.java index 42288b0d4f28..f55933054115 100644 --- a/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/jaxws/EjbProjectJAXWSSupport.java +++ b/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/jaxws/EjbProjectJAXWSSupport.java @@ -20,7 +20,6 @@ package org.netbeans.modules.j2ee.ejbjarproject.jaxws; import java.io.IOException; -import org.netbeans.api.j2ee.core.Profile; import org.netbeans.api.project.Project; import org.netbeans.modules.j2ee.api.ejbjar.EjbJar; import org.netbeans.modules.j2ee.dd.api.webservices.WebservicesMetadata; @@ -183,6 +182,8 @@ protected String getProjectJavaEEVersion() { case JAKARTA_EE_11_WEB: case JAKARTA_EE_11_FULL: return JAKARTA_EE_VERSION_11; + case JAKARTA_EE_12_FULL: + return JAKARTA_EE_VERSION_12; case JAVA_EE_5: return JAVA_EE_VERSION_15; default: diff --git a/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/EjbJarProjectProperties.java b/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/EjbJarProjectProperties.java index b8297fe2041e..2a3af798903a 100644 --- a/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/EjbJarProjectProperties.java +++ b/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/EjbJarProjectProperties.java @@ -323,7 +323,9 @@ private void init() { SpecificationVersion minimalSourceLevel = null; Profile profile = Profile.fromPropertiesString(evaluator.getProperty(J2EE_PLATFORM)); if (profile != null && profile.isFullProfile()) { - if (profile.isAtLeast(Profile.JAKARTA_EE_11_FULL)) { + if (profile.isAtLeast(Profile.JAKARTA_EE_12_FULL)) { + minimalSourceLevel = new SpecificationVersion("21"); + } else if (profile.isAtLeast(Profile.JAKARTA_EE_11_FULL)) { minimalSourceLevel = new SpecificationVersion("17"); } else if (profile.isAtLeast(Profile.JAKARTA_EE_9_1_FULL)) { minimalSourceLevel = new SpecificationVersion("11"); diff --git a/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/ui/resources/ejb-jar-4.1.xml b/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/ui/resources/ejb-jar-4.1.xml new file mode 100644 index 000000000000..f220137ff6eb --- /dev/null +++ b/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/ui/resources/ejb-jar-4.1.xml @@ -0,0 +1,7 @@ + + + + diff --git a/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/ui/resources/layer.xml b/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/ui/resources/layer.xml index 665fc36fb0c0..20143b0428b2 100644 --- a/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/ui/resources/layer.xml +++ b/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/ui/resources/layer.xml @@ -55,6 +55,7 @@ + diff --git a/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/ui/wizards/NewEjbJarProjectWizardIterator.java b/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/ui/wizards/NewEjbJarProjectWizardIterator.java index a7027faed226..bda848052dd3 100644 --- a/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/ui/wizards/NewEjbJarProjectWizardIterator.java +++ b/enterprise/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/ui/wizards/NewEjbJarProjectWizardIterator.java @@ -21,7 +21,6 @@ import java.io.File; import java.io.IOException; -import java.text.MessageFormat; import java.util.HashSet; import java.util.NoSuchElementException; @@ -227,8 +226,10 @@ public final void addChangeListener(ChangeListener l) {} public final void removeChangeListener(ChangeListener l) {} private static String adaptSourceLevelToJavaEEProfile(Profile javaEEProfile, String defaultSourceLevel) { - if (javaEEProfile.isAtLeast(Profile.JAKARTA_EE_11_WEB)) { + if (javaEEProfile.isAtLeast(Profile.JAKARTA_EE_12_WEB)) { return "21"; //NOI18N + } else if (javaEEProfile.isAtLeast(Profile.JAKARTA_EE_11_WEB)) { + return "17"; //NOI18N } else if (javaEEProfile.isAtLeast(Profile.JAKARTA_EE_9_1_WEB)) { return "11"; //NOI18N } else if (javaEEProfile.isAtLeast(Profile.JAVA_EE_8_WEB)) { diff --git a/enterprise/j2ee.ejbverification/src/org/netbeans/modules/j2ee/ejbverification/rules/PersistentTimerInEjbLite.java b/enterprise/j2ee.ejbverification/src/org/netbeans/modules/j2ee/ejbverification/rules/PersistentTimerInEjbLite.java index fdd24a526709..3b31ef17ba2d 100644 --- a/enterprise/j2ee.ejbverification/src/org/netbeans/modules/j2ee/ejbverification/rules/PersistentTimerInEjbLite.java +++ b/enterprise/j2ee.ejbverification/src/org/netbeans/modules/j2ee/ejbverification/rules/PersistentTimerInEjbLite.java @@ -84,11 +84,12 @@ public static Collection run(HintContext hintContext) { final EJBProblemContext ctx = HintsUtils.getOrCacheContext(hintContext); if (ctx != null && ctx.getEjb() instanceof Session) { final Profile profile = ctx.getEjbModule().getJ2eeProfile(); + boolean ee12lite = profile != null && profile.isAtLeast(Profile.JAKARTA_EE_12_WEB); boolean ee9lite = profile != null && profile.isAtLeast(Profile.JAKARTA_EE_9_WEB); boolean ee7lite = profile != null && profile.isAtLeast(Profile.JAVA_EE_7_WEB); boolean ee6lite = profile == Profile.JAVA_EE_6_WEB; J2eePlatform platform = ProjectUtil.getPlatform(ctx.getProject()); - if ((ee6lite || ee7lite || ee9lite) && nonEeFullServer(platform)) { + if ((ee6lite || ee7lite || ee9lite || ee12lite) && nonEeFullServer(platform)) { for (Element element : ctx.getClazz().getEnclosedElements()) { for (AnnotationMirror annm : element.getAnnotationMirrors()) { if (EJBAPIAnnotations.SCHEDULE_JAKARTA.equals(annm.getAnnotationType().toString()) diff --git a/enterprise/j2ee.sun.dd/src/org/netbeans/modules/j2ee/sun/dd/api/ASDDVersion.java b/enterprise/j2ee.sun.dd/src/org/netbeans/modules/j2ee/sun/dd/api/ASDDVersion.java index cf66ab33f012..2d98e8a2239f 100644 --- a/enterprise/j2ee.sun.dd/src/org/netbeans/modules/j2ee/sun/dd/api/ASDDVersion.java +++ b/enterprise/j2ee.sun.dd/src/org/netbeans/modules/j2ee/sun/dd/api/ASDDVersion.java @@ -442,6 +442,32 @@ public final class ASDDVersion { 601, "GlassFish Server 8" // NOI18N ); + /** Represents GF Server 9 + */ + public static final ASDDVersion GLASSFISH_9 = new ASDDVersion( + "9.0", 100, // NOI18N + DTDRegistry.GLASSFISH_WEBAPP_301_DTD_PUBLIC_ID, + DTDRegistry.GLASSFISH_WEBAPP_301_DTD_SYSTEM_ID, + SunWebApp.VERSION_3_0_1, + 301, + DTDRegistry.GLASSFISH_EJBJAR_311_DTD_PUBLIC_ID, + DTDRegistry.GLASSFISH_EJBJAR_311_DTD_SYSTEM_ID, + SunEjbJar.VERSION_3_1_1, + 311, + DTDRegistry.SUN_CMP_MAPPING_810_DTD_PUBLIC_ID, + DTDRegistry.SUN_CMP_MAPPING_810_DTD_SYSTEM_ID, + "1.2", + 120, + DTDRegistry.GLASSFISH_APPLICATION_601_DTD_PUBLIC_ID, + DTDRegistry.GLASSFISH_APPLICATION_601_DTD_SYSTEM_ID, + SunApplication.VERSION_6_0_1, + 601, + DTDRegistry.GLASSFISH_APPCLIENT_601_DTD_PUBLIC_ID, + DTDRegistry.GLASSFISH_APPCLIENT_601_DTD_SYSTEM_ID, + SunApplicationClient.VERSION_6_0_1, + 601, + "GlassFish Server 9" // NOI18N + ); /** Represents Sun Java System Web Server 7.0 */ public static final ASDDVersion SUN_WEBSERVER_7_0 = new ASDDVersion( diff --git a/enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/devmodules/api/J2eePlatform.java b/enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/devmodules/api/J2eePlatform.java index 957eeecafd1f..4d480f321573 100644 --- a/enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/devmodules/api/J2eePlatform.java +++ b/enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/devmodules/api/J2eePlatform.java @@ -575,7 +575,7 @@ public Set getSupportedTypes() { * * @since 1.9 */ - public Set getSupportedJavaPlatformVersions() { + public Set getSupportedJavaPlatformVersions() { return impl.getSupportedJavaPlatformVersions(); } diff --git a/enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/plugins/spi/J2eePlatformImpl.java b/enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/plugins/spi/J2eePlatformImpl.java index b0c34f38f43c..562fb2dbfde6 100644 --- a/enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/plugins/spi/J2eePlatformImpl.java +++ b/enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/plugins/spi/J2eePlatformImpl.java @@ -239,7 +239,7 @@ public Set getSupportedTypes() { * * @since 1.9 */ - public abstract Set/**/ getSupportedJavaPlatformVersions(); + public abstract Set getSupportedJavaPlatformVersions(); /** * Return server J2SE platform or null if the platform is unknown, not diff --git a/enterprise/jakartaee11.api/external/binaries-list b/enterprise/jakartaee11.api/external/binaries-list index 52ecb1598e03..224566ffccd6 100644 --- a/enterprise/jakartaee11.api/external/binaries-list +++ b/enterprise/jakartaee11.api/external/binaries-list @@ -14,5 +14,5 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -3D3471C64C8500880D0C0C6DA265F19194CE8304 jakarta.platform:jakarta.jakartaee-api:11.0.0-M1 -F0117F7D79657E795020A64CE01359962452694A jakarta.platform:jakarta.jakartaee-web-api:11.0.0-M1 \ No newline at end of file +1AF663CE0FB0B144B0EEC5951D5929D534AD2A97 jakarta.platform:jakarta.jakartaee-api:11.0.0 +82743558663A068D1E947166E05885FA96995228 jakarta.platform:jakarta.jakartaee-web-api:11.0.0 \ No newline at end of file diff --git a/enterprise/jakartaee11.api/external/jakarta.jakartaee-api-11.0.0-license.txt b/enterprise/jakartaee11.api/external/jakarta.jakartaee-api-11.0.0-license.txt index 57178c4f03d3..2526a42a7951 100644 --- a/enterprise/jakartaee11.api/external/jakarta.jakartaee-api-11.0.0-license.txt +++ b/enterprise/jakartaee11.api/external/jakarta.jakartaee-api-11.0.0-license.txt @@ -2,8 +2,8 @@ Name: JakartaEE API 11.0.0 Version: 11.0.0 License: EPL-v20 Description: JakartaEE API 11.0.0 -Origin: Eclipse Foundation (https://mvnrepository.com/artifact/jakarta.platform/jakarta.jakartaee-api/11.0.0-M1) -Files: jakarta.jakartaee-api-11.0.0-M1.jar +Origin: Eclipse Foundation (https://mvnrepository.com/artifact/jakarta.platform/jakarta.jakartaee-api/11.0.0) +Files: jakarta.jakartaee-api-11.0.0.jar Eclipse Public License - v 2.0 THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (“AGREEMENT”). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. diff --git a/enterprise/jakartaee11.api/external/jakarta.jakartaee-web-api-11.0.0-license.txt b/enterprise/jakartaee11.api/external/jakarta.jakartaee-web-api-11.0.0-license.txt index 62b3c3cee0b4..0ba7fcc03686 100644 --- a/enterprise/jakartaee11.api/external/jakarta.jakartaee-web-api-11.0.0-license.txt +++ b/enterprise/jakartaee11.api/external/jakarta.jakartaee-web-api-11.0.0-license.txt @@ -2,8 +2,8 @@ Name: JakartaEE Web API 11.0.0 Version: 11.0.0 License: EPL-v20 Description: JakartaEE Web API 11.0.0 -Origin: Eclipse Foundation (https://mvnrepository.com/artifact/jakarta.platform/jakarta.jakartaee-web-api/11.0.0-M1) -Files: jakarta.jakartaee-web-api-11.0.0-M1.jar +Origin: Eclipse Foundation (https://mvnrepository.com/artifact/jakarta.platform/jakarta.jakartaee-web-api/11.0.0) +Files: jakarta.jakartaee-web-api-11.0.0.jar Eclipse Public License - v 2.0 THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (“AGREEMENT”). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. diff --git a/enterprise/jakartaee11.api/nbproject/project.properties b/enterprise/jakartaee11.api/nbproject/project.properties index bcd98339ab49..e0635e5b5b7b 100644 --- a/enterprise/jakartaee11.api/nbproject/project.properties +++ b/enterprise/jakartaee11.api/nbproject/project.properties @@ -17,5 +17,5 @@ is.autoload=true javac.release=11 -release.external/jakarta.jakartaee-api-11.0.0-M1.jar=modules/ext/jakarta.jakartaee-api-11.0.0.jar -release.external/jakarta.jakartaee-web-api-11.0.0-M1.jar=modules/ext/jakarta.jakartaee-web-api-11.0.0.jar +release.external/jakarta.jakartaee-api-11.0.0.jar=modules/ext/jakarta.jakartaee-api-11.0.0.jar +release.external/jakarta.jakartaee-web-api-11.0.0.jar=modules/ext/jakarta.jakartaee-web-api-11.0.0.jar diff --git a/enterprise/jakartaee11.api/src/org/netbeans/modules/jakartaee11/api/jakartaee-api-11.0.xml b/enterprise/jakartaee11.api/src/org/netbeans/modules/jakartaee11/api/jakartaee-api-11.0.xml index d148946875ba..4d6cde2675ed 100644 --- a/enterprise/jakartaee11.api/src/org/netbeans/modules/jakartaee11/api/jakartaee-api-11.0.xml +++ b/enterprise/jakartaee11.api/src/org/netbeans/modules/jakartaee11/api/jakartaee-api-11.0.xml @@ -35,7 +35,7 @@ maven-dependencies - jakarta.platform:jakarta.jakartaee-api:11.0.0-M1:jar + jakarta.platform:jakarta.jakartaee-api:11.0.0:jar diff --git a/enterprise/jakartaee11.api/src/org/netbeans/modules/jakartaee11/api/jakartaee-web-api-11.0.xml b/enterprise/jakartaee11.api/src/org/netbeans/modules/jakartaee11/api/jakartaee-web-api-11.0.xml index 2d7da18fa36c..030278a1b766 100644 --- a/enterprise/jakartaee11.api/src/org/netbeans/modules/jakartaee11/api/jakartaee-web-api-11.0.xml +++ b/enterprise/jakartaee11.api/src/org/netbeans/modules/jakartaee11/api/jakartaee-web-api-11.0.xml @@ -35,7 +35,7 @@ maven-dependencies - jakarta.platform:jakarta.jakartaee-web-api:11.0.0-M1:jar + jakarta.platform:jakarta.jakartaee-web-api:11.0.0:jar diff --git a/enterprise/jakartaee11.platform/build.xml b/enterprise/jakartaee11.platform/build.xml index 57ecf544f309..b79986955660 100644 --- a/enterprise/jakartaee11.platform/build.xml +++ b/enterprise/jakartaee11.platform/build.xml @@ -41,7 +41,7 @@ - + diff --git a/enterprise/jakartaee11.platform/external/binaries-list b/enterprise/jakartaee11.platform/external/binaries-list index 5fbe81d7f9ea..93ce2885adc5 100644 --- a/enterprise/jakartaee11.platform/external/binaries-list +++ b/enterprise/jakartaee11.platform/external/binaries-list @@ -15,4 +15,4 @@ # specific language governing permissions and limitations # under the License. -4165DFDD7B817AF41113E8A5C5DB80A348DB21CA jakarta.platform:jakarta.jakartaee-api:11.0.0-M1:javadoc +3F6189249AF2A89CA42BB50545DFBD076F00CD7A jakarta.platform:jakarta.jakartaee-api:11.0.0:javadoc diff --git a/enterprise/jakartaee11.platform/external/generated-jakarta.jakartaee-api-11.0.0-javadoc-license.txt b/enterprise/jakartaee11.platform/external/generated-jakarta.jakartaee-api-11.0.0-javadoc-license.txt index 5d03fc5d2739..746547758cda 100644 --- a/enterprise/jakartaee11.platform/external/generated-jakarta.jakartaee-api-11.0.0-javadoc-license.txt +++ b/enterprise/jakartaee11.platform/external/generated-jakarta.jakartaee-api-11.0.0-javadoc-license.txt @@ -2,7 +2,7 @@ Name: JakartaEE API 11.0.0 Documentation Version: 11.0.0 License: EPL-v20 Description: JakartaEE API 11.0.0 Documentation -Origin: Generated from jakarta.jakartaee-api-11.0.0-M1-javadoc.jar +Origin: Generated from jakarta.jakartaee-api-11.0.0-javadoc.jar Type: generated Eclipse Public License - v 2.0 diff --git a/enterprise/jakartaee11.platform/external/jakarta.jakartaee-api-11.0.0-javadoc-license.txt b/enterprise/jakartaee11.platform/external/jakarta.jakartaee-api-11.0.0-javadoc-license.txt index 6c205499e823..10f129adc28b 100644 --- a/enterprise/jakartaee11.platform/external/jakarta.jakartaee-api-11.0.0-javadoc-license.txt +++ b/enterprise/jakartaee11.platform/external/jakarta.jakartaee-api-11.0.0-javadoc-license.txt @@ -2,8 +2,8 @@ Name: JakartaEE API 11.0.0 Documentation Version: 11.0.0 License: EPL-v20 Description: JakartaEE API 11.0.0 Documentation -Origin: Eclipse Foundation (https://mvnrepository.com/artifact/jakarta.platform/jakarta.jakartaee-api/11.0.0-M1) -Files: jakarta.jakartaee-api-11.0.0-M1-javadoc.jar +Origin: Eclipse Foundation (https://mvnrepository.com/artifact/jakarta.platform/jakarta.jakartaee-api/11.0.0) +Files: jakarta.jakartaee-api-11.0.0-javadoc.jar Eclipse Public License - v 2.0 THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (“AGREEMENT”). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. diff --git a/enterprise/jakartaee12.api/build.xml b/enterprise/jakartaee12.api/build.xml new file mode 100644 index 000000000000..13c5ba730357 --- /dev/null +++ b/enterprise/jakartaee12.api/build.xml @@ -0,0 +1,25 @@ + + + + Builds, tests, and runs the project org.netbeans.modules.jakartaee12.api + + diff --git a/enterprise/jakartaee12.api/external/binaries-list b/enterprise/jakartaee12.api/external/binaries-list new file mode 100644 index 000000000000..4a21abd9f201 --- /dev/null +++ b/enterprise/jakartaee12.api/external/binaries-list @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +1AF663CE0FB0B144B0EEC5951D5929D534AD2A97 jakarta.platform:jakarta.jakartaee-api:11.0.0 +82743558663A068D1E947166E05885FA96995228 jakarta.platform:jakarta.jakartaee-web-api:11.0.0 diff --git a/enterprise/jakartaee12.api/external/jakarta.jakartaee-api-12.0.0-license.txt b/enterprise/jakartaee12.api/external/jakarta.jakartaee-api-12.0.0-license.txt new file mode 100644 index 000000000000..188355f6a6b3 --- /dev/null +++ b/enterprise/jakartaee12.api/external/jakarta.jakartaee-api-12.0.0-license.txt @@ -0,0 +1,93 @@ +Name: JakartaEE API 12.0.0 +Version: 12.0.0 +License: EPL-v20 +Description: JakartaEE API 12.0.0 +Origin: Eclipse Foundation (https://mvnrepository.com/artifact/jakarta.platform/jakarta.jakartaee-api/12.0.0-M1) +Files: jakarta.jakartaee-api-12.0.0-M1.jar + +Eclipse Public License - v 2.0 +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (“AGREEMENT”). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + +1. Definitions +“Contribution” means: + +a) in the case of the initial Contributor, the initial content Distributed under this Agreement, and +b) in the case of each subsequent Contributor: +i) changes to the Program, and +ii) additions to the Program; where such changes and/or additions to the Program originate from and are Distributed by that particular Contributor. A Contribution “originates” from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include changes or additions to the Program that are not Modified Works. +“Contributor” means any person or entity that Distributes the Program. + +“Licensed Patents” mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. + +“Program” means the Contributions Distributed in accordance with this Agreement. + +“Recipient” means anyone who receives the Program under this Agreement or any Secondary License (as applicable), including Contributors. + +“Derivative Works” shall mean any work, whether in Source Code or other form, that is based on (or derived from) the Program and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. + +“Modified Works” shall mean any work in Source Code or other form that results from an addition to, deletion from, or modification of the contents of the Program, including, for purposes of clarity any new file in Source Code form that contains any contents of the Program. Modified Works shall not include works that contain only declarations, interfaces, types, classes, structures, or files of the Program solely in each case in order to link to, bind by name, or subclass the Program or Modified Works thereof. + +“Distribute” means the acts of a) distributing or b) making available in any manner that enables the transfer of a copy. + +“Source Code” means the form of a Program preferred for making modifications, including but not limited to software source code, documentation source, and configuration files. + +“Secondary License” means either the GNU General Public License, Version 2.0, or any later versions of that license, including any exceptions or additional permissions as identified by the initial Contributor. + +2. Grant of Rights +a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, Distribute and sublicense the Contribution of such Contributor, if any, and such Derivative Works. + +b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in Source Code or other form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. + +c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to Distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. + +d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. + +e) Notwithstanding the terms of any Secondary License, no Contributor makes additional grants to any Recipient (other than those set forth in this Agreement) as a result of such Recipient's receipt of the Program under the terms of a Secondary License (if permitted under the terms of Section 3). + +3. Requirements +3.1 If a Contributor Distributes the Program in any form, then: + +a) the Program must also be made available as Source Code, in accordance with section 3.2, and the Contributor must accompany the Program with a statement that the Source Code for the Program is available under this Agreement, and informs Recipients how to obtain it in a reasonable manner on or through a medium customarily used for software exchange; and + +b) the Contributor may Distribute the Program under a license different than this Agreement, provided that such license: + +i) effectively disclaims on behalf of all other Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; +ii) effectively excludes on behalf of all other Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; +iii) does not attempt to limit or alter the recipients' rights in the Source Code under section 3.2; and +iv) requires any subsequent distribution of the Program by any party to be under a license that satisfies the requirements of this section 3. +3.2 When the Program is Distributed as Source Code: + +a) it must be made available under this Agreement, or if the Program (i) is combined with other material in a separate file or files made available under a Secondary License, and (ii) the initial Contributor attached to the Source Code the notice described in Exhibit A of this Agreement, then the Program may be made available under the terms of such Secondary Licenses, and +b) a copy of this Agreement must be included with each copy of the Program. +3.3 Contributors may not remove or alter any copyright, patent, trademark, attribution notices, disclaimers of warranty, or limitations of liability (“notices”) contained within the Program from any copy of the Program which they Distribute, provided that Contributors may add their own appropriate notices. + +4. Commercial Distribution +Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor (“Commercial Contributor”) hereby agrees to defend and indemnify every other Contributor (“Indemnified Contributor”) against any losses, damages and costs (collectively “Losses”) arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. + +For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. + +5. No Warranty +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. + +6. Disclaimer of Liability +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. General +If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. + +If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. + +All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. + +Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be Distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to Distribute the Program (including its Contributions) under the new version. + +Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. Nothing in this Agreement is intended to be enforceable by any entity that is not a Contributor or Recipient. No third-party beneficiary rights are created under this Agreement. + +Exhibit A - Form of Secondary Licenses Notice +“This Source Code may also be made available under the following Secondary Licenses when the conditions for such availability set forth in the Eclipse Public License, v. 2.0 are satisfied: {name license(s), version(s), and exceptions or additional permissions here}.” + +Simply including a copy of this Agreement, including this Exhibit A is not sufficient to license the Source Code under Secondary Licenses. + +If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. + +You may add additional accurate notices of copyright ownership. diff --git a/enterprise/jakartaee12.api/external/jakarta.jakartaee-web-api-12.0.0-license.txt b/enterprise/jakartaee12.api/external/jakarta.jakartaee-web-api-12.0.0-license.txt new file mode 100644 index 000000000000..dd29a750885c --- /dev/null +++ b/enterprise/jakartaee12.api/external/jakarta.jakartaee-web-api-12.0.0-license.txt @@ -0,0 +1,93 @@ +Name: JakartaEE Web API 12.0.0 +Version: 12.0.0 +License: EPL-v20 +Description: JakartaEE Web API 12.0.0 +Origin: Eclipse Foundation (https://mvnrepository.com/artifact/jakarta.platform/jakarta.jakartaee-web-api/12.0.0-M1) +Files: jakarta.jakartaee-web-api-12.0.0-M1.jar + +Eclipse Public License - v 2.0 +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (“AGREEMENT”). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + +1. Definitions +“Contribution” means: + +a) in the case of the initial Contributor, the initial content Distributed under this Agreement, and +b) in the case of each subsequent Contributor: +i) changes to the Program, and +ii) additions to the Program; where such changes and/or additions to the Program originate from and are Distributed by that particular Contributor. A Contribution “originates” from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include changes or additions to the Program that are not Modified Works. +“Contributor” means any person or entity that Distributes the Program. + +“Licensed Patents” mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. + +“Program” means the Contributions Distributed in accordance with this Agreement. + +“Recipient” means anyone who receives the Program under this Agreement or any Secondary License (as applicable), including Contributors. + +“Derivative Works” shall mean any work, whether in Source Code or other form, that is based on (or derived from) the Program and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. + +“Modified Works” shall mean any work in Source Code or other form that results from an addition to, deletion from, or modification of the contents of the Program, including, for purposes of clarity any new file in Source Code form that contains any contents of the Program. Modified Works shall not include works that contain only declarations, interfaces, types, classes, structures, or files of the Program solely in each case in order to link to, bind by name, or subclass the Program or Modified Works thereof. + +“Distribute” means the acts of a) distributing or b) making available in any manner that enables the transfer of a copy. + +“Source Code” means the form of a Program preferred for making modifications, including but not limited to software source code, documentation source, and configuration files. + +“Secondary License” means either the GNU General Public License, Version 2.0, or any later versions of that license, including any exceptions or additional permissions as identified by the initial Contributor. + +2. Grant of Rights +a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, Distribute and sublicense the Contribution of such Contributor, if any, and such Derivative Works. + +b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in Source Code or other form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. + +c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to Distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. + +d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. + +e) Notwithstanding the terms of any Secondary License, no Contributor makes additional grants to any Recipient (other than those set forth in this Agreement) as a result of such Recipient's receipt of the Program under the terms of a Secondary License (if permitted under the terms of Section 3). + +3. Requirements +3.1 If a Contributor Distributes the Program in any form, then: + +a) the Program must also be made available as Source Code, in accordance with section 3.2, and the Contributor must accompany the Program with a statement that the Source Code for the Program is available under this Agreement, and informs Recipients how to obtain it in a reasonable manner on or through a medium customarily used for software exchange; and + +b) the Contributor may Distribute the Program under a license different than this Agreement, provided that such license: + +i) effectively disclaims on behalf of all other Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; +ii) effectively excludes on behalf of all other Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; +iii) does not attempt to limit or alter the recipients' rights in the Source Code under section 3.2; and +iv) requires any subsequent distribution of the Program by any party to be under a license that satisfies the requirements of this section 3. +3.2 When the Program is Distributed as Source Code: + +a) it must be made available under this Agreement, or if the Program (i) is combined with other material in a separate file or files made available under a Secondary License, and (ii) the initial Contributor attached to the Source Code the notice described in Exhibit A of this Agreement, then the Program may be made available under the terms of such Secondary Licenses, and +b) a copy of this Agreement must be included with each copy of the Program. +3.3 Contributors may not remove or alter any copyright, patent, trademark, attribution notices, disclaimers of warranty, or limitations of liability (“notices”) contained within the Program from any copy of the Program which they Distribute, provided that Contributors may add their own appropriate notices. + +4. Commercial Distribution +Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor (“Commercial Contributor”) hereby agrees to defend and indemnify every other Contributor (“Indemnified Contributor”) against any losses, damages and costs (collectively “Losses”) arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. + +For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. + +5. No Warranty +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. + +6. Disclaimer of Liability +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. General +If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. + +If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. + +All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. + +Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be Distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to Distribute the Program (including its Contributions) under the new version. + +Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. Nothing in this Agreement is intended to be enforceable by any entity that is not a Contributor or Recipient. No third-party beneficiary rights are created under this Agreement. + +Exhibit A - Form of Secondary Licenses Notice +“This Source Code may also be made available under the following Secondary Licenses when the conditions for such availability set forth in the Eclipse Public License, v. 2.0 are satisfied: {name license(s), version(s), and exceptions or additional permissions here}.” + +Simply including a copy of this Agreement, including this Exhibit A is not sufficient to license the Source Code under Secondary Licenses. + +If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. + +You may add additional accurate notices of copyright ownership. diff --git a/enterprise/jakartaee12.api/manifest.mf b/enterprise/jakartaee12.api/manifest.mf new file mode 100644 index 000000000000..0b9c36f696e4 --- /dev/null +++ b/enterprise/jakartaee12.api/manifest.mf @@ -0,0 +1,7 @@ +Manifest-Version: 1.0 +AutoUpdate-Show-In-Client: false +OpenIDE-Module: org.netbeans.modules.jakartaee12.api +OpenIDE-Module-Layer: org/netbeans/modules/jakartaee12/api/layer.xml +OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jakartaee12/api/Bundle.properties +OpenIDE-Module-Specification-Version: 1.0 +OpenIDE-Module-Provides: jakartaee12.api diff --git a/enterprise/jakartaee12.api/nbproject/project.properties b/enterprise/jakartaee12.api/nbproject/project.properties new file mode 100644 index 000000000000..1652f7a251bb --- /dev/null +++ b/enterprise/jakartaee12.api/nbproject/project.properties @@ -0,0 +1,21 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +is.autoload=true +javac.release=17 +release.external/jakarta.jakartaee-api-11.0.0.jar=modules/ext/jakarta.jakartaee-api-12.0.0.jar +release.external/jakarta.jakartaee-web-api-11.0.0.jar=modules/ext/jakarta.jakartaee-web-api-12.0.0.jar diff --git a/enterprise/jakartaee12.api/nbproject/project.xml b/enterprise/jakartaee12.api/nbproject/project.xml new file mode 100644 index 000000000000..7d4dd5aaeb9a --- /dev/null +++ b/enterprise/jakartaee12.api/nbproject/project.xml @@ -0,0 +1,31 @@ + + + + org.netbeans.modules.apisupport.project + + + org.netbeans.modules.jakartaee12.api + + + + + diff --git a/enterprise/jakartaee12.api/src/org/netbeans/modules/jakartaee12/api/Bundle.properties b/enterprise/jakartaee12.api/src/org/netbeans/modules/jakartaee12/api/Bundle.properties new file mode 100644 index 000000000000..a3896130ded7 --- /dev/null +++ b/enterprise/jakartaee12.api/src/org/netbeans/modules/jakartaee12/api/Bundle.properties @@ -0,0 +1,25 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +OpenIDE-Module-Display-Category=Jakarta EE +OpenIDE-Module-Long-Description=\ + Library wrapper which provides JakartaEE 12 API (full API and web profile API) +OpenIDE-Module-Name=Jakarta EE 12 API Library +OpenIDE-Module-Short-Description=Jakarta EE 12 API Library + +#library display name +jakartaee-api-12.0=Jakarta EE 12 API Library +jakartaee-web-api-12.0=Jakarta EE Web 12 API Library diff --git a/enterprise/jakartaee12.api/src/org/netbeans/modules/jakartaee12/api/jakartaee-api-12.0.xml b/enterprise/jakartaee12.api/src/org/netbeans/modules/jakartaee12/api/jakartaee-api-12.0.xml new file mode 100644 index 000000000000..b59f7a3dfdb6 --- /dev/null +++ b/enterprise/jakartaee12.api/src/org/netbeans/modules/jakartaee12/api/jakartaee-api-12.0.xml @@ -0,0 +1,41 @@ + + + + + jakartaee-api-12.0 + j2se + org/netbeans/modules/jakartaee12/api/Bundle + + classpath + jar:nbinst://org.netbeans.modules.jakartaee12.api/modules/ext/jakarta.jakartaee-api-12.0.0.jar!/ + + + javadoc + jar:nbinst://org.netbeans.modules.jakartaee12.platform/docs/jakartaee12-doc-api.jar!/ + + + + maven-dependencies + jakarta.platform:jakarta.jakartaee-api:12.0.0-M1:jar + + + diff --git a/enterprise/jakartaee12.api/src/org/netbeans/modules/jakartaee12/api/jakartaee-web-api-12.0.xml b/enterprise/jakartaee12.api/src/org/netbeans/modules/jakartaee12/api/jakartaee-web-api-12.0.xml new file mode 100644 index 000000000000..922e3d4ac271 --- /dev/null +++ b/enterprise/jakartaee12.api/src/org/netbeans/modules/jakartaee12/api/jakartaee-web-api-12.0.xml @@ -0,0 +1,41 @@ + + + + + jakartaee-web-api-12.0 + j2se + org/netbeans/modules/jakartaee12/api/Bundle + + classpath + jar:nbinst://org.netbeans.modules.jakartaee12.api/modules/ext/jakarta.jakartaee-web-api-12.0.0.jar!/ + + + javadoc + jar:nbinst://org.netbeans.modules.jakartaee12.platform/docs/jakartaee12-doc-api.jar!/ + + + + maven-dependencies + jakarta.platform:jakarta.jakartaee-web-api:12.0.0-M1:jar + + + diff --git a/enterprise/jakartaee12.api/src/org/netbeans/modules/jakartaee12/api/layer.xml b/enterprise/jakartaee12.api/src/org/netbeans/modules/jakartaee12/api/layer.xml new file mode 100644 index 000000000000..5f7e39116d6e --- /dev/null +++ b/enterprise/jakartaee12.api/src/org/netbeans/modules/jakartaee12/api/layer.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + diff --git a/enterprise/jakartaee12.platform/arch.xml b/enterprise/jakartaee12.platform/arch.xml new file mode 100644 index 000000000000..5c100488e218 --- /dev/null +++ b/enterprise/jakartaee12.platform/arch.xml @@ -0,0 +1,908 @@ + + + +]> + + + + &api-questions; + + + + +

+ This module is an empty module, it only contains javahelp documentation for Jakarta EE 12 functionality. +

+ + + + + + +

+ N/A +

+
+ + + + + +

+ Done. +

+
+ + + + + +

+ No usecases. +

+
+ + + + + +

+ Container for javahelp docs for Jakarta EE 12. +

+
+ + + + + +

+ N/A +

+
+ + + + + +

+ N/A +

+
+ + + + + +

+ N/A +

+
+ + + + + +

+ 1.8 +

+
+ + + + + +

+ JRE +

+
+ + + + + +

+ None. +

+
+ + + + + +

+ None. +

+
+ + + + + +

+ Runs everywhere. +

+
+ + + + +

+ N/A +

+
+ + + + + +

+ docs/jakartaee12-doc-api.jar, modules/docs/org-netbeans-modules-jakartaee12-platform.jar +

+
+ + + + + +

+ Yes. +

+
+ + + + + +

+ Yes. +

+
+ + + + + +

+ Anywhere. +

+
+ + + + + +

+ No. +

+
+ + + + + +

+ No. +

+
+ + + + + +

+ No. +

+
+ + + + + +

+ No. +

+
+ + + + + +

+ No. +

+
+ + + + + +

+ No. +

+
+ + + + + +

+ No. +

+
+ + + + + +

+ No. +

+
+ + + + + +

+ No. +

+
+ + + + + +

+ No. +

+
+ + + + + +

+ No. +

+
+ + + + + +

+ No. +

+
+ + + + + +

+ No. +

+
+ + + + + +

+ No. +

+
+ + + + + +

+ No. +

+
+ + + + + +

+ No. +

+
+ + + + + +

+ N/A +

+
+ + + + + +

+ N/A +

+
+ + + + + +

+ N/A +

+
+ + + + + +

+ No. +

+
+ + + + + +

+ N/A +

+
+ + + + + +

+ N/A +

+
+ + + + + +

+ No. +

+
+ + + + + +

+ No. +

+
+ + + + + +

+ No. +

+
+ + + + + +

+ javahelp helpse registration +

+
+ + + + + +

+ No. +

+
+ + + + + +

+ No. +

+
+ + + + + +

+ No. +

+
+ + + + + +

+ No. +

+
+ + diff --git a/enterprise/jakartaee12.platform/build.xml b/enterprise/jakartaee12.platform/build.xml new file mode 100644 index 000000000000..5c4ff94e3205 --- /dev/null +++ b/enterprise/jakartaee12.platform/build.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/enterprise/jakartaee12.platform/external/binaries-list b/enterprise/jakartaee12.platform/external/binaries-list new file mode 100644 index 000000000000..93ce2885adc5 --- /dev/null +++ b/enterprise/jakartaee12.platform/external/binaries-list @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +3F6189249AF2A89CA42BB50545DFBD076F00CD7A jakarta.platform:jakarta.jakartaee-api:11.0.0:javadoc diff --git a/enterprise/jakartaee12.platform/external/generated-jakarta.jakartaee-api-12.0.0-javadoc-license.txt b/enterprise/jakartaee12.platform/external/generated-jakarta.jakartaee-api-12.0.0-javadoc-license.txt new file mode 100644 index 000000000000..080849351d3d --- /dev/null +++ b/enterprise/jakartaee12.platform/external/generated-jakarta.jakartaee-api-12.0.0-javadoc-license.txt @@ -0,0 +1,93 @@ +Name: JakartaEE API 12.0.0 Documentation +Version: 12.0.0 +License: EPL-v20 +Description: JakartaEE API 12.0.0 Documentation +Origin: Generated from jakarta.jakartaee-api-11.0.0-javadoc.jar +Type: generated + +Eclipse Public License - v 2.0 +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (“AGREEMENT”). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + +1. Definitions +“Contribution” means: + +a) in the case of the initial Contributor, the initial content Distributed under this Agreement, and +b) in the case of each subsequent Contributor: +i) changes to the Program, and +ii) additions to the Program; where such changes and/or additions to the Program originate from and are Distributed by that particular Contributor. A Contribution “originates” from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include changes or additions to the Program that are not Modified Works. +“Contributor” means any person or entity that Distributes the Program. + +“Licensed Patents” mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. + +“Program” means the Contributions Distributed in accordance with this Agreement. + +“Recipient” means anyone who receives the Program under this Agreement or any Secondary License (as applicable), including Contributors. + +“Derivative Works” shall mean any work, whether in Source Code or other form, that is based on (or derived from) the Program and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. + +“Modified Works” shall mean any work in Source Code or other form that results from an addition to, deletion from, or modification of the contents of the Program, including, for purposes of clarity any new file in Source Code form that contains any contents of the Program. Modified Works shall not include works that contain only declarations, interfaces, types, classes, structures, or files of the Program solely in each case in order to link to, bind by name, or subclass the Program or Modified Works thereof. + +“Distribute” means the acts of a) distributing or b) making available in any manner that enables the transfer of a copy. + +“Source Code” means the form of a Program preferred for making modifications, including but not limited to software source code, documentation source, and configuration files. + +“Secondary License” means either the GNU General Public License, Version 2.0, or any later versions of that license, including any exceptions or additional permissions as identified by the initial Contributor. + +2. Grant of Rights +a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, Distribute and sublicense the Contribution of such Contributor, if any, and such Derivative Works. + +b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in Source Code or other form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. + +c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to Distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. + +d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. + +e) Notwithstanding the terms of any Secondary License, no Contributor makes additional grants to any Recipient (other than those set forth in this Agreement) as a result of such Recipient's receipt of the Program under the terms of a Secondary License (if permitted under the terms of Section 3). + +3. Requirements +3.1 If a Contributor Distributes the Program in any form, then: + +a) the Program must also be made available as Source Code, in accordance with section 3.2, and the Contributor must accompany the Program with a statement that the Source Code for the Program is available under this Agreement, and informs Recipients how to obtain it in a reasonable manner on or through a medium customarily used for software exchange; and + +b) the Contributor may Distribute the Program under a license different than this Agreement, provided that such license: + +i) effectively disclaims on behalf of all other Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; +ii) effectively excludes on behalf of all other Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; +iii) does not attempt to limit or alter the recipients' rights in the Source Code under section 3.2; and +iv) requires any subsequent distribution of the Program by any party to be under a license that satisfies the requirements of this section 3. +3.2 When the Program is Distributed as Source Code: + +a) it must be made available under this Agreement, or if the Program (i) is combined with other material in a separate file or files made available under a Secondary License, and (ii) the initial Contributor attached to the Source Code the notice described in Exhibit A of this Agreement, then the Program may be made available under the terms of such Secondary Licenses, and +b) a copy of this Agreement must be included with each copy of the Program. +3.3 Contributors may not remove or alter any copyright, patent, trademark, attribution notices, disclaimers of warranty, or limitations of liability (“notices”) contained within the Program from any copy of the Program which they Distribute, provided that Contributors may add their own appropriate notices. + +4. Commercial Distribution +Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor (“Commercial Contributor”) hereby agrees to defend and indemnify every other Contributor (“Indemnified Contributor”) against any losses, damages and costs (collectively “Losses”) arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. + +For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. + +5. No Warranty +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. + +6. Disclaimer of Liability +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. General +If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. + +If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. + +All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. + +Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be Distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to Distribute the Program (including its Contributions) under the new version. + +Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. Nothing in this Agreement is intended to be enforceable by any entity that is not a Contributor or Recipient. No third-party beneficiary rights are created under this Agreement. + +Exhibit A - Form of Secondary Licenses Notice +“This Source Code may also be made available under the following Secondary Licenses when the conditions for such availability set forth in the Eclipse Public License, v. 2.0 are satisfied: {name license(s), version(s), and exceptions or additional permissions here}.” + +Simply including a copy of this Agreement, including this Exhibit A is not sufficient to license the Source Code under Secondary Licenses. + +If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. + +You may add additional accurate notices of copyright ownership. diff --git a/enterprise/jakartaee12.platform/external/jakarta.jakartaee-api-12.0.0-javadoc-license.txt b/enterprise/jakartaee12.platform/external/jakarta.jakartaee-api-12.0.0-javadoc-license.txt new file mode 100644 index 000000000000..6c9d7ca88b05 --- /dev/null +++ b/enterprise/jakartaee12.platform/external/jakarta.jakartaee-api-12.0.0-javadoc-license.txt @@ -0,0 +1,93 @@ +Name: JakartaEE API 12.0.0 Documentation +Version: 12.0.0 +License: EPL-v20 +Description: JakartaEE API 12.0.0 Documentation +Origin: Eclipse Foundation (https://mvnrepository.com/artifact/jakarta.platform/jakarta.jakartaee-api/12.0.0-M1) +Files: jakarta.jakartaee-api-11.0.0-javadoc.jar + +Eclipse Public License - v 2.0 +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (“AGREEMENT”). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + +1. Definitions +“Contribution” means: + +a) in the case of the initial Contributor, the initial content Distributed under this Agreement, and +b) in the case of each subsequent Contributor: +i) changes to the Program, and +ii) additions to the Program; where such changes and/or additions to the Program originate from and are Distributed by that particular Contributor. A Contribution “originates” from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include changes or additions to the Program that are not Modified Works. +“Contributor” means any person or entity that Distributes the Program. + +“Licensed Patents” mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. + +“Program” means the Contributions Distributed in accordance with this Agreement. + +“Recipient” means anyone who receives the Program under this Agreement or any Secondary License (as applicable), including Contributors. + +“Derivative Works” shall mean any work, whether in Source Code or other form, that is based on (or derived from) the Program and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. + +“Modified Works” shall mean any work in Source Code or other form that results from an addition to, deletion from, or modification of the contents of the Program, including, for purposes of clarity any new file in Source Code form that contains any contents of the Program. Modified Works shall not include works that contain only declarations, interfaces, types, classes, structures, or files of the Program solely in each case in order to link to, bind by name, or subclass the Program or Modified Works thereof. + +“Distribute” means the acts of a) distributing or b) making available in any manner that enables the transfer of a copy. + +“Source Code” means the form of a Program preferred for making modifications, including but not limited to software source code, documentation source, and configuration files. + +“Secondary License” means either the GNU General Public License, Version 2.0, or any later versions of that license, including any exceptions or additional permissions as identified by the initial Contributor. + +2. Grant of Rights +a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, Distribute and sublicense the Contribution of such Contributor, if any, and such Derivative Works. + +b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in Source Code or other form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. + +c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to Distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. + +d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. + +e) Notwithstanding the terms of any Secondary License, no Contributor makes additional grants to any Recipient (other than those set forth in this Agreement) as a result of such Recipient's receipt of the Program under the terms of a Secondary License (if permitted under the terms of Section 3). + +3. Requirements +3.1 If a Contributor Distributes the Program in any form, then: + +a) the Program must also be made available as Source Code, in accordance with section 3.2, and the Contributor must accompany the Program with a statement that the Source Code for the Program is available under this Agreement, and informs Recipients how to obtain it in a reasonable manner on or through a medium customarily used for software exchange; and + +b) the Contributor may Distribute the Program under a license different than this Agreement, provided that such license: + +i) effectively disclaims on behalf of all other Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; +ii) effectively excludes on behalf of all other Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; +iii) does not attempt to limit or alter the recipients' rights in the Source Code under section 3.2; and +iv) requires any subsequent distribution of the Program by any party to be under a license that satisfies the requirements of this section 3. +3.2 When the Program is Distributed as Source Code: + +a) it must be made available under this Agreement, or if the Program (i) is combined with other material in a separate file or files made available under a Secondary License, and (ii) the initial Contributor attached to the Source Code the notice described in Exhibit A of this Agreement, then the Program may be made available under the terms of such Secondary Licenses, and +b) a copy of this Agreement must be included with each copy of the Program. +3.3 Contributors may not remove or alter any copyright, patent, trademark, attribution notices, disclaimers of warranty, or limitations of liability (“notices”) contained within the Program from any copy of the Program which they Distribute, provided that Contributors may add their own appropriate notices. + +4. Commercial Distribution +Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor (“Commercial Contributor”) hereby agrees to defend and indemnify every other Contributor (“Indemnified Contributor”) against any losses, damages and costs (collectively “Losses”) arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. + +For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. + +5. No Warranty +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. + +6. Disclaimer of Liability +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. General +If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. + +If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. + +All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. + +Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be Distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to Distribute the Program (including its Contributions) under the new version. + +Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. Nothing in this Agreement is intended to be enforceable by any entity that is not a Contributor or Recipient. No third-party beneficiary rights are created under this Agreement. + +Exhibit A - Form of Secondary Licenses Notice +“This Source Code may also be made available under the following Secondary Licenses when the conditions for such availability set forth in the Eclipse Public License, v. 2.0 are satisfied: {name license(s), version(s), and exceptions or additional permissions here}.” + +Simply including a copy of this Agreement, including this Exhibit A is not sufficient to license the Source Code under Secondary Licenses. + +If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. + +You may add additional accurate notices of copyright ownership. diff --git a/enterprise/jakartaee12.platform/manifest.mf b/enterprise/jakartaee12.platform/manifest.mf new file mode 100644 index 000000000000..352d4d99bf87 --- /dev/null +++ b/enterprise/jakartaee12.platform/manifest.mf @@ -0,0 +1,6 @@ +Manifest-Version: 1.0 +OpenIDE-Module: org.netbeans.modules.jakartaee12.platform/1 +OpenIDE-Module-Specification-Version: 1.0 +OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jakartaee12/platform/Bundle.properties +AutoUpdate-Show-In-Client: false +OpenIDE-Module-Provides: jakartaee12.platform diff --git a/enterprise/jakartaee12.platform/nbproject/project.properties b/enterprise/jakartaee12.platform/nbproject/project.properties new file mode 100644 index 000000000000..6a17ace747c3 --- /dev/null +++ b/enterprise/jakartaee12.platform/nbproject/project.properties @@ -0,0 +1,23 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +is.autoload=true +javac.compilerargs=-Xlint:all -Xlint:-serial +javac.release=17 +release.external/generated-jakarta.jakartaee-api-11.0.0-javadoc.jar=docs/jakartaee12-doc-api.jar + +javadoc.arch=${basedir}/arch.xml diff --git a/enterprise/jakartaee12.platform/nbproject/project.xml b/enterprise/jakartaee12.platform/nbproject/project.xml new file mode 100644 index 000000000000..7fa932ce4697 --- /dev/null +++ b/enterprise/jakartaee12.platform/nbproject/project.xml @@ -0,0 +1,32 @@ + + + + org.netbeans.modules.apisupport.project + + + org.netbeans.modules.jakartaee12.platform + + + + + + diff --git a/enterprise/jakartaee12.platform/src/org/netbeans/modules/jakartaee12/platform/Bundle.properties b/enterprise/jakartaee12.platform/src/org/netbeans/modules/jakartaee12/platform/Bundle.properties new file mode 100644 index 000000000000..485df0f36ddd --- /dev/null +++ b/enterprise/jakartaee12.platform/src/org/netbeans/modules/jakartaee12/platform/Bundle.properties @@ -0,0 +1,23 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# module description +OpenIDE-Module-Name=Jakarta EE 12 Documentation +OpenIDE-Module-Display-Category=Jakarta EE +OpenIDE-Module-Short-Description=Jakarta EE 12 Documentation +OpenIDE-Module-Long-Description=\ + Documentation for the NetBeans Jakarta EE 12 support and Jakarta EE 12 Javadoc diff --git a/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/PersistenceProviderSupplierImpl.java b/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/PersistenceProviderSupplierImpl.java index cd26eaec77aa..ad0a773220ee 100644 --- a/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/PersistenceProviderSupplierImpl.java +++ b/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/PersistenceProviderSupplierImpl.java @@ -94,6 +94,7 @@ private List findPersistenceProviders(J2eePlatform platform) { if (jpa != null) { String version = ProviderUtil.getVersion(provider); if (version == null + || (version.equals(Persistence.VERSION_4_0) && jpa.isJpa40Supported()) || (version.equals(Persistence.VERSION_3_2) && jpa.isJpa32Supported()) || (version.equals(Persistence.VERSION_3_1) && jpa.isJpa31Supported()) || (version.equals(Persistence.VERSION_3_0) && jpa.isJpa30Supported()) @@ -129,7 +130,8 @@ private List findPersistenceProviders(J2eePlatform platform) { || version.equals(Persistence.VERSION_2_2) || version.equals(Persistence.VERSION_3_0) || version.equals(Persistence.VERSION_3_1) - || version.equals(Persistence.VERSION_3_2)) { + || version.equals(Persistence.VERSION_3_2) + || version.equals(Persistence.VERSION_4_0)) { providers.add(each); } } diff --git a/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/ant/ui/wizard/Bundle.properties b/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/ant/ui/wizard/Bundle.properties index 396be381dde8..21328f8b33f4 100644 --- a/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/ant/ui/wizard/Bundle.properties +++ b/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/ant/ui/wizard/Bundle.properties @@ -145,6 +145,10 @@ MSG_RecommendationSetJdk17=Note: JDK 17 will be used for Jakarta EE 11 pro MSG_RecommendationSetSourceLevel17=Note: Source Level 17 will be set for Jakarta EE 11 project. MSG_RecommendationJDK17=Recommendation: JDK 17 should be used for Jakarta EE 11 projects. +MSG_RecommendationSetJdk21=Note: JDK 21 will be used for Jakarta EE 12 projects. +MSG_RecommendationSetSourceLevel21=Note: Source Level 21 will be set for Jakarta EE 12 project. +MSG_RecommendationJDK21=Recommendation: JDK 21 should be used for Jakarta EE 12 projects. + #Import wizard - existing sources LBL_IW_ImportTitle=Add Existing Sources LBL_IW_LocationSrcDesc=Select the folder that contains all the sources for your application. diff --git a/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/ant/ui/wizard/J2eeVersionWarningPanel.java b/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/ant/ui/wizard/J2eeVersionWarningPanel.java index 37aca584bf68..555dcd0b2258 100644 --- a/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/ant/ui/wizard/J2eeVersionWarningPanel.java +++ b/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/ant/ui/wizard/J2eeVersionWarningPanel.java @@ -43,6 +43,7 @@ final class J2eeVersionWarningPanel extends javax.swing.JPanel { public static final String WARN_SET_JDK_8 = "warnSetJdk8"; // NOI18N public static final String WARN_SET_JDK_11 = "warnSetJdk11"; // NOI18N public static final String WARN_SET_JDK_17 = "warnSetJdk17"; // NOI18N + public static final String WARN_SET_JDK_21 = "warnSetJdk21"; // NOI18N public static final String WARN_SET_SOURCE_LEVEL_15 = "warnSetSourceLevel15"; // NOI18N public static final String WARN_SET_SOURCE_LEVEL_6 = "warnSetSourceLevel6"; // NOI18N @@ -50,12 +51,14 @@ final class J2eeVersionWarningPanel extends javax.swing.JPanel { public static final String WARN_SET_SOURCE_LEVEL_8 = "warnSetSourceLevel8"; // NOI18N public static final String WARN_SET_SOURCE_LEVEL_11 = "warnSetSourceLevel11"; // NOI18N public static final String WARN_SET_SOURCE_LEVEL_17 = "warnSetSourceLevel17"; // NOI18N + public static final String WARN_SET_SOURCE_LEVEL_21 = "warnSetSourceLevel21"; // NOI18N public static final String WARN_JDK_6_REQUIRED = "warnJdk6Required"; // NOI18N public static final String WARN_JDK_7_REQUIRED = "warnJdk7Required"; // NOI18N public static final String WARN_JDK_8_REQUIRED = "warnJdk8Required"; // NOI18N public static final String WARN_JDK_11_REQUIRED = "warnJdk11Required"; // NOI18N public static final String WARN_JDK_17_REQUIRED = "warnJdk17Required"; // NOI18N + public static final String WARN_JDK_21_REQUIRED = "warnJdk21Required"; // NOI18N private String warningType; @@ -91,6 +94,9 @@ public void setWarningType(String warningType) { case WARN_SET_JDK_17: labelText = NbBundle.getMessage(J2eeVersionWarningPanel.class, "MSG_RecommendationSetJdk17"); break; + case WARN_SET_JDK_21: + labelText = NbBundle.getMessage(J2eeVersionWarningPanel.class, "MSG_RecommendationSetJdk21"); + break; case WARN_SET_SOURCE_LEVEL_15: labelText = NbBundle.getMessage(J2eeVersionWarningPanel.class, "MSG_RecommendationSetSourceLevel15"); break; @@ -109,6 +115,9 @@ public void setWarningType(String warningType) { case WARN_SET_SOURCE_LEVEL_17: labelText = NbBundle.getMessage(J2eeVersionWarningPanel.class, "MSG_RecommendationSetSourceLevel17"); break; + case WARN_SET_SOURCE_LEVEL_21: + labelText = NbBundle.getMessage(J2eeVersionWarningPanel.class, "MSG_RecommendationSetSourceLevel21"); + break; case WARN_JDK_6_REQUIRED: labelText = NbBundle.getMessage(J2eeVersionWarningPanel.class, "MSG_RecommendationJDK6"); break; @@ -124,6 +133,9 @@ public void setWarningType(String warningType) { case WARN_JDK_17_REQUIRED: labelText = NbBundle.getMessage(J2eeVersionWarningPanel.class, "MSG_RecommendationJDK17"); break; + case WARN_JDK_21_REQUIRED: + labelText = NbBundle.getMessage(J2eeVersionWarningPanel.class, "MSG_RecommendationJDK21"); + break; default: break; } @@ -161,6 +173,10 @@ public String getSuggestedJavaPlatformName() { JavaPlatform[] javaPlatforms = getJavaPlatforms("17"); return getPreferredPlatform(javaPlatforms).getDisplayName(); } + case WARN_SET_JDK_21: { + JavaPlatform[] javaPlatforms = getJavaPlatforms("21"); + return getPreferredPlatform(javaPlatforms).getDisplayName(); + } default: return JavaPlatform.getDefault().getDisplayName(); } @@ -197,6 +213,10 @@ public Specification getSuggestedJavaPlatformSpecification() { JavaPlatform[] javaPlatforms = getJavaPlatforms("17"); return getPreferredPlatform(javaPlatforms).getSpecification(); } + case WARN_SET_JDK_21: { + JavaPlatform[] javaPlatforms = getJavaPlatforms("21"); + return getPreferredPlatform(javaPlatforms).getSpecification(); + } default: return JavaPlatform.getDefault().getSpecification(); } @@ -216,7 +236,7 @@ private static JavaPlatform getPreferredPlatform(@NullAllowed final JavaPlatform return platforms[0]; } - public static String findWarningType(Profile j2eeProfile, Set acceptableSourceLevels) { + public static String findWarningType(Profile j2eeProfile, Set acceptableSourceLevels) { JavaPlatform defaultPlatform = JavaPlatformManager.getDefault().getDefaultPlatform(); SpecificationVersion version = defaultPlatform.getSpecification().getVersion(); String sourceLevel = version.toString(); @@ -267,6 +287,12 @@ public static String findWarningType(Profile j2eeProfile, Set acceptableSourceLe return null; } + // no warning if 21 is the default for jakartaee12 + if ((j2eeProfile == Profile.JAKARTA_EE_12_FULL || j2eeProfile == Profile.JAKARTA_EE_12_WEB) && + isAcceptableSourceLevel("21", sourceLevel, acceptableSourceLevels)) { // NOI18N + return null; + } + if (j2eeProfile == Profile.JAVA_EE_5) { JavaPlatform[] java15Platforms = getJavaPlatforms("1.5"); //NOI18N if (java15Platforms.length > 0) { @@ -332,6 +358,17 @@ public static String findWarningType(Profile j2eeProfile, Set acceptableSourceLe return WARN_JDK_17_REQUIRED; } } + } else if (j2eeProfile == Profile.JAKARTA_EE_12_FULL || j2eeProfile == Profile.JAKARTA_EE_12_WEB) { + JavaPlatform[] java21Platforms = getJavaPlatforms("21"); //NOI18N + if (java21Platforms.length > 0) { + return WARN_SET_JDK_21; + } else { + if (canSetSourceLevel("21")) { + return WARN_SET_SOURCE_LEVEL_21; + } else { + return WARN_JDK_21_REQUIRED; + } + } } else { return null; } diff --git a/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/ant/ui/wizard/ProjectServerPanel.java b/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/ant/ui/wizard/ProjectServerPanel.java index 548893956cbb..153a25dfa3fc 100644 --- a/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/ant/ui/wizard/ProjectServerPanel.java +++ b/enterprise/javaee.project/src/org/netbeans/modules/javaee/project/api/ant/ui/wizard/ProjectServerPanel.java @@ -611,7 +611,9 @@ private String getSourceLevel(WizardDescriptor d, String serverInstanceId, Profi Set jdks = j2eePlatform.getSupportedJavaPlatformVersions(); // make sure that chosen source level is suported by server: if (jdks != null && !jdks.contains(sourceLevel)) { // workaround for #212146 when jdks == null - if ("17".equals(sourceLevel) && jdks.contains("11")) { + if ("21".equals(sourceLevel) && jdks.contains("17")) { + sourceLevel = "17"; + } else if ("17".equals(sourceLevel) && jdks.contains("11")) { sourceLevel = "11"; } else if ("11".equals(sourceLevel) && jdks.contains("1.8")) { sourceLevel = "1.8"; @@ -634,6 +636,9 @@ private String getSourceLevel(WizardDescriptor d, String serverInstanceId, Profi String warningType = warningPanel.getWarningType(); if (warningType != null) { switch (warningType) { + case J2eeVersionWarningPanel.WARN_SET_SOURCE_LEVEL_21: + sourceLevel = "21"; //NOI18N + break; case J2eeVersionWarningPanel.WARN_SET_SOURCE_LEVEL_17: sourceLevel = "17"; //NOI18N break; @@ -915,7 +920,7 @@ private void updateJ2EEVersion(String configFileName) { } } else { // suppose highest - j2eeSpecComboBox.setSelectedItem(new ProfileItem(Profile.JAVA_EE_8_FULL)); + j2eeSpecComboBox.setSelectedItem(new ProfileItem(Profile.JAKARTA_EE_8_FULL)); } } } @@ -949,6 +954,8 @@ private void checkEjbJarXmlJ2eeVersion(FileObject ejbJarXml) { j2eeSpecComboBox.setSelectedItem(new ProfileItem(Profile.JAVA_EE_7_FULL)); } else if(new BigDecimal(org.netbeans.modules.j2ee.dd.api.ejb.EjbJar.VERSION_4_0).equals(version)) { j2eeSpecComboBox.setSelectedItem(new ProfileItem(Profile.JAKARTA_EE_9_FULL)); + } else if(new BigDecimal(org.netbeans.modules.j2ee.dd.api.ejb.EjbJar.VERSION_4_1).equals(version)) { + j2eeSpecComboBox.setSelectedItem(new ProfileItem(Profile.JAKARTA_EE_12_FULL)); } } catch (IOException e) { String message = NbBundle.getMessage(ProjectServerPanel.class, "MSG_EjbJarXmlCorrupted"); // NOI18N @@ -988,6 +995,8 @@ private void checkACXmlJ2eeVersion(FileObject appClientXML) { j2eeSpecComboBox.setSelectedItem(new ProfileItem(Profile.JAKARTA_EE_10_FULL)); } else if(new BigDecimal(org.netbeans.modules.j2ee.dd.api.client.AppClient.VERSION_11_0).equals(version)) { j2eeSpecComboBox.setSelectedItem(new ProfileItem(Profile.JAKARTA_EE_11_FULL)); + } else if(new BigDecimal(org.netbeans.modules.j2ee.dd.api.client.AppClient.VERSION_12_0).equals(version)) { + j2eeSpecComboBox.setSelectedItem(new ProfileItem(Profile.JAKARTA_EE_12_FULL)); } } catch (IOException e) { String message = NbBundle.getMessage(ProjectServerPanel.class, "MSG_AppClientXmlCorrupted"); // NOI18N diff --git a/enterprise/javaee.specs.support/nbproject/org-netbeans-modules-javaee-specs-support.sig b/enterprise/javaee.specs.support/nbproject/org-netbeans-modules-javaee-specs-support.sig index 54c6951164cc..9ce2ca99a261 100644 --- a/enterprise/javaee.specs.support/nbproject/org-netbeans-modules-javaee-specs-support.sig +++ b/enterprise/javaee.specs.support/nbproject/org-netbeans-modules-javaee-specs-support.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 1.56 +#Version 1.57 CLSS public abstract interface java.io.Serializable @@ -170,6 +170,7 @@ meth public boolean isJpa2Supported() meth public boolean isJpa30Supported() meth public boolean isJpa31Supported() meth public boolean isJpa32Supported() +meth public boolean isJpa40Supported() meth public java.lang.String getClassName() supr java.lang.Object hfds impl @@ -222,7 +223,7 @@ meth public abstract java.lang.String activationConfigProperty() CLSS public final org.netbeans.modules.javaee.specs.support.spi.JpaProviderFactory cons public init() innr public abstract static Accessor -meth public static org.netbeans.modules.javaee.specs.support.api.JpaProvider createJpaProvider(java.lang.String,boolean,boolean,boolean,boolean,boolean,boolean,boolean,boolean) +meth public static org.netbeans.modules.javaee.specs.support.api.JpaProvider createJpaProvider(java.lang.String,boolean,boolean,boolean,boolean,boolean,boolean,boolean,boolean,boolean) meth public static org.netbeans.modules.javaee.specs.support.api.JpaProvider createJpaProvider(org.netbeans.modules.javaee.specs.support.spi.JpaProviderImplementation) supr java.lang.Object @@ -244,6 +245,7 @@ meth public abstract boolean isJpa2Supported() meth public abstract boolean isJpa30Supported() meth public abstract boolean isJpa31Supported() meth public abstract boolean isJpa32Supported() +meth public abstract boolean isJpa40Supported() meth public abstract java.lang.String getClassName() CLSS public abstract interface org.netbeans.modules.javaee.specs.support.spi.JpaSupportImplementation diff --git a/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/api/JpaProvider.java b/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/api/JpaProvider.java index b2b37eaf8238..8fa01db37871 100644 --- a/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/api/JpaProvider.java +++ b/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/api/JpaProvider.java @@ -70,6 +70,10 @@ public boolean isJpa31Supported() { public boolean isJpa32Supported() { return impl.isJpa32Supported(); } + + public boolean isJpa40Supported() { + return impl.isJpa40Supported(); + } public boolean isDefault() { return impl.isDefault(); diff --git a/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/bridge/BridgingJpaSupportImpl.java b/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/bridge/BridgingJpaSupportImpl.java index 5cabb0e6bcea..ab903f7d02fb 100644 --- a/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/bridge/BridgingJpaSupportImpl.java +++ b/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/bridge/BridgingJpaSupportImpl.java @@ -55,7 +55,7 @@ public JpaProvider getDefaultProvider() { @Override public Set getProviders() { - Set result = new HashSet(); + Set result = new HashSet<>(); boolean check = platform.isToolSupported(JPAModuleInfo.JPACHECKSUPPORTED); boolean jpa1 = !check || platform.isToolSupported(JPAModuleInfo.JPAVERSIONPREFIX + Persistence.VERSION_1_0); @@ -71,6 +71,8 @@ public Set getProviders() { || platform.isToolSupported(JPAModuleInfo.JPAVERSIONPREFIX + Persistence.VERSION_3_1); boolean jpa32 = !check || platform.isToolSupported(JPAModuleInfo.JPAVERSIONPREFIX + Persistence.VERSION_3_2); + boolean jpa40 = !check + || platform.isToolSupported(JPAModuleInfo.JPAVERSIONPREFIX + Persistence.VERSION_4_0); for (Map.Entry entry : getPossibleContainerProviders().entrySet()) { Provider provider = entry.getKey(); @@ -78,14 +80,14 @@ public Set getProviders() { JpaProvider jpaProvider = JpaProviderFactory.createJpaProvider( provider.getProviderClass(), platform.isToolSupported(entry.getValue()), - jpa1, jpa2, jpa21, jpa22, jpa30, jpa31, jpa32); + jpa1, jpa2, jpa21, jpa22, jpa30, jpa31, jpa32, jpa40); result.add(jpaProvider); } } return result; } - // TODO: Add missing JPA 3.x providers + // TODO: Add missing JPA 4.0 providers private static Map getPossibleContainerProviders() { Map candidates = new HashMap<>(); candidates.put(ProviderUtil.HIBERNATE_PROVIDER1_0, "hibernatePersistenceProviderIsDefault1.0"); // NOI18N diff --git a/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/spi/JpaProviderFactory.java b/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/spi/JpaProviderFactory.java index 4610185dcd34..9d4c7cd60230 100644 --- a/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/spi/JpaProviderFactory.java +++ b/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/spi/JpaProviderFactory.java @@ -31,10 +31,24 @@ public static JpaProvider createJpaProvider(JpaProviderImplementation impl) { return Accessor.getDefault().createJpaProvider(impl); } + /** + * + * @param className + * @param isDefault + * @param isJpa1Supported + * @param isJpa2Supported + * @param isJpa21Supported + * @param isJpa22Supported + * @param isJpa30Supported + * @param isJpa31Supported + * @param isJpa32Supported + * @param isJpa40Supported + * @return + */ public static JpaProvider createJpaProvider(final String className, final boolean isDefault, final boolean isJpa1Supported, final boolean isJpa2Supported, final boolean isJpa21Supported, final boolean isJpa22Supported, final boolean isJpa30Supported, final boolean isJpa31Supported, - final boolean isJpa32Supported) { + final boolean isJpa32Supported, final boolean isJpa40Supported) { return Accessor.getDefault().createJpaProvider(new JpaProviderImplementation() { @Override @@ -72,6 +86,11 @@ public boolean isJpa32Supported() { return isJpa32Supported; } + @Override + public boolean isJpa40Supported() { + return isJpa40Supported; + } + @Override public boolean isDefault() { return isDefault; @@ -100,7 +119,7 @@ public static Accessor getDefault() { return accessor; } - Class c = JpaProvider.class; + Class c = JpaProvider.class; try { Class.forName(c.getName(), true, Accessor.class.getClassLoader()); } catch (ClassNotFoundException cnf) { diff --git a/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/spi/JpaProviderImplementation.java b/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/spi/JpaProviderImplementation.java index 87208738f972..9ead01d5e5f7 100644 --- a/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/spi/JpaProviderImplementation.java +++ b/enterprise/javaee.specs.support/src/org/netbeans/modules/javaee/specs/support/spi/JpaProviderImplementation.java @@ -38,6 +38,12 @@ public interface JpaProviderImplementation { boolean isJpa32Supported(); + /** + * JPA 4.0 is supported by Jakarta EE 12 + * @return true if JPA 4.0 is supported + */ + boolean isJpa40Supported(); + boolean isDefault(); String getClassName(); diff --git a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/JpaSupportImpl.java b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/JpaSupportImpl.java index 863f9166545a..fc12c6648c2b 100644 --- a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/JpaSupportImpl.java +++ b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/JpaSupportImpl.java @@ -38,25 +38,28 @@ public JpaSupportImpl(WildflyJ2eePlatformFactory.J2eePlatformImplImpl platformIm @Override public JpaProvider getDefaultProvider() { String defaultProvider = platformImpl.getDefaultJpaProvider(); - return JpaProviderFactory.createJpaProvider(defaultProvider, true, true, true, true, true, true, true, true); + final boolean isDefault = true; + final boolean isJpa10 = true, isJpa20 = true, isJpa21 = true, isJpa22 = true; + final boolean isJpa30 = true, isJpa31 = true, isJpa32 = true, isJpa40 = true; + return JpaProviderFactory.createJpaProvider(defaultProvider, isDefault, + isJpa10, isJpa20, isJpa21, isJpa22, isJpa30, isJpa31, isJpa32, isJpa40); } @Override public Set getProviders() { String defaultProvider = platformImpl.getDefaultJpaProvider(); - boolean jpa2 = true; - Set providers = new HashSet(); + Set providers = new HashSet<>(); if (platformImpl.containsPersistenceProvider(WildflyJ2eePlatformFactory.HIBERNATE_JPA_PROVIDER)) { providers.add(JpaProviderFactory.createJpaProvider(WildflyJ2eePlatformFactory.HIBERNATE_JPA_PROVIDER, - WildflyJ2eePlatformFactory.HIBERNATE_JPA_PROVIDER.equals(defaultProvider), true, jpa2, true, true, true, true, true)); + WildflyJ2eePlatformFactory.HIBERNATE_JPA_PROVIDER.equals(defaultProvider), true, true, true, true, true, true, true, true)); } if (platformImpl.containsPersistenceProvider(WildflyJ2eePlatformFactory.TOPLINK_JPA_PROVIDER)) { providers.add(JpaProviderFactory.createJpaProvider(WildflyJ2eePlatformFactory.TOPLINK_JPA_PROVIDER, - WildflyJ2eePlatformFactory.TOPLINK_JPA_PROVIDER.equals(defaultProvider), true, false, false, false, false, false, false)); + WildflyJ2eePlatformFactory.TOPLINK_JPA_PROVIDER.equals(defaultProvider), true, false, false, false, false, false, false, false)); } if (platformImpl.containsPersistenceProvider(WildflyJ2eePlatformFactory.KODO_JPA_PROVIDER)) { providers.add(JpaProviderFactory.createJpaProvider(WildflyJ2eePlatformFactory.KODO_JPA_PROVIDER, - WildflyJ2eePlatformFactory.KODO_JPA_PROVIDER.equals(defaultProvider), true, false, false, false, false, false, false)); + WildflyJ2eePlatformFactory.KODO_JPA_PROVIDER.equals(defaultProvider), true, false, false, false, false, false, false, false)); } return providers; } diff --git a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/WildflyJ2eePlatformFactory.java b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/WildflyJ2eePlatformFactory.java index be40e1ece72e..026ba13bf5eb 100644 --- a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/WildflyJ2eePlatformFactory.java +++ b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/WildflyJ2eePlatformFactory.java @@ -112,13 +112,14 @@ public static class J2eePlatformImplImpl extends J2eePlatformImpl2 { WILDFLY_PROFILES.add(Profile.JAVA_EE_8_FULL); WILDFLY_PROFILES.add(Profile.JAKARTA_EE_8_FULL); } - private static final Set JAKARTAEE_FULL_PROFILES = new HashSet<>(8); + private static final Set JAKARTAEE_FULL_PROFILES = new HashSet<>(16); static { JAKARTAEE_FULL_PROFILES.add(Profile.JAKARTA_EE_9_FULL); JAKARTAEE_FULL_PROFILES.add(Profile.JAKARTA_EE_9_1_FULL); JAKARTAEE_FULL_PROFILES.add(Profile.JAKARTA_EE_10_FULL); JAKARTAEE_FULL_PROFILES.add(Profile.JAKARTA_EE_11_FULL); + JAKARTAEE_FULL_PROFILES.add(Profile.JAKARTA_EE_12_FULL); } private static final Set EAP6_PROFILES = new HashSet<>(4); @@ -138,15 +139,17 @@ public static class J2eePlatformImplImpl extends J2eePlatformImpl2 { WILDFLY_WEB_PROFILES.add(Profile.JAKARTA_EE_9_1_WEB); WILDFLY_WEB_PROFILES.add(Profile.JAKARTA_EE_10_WEB); WILDFLY_WEB_PROFILES.add(Profile.JAKARTA_EE_11_WEB); + WILDFLY_WEB_PROFILES.add(Profile.JAKARTA_EE_12_WEB); } - private static final Set JAKARTAEE_WEB_PROFILES = new HashSet<>(8); + private static final Set JAKARTAEE_WEB_PROFILES = new HashSet<>(16); static { JAKARTAEE_WEB_PROFILES.add(Profile.JAKARTA_EE_9_WEB); JAKARTAEE_WEB_PROFILES.add(Profile.JAKARTA_EE_9_1_WEB); JAKARTAEE_WEB_PROFILES.add(Profile.JAKARTA_EE_10_WEB); JAKARTAEE_WEB_PROFILES.add(Profile.JAKARTA_EE_11_WEB); + JAKARTAEE_WEB_PROFILES.add(Profile.JAKARTA_EE_12_WEB); } private LibraryImplementation[] libraries; @@ -321,6 +324,9 @@ public boolean isToolSupported(String toolName) { if ("jpa3.1".equals(toolName)) { // NOI18N return this.properties.isWildfly(); } + if ("jpa4.0".equals(toolName)) { // NOI18N + return this.properties.isWildfly(); + } if ("hibernatePersistenceProviderIsDefault2.0".equals(toolName)) { return true; @@ -351,7 +357,9 @@ private boolean containsJaxWsLibraries() { } boolean containsPersistenceProvider(String providerName) { - return containsService(libraries, "javax.persistence.spi.PersistenceProvider", providerName); + final boolean isJavaEEPersistence = containsService(libraries, "javax.persistence.spi.PersistenceProvider", providerName); + final boolean isJakartaEEPersistence = containsService(libraries, "jakarta.persistence.spi.PersistenceProvider", providerName); + return isJavaEEPersistence || isJakartaEEPersistence; } private static boolean containsService(LibraryImplementation[] libraries, String serviceName, String serviceImplName) { @@ -517,7 +525,8 @@ public Lookup getLookup() { private class JaxRsStackSupportImpl implements JaxRsStackSupportImplementation { - private static final String JAX_RS_APPLICATION_CLASS = "javax.ws.rs.core.Application"; //NOI18N + private static final String JAX_RS_APPLICATION_CLASS_JAVAEE = "javax.ws.rs.core.Application"; //NOI18N + private static final String JAX_RS_APPLICATION_CLASS_JAKARTAEE = "jakarta.ws.rs.core.Application"; //NOI18N private final J2eePlatformImplImpl j2eePlatform; JaxRsStackSupportImpl(J2eePlatformImplImpl j2eePlatform) { @@ -526,12 +535,12 @@ private class JaxRsStackSupportImpl implements JaxRsStackSupportImplementation { @Override public boolean addJsr311Api(Project project) { - return isBundled(JAX_RS_APPLICATION_CLASS); + return isBundled(JAX_RS_APPLICATION_CLASS_JAVAEE) || isBundled(JAX_RS_APPLICATION_CLASS_JAKARTAEE); } @Override public boolean extendsJerseyProjectClasspath(Project project) { - return isBundled(JAX_RS_APPLICATION_CLASS); + return isBundled(JAX_RS_APPLICATION_CLASS_JAVAEE) || isBundled(JAX_RS_APPLICATION_CLASS_JAKARTAEE); } @Override diff --git a/enterprise/maven.j2ee/nbproject/project.properties b/enterprise/maven.j2ee/nbproject/project.properties index 5f9e836dbcef..5b10422d7663 100644 --- a/enterprise/maven.j2ee/nbproject/project.properties +++ b/enterprise/maven.j2ee/nbproject/project.properties @@ -18,5 +18,5 @@ is.eager=true javac.compilerargs=-Xlint -Xlint:-serial -Xlint -Xlint:-serial -javac.source=1.8 +javac.release=17 test.config.stableBTD.includes=**/*Test.class diff --git a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/JPAStuffImpl.java b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/JPAStuffImpl.java index b1e0031b24d7..1c66a6ce7a6c 100644 --- a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/JPAStuffImpl.java +++ b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/JPAStuffImpl.java @@ -102,10 +102,11 @@ public Boolean isJPAVersionSupported(String version) { if (platform == null) { return null; } - JpaSupport support = JpaSupport.getInstance(platform); - JpaProvider provider = support.getDefaultProvider(); + JpaSupport _support = JpaSupport.getInstance(platform); + JpaProvider provider = _support.getDefaultProvider(); if (provider != null) { - return (Persistence.VERSION_3_2.equals(version) && provider.isJpa32Supported()) + return (Persistence.VERSION_4_0.equals(version) && provider.isJpa40Supported()) + || (Persistence.VERSION_3_2.equals(version) && provider.isJpa32Supported()) || (Persistence.VERSION_3_1.equals(version) && provider.isJpa31Supported()) || (Persistence.VERSION_3_0.equals(version) && provider.isJpa30Supported()) || (Persistence.VERSION_2_2.equals(version) && provider.isJpa22Supported()) diff --git a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/MavenJsfReferenceImplementationProvider.java b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/MavenJsfReferenceImplementationProvider.java index 707819664363..735a722b662b 100644 --- a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/MavenJsfReferenceImplementationProvider.java +++ b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/MavenJsfReferenceImplementationProvider.java @@ -56,8 +56,9 @@ public class MavenJsfReferenceImplementationProvider implements JsfReferenceImpl map.put(JsfVersion.JSF_2_2, "com.sun.faces:jsf-impl:2.2.20"); map.put(JsfVersion.JSF_2_3, "org.glassfish:jakarta.faces:2.3.21"); map.put(JsfVersion.JSF_3_0, "org.glassfish:jakarta.faces:3.0.5"); - map.put(JsfVersion.JSF_4_0, "org.glassfish:jakarta.faces:4.0.5"); - map.put(JsfVersion.JSF_4_1, "org.glassfish:jakarta.faces:4.1.0-M1"); + map.put(JsfVersion.JSF_4_0, "org.glassfish:jakarta.faces:4.0.14"); + map.put(JsfVersion.JSF_4_1, "org.glassfish:jakarta.faces:4.1.6"); + map.put(JsfVersion.JSF_5_0, "org.glassfish:jakarta.faces:5.0.0-M1"); JSF_VERSION_MAVEN_COORDINATES_MAPPING = Collections.unmodifiableMap(map); } diff --git a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ear/EarImpl.java b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ear/EarImpl.java index e6baefd668f2..bbd05b7e372c 100644 --- a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ear/EarImpl.java +++ b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ear/EarImpl.java @@ -258,13 +258,17 @@ public J2eeModule.Type getModuleType() { @Override public String getModuleVersion() { Profile prf = getJ2eeProfile(); - if (prf == Profile.JAKARTA_EE_11_FULL || prf == Profile.JAKARTA_EE_11_FULL) return Application.VERSION_11; - if (prf == Profile.JAKARTA_EE_10_FULL || prf == Profile.JAKARTA_EE_10_FULL) return Application.VERSION_10; - if (prf == Profile.JAKARTA_EE_9_1_FULL || prf == Profile.JAKARTA_EE_9_FULL) return Application.VERSION_9; - if (prf == Profile.JAKARTA_EE_8_FULL || prf == Profile.JAVA_EE_8_FULL) return Application.VERSION_8; - if (prf == Profile.JAVA_EE_7_FULL) return Application.VERSION_7; - if (prf == Profile.JAVA_EE_6_FULL) return Application.VERSION_6; - if (prf == Profile.JAVA_EE_5) return Application.VERSION_5; + if (null != prf) return switch (prf) { + case JAKARTA_EE_12_FULL -> Application.VERSION_12; + case JAKARTA_EE_11_FULL -> Application.VERSION_11; + case JAKARTA_EE_10_FULL -> Application.VERSION_10; + case JAKARTA_EE_9_1_FULL, JAKARTA_EE_9_FULL -> Application.VERSION_9; + case JAKARTA_EE_8_FULL, JAVA_EE_8_FULL -> Application.VERSION_8; + case JAVA_EE_7_FULL -> Application.VERSION_7; + case JAVA_EE_6_FULL -> Application.VERSION_6; + case JAVA_EE_5 -> Application.VERSION_5; + default -> Application.VERSION_1_4; + }; return Application.VERSION_1_4; } @@ -443,7 +447,7 @@ public J2eeModule[] getModules() { } } } - return toRet.toArray(new J2eeModule[0]); + return toRet.toArray(J2eeModule[]::new); } @Override @@ -759,7 +763,7 @@ private MavenModule[] checkConfiguration(MavenProject prj, Object conf) { } else if ("bundleFileName".equals(param.getName())) { //NOI18N mm.bundleFileName = value; } else if ("excluded".equals(param.getName())) { //NOI18N - mm.excluded = Boolean.valueOf(value); + mm.excluded = Boolean.parseBoolean(value); } } } @@ -769,7 +773,7 @@ private MavenModule[] checkConfiguration(MavenProject prj, Object conf) { } } } - return toRet.toArray(new MavenModule[0]); + return toRet.toArray(MavenModule[]::new); } private static class MavenModule { diff --git a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/customizer/impl/CustomizerRunWeb.java b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/customizer/impl/CustomizerRunWeb.java index 935e59e856ca..e093878eff43 100644 --- a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/customizer/impl/CustomizerRunWeb.java +++ b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/customizer/impl/CustomizerRunWeb.java @@ -114,6 +114,7 @@ public class CustomizerRunWeb extends BaseRunCustomizer { WEB_PROFILES.add(Profile.JAKARTA_EE_9_1_WEB); WEB_PROFILES.add(Profile.JAKARTA_EE_10_WEB); WEB_PROFILES.add(Profile.JAKARTA_EE_11_WEB); + WEB_PROFILES.add(Profile.JAKARTA_EE_12_WEB); FULL_PROFILES = new TreeSet<>(Profile.UI_COMPARATOR); FULL_PROFILES.add(Profile.JAVA_EE_5); @@ -125,10 +126,11 @@ public class CustomizerRunWeb extends BaseRunCustomizer { FULL_PROFILES.add(Profile.JAKARTA_EE_9_1_FULL); FULL_PROFILES.add(Profile.JAKARTA_EE_10_FULL); FULL_PROFILES.add(Profile.JAKARTA_EE_11_FULL); + FULL_PROFILES.add(Profile.JAKARTA_EE_12_FULL); } @Messages({ - "WARNING_ChangingJavaEEVersion=You are changing Java EE version. Please be aware about " + "WARNING_ChangingJavaEEVersion=You are changing Java/Jakarta EE version. Please be aware about " + "possible consequences. Your project might not be deployable anymore if the selected " + "server doesn't support choosen version.

Also note that changing this value doesn't " + "make any changes in your project configuration (pom.xml will still reffer to the original " diff --git a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/EAVisualPanel.java b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/EAVisualPanel.java index eed67c5c326f..f86db2ff7c93 100644 --- a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/EAVisualPanel.java +++ b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/EAVisualPanel.java @@ -101,7 +101,7 @@ void storeSettings(WizardDescriptor d) { Profile profile = helper.getSelectedProfile(); if (profile == null) { - profile = Profile.JAVA_EE_8_FULL; + profile = Profile.JAKARTA_EE_8_FULL; } helper.storeServerSettings(d); diff --git a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/ServerSelectionHelper.java b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/ServerSelectionHelper.java index 7c632790f2cc..745c6011e0bb 100644 --- a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/ServerSelectionHelper.java +++ b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/ServerSelectionHelper.java @@ -155,6 +155,7 @@ private void updatePlatformVersionModel() { // If option was selected, show all supported profiles except Java EE 7 profiles if (ExecutionChecker.DEV_NULL.equals(serverInstance)) { if (J2eeModule.Type.WAR.equals(projectType)) { + profiles.add(Profile.JAKARTA_EE_12_WEB); profiles.add(Profile.JAKARTA_EE_11_WEB); profiles.add(Profile.JAKARTA_EE_10_WEB); profiles.add(Profile.JAKARTA_EE_9_1_WEB); @@ -164,6 +165,7 @@ private void updatePlatformVersionModel() { profiles.add(Profile.JAVA_EE_7_WEB); profiles.add(Profile.JAVA_EE_6_WEB); } else { + profiles.add(Profile.JAKARTA_EE_12_FULL); profiles.add(Profile.JAKARTA_EE_11_FULL); profiles.add(Profile.JAKARTA_EE_10_FULL); profiles.add(Profile.JAKARTA_EE_9_1_FULL); @@ -190,6 +192,7 @@ private void updatePlatformVersionModel() { // We want to have Java EE 6 Full profile for all project types except Web project if (J2eeModule.Type.WAR.equals(projectType)) { + profiles.remove(Profile.JAKARTA_EE_12_FULL); profiles.remove(Profile.JAKARTA_EE_11_FULL); profiles.remove(Profile.JAKARTA_EE_10_FULL); profiles.remove(Profile.JAKARTA_EE_9_1_FULL); @@ -199,6 +202,7 @@ private void updatePlatformVersionModel() { profiles.remove(Profile.JAVA_EE_7_FULL); profiles.remove(Profile.JAVA_EE_6_FULL); } else { + profiles.remove(Profile.JAKARTA_EE_12_WEB); profiles.remove(Profile.JAKARTA_EE_11_WEB); profiles.remove(Profile.JAKARTA_EE_10_WEB); profiles.remove(Profile.JAKARTA_EE_9_1_WEB); diff --git a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/archetype/BaseJ2eeArchetypeProvider.java b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/archetype/BaseJ2eeArchetypeProvider.java index 5f673b20898d..24388f7c0a77 100755 --- a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/archetype/BaseJ2eeArchetypeProvider.java +++ b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/archetype/BaseJ2eeArchetypeProvider.java @@ -106,6 +106,11 @@ protected void addSameMojoArchetypeForAllProfiles(String version, String artifac NbBundle.getMessage(BaseJ2eeArchetypeProvider.class,"mvn.archetypeGroupId.JakartaEE11_0"), NbBundle.getMessage(BaseJ2eeArchetypeProvider.class,"mvn.archetypeVersion.JakartaEE11_0"), NbBundle.getMessage(BaseJ2eeArchetypeProvider.class,"mvn.archetypeArtifactId.JakartaEE11_0")); + + Archetype jakartaEE12_0Archetype = createArchetype( + NbBundle.getMessage(BaseJ2eeArchetypeProvider.class,"mvn.archetypeGroupId.JakartaEE12_0"), + NbBundle.getMessage(BaseJ2eeArchetypeProvider.class,"mvn.archetypeVersion.JakartaEE12_0"), + NbBundle.getMessage(BaseJ2eeArchetypeProvider.class,"mvn.archetypeArtifactId.JakartaEE12_0")); map.put(Profile.JAVA_EE_8_FULL, javaEE8Archetype); map.put(Profile.JAVA_EE_8_WEB, javaEE8Archetype); @@ -119,6 +124,8 @@ protected void addSameMojoArchetypeForAllProfiles(String version, String artifac map.put(Profile.JAKARTA_EE_10_WEB, jakartaEE10_0Archetype); map.put(Profile.JAKARTA_EE_11_FULL, jakartaEE11_0Archetype); map.put(Profile.JAKARTA_EE_11_WEB, jakartaEE11_0Archetype); + map.put(Profile.JAKARTA_EE_12_FULL, jakartaEE12_0Archetype); + map.put(Profile.JAKARTA_EE_12_WEB, jakartaEE12_0Archetype); } private Archetype createMojoArchetype(String version, String artifactId) { diff --git a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/archetype/Bundle.properties b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/archetype/Bundle.properties index acdb31543fe2..7267d45f0358 100644 --- a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/archetype/Bundle.properties +++ b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/archetype/Bundle.properties @@ -16,6 +16,9 @@ # under the License. # Maven Archetype Properties +mvn.archetypeGroupId.JakartaEE12_0=io.github.juneau001 +mvn.archetypeVersion.JakartaEE12_0=1.0.0 +mvn.archetypeArtifactId.JakartaEE12_0=webapp-jakartaee12 mvn.archetypeGroupId.JakartaEE11_0=io.github.juneau001 mvn.archetypeVersion.JakartaEE11_0=1.0.0 mvn.archetypeArtifactId.JakartaEE11_0=webapp-jakartaee11 diff --git a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/archetype/J2eeArchetypeFactory.java b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/archetype/J2eeArchetypeFactory.java index 1e02f73856a0..301f30faf528 100755 --- a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/archetype/J2eeArchetypeFactory.java +++ b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ui/wizard/archetype/J2eeArchetypeFactory.java @@ -74,7 +74,7 @@ public Archetype findArchetypeFor(J2eeModule.Type projectType, Profile profile) // Such situation might happened if user wants to create project with server that // doesn't support any of EE version we supported in NetBeans (e.g. Tomcat 5.5) if (profile == null) { - profile = Profile.J2EE_14; + profile = Profile.JAKARTA_EE_8_FULL; } return getProvider(projectType).getArchetypeFor(profile); } @@ -90,6 +90,7 @@ public Map getArchetypeMap(J2eeModule.Type projectType) { private static class AppClientArchetypes extends BaseJ2eeArchetypeProvider { @Override protected void setUpProjectArchetypes() { + addJakartaEEArchetype(Profile.JAKARTA_EE_12_FULL,"mvn.archetypeGroupId.JakartaEE12_0","mvn.archetypeVersion.JakartaEE12_0","mvn.archetypeArtifactId.JakartaEE12_0"); addJakartaEEArchetype(Profile.JAKARTA_EE_11_FULL,"mvn.archetypeGroupId.JakartaEE11_0","mvn.archetypeVersion.JakartaEE11_0","mvn.archetypeArtifactId.JakartaEE11_0"); addJakartaEEArchetype(Profile.JAKARTA_EE_10_FULL,"mvn.archetypeGroupId.JakartaEE10_0","mvn.archetypeVersion.JakartaEE10_0","mvn.archetypeArtifactId.JakartaEE10_0"); addJakartaEEArchetype(Profile.JAKARTA_EE_9_1_FULL,"mvn.archetypeGroupId.JakartaEE9_1","mvn.archetypeVersion.JakartaEE9_1","mvn.archetypeArtifactId.JakartaEE9_1"); @@ -106,6 +107,7 @@ protected void setUpProjectArchetypes() { private static class EaArchetypes extends BaseJ2eeArchetypeProvider { @Override protected void setUpProjectArchetypes() { + addJakartaEEArchetype(Profile.JAKARTA_EE_12_FULL,"mvn.archetypeGroupId.JakartaEE12_0","mvn.archetypeVersion.JakartaEE12_0","mvn.archetypeArtifactId.JakartaEE12_0"); addJakartaEEArchetype(Profile.JAKARTA_EE_11_FULL,"mvn.archetypeGroupId.JakartaEE11_0","mvn.archetypeVersion.JakartaEE11_0","mvn.archetypeArtifactId.JakartaEE11_0"); addJakartaEEArchetype(Profile.JAKARTA_EE_10_FULL,"mvn.archetypeGroupId.JakartaEE10_0","mvn.archetypeVersion.JakartaEE10_0","mvn.archetypeArtifactId.JakartaEE10_0"); addJakartaEEArchetype(Profile.JAKARTA_EE_9_1_FULL,"mvn.archetypeGroupId.JakartaEE9_1","mvn.archetypeVersion.JakartaEE9_1","mvn.archetypeArtifactId.JakartaEE9_1"); @@ -120,6 +122,7 @@ protected void setUpProjectArchetypes() { private static class EarArchetypes extends BaseJ2eeArchetypeProvider { @Override protected void setUpProjectArchetypes() { + addJakartaEEArchetype(Profile.JAKARTA_EE_12_FULL,"mvn.archetypeGroupId.JakartaEE12_0","mvn.archetypeVersion.JakartaEE12_0","mvn.archetypeArtifactId.JakartaEE12_0"); addJakartaEEArchetype(Profile.JAKARTA_EE_11_FULL,"mvn.archetypeGroupId.JakartaEE11_0","mvn.archetypeVersion.JakartaEE11_0","mvn.archetypeArtifactId.JakartaEE11_0"); addJakartaEEArchetype(Profile.JAKARTA_EE_10_FULL,"mvn.archetypeGroupId.JakartaEE10_0","mvn.archetypeVersion.JakartaEE10_0","mvn.archetypeArtifactId.JakartaEE10_0"); addJakartaEEArchetype(Profile.JAKARTA_EE_9_1_FULL,"mvn.archetypeGroupId.JakartaEE9_1","mvn.archetypeVersion.JakartaEE9_1","mvn.archetypeArtifactId.JakartaEE9_1"); @@ -136,6 +139,7 @@ protected void setUpProjectArchetypes() { private static class EjbArchetypes extends BaseJ2eeArchetypeProvider { @Override protected void setUpProjectArchetypes() { + addJakartaEEArchetype(Profile.JAKARTA_EE_12_FULL,"mvn.archetypeGroupId.JakartaEE12_0","mvn.archetypeVersion.JakartaEE12_0","mvn.archetypeArtifactId.JakartaEE12_0"); addJakartaEEArchetype(Profile.JAKARTA_EE_11_FULL,"mvn.archetypeGroupId.JakartaEE11_0","mvn.archetypeVersion.JakartaEE11_0","mvn.archetypeArtifactId.JakartaEE11_0"); addJakartaEEArchetype(Profile.JAKARTA_EE_10_FULL,"mvn.archetypeGroupId.JakartaEE10_0","mvn.archetypeVersion.JakartaEE10_0","mvn.archetypeArtifactId.JakartaEE10_0"); addJakartaEEArchetype(Profile.JAKARTA_EE_9_1_FULL,"mvn.archetypeGroupId.JakartaEE9_1","mvn.archetypeVersion.JakartaEE9_1","mvn.archetypeArtifactId.JakartaEE9_1"); @@ -152,6 +156,7 @@ protected void setUpProjectArchetypes() { private static class WebArchetypes extends BaseJ2eeArchetypeProvider { @Override protected void setUpProjectArchetypes() { + addJakartaEEArchetype(Profile.JAKARTA_EE_12_WEB,"mvn.archetypeGroupId.JakartaEE12_0","mvn.archetypeVersion.JakartaEE12_0","mvn.archetypeArtifactId.JakartaEE12_0"); addJakartaEEArchetype(Profile.JAKARTA_EE_11_WEB,"mvn.archetypeGroupId.JakartaEE11_0","mvn.archetypeVersion.JakartaEE11_0","mvn.archetypeArtifactId.JakartaEE11_0"); addJakartaEEArchetype(Profile.JAKARTA_EE_10_WEB,"mvn.archetypeGroupId.JakartaEE10_0","mvn.archetypeVersion.JakartaEE10_0","mvn.archetypeArtifactId.JakartaEE10_0"); addJakartaEEArchetype(Profile.JAKARTA_EE_9_1_WEB,"mvn.archetypeGroupId.JakartaEE9_1","mvn.archetypeVersion.JakartaEE9_1","mvn.archetypeArtifactId.JakartaEE9_1"); @@ -167,6 +172,7 @@ protected void setUpProjectArchetypes() { // using Java EE 6 Full profile, then the same profile applies to Ejb, Web and Parent project creation - In that case // application is looking for Java EE 6 Full archetype to create the Web project with it, so we need to have it here // or otherwise Java EE project would not be created properly + addJakartaEEArchetype(Profile.JAKARTA_EE_12_FULL,"mvn.archetypeGroupId.JakartaEE12_0","mvn.archetypeVersion.JakartaEE12_0","mvn.archetypeArtifactId.JakartaEE12_0"); addJakartaEEArchetype(Profile.JAKARTA_EE_11_FULL,"mvn.archetypeGroupId.JakartaEE11_0","mvn.archetypeVersion.JakartaEE11_0","mvn.archetypeArtifactId.JakartaEE11_0"); addJakartaEEArchetype(Profile.JAKARTA_EE_10_FULL,"mvn.archetypeGroupId.JakartaEE10_0","mvn.archetypeVersion.JakartaEE10_0","mvn.archetypeArtifactId.JakartaEE10_0"); addJakartaEEArchetype(Profile.JAKARTA_EE_9_1_FULL,"mvn.archetypeGroupId.JakartaEE9_1","mvn.archetypeVersion.JakartaEE9_1","mvn.archetypeArtifactId.JakartaEE9_1"); diff --git a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/web/WebModuleImpl.java b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/web/WebModuleImpl.java index a2e7324cffe9..21cf503295cb 100644 --- a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/web/WebModuleImpl.java +++ b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/web/WebModuleImpl.java @@ -23,11 +23,9 @@ import java.io.IOException; import java.net.URI; import java.util.ArrayList; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import java.util.TreeMap; import org.apache.maven.model.Dependency; import org.apache.maven.project.MavenProject; import org.netbeans.api.j2ee.core.Profile; @@ -137,31 +135,18 @@ public Profile getJ2eeProfile() { if (pomProfile != null) { // If might happened in cases when WAR project uses Java EE full stack // Simply return corresponding Web profile until #232478 will be resolved - if (Profile.JAVA_EE_6_FULL.equals(pomProfile)) { - return Profile.JAVA_EE_6_WEB; - } - if (Profile.JAVA_EE_7_FULL.equals(pomProfile)) { - return Profile.JAVA_EE_7_WEB; - } - if (Profile.JAVA_EE_8_FULL.equals(pomProfile)) { - return Profile.JAVA_EE_8_WEB; - } - if (Profile.JAKARTA_EE_8_FULL.equals(pomProfile)) { - return Profile.JAKARTA_EE_8_WEB; - } - if (Profile.JAKARTA_EE_9_FULL.equals(pomProfile)) { - return Profile.JAKARTA_EE_9_WEB; - } - if (Profile.JAKARTA_EE_9_1_FULL.equals(pomProfile)) { - return Profile.JAKARTA_EE_9_1_WEB; - } - if (Profile.JAKARTA_EE_10_FULL.equals(pomProfile)) { - return Profile.JAKARTA_EE_10_WEB; - } - if (Profile.JAKARTA_EE_11_FULL.equals(pomProfile)) { - return Profile.JAKARTA_EE_11_WEB; - } - return pomProfile; + return switch (pomProfile) { + case JAVA_EE_6_FULL -> Profile.JAVA_EE_6_WEB; + case JAVA_EE_7_FULL -> Profile.JAVA_EE_7_WEB; + case JAVA_EE_8_FULL -> Profile.JAVA_EE_8_WEB; + case JAKARTA_EE_8_FULL -> Profile.JAKARTA_EE_8_WEB; + case JAKARTA_EE_9_FULL -> Profile.JAKARTA_EE_9_WEB; + case JAKARTA_EE_9_1_FULL -> Profile.JAKARTA_EE_9_1_WEB; + case JAKARTA_EE_10_FULL -> Profile.JAKARTA_EE_10_WEB; + case JAKARTA_EE_11_FULL -> Profile.JAKARTA_EE_11_WEB; + case JAKARTA_EE_12_FULL -> Profile.JAKARTA_EE_12_WEB; + default -> pomProfile; + }; } Profile descriptorProfile = getProfileFromDescriptor(); @@ -204,6 +189,9 @@ private Profile getProfileFromDescriptor() { if (WebApp.VERSION_6_1.equals(waVersion)) { return Profile.JAKARTA_EE_11_WEB; } + if (WebApp.VERSION_6_2.equals(waVersion)) { + return Profile.JAKARTA_EE_12_WEB; + } } catch (IOException exc) { ErrorManager.getDefault().notify(exc); } @@ -229,25 +217,27 @@ private Profile getProfileFromDescriptor() { * *

*/ - private static Map> javaEEMap = new LinkedHashMap<>(); + private static Map> javaEEMap = new LinkedHashMap<>(32); static { - List javaEE5 = new ArrayList<>(); - List javaEE6Web = new ArrayList<>(); - List javaEE6Full = new ArrayList<>(); - List javaEE7Web = new ArrayList<>(); - List javaEE7Full = new ArrayList<>(); - List javaEE8Web = new ArrayList<>(); - List javaEE8Full = new ArrayList<>(); - List jakartaEE8Web = new ArrayList<>(); - List jakartaEE8Full = new ArrayList<>(); - List jakartaEE9Web = new ArrayList<>(); - List jakartaEE9Full = new ArrayList<>(); - List jakartaEE91Web = new ArrayList<>(); - List jakartaEE91Full = new ArrayList<>(); - List jakartaEE10Web = new ArrayList<>(); - List jakartaEE10Full = new ArrayList<>(); - List jakartaEE11Web = new ArrayList<>(); - List jakartaEE11Full = new ArrayList<>(); + List javaEE5 = new ArrayList<>(16); + List javaEE6Web = new ArrayList<>(8); + List javaEE6Full = new ArrayList<>(8); + List javaEE7Web = new ArrayList<>(8); + List javaEE7Full = new ArrayList<>(8); + List javaEE8Web = new ArrayList<>(8); + List javaEE8Full = new ArrayList<>(8); + List jakartaEE8Web = new ArrayList<>(8); + List jakartaEE8Full = new ArrayList<>(8); + List jakartaEE9Web = new ArrayList<>(8); + List jakartaEE9Full = new ArrayList<>(8); + List jakartaEE91Web = new ArrayList<>(8); + List jakartaEE91Full = new ArrayList<>(8); + List jakartaEE10Web = new ArrayList<>(8); + List jakartaEE10Full = new ArrayList<>(8); + List jakartaEE11Web = new ArrayList<>(8); + List jakartaEE11Full = new ArrayList<>(8); + List jakartaEE12Web = new ArrayList<>(8); + List jakartaEE12Full = new ArrayList<>(8); // Java EE specification javaEE5.add(new DependencyDesc("javaee", "javaee-api", "5.0")); @@ -258,16 +248,18 @@ private Profile getProfileFromDescriptor() { javaEE7Web.add(new DependencyDesc("javax", "javaee-web-api", "7.0")); javaEE8Full.add(new DependencyDesc("javax", "javaee-api", "8.0")); javaEE8Web.add(new DependencyDesc("javax", "javaee-web-api", "8.0")); - jakartaEE8Web.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-api","8.0.0")); - jakartaEE8Full.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-web-api","8.0.0")); - jakartaEE9Web.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-api","9.0.0")); - jakartaEE9Full.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-web-api","9.0.0")); - jakartaEE91Web.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-api","9.1.0")); - jakartaEE91Full.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-web-api","9.1.0")); - jakartaEE10Web.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-api","10.0.0")); - jakartaEE10Full.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-web-api","10.0.0")); - jakartaEE11Web.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-api","11.0.0-M1")); - jakartaEE11Full.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-web-api","11.0.0-M1")); + jakartaEE8Web.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-web-api","8.0.0")); + jakartaEE8Full.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-api","8.0.0")); + jakartaEE9Web.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-web-api","9.0.0")); + jakartaEE9Full.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-api","9.0.0")); + jakartaEE91Web.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-web-api","9.1.0")); + jakartaEE91Full.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-api","9.1.0")); + jakartaEE10Web.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-web-api","10.0.0")); + jakartaEE10Full.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-api","10.0.0")); + jakartaEE11Web.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-web-api","11.0.0")); + jakartaEE11Full.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-api","11.0.0")); + jakartaEE12Web.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-web-api","12.0.0-M1")); + jakartaEE12Full.add(new DependencyDesc("jakarta.platform","jakarta.jakartaee-api","12.0.0-M1")); // GlassFish implementations javaEE5.add(new DependencyDesc("org.glassfish.main.extras", "glassfish-embedded-all", "2")); @@ -288,8 +280,10 @@ private Profile getProfileFromDescriptor() { jakartaEE91Web.add(new DependencyDesc("org.glassfish.main.extras", "glassfish-embedded-web", "6.2.5")); jakartaEE10Full.add(new DependencyDesc("org.glassfish.main.extras", "glassfish-embedded-all", "7.0.11")); jakartaEE10Web.add(new DependencyDesc("org.glassfish.main.extras", "glassfish-embedded-web", "7.0.11")); - jakartaEE11Full.add(new DependencyDesc("org.glassfish.main.extras", "glassfish-embedded-all", "8.0.0-M1")); - jakartaEE11Web.add(new DependencyDesc("org.glassfish.main.extras", "glassfish-embedded-web", "8.0.0-M1")); + jakartaEE11Full.add(new DependencyDesc("org.glassfish.main.extras", "glassfish-embedded-all", "8.0.0")); + jakartaEE11Web.add(new DependencyDesc("org.glassfish.main.extras", "glassfish-embedded-web", "8.0.0")); + jakartaEE12Full.add(new DependencyDesc("org.glassfish.main.extras", "glassfish-embedded-all", "9.0.0-M1")); + jakartaEE12Web.add(new DependencyDesc("org.glassfish.main.extras", "glassfish-embedded-web", "9.0.0-M1")); // WebLogic implementations @@ -312,6 +306,8 @@ private Profile getProfileFromDescriptor() { jakartaEE8Full.add(new DependencyDesc("org.jboss.spec", "jboss-jakartaee-all-8.0", null)); jakartaEE8Web.add(new DependencyDesc("org.jboss.spec", "jboss-jakartaee-web-8.0", null)); + javaEEMap.put(Profile.JAKARTA_EE_12_FULL, jakartaEE12Full); + javaEEMap.put(Profile.JAKARTA_EE_12_WEB, jakartaEE12Web); javaEEMap.put(Profile.JAKARTA_EE_11_FULL, jakartaEE11Full); javaEEMap.put(Profile.JAKARTA_EE_11_WEB, jakartaEE11Web); javaEEMap.put(Profile.JAKARTA_EE_10_FULL, jakartaEE10Full); diff --git a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/web/WebRecoPrivTemplates.java b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/web/WebRecoPrivTemplates.java index 8e0fb3a50170..298ae841284a 100644 --- a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/web/WebRecoPrivTemplates.java +++ b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/web/WebRecoPrivTemplates.java @@ -96,7 +96,14 @@ public WebRecoPrivTemplates(Project project) { "ejb-types_3_2", // NOI18N "ejb-deployment-descriptor", // NOI18N }; - + + private static final String[] WEB_TYPES_EJB41_LITE = new String[] { + "ejb-types", // NOI18N + "ejb-types_3_0", // NOI18N + "ejb-types_3_1", // NOI18N + "ejb-types_3_2", // NOI18N + "ejb-deployment-descriptor", // NOI18N + }; private static final String[] WEB_PRIVILEGED_NAMES = new String[] { "Templates/JSP_Servlet/JSP.jsp", // NOI18N @@ -154,6 +161,8 @@ public String[] getRecommendedTypes() { toRet.addAll(Arrays.asList(WEB_TYPES_EJB32_LITE)); } else if (cap.isEjb31LiteSupported()) { toRet.addAll(Arrays.asList(WEB_TYPES_EJB_LITE)); + } else if (cap.isEjb41LiteSupported()) { + toRet.addAll(Arrays.asList(WEB_TYPES_EJB41_LITE)); } } return toRet.toArray(new String[0]); @@ -180,7 +189,7 @@ public String[] getPrivilegedTemplates() { if (cap.isEjb31LiteSupported()) { toRet.addAll(Arrays.asList(WEB_PRIVILEGED_NAMES_EE6_WEB)); } - if (cap.isEjb32LiteSupported() || cap.isEjb40LiteSupported()) { + if (cap.isEjb32LiteSupported() || cap.isEjb40LiteSupported() || cap.isEjb41LiteSupported()) { toRet.addAll(Arrays.asList(WEB_PRIVILEGED_NAMES_EE7_WEB)); } } @@ -191,13 +200,9 @@ public String[] getPrivilegedTemplates() { } private boolean isServerSupportingEJB31() { - if (ProjectUtil.getSupportedProfiles(project).contains(Profile.JAVA_EE_6_FULL) + return ProjectUtil.getSupportedProfiles(project).contains(Profile.JAVA_EE_6_FULL) || ProjectUtil.getSupportedProfiles(project).contains(Profile.JAVA_EE_7_FULL) || ProjectUtil.getSupportedProfiles(project).contains(Profile.JAVA_EE_8_FULL) - || ProjectUtil.getSupportedProfiles(project).contains(Profile.JAKARTA_EE_8_FULL)) { - - return true; - } - return false; + || ProjectUtil.getSupportedProfiles(project).contains(Profile.JAKARTA_EE_8_FULL); } } diff --git a/enterprise/maven.j2ee/test/unit/src/org/netbeans/modules/maven/j2ee/JavaEEProjectSettingsImplTest.java b/enterprise/maven.j2ee/test/unit/src/org/netbeans/modules/maven/j2ee/JavaEEProjectSettingsImplTest.java index 6a786e9af48e..088ee1bb8bad 100644 --- a/enterprise/maven.j2ee/test/unit/src/org/netbeans/modules/maven/j2ee/JavaEEProjectSettingsImplTest.java +++ b/enterprise/maven.j2ee/test/unit/src/org/netbeans/modules/maven/j2ee/JavaEEProjectSettingsImplTest.java @@ -51,6 +51,8 @@ public void testJavaEEProjectSettingsInMavenProjects() throws Exception { } public void checkProjectForProfileChange(Project prj) { + JavaEEProjectSettings.setProfile(prj, Profile.JAKARTA_EE_12_FULL); + assertEquals(Profile.JAKARTA_EE_12_FULL, JavaEEProjectSettings.getProfile(prj)); JavaEEProjectSettings.setProfile(prj, Profile.JAKARTA_EE_11_FULL); assertEquals(Profile.JAKARTA_EE_11_FULL, JavaEEProjectSettings.getProfile(prj)); JavaEEProjectSettings.setProfile(prj, Profile.JAKARTA_EE_10_FULL); diff --git a/enterprise/maven.j2ee/test/unit/src/org/netbeans/modules/maven/j2ee/web/WebModuleImplTest.java b/enterprise/maven.j2ee/test/unit/src/org/netbeans/modules/maven/j2ee/web/WebModuleImplTest.java index e70edf752d5a..887ea62f1c91 100644 --- a/enterprise/maven.j2ee/test/unit/src/org/netbeans/modules/maven/j2ee/web/WebModuleImplTest.java +++ b/enterprise/maven.j2ee/test/unit/src/org/netbeans/modules/maven/j2ee/web/WebModuleImplTest.java @@ -151,11 +151,19 @@ public void testGetJ2eeProfile_jakartaEE10WebSpecification() throws IOException } public void testGetJ2eeProfile_warProject_jakartaEE11FullSpecification() throws IOException { - checkJ2eeProfile(Profile.JAKARTA_EE_11_WEB, "jakarta.platform", "jakarta.jakartaee-api", "11.0.0-M1"); //NOI18N + checkJ2eeProfile(Profile.JAKARTA_EE_11_WEB, "jakarta.platform", "jakarta.jakartaee-api", "11.0.0"); //NOI18N } public void testGetJ2eeProfile_jakartaEE11WebSpecification() throws IOException { - checkJ2eeProfile(Profile.JAKARTA_EE_11_WEB, "jakarta.platform", "jakarta.jakartaee-web-api", "11.0.0-M1"); //NOI18N + checkJ2eeProfile(Profile.JAKARTA_EE_11_WEB, "jakarta.platform", "jakarta.jakartaee-web-api", "11.0.0"); //NOI18N + } + + public void testGetJ2eeProfile_warProject_jakartaEE12FullSpecification() throws IOException { + checkJ2eeProfile(Profile.JAKARTA_EE_12_WEB, "jakarta.platform", "jakarta.jakartaee-api", "12.0.0-M1"); //NOI18N + } + + public void testGetJ2eeProfile_jakartaEE12WebSpecification() throws IOException { + checkJ2eeProfile(Profile.JAKARTA_EE_12_WEB, "jakarta.platform", "jakarta.jakartaee-web-api", "12.0.0-M1"); //NOI18N } public void testGetJ2eeProfile_javaEE5Full_glassfish() throws IOException { @@ -223,11 +231,19 @@ public void testGetJ2eeProfile_jakartaEE10Web_glassfish() throws IOException { } public void testGetJ2eeProfile_warProject_jakartaEE11Full_glassfish() throws IOException { - checkJ2eeProfile(Profile.JAKARTA_EE_11_WEB, "org.glassfish.main.extras", "glassfish-embedded-all", "8.0.0-M1"); //NOI18N + checkJ2eeProfile(Profile.JAKARTA_EE_11_WEB, "org.glassfish.main.extras", "glassfish-embedded-all", "8.0.0"); //NOI18N } public void testGetJ2eeProfile_jakartaEE11Web_glassfish() throws IOException { - checkJ2eeProfile(Profile.JAKARTA_EE_11_WEB, "org.glassfish.main.extras", "glassfish-embedded-web", "8.0.0-M1"); //NOI18N + checkJ2eeProfile(Profile.JAKARTA_EE_11_WEB, "org.glassfish.main.extras", "glassfish-embedded-web", "8.0.0"); //NOI18N + } + + public void testGetJ2eeProfile_warProject_jakartaEE12Full_glassfish() throws IOException { + checkJ2eeProfile(Profile.JAKARTA_EE_12_WEB, "org.glassfish.main.extras", "glassfish-embedded-all", "9.0.0-M1"); //NOI18N + } + + public void testGetJ2eeProfile_jakartaEE12Web_glassfish() throws IOException { + checkJ2eeProfile(Profile.JAKARTA_EE_12_WEB, "org.glassfish.main.extras", "glassfish-embedded-web", "9.0.0-M1"); //NOI18N } public void testGetJ2eeProfile_javaEE5_weblogic() throws IOException { diff --git a/enterprise/payara.common/src/org/netbeans/modules/payara/common/ServerDetails.java b/enterprise/payara.common/src/org/netbeans/modules/payara/common/ServerDetails.java index cdb92e7f7cd4..aa419b1c6c68 100644 --- a/enterprise/payara.common/src/org/netbeans/modules/payara/common/ServerDetails.java +++ b/enterprise/payara.common/src/org/netbeans/modules/payara/common/ServerDetails.java @@ -440,6 +440,16 @@ public boolean isEE9Supported() { public boolean isEE10Supported() { throw new UnsupportedOperationException("Not supported yet."); } + + @Override + public boolean isEE11Supported() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isEE12Supported() { + throw new UnsupportedOperationException("Not supported yet."); + } @Override public boolean equalsMajorMinor(PayaraPlatformVersionAPI version) { diff --git a/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/api/config/AppClientVersion.java b/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/api/config/AppClientVersion.java index 72bdfa929669..6dc3411a330c 100644 --- a/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/api/config/AppClientVersion.java +++ b/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/api/config/AppClientVersion.java @@ -88,6 +88,13 @@ public final class AppClientVersion extends J2EEBaseVersion { "11.0", 11000, // NOI18N "11.0", 11000 // NOI18N ); + + /** Represents application-client version 12.0 + */ + public static final AppClientVersion APP_CLIENT_12_0 = new AppClientVersion( + "12.0", 12000, // NOI18N + "12.0", 12000 // NOI18N + ); /** Creates a new instance of AppClientVersion */ @@ -102,6 +109,7 @@ private AppClientVersion(String version, int nv, String specVersion, int nsv) { * than the version passed in as an argument. * @throws ClassCastException if obj is not a AppClientVersion object. */ + @Override public int compareTo(Object obj) { AppClientVersion target = (AppClientVersion) obj; return numericCompare(target); @@ -128,6 +136,8 @@ public static AppClientVersion getAppClientVersion(String version) { result = APP_CLIENT_10_0; } else if(APP_CLIENT_11_0.toString().equals(version)) { result = APP_CLIENT_11_0; + } else if(APP_CLIENT_12_0.toString().equals(version)) { + result = APP_CLIENT_12_0; } return result; diff --git a/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/api/config/ApplicationVersion.java b/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/api/config/ApplicationVersion.java index 07653cfc83ba..825334315d3b 100644 --- a/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/api/config/ApplicationVersion.java +++ b/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/api/config/ApplicationVersion.java @@ -88,6 +88,13 @@ public final class ApplicationVersion extends J2EEBaseVersion { "11.0", 11000, // NOI18N "11.0", 11000 // NOI18N ); + + /** Represents application version 12.0 + */ + public static final ApplicationVersion APPLICATION_12_0 = new ApplicationVersion( + "12.0", 12000, // NOI18N + "12.0", 12000 // NOI18N + ); /** Creates a new instance of ApplicationVersion */ @@ -128,6 +135,8 @@ public static ApplicationVersion getApplicationVersion(String version) { result = APPLICATION_10_0; } else if (APPLICATION_11_0.toString().equals(version)) { result = APPLICATION_11_0; + } else if (APPLICATION_12_0.toString().equals(version)) { + result = APPLICATION_12_0; } return result; diff --git a/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/api/config/J2EEVersion.java b/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/api/config/J2EEVersion.java index 1c27e64674fa..c8960937334a 100644 --- a/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/api/config/J2EEVersion.java +++ b/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/api/config/J2EEVersion.java @@ -103,6 +103,12 @@ public final class J2EEVersion extends J2EEBaseVersion { public static final J2EEVersion JAKARTAEE_11_0 = new J2EEVersion( "11.0.0", 110000, // NOI18N "11.0.0", 110000); // NOI18N + + /** Represents Jakarta EE version 12.0.0 + */ + public static final J2EEVersion JAKARTAEE_12_0 = new J2EEVersion( + "12.0.0", 120000, // NOI18N + "12.0.0", 120000); // NOI18N /* * Implementation @@ -152,6 +158,8 @@ public static J2EEVersion getJ2EEVersion(String version) { result = JAKARTAEE_10_0; } else if (JAKARTAEE_11_0.toString().equals(version)) { result = JAKARTAEE_11_0; + } else if (JAKARTAEE_12_0.toString().equals(version)) { + result = JAKARTAEE_12_0; } return result; diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JavaEEPlatformImpl.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JavaEEPlatformImpl.java index d502a8c5bc91..490d297342e6 100644 --- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JavaEEPlatformImpl.java +++ b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JavaEEPlatformImpl.java @@ -210,6 +210,10 @@ public static Profile[] nbJavaEEProfiles( break; case v11_0_0: profiles[index++] = Profile.JAKARTA_EE_11_FULL; break; + case v12_0_0_web: profiles[index++] = Profile.JAKARTA_EE_12_WEB; + break; + case v12_0_0: profiles[index++] = Profile.JAKARTA_EE_12_FULL; + break; } } else { profiles = new Profile[0]; diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JpaSupportImpl.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JpaSupportImpl.java index 02c61a148f0c..266dfd2376ee 100644 --- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JpaSupportImpl.java +++ b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JpaSupportImpl.java @@ -53,10 +53,12 @@ private static class JpaSupportVector { * @param jpa_3_0 JPA 3.0 supported. * @param jpa_3_1 JPA 3.1 supported. * @param jpa_3_2 JPA 3.2 supported. + * @param jpa_4_0 JPA 4.0 supported. */ JpaSupportVector(boolean jpa_1_0, boolean jpa_2_0, boolean jpa_2_1, boolean jpa_2_2, - boolean jpa_3_0, boolean jpa_3_1, boolean jpa_3_2) { + boolean jpa_3_0, boolean jpa_3_1, + boolean jpa_3_2, boolean jpa_4_0) { _1_0 = jpa_1_0; _2_0 = jpa_2_0; _2_1 = jpa_2_1; @@ -64,6 +66,7 @@ private static class JpaSupportVector { _3_0 = jpa_3_0; _3_1 = jpa_3_1; _3_2 = jpa_3_2; + _4_0 = jpa_4_0; } /** JPA 1.0 supported. */ @@ -83,8 +86,12 @@ private static class JpaSupportVector { /** JPA 3.1 supported. */ boolean _3_1; + /** JPA 3.2 supported. */ boolean _3_2; + + /** JPA 4.0 supported. */ + boolean _4_0; } // Class attributes // @@ -104,7 +111,7 @@ private static class JpaSupportVector { true, true, version.isEE7Supported(), version.isEE8Supported(), version.isEE9Supported(), version.isEE10Supported(), - false + false, false ) ); } @@ -171,7 +178,8 @@ public JpaProvider getDefaultProvider() { JPA_PROVIDER, true, instanceJpaSupport._1_0, instanceJpaSupport._2_0, instanceJpaSupport._2_1, instanceJpaSupport._2_2, instanceJpaSupport._3_0, - instanceJpaSupport._3_1, instanceJpaSupport._3_2); + instanceJpaSupport._3_1, instanceJpaSupport._3_2, + instanceJpaSupport._4_0); } } return defaultProvider; diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/RunTimeDDCatalog.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/RunTimeDDCatalog.java index 9348bad47517..4355b54a9d87 100644 --- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/RunTimeDDCatalog.java +++ b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/RunTimeDDCatalog.java @@ -140,6 +140,7 @@ public class RunTimeDDCatalog extends GrammarQueryManager implements CatalogRead "SCHEMA:http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd" , "ejb-jar_3_1", "SCHEMA:http://xmlns.jcp.org/xml/ns/javaee/ejb-jar_3_2.xsd" , "ejb-jar_3_2", "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/ejb-jar_4_0.xsd" , "ejb-jar_4_0", + "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/ejb-jar_4_1.xsd" , "ejb-jar_4_1", "SCHEMA:http://java.sun.com/xml/ns/j2ee/application-client_1_4.xsd" , "application-client_1_4", "SCHEMA:http://java.sun.com/xml/ns/j2ee/application_1_4.xsd" , "application_1_4", "SCHEMA:http://java.sun.com/xml/ns/javaee/application-client_5.xsd" , "application-client_5", @@ -156,12 +157,15 @@ public class RunTimeDDCatalog extends GrammarQueryManager implements CatalogRead "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/application_10.xsd" , "application_10", "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/application-client_11.xsd" , "application-client_11", "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/application_11.xsd" , "application_11", + "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/application-client_12.xsd" , "application-client_12", + "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/application_12.xsd" , "application_12", "SCHEMA:http://java.sun.com/xml/ns/j2ee/jax-rpc-ri-config.xsd" , "jax-rpc-ri-config", "SCHEMA:http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd" , "connector_1_5", "SCHEMA:http://java.sun.com/xml/ns/javaee/connector_1_6.xsd" , "connector_1_6", "SCHEMA:http://xmlns.jcp.org/xml/ns/javaee/connector_1_7.xsd" , "connector_1_7", "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/connector_2_0.xsd" , "connector_2_0", "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/connector_2_1.xsd" , "connector_2_1", + "SCHEMA:https://jakarta.ee/xml/ns/jakartaee/connector_2_2.xsd" , "connector_2_2", //"SCHEMA:http://java.sun.com/xml/ns/j2ee/jsp_2_0.xsd" , "jsp_2_0.xsd", //"SCHEMA:http://java.sun.com/xml/ns/j2ee/datatypes.dtd" , "datatypes", //"SCHEMA:http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" , "web-app_2_4", @@ -185,12 +189,14 @@ public class RunTimeDDCatalog extends GrammarQueryManager implements CatalogRead "SCHEMA:https://jakarta.ee/xml/ns/persistence/orm/orm_3_0.xsd" , "orm_3_0", "SCHEMA:https://jakarta.ee/xml/ns/persistence/orm/orm_3_1.xsd" , "orm_3_1", "SCHEMA:https://jakarta.ee/xml/ns/persistence/orm/orm_3_2.xsd" , "orm_3_2", + "SCHEMA:https://jakarta.ee/xml/ns/persistence/orm/orm_4_0.xsd" , "orm_4_0", "SCHEMA:http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" , "persistence_1_0", "SCHEMA:http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" , "persistence_2_0", "SCHEMA:http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd" , "persistence_2_1", "SCHEMA:http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd" , "persistence_2_2", "SCHEMA:https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd" , "persistence_3_0", "SCHEMA:https://jakarta.ee/xml/ns/persistence/persistence_3_2.xsd" , "persistence_3_2", + "SCHEMA:https://jakarta.ee/xml/ns/persistence/persistence_4_0.xsd" , "persistence_4_0", }; private static final String JavaEE6SchemaToURLMap[] = { @@ -491,6 +497,10 @@ public String getShortDescription() { private static final String EJBJAR_4_0_XSD="ejb-jar_4_0.xsd"; // NOI18N private static final String EJBJAR_4_0 = JAKARTAEE_NS+"/"+EJBJAR_4_0_XSD; // NOI18N public static final String EJBJAR_4_0_ID = "SCHEMA:"+EJBJAR_4_0; // NOI18N + + private static final String EJBJAR_4_1_XSD="ejb-jar_4_1.xsd"; // NOI18N + private static final String EJBJAR_4_1 = JAKARTAEE_NS+"/"+EJBJAR_4_1_XSD; // NOI18N + public static final String EJBJAR_4_1_ID = "SCHEMA:"+EJBJAR_4_1; // NOI18N private static final String APP_TAG="application"; //NOI18N private static final String APP_1_4_XSD="application_1_4.xsd"; // NOI18N @@ -524,6 +534,10 @@ public String getShortDescription() { private static final String APP_11_XSD="application_11.xsd"; // NOI18N private static final String APP_11= JAKARTAEE_NS+"/"+APP_11_XSD; // NOI18N public static final String APP_11_ID = "SCHEMA:"+APP_11; // NOI18N + + private static final String APP_12_XSD="application_12.xsd"; // NOI18N + private static final String APP_12= JAKARTAEE_NS+"/"+APP_12_XSD; // NOI18N + public static final String APP_12_ID = "SCHEMA:"+APP_12; // NOI18N private static final String APPCLIENT_TAG="application-client"; //NOI18N private static final String APPCLIENT_1_4_XSD="application-client_1_4.xsd"; // NOI18N @@ -557,6 +571,10 @@ public String getShortDescription() { private static final String APPCLIENT_11_XSD="application-client_11.xsd"; // NOI18N private static final String APPCLIENT_11= JAKARTAEE_NS+"/"+APPCLIENT_11_XSD; // NOI18N public static final String APPCLIENT_11_ID = "SCHEMA:"+APPCLIENT_11; // NOI18N + + private static final String APPCLIENT_12_XSD="application-client_12.xsd"; // NOI18N + private static final String APPCLIENT_12= JAKARTAEE_NS+"/"+APPCLIENT_12_XSD; // NOI18N + public static final String APPCLIENT_12_ID = "SCHEMA:"+APPCLIENT_12; // NOI18N private static final String WEBSERVICES_TAG="webservices"; //NOI18N private static final String WEBSERVICES_1_1_XSD="j2ee_web_services_1_1.xsd"; // NOI18N @@ -675,6 +693,18 @@ public String getShortDescription() { private static final String WEBFRAGMENT_6_1_XSD="web-fragment_6_1.xsd"; // NOI18N private static final String WEBFRAGMENT_6_1 = JAKARTAEE_NS+"/"+WEBFRAGMENT_6_1_XSD; // NOI18N public static final String WEBFRAGMENT_6_1_ID = "SCHEMA:"+WEBFRAGMENT_6_1; // NOI18N + + private static final String WEBAPP_6_2_XSD="web-app_6_2.xsd"; // NOI18N + private static final String WEBAPP_6_2 = JAKARTAEE_NS+"/"+WEBAPP_6_2_XSD; // NOI18N + public static final String WEBAPP_6_2_ID = "SCHEMA:"+WEBAPP_6_2; // NOI18N + + private static final String WEBCOMMON_6_2_XSD="web-common_6_2.xsd"; // NOI18N + private static final String WEBCOMMON_6_2 = JAKARTAEE_NS+"/"+WEBCOMMON_6_2_XSD; // NOI18N + public static final String WEBCOMMON_6_2_ID = "SCHEMA:"+WEBCOMMON_6_2; // NOI18N + + private static final String WEBFRAGMENT_6_2_XSD="web-fragment_6_2.xsd"; // NOI18N + private static final String WEBFRAGMENT_6_2 = JAKARTAEE_NS+"/"+WEBFRAGMENT_6_2_XSD; // NOI18N + public static final String WEBFRAGMENT_6_2_ID = "SCHEMA:"+WEBFRAGMENT_6_2; // NOI18N public static final String PERSISTENCE_NS = "http://java.sun.com/xml/ns/persistence"; // NOI18N public static final String NEW_PERSISTENCE_NS = "http://xmlns.jcp.org/xml/ns/persistence"; // NOI18N @@ -708,6 +738,10 @@ public String getShortDescription() { private static final String PERSISTENCE_3_2_XSD="persistence_3_2.xsd"; // NOI18N private static final String PERSISTENCE_3_2 = JAKARTA_PERSISTENCE_NS+"/"+PERSISTENCE_3_2_XSD; // NOI18N public static final String PERSISTENCE_3_2_ID = "SCHEMA:"+PERSISTENCE_3_2; // NOI18N + + private static final String PERSISTENCE_4_0_XSD="persistence_4_0.xsd"; // NOI18N + private static final String PERSISTENCE_4_0 = JAKARTA_PERSISTENCE_NS+"/"+PERSISTENCE_4_0_XSD; // NOI18N + public static final String PERSISTENCE_4_0_ID = "SCHEMA:"+PERSISTENCE_4_0; // NOI18N public static final String PERSISTENCEORM_NS = "http://java.sun.com/xml/ns/persistence/orm"; // NOI18N public static final String NEW_PERSISTENCEORM_NS = "http://xmlns.jcp.org/xml/ns/persistence/orm"; // NOI18N @@ -741,15 +775,21 @@ public String getShortDescription() { private static final String PERSISTENCEORM_3_2_XSD="orm_3_2.xsd"; // NOI18N private static final String PERSISTENCEORM_3_2 = JAKARTA_PERSISTENCEORM_NS+"/"+PERSISTENCEORM_3_2_XSD; // NOI18N yes not ORM NS!!! public static final String PERSISTENCEORM_3_2_ID = "SCHEMA:"+PERSISTENCEORM_3_2; // NOI18N + + private static final String PERSISTENCEORM_4_0_XSD="orm_4_0.xsd"; // NOI18N + private static final String PERSISTENCEORM_4_0 = JAKARTA_PERSISTENCEORM_NS+"/"+PERSISTENCEORM_4_0_XSD; // NOI18N yes not ORM NS!!! + public static final String PERSISTENCEORM_4_0_ID = "SCHEMA:"+PERSISTENCEORM_4_0; // NOI18N private static final String[] SUPPORTED_SCHEMAS = new String[]{ // ejb - EJBJAR_2_1_XSD, EJBJAR_3_0_XSD, EJBJAR_3_1_XSD, EJBJAR_3_2_XSD, EJBJAR_4_0_XSD, + EJBJAR_2_1_XSD, EJBJAR_3_0_XSD, EJBJAR_3_1_XSD, EJBJAR_3_2_XSD, + EJBJAR_4_0_XSD, EJBJAR_4_1_XSD, // application & application-client APP_1_4_XSD, APPCLIENT_1_4_XSD, APP_5_XSD, APPCLIENT_5_XSD, APP_6_XSD, APPCLIENT_6_XSD, APP_7_XSD, APPCLIENT_7_XSD, APP_8_XSD, APPCLIENT_8_XSD, APP_9_XSD, APPCLIENT_9_XSD, APP_10_XSD, APPCLIENT_10_XSD, APP_11_XSD, APPCLIENT_11_XSD, + APP_12_XSD, APPCLIENT_12_XSD, //web-app, web-common & web-fragment WEBAPP_2_5_XSD, WEBAPP_3_0_XSD, WEBFRAGMENT_3_0_XSD, WEBCOMMON_3_0_XSD, @@ -758,6 +798,7 @@ public String getShortDescription() { WEBAPP_5_0_XSD, WEBFRAGMENT_5_0_XSD, WEBCOMMON_5_0_XSD, WEBAPP_6_0_XSD, WEBFRAGMENT_6_0_XSD, WEBCOMMON_6_0_XSD, WEBAPP_6_1_XSD, WEBFRAGMENT_6_1_XSD, WEBCOMMON_6_1_XSD, + WEBAPP_6_2_XSD, WEBFRAGMENT_6_2_XSD, WEBCOMMON_6_2_XSD, //persistence & orm PERSISTENCE_XSD, PERSISTENCEORM_XSD, PERSISTENCE_2_0_XSD, PERSISTENCEORM_2_0_XSD, @@ -766,6 +807,7 @@ public String getShortDescription() { PERSISTENCE_3_0_XSD, PERSISTENCEORM_3_0_XSD, PERSISTENCE_3_1_XSD, PERSISTENCEORM_3_1_XSD, PERSISTENCE_3_2_XSD, PERSISTENCEORM_3_2_XSD, + PERSISTENCE_4_0_XSD, PERSISTENCEORM_4_0_XSD, //webservice & webservice-client WEBSERVICES_1_1_XSD, WEBSERVICES_CLIENT_1_1_XSD, WEBSERVICES_1_2_XSD, WEBSERVICES_CLIENT_1_2_XSD, @@ -833,7 +875,7 @@ public InputSource resolveEntity(String publicId, String systemId) throws SAXExc } @Override - public Enumeration enabled(GrammarEnvironment ctx) { + public Enumeration enabled(GrammarEnvironment ctx) { if (ctx.getFileObject() == null) return null; Enumeration en = ctx.getDocumentChildren(); while (en.hasMoreElements()) { @@ -891,6 +933,9 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { return null; } switch (mimeType) { + case "text/x-dd-ejbjar4.1": // NOI18N + inputSource = resolver.resolveEntity(EJBJAR_4_1_ID, ""); + break; case "text/x-dd-ejbjar4.0": // NOI18N inputSource = resolver.resolveEntity(EJBJAR_4_0_ID, ""); break; @@ -906,6 +951,9 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { case "text/x-dd-ejbjar2.1": // NOI18N inputSource = resolver.resolveEntity(EJBJAR_2_1_ID, ""); break; + case "text/x-dd-application12.0": // NOI18N + inputSource = resolver.resolveEntity(APP_12_ID, ""); + break; case "text/x-dd-application11.0": // NOI18N inputSource = resolver.resolveEntity(APP_11_ID, ""); break; @@ -930,6 +978,9 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { case "text/x-dd-application1.4": // NOI18N inputSource = resolver.resolveEntity(APP_1_4_ID, ""); break; + case "text/x-dd-client12.0": // NOI18N + inputSource = resolver.resolveEntity(APPCLIENT_12_ID, ""); + break; case "text/x-dd-client11.0": // NOI18N inputSource = resolver.resolveEntity(APPCLIENT_11_ID, ""); break; @@ -954,6 +1005,9 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { case "text/x-dd-client1.4": // NOI18N inputSource = resolver.resolveEntity(APPCLIENT_1_4_ID, ""); break; + case "text/x-dd-servlet6.2": // NOI18N + inputSource = resolver.resolveEntity(WEBAPP_6_2_ID, ""); + break; case "text/x-dd-servlet6.1": // NOI18N inputSource = resolver.resolveEntity(WEBAPP_6_1_ID, ""); break; @@ -975,6 +1029,9 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { case "text/x-dd-servlet2.5": // NOI18N inputSource = resolver.resolveEntity(WEBAPP_2_5_ID, ""); break; + case "text/x-dd-servlet-fragment6.2": // NOI18N + inputSource = resolver.resolveEntity(WEBFRAGMENT_6_2_ID, ""); + break; case "text/x-dd-servlet-fragment6.1": // NOI18N inputSource = resolver.resolveEntity(WEBFRAGMENT_6_1_ID, ""); break; @@ -993,6 +1050,9 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { case "text/x-dd-servlet-fragment3.0": // NOI18N inputSource = resolver.resolveEntity(WEBFRAGMENT_3_0_ID, ""); break; + case "text/x-persistence4.0": // NOI18N + inputSource = resolver.resolveEntity(PERSISTENCE_4_0_ID, ""); + break; case "text/x-persistence3.2": // NOI18N inputSource = resolver.resolveEntity(PERSISTENCE_3_2_ID, ""); break; @@ -1014,6 +1074,9 @@ public GrammarQuery getGrammar(GrammarEnvironment ctx) { case "text/x-persistence1.0": // NOI18N inputSource = resolver.resolveEntity(PERSISTENCE_ID, ""); break; + case "text/x-orm4.0": // NOI18N + inputSource = resolver.resolveEntity(PERSISTENCEORM_4_0_ID, ""); + break; case "text/x-orm3.2": // NOI18N inputSource = resolver.resolveEntity(PERSISTENCEORM_3_2_ID, ""); break; diff --git a/enterprise/payara.tooling/nbproject/org-netbeans-modules-payara-tooling.sig b/enterprise/payara.tooling/nbproject/org-netbeans-modules-payara-tooling.sig index 08cc94f11239..59561e002e79 100644 --- a/enterprise/payara.tooling/nbproject/org-netbeans-modules-payara-tooling.sig +++ b/enterprise/payara.tooling/nbproject/org-netbeans-modules-payara-tooling.sig @@ -1331,6 +1331,8 @@ intf org.netbeans.modules.payara.tooling.data.PayaraPlatformVersionAPI meth public boolean equals(org.netbeans.modules.payara.tooling.data.PayaraPlatformVersionAPI) meth public boolean equalsMajorMinor(org.netbeans.modules.payara.tooling.data.PayaraPlatformVersionAPI) meth public boolean isEE10Supported() +meth public boolean isEE11Supported() +meth public boolean isEE12Supported() meth public boolean isEE7Supported() meth public boolean isEE8Supported() meth public boolean isEE9Supported() @@ -1366,6 +1368,8 @@ fld public final static java.lang.String SEPARATOR_PATTERN = "\u005c." meth public abstract boolean equals(org.netbeans.modules.payara.tooling.data.PayaraPlatformVersionAPI) meth public abstract boolean equalsMajorMinor(org.netbeans.modules.payara.tooling.data.PayaraPlatformVersionAPI) meth public abstract boolean isEE10Supported() +meth public abstract boolean isEE11Supported() +meth public abstract boolean isEE12Supported() meth public abstract boolean isEE7Supported() meth public abstract boolean isEE8Supported() meth public abstract boolean isEE9Supported() @@ -1517,6 +1521,8 @@ meth public boolean equals(org.netbeans.modules.payara.tooling.data.PayaraVersio meth public boolean equalsMajorMinor(org.netbeans.modules.payara.tooling.data.PayaraPlatformVersionAPI) meth public boolean equalsMajorMinor(org.netbeans.modules.payara.tooling.data.PayaraVersion) meth public boolean isEE10Supported() +meth public boolean isEE11Supported() +meth public boolean isEE12Supported() meth public boolean isEE7Supported() meth public boolean isEE8Supported() meth public boolean isEE9Supported() @@ -1857,6 +1863,8 @@ fld public final static org.netbeans.modules.payara.tooling.server.config.JavaEE fld public final static org.netbeans.modules.payara.tooling.server.config.JavaEEProfile v10_0_0_web fld public final static org.netbeans.modules.payara.tooling.server.config.JavaEEProfile v11_0_0 fld public final static org.netbeans.modules.payara.tooling.server.config.JavaEEProfile v11_0_0_web +fld public final static org.netbeans.modules.payara.tooling.server.config.JavaEEProfile v12_0_0 +fld public final static org.netbeans.modules.payara.tooling.server.config.JavaEEProfile v12_0_0_web fld public final static org.netbeans.modules.payara.tooling.server.config.JavaEEProfile v1_2 fld public final static org.netbeans.modules.payara.tooling.server.config.JavaEEProfile v1_3 fld public final static org.netbeans.modules.payara.tooling.server.config.JavaEEProfile v1_4 @@ -1898,6 +1906,7 @@ CLSS public final static !enum org.netbeans.modules.payara.tooling.server.config outer org.netbeans.modules.payara.tooling.server.config.JavaEEProfile fld public final static org.netbeans.modules.payara.tooling.server.config.JavaEEProfile$Version v10_0_0 fld public final static org.netbeans.modules.payara.tooling.server.config.JavaEEProfile$Version v11_0_0 +fld public final static org.netbeans.modules.payara.tooling.server.config.JavaEEProfile$Version v12_0_0 fld public final static org.netbeans.modules.payara.tooling.server.config.JavaEEProfile$Version v1_2 fld public final static org.netbeans.modules.payara.tooling.server.config.JavaEEProfile$Version v1_3 fld public final static org.netbeans.modules.payara.tooling.server.config.JavaEEProfile$Version v1_4 diff --git a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraPlatformVersion.java b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraPlatformVersion.java index da9722700ef3..7d7599ef54a5 100644 --- a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraPlatformVersion.java +++ b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraPlatformVersion.java @@ -348,6 +348,16 @@ public boolean isEE9Supported() { public boolean isEE10Supported() { return major >= 6; } + + @Override + public boolean isEE11Supported() { + return major >= 7; + } + + @Override + public boolean isEE12Supported() { + return major >= 8; + } // Methods // /** diff --git a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraPlatformVersionAPI.java b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraPlatformVersionAPI.java index 7e234b357062..ef946ac2016d 100644 --- a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraPlatformVersionAPI.java +++ b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraPlatformVersionAPI.java @@ -82,6 +82,10 @@ public interface PayaraPlatformVersionAPI { public boolean isEE10Supported(); + public boolean isEE11Supported(); + + public boolean isEE12Supported(); + /** * Compare major and minor parts of version number Strings. *

diff --git a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraVersion.java b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraVersion.java index d54cf5fe2a3c..88e809bd2308 100644 --- a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraVersion.java +++ b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraVersion.java @@ -526,6 +526,16 @@ public boolean isEE9Supported() { public boolean isEE10Supported() { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } + + @Override + public boolean isEE11Supported() { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public boolean isEE12Supported() { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } @Override public boolean equalsMajorMinor(PayaraPlatformVersionAPI version) { diff --git a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/JavaEEProfile.java b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/JavaEEProfile.java index fbe35080d570..30361fcb6229 100644 --- a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/JavaEEProfile.java +++ b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/JavaEEProfile.java @@ -87,7 +87,13 @@ public enum JavaEEProfile { v11_0_0_web(Version.v11_0_0, Type.WEB, "11.0.0-web"), /** JakartaEE 11 full profile. */ - v11_0_0(Version.v11_0_0, Type.FULL, "11.0.0"); + v11_0_0(Version.v11_0_0, Type.FULL, "11.0.0"), + + /** JakartaEE 12 web profile. */ + v12_0_0_web(Version.v11_0_0, Type.WEB, "12.0.0-web"), + + /** JakartaEE 12 full profile. */ + v12_0_0(Version.v12_0_0, Type.FULL, "12.0.0"); // Inner enums // /** JavaEE profile type. */ @@ -146,7 +152,9 @@ public enum Version { /** JakartaEE 10.0 */ v10_0_0("10.0.0"), /** JakartaEE 11.0 */ - v11_0_0("11.0.0"); + v11_0_0("11.0.0"), + /** JakartaEE 12.0 */ + v12_0_0("12.0.0"); /** JavaEE profile type name. */ private final String name; diff --git a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/PayaraV7.xml b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/PayaraV7.xml index b003efb894ed..aab65c99de68 100644 --- a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/PayaraV7.xml +++ b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/config/PayaraV7.xml @@ -84,7 +84,7 @@ under the License. - + diff --git a/enterprise/servletjspapi/build.xml b/enterprise/servletjspapi/build.xml index 644f176b6616..1b1a85691722 100755 --- a/enterprise/servletjspapi/build.xml +++ b/enterprise/servletjspapi/build.xml @@ -26,7 +26,7 @@ - + @@ -38,7 +38,7 @@ - + @@ -108,15 +108,15 @@ - + - + - - - + + + @@ -140,8 +140,10 @@ - + + + @@ -156,6 +158,8 @@ + + @@ -163,41 +167,55 @@ + + + + + + + + + + + + + + - + + zipfile="./external/generated-servlet-jsp-api-6.2_4.1.jar" /> diff --git a/enterprise/servletjspapi/external/binaries-list b/enterprise/servletjspapi/external/binaries-list index 2c9c767e6656..badab3c39348 100755 --- a/enterprise/servletjspapi/external/binaries-list +++ b/enterprise/servletjspapi/external/binaries-list @@ -15,10 +15,10 @@ # specific language governing permissions and limitations # under the License. -A8DE3741B91BA7427306104979AB2F084E831438 jakarta.servlet.jsp:jakarta.servlet.jsp-api:4.0.0 -1169A246913FE3823782AF7943E7A103634867C5 jakarta.servlet:jakarta.servlet-api:6.1.0 -C7C4A2EB1E40E0FF45AB5E2E52BD77D8C7A75176 jakarta.el:jakarta.el-api:6.0.1 +1C3755124F74EF13E668FD8BD5FB34B1F4E072A8 jakarta.servlet.jsp:jakarta.servlet.jsp-api:4.1.0-M1 +78775662980AF75BE87A543A86AE1D12C01B3401 jakarta.servlet:jakarta.servlet-api:6.2.0-M1 +F566CE11E236B36C0EF1C1ED1FACFA505863B3DF jakarta.el:jakarta.el-api:6.1.0-M1 EE48550ECE1AF1E0D8BD4877DBC6DA5C29C5496B jakarta.servlet.jsp:jakarta.servlet.jsp-api:2.3.6 B8A1142E04838FE54194049C6E7A18DAE8F9B960 jakarta.servlet:jakarta.servlet-api:4.0.4 F311AB94BB1D4380690A53D737226A6B879DD4F1 jakarta.el:jakarta.el-api:3.0.3 -1E77F50E244682173C27F661287629ADB83FE2D2 org.glassfish.main.appclient:gf-client-module:7.0.25 \ No newline at end of file +EC9C390DB67BF79957E283027AB2B38018FF3AF3 org.glassfish.main.appclient:gf-client-module:9.0.0-M1 \ No newline at end of file diff --git a/enterprise/servletjspapi/external/generated-servlet-jsp-api-6.1_3.0-license.txt b/enterprise/servletjspapi/external/generated-servlet-jsp-api-6.2_4.1-license.txt similarity index 99% rename from enterprise/servletjspapi/external/generated-servlet-jsp-api-6.1_3.0-license.txt rename to enterprise/servletjspapi/external/generated-servlet-jsp-api-6.2_4.1-license.txt index f0b1396074b8..852433aa508c 100644 --- a/enterprise/servletjspapi/external/generated-servlet-jsp-api-6.1_3.0-license.txt +++ b/enterprise/servletjspapi/external/generated-servlet-jsp-api-6.2_4.1-license.txt @@ -1,6 +1,6 @@ Name: Java API for Jakarta Servlets, Java API for Jakarta Server Pages License: EPL-v20 -Version: 6.1_3.0 +Version: 6.2_4.1 Type: generated Description: Java API for Jakarta Servlets, Java API for Jakarta Server Pages, Java API for Jakarta Expression Language Origin: Eclipse Foundation (https://projects.eclipse.org/projects/ee4j) diff --git a/enterprise/servletjspapi/external/servlet-jsp-api-6.1_3.0-license.txt b/enterprise/servletjspapi/external/servlet-jsp-api-6.2_4.1-license.txt similarity index 98% rename from enterprise/servletjspapi/external/servlet-jsp-api-6.1_3.0-license.txt rename to enterprise/servletjspapi/external/servlet-jsp-api-6.2_4.1-license.txt index fce22be444d5..1f966768785e 100644 --- a/enterprise/servletjspapi/external/servlet-jsp-api-6.1_3.0-license.txt +++ b/enterprise/servletjspapi/external/servlet-jsp-api-6.2_4.1-license.txt @@ -1,10 +1,10 @@ Name: Java API for Jakarta Servlets, Java API for Jakarta Server Pages License: EPL-v20 -Version: 6.1_3.0 +Version: 6.2_4.1 Type: generated Description: Java API for Jakarta Servlets, Java API for Jakarta Server Pages, Java API for Jakarta Expression Language Origin: Eclipse Foundation (https://projects.eclipse.org/projects/ee4j) -Files: gf-client-module-7.0.25.jar, jakarta.el-api-3.0.3.jar, jakarta.servlet-api-4.0.4.jar, jakarta.servlet.jsp-api-2.3.6.jar, jakarta.el-api-6.0.1.jar, jakarta.servlet-api-6.1.0.jar, jakarta.servlet.jsp-api-4.0.0.jar +Files: gf-client-module-9.0.0-M1.jar, jakarta.el-api-3.0.3.jar, jakarta.servlet-api-4.0.4.jar, jakarta.servlet.jsp-api-2.3.6.jar, jakarta.el-api-6.1.0-M1.jar, jakarta.servlet-api-6.2.0-M1.jar, jakarta.servlet.jsp-api-4.1.0-M1.jar Eclipse Public License - v 2.0 THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (“AGREEMENT”). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. diff --git a/enterprise/servletjspapi/nbproject/org-netbeans-modules-servletjspapi.sig b/enterprise/servletjspapi/nbproject/org-netbeans-modules-servletjspapi.sig index 420bc579095d..178aa9b43419 100644 --- a/enterprise/servletjspapi/nbproject/org-netbeans-modules-servletjspapi.sig +++ b/enterprise/servletjspapi/nbproject/org-netbeans-modules-servletjspapi.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 1.62.0 +#Version 1.63.0 CLSS public jakarta.el.ArrayELResolver cons public init() @@ -139,6 +139,7 @@ hfds elManager,factory CLSS public abstract jakarta.el.ELResolver cons public init() +innr public static StandaloneIdentifierMarker meth public <%0 extends java.lang.Object> {%%0} convertToType(jakarta.el.ELContext,java.lang.Object,java.lang.Class<{%%0}>) meth public abstract boolean isReadOnly(jakarta.el.ELContext,java.lang.Object,java.lang.Object) meth public abstract java.lang.Class getCommonPropertyType(jakarta.el.ELContext,java.lang.Object) @@ -148,6 +149,10 @@ meth public abstract void setValue(jakarta.el.ELContext,java.lang.Object,java.la meth public java.lang.Object invoke(jakarta.el.ELContext,java.lang.Object,java.lang.Object,java.lang.Class[],java.lang.Object[]) supr java.lang.Object +CLSS public static jakarta.el.ELResolver$StandaloneIdentifierMarker + outer jakarta.el.ELResolver +supr java.lang.Object + CLSS public abstract jakarta.el.EvaluationListener cons public init() meth public void afterEvaluation(jakarta.el.ELContext,java.lang.String) @@ -1223,6 +1228,7 @@ fld public final static int SC_BAD_REQUEST = 400 fld public final static int SC_CONFLICT = 409 fld public final static int SC_CONTINUE = 100 fld public final static int SC_CREATED = 201 +fld public final static int SC_EARLY_HINTS = 103 fld public final static int SC_EXPECTATION_FAILED = 417 fld public final static int SC_FORBIDDEN = 403 fld public final static int SC_FOUND = 302 @@ -1274,6 +1280,7 @@ meth public abstract void addCookie(jakarta.servlet.http.Cookie) meth public abstract void addDateHeader(java.lang.String,long) meth public abstract void addHeader(java.lang.String,java.lang.String) meth public abstract void addIntHeader(java.lang.String,int) +meth public abstract void sendEarlyHints() meth public abstract void sendError(int) throws java.io.IOException meth public abstract void sendError(int,java.lang.String) throws java.io.IOException meth public abstract void sendRedirect(java.lang.String,int,boolean) throws java.io.IOException @@ -1302,6 +1309,7 @@ meth public void addCookie(jakarta.servlet.http.Cookie) meth public void addDateHeader(java.lang.String,long) meth public void addHeader(java.lang.String,java.lang.String) meth public void addIntHeader(java.lang.String,int) +meth public void sendEarlyHints() meth public void sendError(int) throws java.io.IOException meth public void sendError(int,java.lang.String) throws java.io.IOException meth public void sendRedirect(java.lang.String) throws java.io.IOException @@ -1922,7 +1930,6 @@ meth public void mark(int) meth public void reset() throws java.io.IOException meth public void skipNBytes(long) throws java.io.IOException supr java.lang.Object -hfds DEFAULT_BUFFER_SIZE,MAX_BUFFER_SIZE,MAX_SKIP_BUFFER_SIZE CLSS public abstract java.io.OutputStream cons public init() @@ -1957,7 +1964,6 @@ meth public void write(int) throws java.io.IOException meth public void write(java.lang.String) throws java.io.IOException meth public void write(java.lang.String,int,int) throws java.io.IOException supr java.lang.Object -hfds WRITE_BUFFER_SIZE,writeBuffer CLSS public abstract interface java.lang.Appendable meth public abstract java.lang.Appendable append(char) throws java.io.IOException @@ -1998,7 +2004,6 @@ meth public final java.util.Optional meth public java.lang.String toString() meth public static <%0 extends java.lang.Enum<{%%0}>> {%%0} valueOf(java.lang.Class<{%%0}>,java.lang.String) supr java.lang.Object -hfds name,ordinal CLSS public java.lang.Exception cons protected init(java.lang.String,java.lang.Throwable,boolean,boolean) @@ -2007,7 +2012,6 @@ cons public init(java.lang.String) cons public init(java.lang.String,java.lang.Throwable) cons public init(java.lang.Throwable) supr java.lang.Throwable -hfds serialVersionUID CLSS public java.lang.Object cons public init() @@ -2031,7 +2035,6 @@ cons public init(java.lang.String) cons public init(java.lang.String,java.lang.Throwable) cons public init(java.lang.Throwable) supr java.lang.Exception -hfds serialVersionUID CLSS public java.lang.Throwable cons protected init(java.lang.String,java.lang.Throwable,boolean,boolean) @@ -2054,8 +2057,6 @@ meth public void printStackTrace(java.io.PrintStream) meth public void printStackTrace(java.io.PrintWriter) meth public void setStackTrace(java.lang.StackTraceElement[]) supr java.lang.Object -hfds CAUSE_CAPTION,EMPTY_THROWABLE_ARRAY,NULL_CAUSE_MESSAGE,SELF_SUPPRESSION_MESSAGE,SUPPRESSED_CAPTION,SUPPRESSED_SENTINEL,UNASSIGNED_STACK,backtrace,cause,depth,detailMessage,serialVersionUID,stackTrace,suppressedExceptions -hcls PrintStreamOrWriter,SentinelHolder,WrappedPrintStream,WrappedPrintWriter CLSS public abstract interface java.lang.annotation.Annotation meth public abstract boolean equals(java.lang.Object) @@ -2101,7 +2102,6 @@ intf java.io.Serializable meth public java.lang.Object getSource() meth public java.lang.String toString() supr java.lang.Object -hfds serialVersionUID CLSS public javax.el.ArrayELResolver cons public init() diff --git a/enterprise/servletjspapi/nbproject/project.properties b/enterprise/servletjspapi/nbproject/project.properties index 70ebd3332482..0f5660cd60e3 100644 --- a/enterprise/servletjspapi/nbproject/project.properties +++ b/enterprise/servletjspapi/nbproject/project.properties @@ -21,5 +21,5 @@ javac.release=17 spec.version.base=1.63.0 release.external/generated-servlet-jsp-api-4.0_2.3.jar=modules/ext/servlet4.0-jsp2.3-api.jar -release.external/generated-servlet-jsp-api-6.1_3.0.jar=modules/ext/servlet-jsp-api-6.1_3.0.jar -extra.module.files=modules/ext/servlet4.0-jsp2.3-api.jar,modules/ext/servlet-jsp-api-6.1_3.0.jar +release.external/generated-servlet-jsp-api-6.2_4.1.jar=modules/ext/servlet-jsp-api-6.2_4.1.jar +extra.module.files=modules/ext/servlet4.0-jsp2.3-api.jar,modules/ext/servlet-jsp-api-6.2_4.1.jar diff --git a/enterprise/servletjspapi/nbproject/project.xml b/enterprise/servletjspapi/nbproject/project.xml index 940a285c0adf..bb9dd5288103 100644 --- a/enterprise/servletjspapi/nbproject/project.xml +++ b/enterprise/servletjspapi/nbproject/project.xml @@ -48,8 +48,8 @@ external/generated-servlet-jsp-api-4.0_2.3.jar - ext/servlet-jsp-api-6.1_3.0.jar - external/generated-servlet-jsp-api-6.1_3.0.jar + ext/servlet-jsp-api-6.2_4.1.jar + external/generated-servlet-jsp-api-6.2_4.1.jar diff --git a/enterprise/servletjspapi/src/org/netbeans/modules/servletjspapi/Bundle.properties b/enterprise/servletjspapi/src/org/netbeans/modules/servletjspapi/Bundle.properties index fba8184c56f2..0732d4e2ec98 100644 --- a/enterprise/servletjspapi/src/org/netbeans/modules/servletjspapi/Bundle.properties +++ b/enterprise/servletjspapi/src/org/netbeans/modules/servletjspapi/Bundle.properties @@ -17,6 +17,6 @@ OpenIDE-Module-Name=Servlet/JSP API OpenIDE-Module-Display-Category=Libraries -OpenIDE-Module-Short-Description=Servlet 6.1/JSP 4.0 API Library +OpenIDE-Module-Short-Description=Servlet 6.2/JSP 4.1 API Library OpenIDE-Module-Long-Description=\ - Servlet 6.1/JSP 4.0 API Library + Servlet 6.2/JSP 4.1 API Library diff --git a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/deploy/TomcatManager.java b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/deploy/TomcatManager.java index fed38bcb1714..b6dfe38b4b56 100644 --- a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/deploy/TomcatManager.java +++ b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/deploy/TomcatManager.java @@ -526,6 +526,10 @@ public boolean isJpa31() { public boolean isJpa32() { return false; } + + public boolean isJpa40() { + return false; + } public boolean isJpa22() { return isTomEE8(); diff --git a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/j2ee/JpaSupportImpl.java b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/j2ee/JpaSupportImpl.java index 55898ab5a52b..d7f40ba519cd 100644 --- a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/j2ee/JpaSupportImpl.java +++ b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/j2ee/JpaSupportImpl.java @@ -53,7 +53,8 @@ public JpaProvider getDefaultProvider() { instance.isJpa22(), instance.isJpa30(), instance.isJpa31(), - instance.isJpa32()); + instance.isJpa32(), + instance.isJpa40()); } @Override @@ -68,7 +69,8 @@ public Set getProviders() { instance.isJpa22(), instance.isJpa30(), instance.isJpa31(), - instance.isJpa32())); + instance.isJpa32(), + instance.isJpa40())); // TomEE PluME has Eclipselink and OpenJPA if (instance.isTomEEplume()) { providers.add(JpaProviderFactory.createJpaProvider( @@ -80,7 +82,8 @@ public Set getProviders() { instance.isJpa22(), instance.isJpa30(), instance.isJpa31(), - instance.isJpa32())); + instance.isJpa32(), + instance.isJpa40())); } return providers; } diff --git a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/j2ee/TomcatPlatformImpl.java b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/j2ee/TomcatPlatformImpl.java index 90159b2a299c..8e04ba8d7b7e 100644 --- a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/j2ee/TomcatPlatformImpl.java +++ b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/j2ee/TomcatPlatformImpl.java @@ -561,7 +561,7 @@ public Set getSupportedJavaPlatformVersions() { if (manager.isTomEE()) { switch (manager.getTomEEVersion()) { case TOMEE_100: - versions = versionRange(17, 26); + versions = versionRange(17, 27); break; case TOMEE_90: versions = versionRange(11, 23); @@ -584,20 +584,20 @@ public Set getSupportedJavaPlatformVersions() { } else { switch (manager.getTomcatVersion()) { case TOMCAT_110: - versions = versionRange(17, 26); + versions = versionRange(17, 27); break; case TOMCAT_101: - versions = versionRange(11, 26); + versions = versionRange(11, 27); break; case TOMCAT_100: case TOMCAT_90: - versions = versionRange(8, 26); + versions = versionRange(8, 27); break; case TOMCAT_80: - versions = versionRange(7, 26); + versions = versionRange(7, 27); break; case TOMCAT_70: - versions = versionRange(6, 26); + versions = versionRange(6, 27); break; case TOMCAT_60: versions = versionRange(5, 8); diff --git a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/util/TomcatProperties.java b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/util/TomcatProperties.java index 7c47b14fd520..a55e0b0623b6 100644 --- a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/util/TomcatProperties.java +++ b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/util/TomcatProperties.java @@ -20,9 +20,7 @@ package org.netbeans.modules.tomcat5.util; import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; import java.io.File; -import java.io.FilenameFilter; import java.io.IOException; import java.io.OutputStream; import java.net.MalformedURLException; @@ -419,7 +417,7 @@ public void setJavaOpts(String javaOpts) { public boolean getSecManager() { String val = ip.getProperty(PROP_SEC_MANAGER); - return val != null ? Boolean.valueOf(val) + return val != null ? Boolean.parseBoolean(val) : DEF_VALUE_SEC_MANAGER; } @@ -430,7 +428,7 @@ public void setSecManager(boolean enabled) { public boolean getCustomScript() { String val = ip.getProperty(PROP_CUSTOM_SCRIPT); - return val != null ? Boolean.valueOf(val) + return val != null ? Boolean.parseBoolean(val) : DEF_VALUE_CUSTOM_SCRIPT; } @@ -453,7 +451,7 @@ public boolean getForceStop() { return false; } String val = ip.getProperty(PROP_FORCE_STOP); - return val != null ? Boolean.valueOf(val) + return val != null ? Boolean.parseBoolean(val) : DEF_VALUE_FORCE_STOP; } @@ -476,7 +474,7 @@ public void setDebugType(String type) { public boolean getMonitor() { String val = ip.getProperty(PROP_MONITOR); - return val != null ? Boolean.valueOf(val) + return val != null ? Boolean.parseBoolean(val) : DEF_VALUE_MONITOR; } @@ -486,7 +484,7 @@ public void setMonitor(boolean enabled) { public boolean getProxyEnabled() { String val = ip.getProperty(PROP_PROXY_ENABLED); - return val != null ? Boolean.valueOf(val) + return val != null ? Boolean.parseBoolean(val) : DEF_VALUE_PROXY_ENABLED; } @@ -647,7 +645,7 @@ public void setDriverDeployment(boolean enabled) { ip.setProperty(PROP_DRIVER_DEPLOYMENT, Boolean.toString(enabled)); } - public List/**/ getClasses() { + public List getClasses() { String[] nbFilter = new String[] { "httpmonitor", "schema2beans", diff --git a/enterprise/web.beans/src/org/netbeans/modules/web/beans/wizard/BeansXmlIterator.java b/enterprise/web.beans/src/org/netbeans/modules/web/beans/wizard/BeansXmlIterator.java index 6b9bcdabd3aa..0e1b180517dc 100644 --- a/enterprise/web.beans/src/org/netbeans/modules/web/beans/wizard/BeansXmlIterator.java +++ b/enterprise/web.beans/src/org/netbeans/modules/web/beans/wizard/BeansXmlIterator.java @@ -77,7 +77,9 @@ public Set instantiate(TemplateWizard wizard) throws IOException { Profile profile = null; if (project != null) { J2eeProjectCapabilities cap = J2eeProjectCapabilities.forProject(project); - if (cap != null && cap.isCdi41Supported()) { + if (cap != null && cap.isCdi50Supported()) { + profile = Profile.JAKARTA_EE_12_FULL; + } else if (cap != null && cap.isCdi41Supported()) { profile = Profile.JAKARTA_EE_11_FULL; } else if (cap != null && cap.isCdi40Supported()) { profile = Profile.JAKARTA_EE_10_FULL; @@ -89,7 +91,7 @@ public Set instantiate(TemplateWizard wizard) throws IOException { profile = Profile.JAVA_EE_7_FULL; } } - FileObject fo = DDHelper.createBeansXml(profile != null ? profile : Profile.JAVA_EE_6_FULL, targetDir, targetName); + FileObject fo = DDHelper.createBeansXml(profile != null ? profile : Profile.JAKARTA_EE_8_FULL, targetDir, targetName); if (fo != null) { if ( project != null ){ CdiUtil logger = project.getLookup().lookup( CdiUtil.class ); diff --git a/enterprise/web.core.syntax/nbproject/project.properties b/enterprise/web.core.syntax/nbproject/project.properties index 1375cbd67f94..52324fe12342 100644 --- a/enterprise/web.core.syntax/nbproject/project.properties +++ b/enterprise/web.core.syntax/nbproject/project.properties @@ -74,7 +74,7 @@ test-unit-sys-prop.jsp.parser.jars-jakarta=\ ${o.apache.tools.ant.module.dir}/ant/lib/ant.jar:\ ${web.jspparser.dir}/modules/ext/glassfish-jspparser-7.0.25.jar:\ ${servletjspapi.dir}/modules/ext/jsp-parser-ext-jakarta.jar:\ - ${servletjspapi.dir}/modules/ext/servlet-jsp-api-6.1_3.0.jar:\ + ${servletjspapi.dir}/modules/ext/servlet-jsp-api-6.2_4.1.jar:\ ${o.apache.tools.ant.module.dir}/ant/lib/ant-launcher.jar test-unit-sys-prop.web.project.jars=\ diff --git a/enterprise/web.core/licenseinfo.xml b/enterprise/web.core/licenseinfo.xml index c4ea4d098b44..184bd31ed4c2 100644 --- a/enterprise/web.core/licenseinfo.xml +++ b/enterprise/web.core/licenseinfo.xml @@ -107,6 +107,8 @@ src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_3_1.mdd src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_4_0.xsd src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_4_0.mdd + src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_4_1.xsd + src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_4_1.mdd Copyright (c) 2009, 2020 Oracle and/or its affiliates. All rights reserved. diff --git a/enterprise/web.core/src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_4_1.mdd b/enterprise/web.core/src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_4_1.mdd new file mode 100644 index 000000000000..ad9a3ae3eb4d --- /dev/null +++ b/enterprise/web.core/src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_4_1.mdd @@ -0,0 +1,745 @@ + + + + + taglib + https://jakarta.ee/xml/ns/jakartaee + Taglib + + Description + + + DisplayName + + + Icon + + + TlibVersion + + + ShortName + + + Uri + + + Validator + + + Listener + + + Tag + + + TagFile + + + Function + + + TaglibExtension + + + + dewey-versionType + https://jakarta.ee/xml/ns/jakartaee + DeweyVersionType + java.math.BigDecimal + + + tld-canonical-nameType + https://jakarta.ee/xml/ns/jakartaee + TldCanonicalNameType + java.lang.String + + + xsdAnyURIType + https://jakarta.ee/xml/ns/jakartaee + XsdAnyURIType + java.lang.String + + + validatorType + https://jakarta.ee/xml/ns/jakartaee + ValidatorType + + Description + + + ValidatorClass + + + InitParam + + + + listenerType + https://jakarta.ee/xml/ns/jakartaee + ListenerType + + Description + + + DisplayName + + + Icon + + + ListenerClass + + + + tagType + https://jakarta.ee/xml/ns/jakartaee + TagType + + Description + + + DisplayName + + + Icon + + + Name + + + TagClass + + + TeiClass + + + BodyContent + + + Variable + + + Attribute + + + DynamicAttributes + + + Example + + + TagExtension + + + + tagFileType + https://jakarta.ee/xml/ns/jakartaee + TagFileType + + Description + + + DisplayName + + + Icon + + + Name + + + Path + + + Example + + + TagExtension + + + + functionType + https://jakarta.ee/xml/ns/jakartaee + FunctionType + + Description + + + DisplayName + + + Icon + + + Name + + + FunctionClass + + + FunctionSignature + + + Example + + + FunctionExtension + + + + tld-extensionType + https://jakarta.ee/xml/ns/jakartaee + TldExtensionType + + ExtensionElement + + + + extensibleType + https://jakarta.ee/xml/ns/jakartaee + ExtensibleType + + + fully-qualified-classType + https://jakarta.ee/xml/ns/jakartaee + FullyQualifiedClassType + java.lang.String + + + string + https://jakarta.ee/xml/ns/jakartaee + String + java.lang.String + + + xsdStringType + https://jakarta.ee/xml/ns/jakartaee + XsdStringType + java.lang.String + + + descriptionType + https://jakarta.ee/xml/ns/jakartaee + DescriptionType + java.lang.String + + + display-nameType + https://jakarta.ee/xml/ns/jakartaee + DisplayNameType + java.lang.String + + + iconType + https://jakarta.ee/xml/ns/jakartaee + IconType + + SmallIcon + + + LargeIcon + + + + pathType + https://jakarta.ee/xml/ns/jakartaee + PathType + java.lang.String + + + body-contentType + https://jakarta.ee/xml/ns/jakartaee + BodyContentType + java.lang.String + + + variableType + https://jakarta.ee/xml/ns/jakartaee + VariableType + + Description + + + NameGiven + + + NameFromAttribute + + + VariableClass + + + Declare + + + Scope + + + + tld-attributeType + https://jakarta.ee/xml/ns/jakartaee + TldAttributeType + + Description + + + Name + + + Required + + + Rtexprvalue + + + Type + + + Fragment + + + + generic-booleanType + https://jakarta.ee/xml/ns/jakartaee + GenericBooleanType + java.lang.String + + + java-identifierType + https://jakarta.ee/xml/ns/jakartaee + JavaIdentifierType + java.lang.String + + + variable-scopeType + https://jakarta.ee/xml/ns/jakartaee + VariableScopeType + java.lang.String + + + param-valueType + https://jakarta.ee/xml/ns/jakartaee + ParamValueType + + Description + + + ParamName + + + ParamValue + + + + emptyType + https://jakarta.ee/xml/ns/jakartaee + EmptyType + + + ejb-refType + https://jakarta.ee/xml/ns/jakartaee + EjbRefType + + Description + + + EjbRefName + + + EjbRefType + + + Home + + + Remote + + + EjbLink + + + + remoteType + https://jakarta.ee/xml/ns/jakartaee + RemoteType + java.lang.String + + + res-sharing-scopeType + https://jakarta.ee/xml/ns/jakartaee + ResSharingScopeType + java.lang.String + + + xsdIntegerType + https://jakarta.ee/xml/ns/jakartaee + XsdIntegerType + java.math.BigInteger + + + resource-env-refType + https://jakarta.ee/xml/ns/jakartaee + ResourceEnvRefType + + Description + + + ResourceEnvRefName + + + ResourceEnvRefType + + + + message-destinationType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationType + + Description + + + DisplayName + + + Icon + + + MessageDestinationName + + + + xsdBooleanType + https://jakarta.ee/xml/ns/jakartaee + XsdBooleanType + boolean + + + run-asType + https://jakarta.ee/xml/ns/jakartaee + RunAsType + + Description + + + RoleName + + + + localType + https://jakarta.ee/xml/ns/jakartaee + LocalType + java.lang.String + + + port-component-refType + https://jakarta.ee/xml/ns/jakartaee + PortComponentRefType + + ServiceEndpointInterface + + + PortComponentLink + + + + message-destination-refType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationRefType + + Description + + + MessageDestinationRefName + + + MessageDestinationType + + + MessageDestinationUsage + + + MessageDestinationLink + + + + ejb-ref-nameType + https://jakarta.ee/xml/ns/jakartaee + EjbRefNameType + java.lang.String + + + local-homeType + https://jakarta.ee/xml/ns/jakartaee + LocalHomeType + java.lang.String + + + resource-refType + https://jakarta.ee/xml/ns/jakartaee + ResourceRefType + + Description + + + ResRefName + + + ResType + + + ResAuth + + + ResSharingScope + + + + xsdNMTOKENType + https://jakarta.ee/xml/ns/jakartaee + XsdNMTOKENType + java.lang.String + + + ejb-local-refType + https://jakarta.ee/xml/ns/jakartaee + EjbLocalRefType + + Description + + + EjbRefName + + + EjbRefType + + + LocalHome + + + Local + + + EjbLink + + + + ejb-ref-typeType + https://jakarta.ee/xml/ns/jakartaee + EjbRefTypeType + java.lang.String + + + message-destination-typeType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationTypeType + java.lang.String + + + xsdPositiveIntegerType + https://jakarta.ee/xml/ns/jakartaee + XsdPositiveIntegerType + long + + + xsdNonNegativeIntegerType + https://jakarta.ee/xml/ns/jakartaee + XsdNonNegativeIntegerType + java.math.BigInteger + + + xsdQNameType + https://jakarta.ee/xml/ns/jakartaee + XsdQNameType + java.lang.String + + + res-authType + https://jakarta.ee/xml/ns/jakartaee + ResAuthType + java.lang.String + + + jndi-nameType + https://jakarta.ee/xml/ns/jakartaee + JndiNameType + java.lang.String + + + url-patternType + https://jakarta.ee/xml/ns/jakartaee + UrlPatternType + java.lang.String + + + security-roleType + https://jakarta.ee/xml/ns/jakartaee + SecurityRoleType + + Description + + + RoleName + + + + env-entry-type-valuesType + https://jakarta.ee/xml/ns/jakartaee + EnvEntryTypeValuesType + java.lang.String + + + ejb-linkType + https://jakarta.ee/xml/ns/jakartaee + EjbLinkType + java.lang.String + + + service-refType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefType + + Description + + + DisplayName + + + Icon + + + ServiceRefName + + + ServiceInterface + + + WsdlFile + + + JaxrpcMappingFile + + + ServiceQname + + + PortComponentRef + + + Handler + + + + java-typeType + https://jakarta.ee/xml/ns/jakartaee + JavaTypeType + java.lang.String + + + security-role-refType + https://jakarta.ee/xml/ns/jakartaee + SecurityRoleRefType + + Description + + + RoleName + + + RoleLink + + + + env-entryType + https://jakarta.ee/xml/ns/jakartaee + EnvEntryType + + Description + + + EnvEntryName + + + EnvEntryType + + + EnvEntryValue + + + + true-falseType + https://jakarta.ee/xml/ns/jakartaee + TrueFalseType + boolean + + + message-destination-linkType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationLinkType + java.lang.String + + + service-ref_handlerType + https://jakarta.ee/xml/ns/jakartaee + ServiceRefHandlerType + + Description + + + DisplayName + + + Icon + + + HandlerName + + + HandlerClass + + + InitParam + + + SoapHeader + + + SoapRole + + + PortName + + + + role-nameType + https://jakarta.ee/xml/ns/jakartaee + RoleNameType + java.lang.String + + + message-destination-usageType + https://jakarta.ee/xml/ns/jakartaee + MessageDestinationUsageType + java.lang.String + + + homeType + https://jakarta.ee/xml/ns/jakartaee + HomeType + java.lang.String + + diff --git a/enterprise/web.core/src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_4_1.xsd b/enterprise/web.core/src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_4_1.xsd new file mode 100644 index 000000000000..db350a5c48c9 --- /dev/null +++ b/enterprise/web.core/src/org/netbeans/modules/web/taglib/resources/web-jsptaglibrary_4_1.xsd @@ -0,0 +1,1109 @@ + + + + + + Copyright (c) 2009, 2021 Oracle and/or its affiliates. All rights reserved. + + This program and the accompanying materials are made available under the + terms of the Eclipse Public License v. 2.0, which is available at + http://www.eclipse.org/legal/epl-2.0. + + This Source Code may also be made available under the following Secondary + Licenses when the conditions for such availability set forth in the + Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + version 2 with the GNU Classpath Exception, which is available at + https://www.gnu.org/software/classpath/license.html. + + SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + + + + + + + + ... + + + The instance documents may indicate the published + version of the schema using xsi:schemaLocation attribute + for Jakarta EE namespace with the following location: + + https://jakarta.ee/xml/ns/jakartaee/web-jsptaglibrary_4_1.xsd + + ]]> + + + + + + + + + + + + + The taglib tag is the document root. + The definition of taglib is provided + by the tldTaglibType. + + + + + + + + The taglib element contains, among other things, tag and + tag-file elements. + The name subelements of these elements must each be unique. + + + + + + + + + + + The taglib element contains function elements. + The name subelements of these elements must each be unique. + + + + + + + + + + + + + + + + Specifies the type of body that is valid for a tag. + This value is used by the JSP container to validate + that a tag invocation has the correct body syntax and + by page composition tools to assist the page author + in providing a valid tag body. + + There are currently four values specified: + + tagdependent The body of the tag is interpreted by the tag + implementation itself, and is most likely + in a different "language", e.g embedded SQL + statements. + + JSP The body of the tag contains nested JSP + syntax. + + empty The body must be empty + + scriptless The body accepts only template text, EL + Expressions, and JSP action elements. No + scripting elements are allowed. + + + + + + + + + + + + + + + + + + + + + Defines the canonical name of a tag or attribute being + defined. + + The name must conform to the lexical rules for an NMTOKEN. + + + + + + + + + + + + + + + + A validator that can be used to validate + the conformance of a JSP page to using this tag library is + defined by a validatorType. + + + + + + + + + + Defines the TagLibraryValidator class that can be used + to validate the conformance of a JSP page to using this + tag library. + + + + + + + + + The init-param element contains a name/value pair as an + initialization param. + + + + + + + + + + + + + + + + The tag defines a unique tag in this tag library. It has one + attribute, id. + + The tag element may have several subelements defining: + + description Optional tag-specific information + + display-name A short name that is intended to be + displayed by tools + + icon Optional icon element that can be used + by tools + + name The unique action name + + tag-class The tag handler class implementing + jakarta.servlet.jsp.tagext.JspTag + + tei-class An optional subclass of + jakarta.servlet.jsp.tagext.TagExtraInfo + + body-content The body content type + + variable Optional scripting variable information + + attribute All attributes of this action that are + evaluated prior to invocation. + + dynamic-attributes Whether this tag supports additional + attributes with dynamic names. If + true, the tag-class must implement the + jakarta.servlet.jsp.tagext.DynamicAttributes + interface. Defaults to false. + + example Optional informal description of an + example of a use of this tag + + tag-extension Zero or more extensions that provide extra + information about this tag, for tool + consumption + + + + + + + + + + + Defines the subclass of jakarta.servlet.jsp.tagext.JspTag + that implements the request time semantics for + this tag. (required) + + + + + + + + + Defines the subclass of jakarta.servlet.jsp.tagext.TagExtraInfo + for this tag. (optional) + + If this is not given, the class is not consulted at + translation time. + + + + + + + + + Specifies the format for the body of this tag. + The default in JSP 1.2 was "JSP" but because this + is an invalid setting for simple tag handlers, there + is no longer a default in JSP 2.0. A reasonable + default for simple tag handlers is "scriptless" if + the tag can have a body. + + + + + + + + + + + + The example element contains an informal description + of an example of the use of a tag. + + + + + + + + + Tag extensions are for tool use only and must not affect + the behavior of a container. + + + + + + + + + + + + + + + + Defines an action in this tag library that is implemented + as a .tag file. + + The tag-file element has two required subelements: + + description Optional tag-specific information + + display-name A short name that is intended to be + displayed by tools + + icon Optional icon element that can be used + by tools + + name The unique action name + + path Where to find the .tag file implementing this + action, relative to the root of the web + application or the root of the JAR file for a + tag library packaged in a JAR. This must + begin with /WEB-INF/tags if the .tag file + resides in the WAR, or /META-INF/tags if the + .tag file resides in a JAR. + + example Optional informal description of an + example of a use of this tag + + tag-extension Zero or more extensions that provide extra + information about this tag, for tool + consumption + + + + + + + + + + + + The example element contains an informal description + of an example of the use of a tag. + + + + + + + + + Tag extensions are for tool use only and must not affect + the behavior of a container. + + + + + + + + + + + + + + + + The function element is used to provide information on each + function in the tag library that is to be exposed to the EL. + + The function element may have several subelements defining: + + description Optional tag-specific information + + display-name A short name that is intended to be + displayed by tools + + icon Optional icon element that can be used + by tools + + name A unique name for this function + + function-class Provides the name of the Java class that + implements the function + + function-signature Provides the signature, as in the Java + Language Specification, of the Java + method that is to be used to implement + the function. + + example Optional informal description of an + example of a use of this function + + function-extension Zero or more extensions that provide extra + information about this function, for tool + consumption + + + + + + + + + + A unique name for this function. + + + + + + + + + Provides the fully-qualified class name of the Java + class containing the static method that implements + the function. + + + + + + + + + Provides the signature, of the static Java method that is + to be used to implement the function. The syntax of the + function-signature element is as follows: + + FunctionSignature ::= ReturnType S MethodName S? + '(' S? Parameters? S? ')' + + ReturnType ::= Type + + MethodName ::= Identifier + + Parameters ::= Parameter + | ( Parameter S? ',' S? Parameters ) + + Parameter ::= Type + + Where: + + * Type is a basic type or a fully qualified + Java class name (including package name), + as per the 'Type' production in the Java + Language Specification, Second Edition, + Chapter 18. + + * Identifier is a Java identifier, as per + the 'Identifier' production in the Java + Language Specification, Second + Edition, Chapter 18. + + Example: + + java.lang.String nickName( java.lang.String, int ) + + + + + + + + + The example element contains an informal description + of an example of the use of this function. + + + + + + + + + Function extensions are for tool use only and must not + affect the behavior of a container. + + + + + + + + + + + + + + + + The taglib tag is the document root, it defines: + + description a simple string describing the "use" of this + taglib, should be user discernable + + display-name the display-name element contains a + short name that is intended to be displayed + by tools + + icon optional icon that can be used by tools + + tlib-version the version of the tag library implementation + + short-name a simple default short name that could be + used by a JSP authoring tool to create + names with a mnemonic value; for example, + the it may be used as the prefered prefix + value in taglib directives + + uri a uri uniquely identifying this taglib + + validator optional TagLibraryValidator information + + listener optional event listener specification + + tag tags in this tag library + + tag-file tag files in this tag library + + function zero or more EL functions defined in this + tag library + + taglib-extension zero or more extensions that provide extra + information about this taglib, for tool + consumption + + + + + + + + + + Describes this version (number) of the taglibrary. + It is described as a dewey decimal. + + + + + + + + + Defines a simple default name that could be used by + a JSP authoring tool to create names with a + mnemonicvalue; for example, it may be used as the + preferred prefix value in taglib directives. Do + not use white space, and do not start with digits + or underscore. + + + + + + + + + Defines a public URI that uniquely identifies this + version of the taglibrary. Leave it empty if it + does not apply. + + + + + + + + + + + + + + + + Taglib extensions are for tool use only and must not + affect the behavior of a container. + + + + + + + + + + Describes the JSP version (number) this taglibrary + requires in order to function (dewey decimal) + + + + + + + + + + + + + + + The variableType provides information on the scripting + variables defined by using this tag. It is a (translation + time) error for a tag that has one or more variable + subelements to have a TagExtraInfo class that returns a + non-null value from a call to getVariableInfo(). + + The subelements of variableType are of the form: + + description Optional description of this + variable + + name-given The variable name as a constant + + name-from-attribute The name of an attribute whose + (translation time) value will + give the name of the + variable. One of name-given or + name-from-attribute is required. + + variable-class Name of the class of the variable. + java.lang.String is default. + + declare Whether the variable is declared + or not. True is the default. + + scope The scope of the scripting varaible + defined. NESTED is default. + + + + + + + + + + + The name for the scripting variable. + + + + + + + + + The name of an attribute whose + (translation-time) value will give the name of + the variable. + + + + + + + + + + The optional name of the class for the scripting + variable. The default is java.lang.String. + + + + + + + + + Whether the scripting variable is to be defined + or not. See TagExtraInfo for details. This + element is optional and "true" is the default. + + + + + + + + + The element is optional and "NESTED" is the default. + + + + + + + + + + + + + + + + This type defines scope of the scripting variable. See + TagExtraInfo for details. The allowed values are, + "NESTED", "AT_BEGIN" and "AT_END". + + + + + + + + + + + + + + + + + + + + The attribute element defines an attribute for the nesting + tag. The attribute element may have several subelements + defining: + + description a description of the attribute + + name the name of the attribute + + required whether the attribute is required or + optional + + rtexprvalue whether the attribute is a runtime attribute + + type the type of the attributes + + fragment whether this attribute is a fragment + + deferred-value present if this attribute is to be parsed as a + jakarta.el.ValueExpression + + deferred-method present if this attribute is to be parsed as a + jakarta.el.MethodExpression + + + + + + + + + + + Defines if the nesting attribute is required or + optional. + + If not present then the default is "false", i.e + the attribute is optional. + + + + + + + + + + + + Defines if the nesting attribute can have scriptlet + expressions as a value, i.e the value of the + attribute may be dynamically calculated at request + time, as opposed to a static value determined at + translation time. + If not present then the default is "false", i.e the + attribute has a static value + + + + + + + + + Defines the Java type of the attributes value. + If this element is omitted, the expected type is + assumed to be "java.lang.Object". + + + + + + + + + + + Present if the value for this attribute is to be + passed to the tag handler as a + jakarta.el.ValueExpression. This allows for deferred + evaluation of EL expressions. An optional subelement + will contain the expected type that the value will + be coerced to after evaluation of the expression. + The type defaults to Object if one is not provided. + + + + + + + + + Present if the value for this attribute is to be + passed to the tag handler as a + jakarta.el.MethodExpression. This allows for deferred + evaluation of an EL expression that identifies a + method to be invoked on an Object. An optional + subelement will contain the expected method + signature. The signature defaults to "void method()" + if one is not provided. + + + + + + + + + + + "true" if this attribute is of type + jakarta.servlet.jsp.tagext.JspFragment, representing dynamic + content that can be re-evaluated as many times + as needed by the tag handler. If omitted or "false", + the default is still type="java.lang.String" + + + + + + + + + + + + + + + + + Defines information about how to provide the value for a + tag handler attribute that accepts a jakarta.el.ValueExpression. + + The deferred-value element has one optional subelement: + + type the expected type of the attribute + + + + + + + + + The fully-qualified name of the Java type that is the + expected type for this deferred expression. If this + element is omitted, the expected type is assumed to be + "java.lang.Object". + + + + + + + + + + + + + + + + Defines information about how to provide the value for a + tag handler attribute that accepts a jakarta.el.MethodExpression. + + The deferred-method element has one optional subelement: + + method-signature Provides the signature, as in the Java + Language Specifies, that is expected for + the method being identified by the + expression. + + + + + + + + + Provides the expected signature of the method identified + by the jakarta.el.MethodExpression. + + This disambiguates overloaded methods and ensures that + the return value is of the expected type. + + The syntax of the method-signature element is identical + to that of the function-signature element. See the + documentation for function-signature for more details. + + The name of the method is for documentation purposes only + and is ignored by the JSP container. + + Example: + + boolean validate(java.lang.String) + + + + + + + + + + + + + + + + The tld-extensionType is used to indicate + extensions to a specific TLD element. + + It is used by elements to designate an extension block + that is targeted to a specific extension designated by + a set of extension elements that are declared by a + namespace. The namespace identifies the extension to + the tool that processes the extension. + + The type of the extension-element is abstract. Therefore, + a concrete type must be specified by the TLD using + xsi:type attribute for each extension-element. + + + + + + + + + + + + + + + + + + The extensibleType is an abstract base type that is used to + define the type of extension-elements. Instance documents + must substitute a known type to define the extension by + using xsi:type attribute to define the actual type of + extension-elements. + + + + + + + diff --git a/enterprise/web.core/src/org/netbeans/modules/web/wizards/PageIterator.java b/enterprise/web.core/src/org/netbeans/modules/web/wizards/PageIterator.java index d6f6ba78d5de..b912a518e2e3 100644 --- a/enterprise/web.core/src/org/netbeans/modules/web/wizards/PageIterator.java +++ b/enterprise/web.core/src/org/netbeans/modules/web/wizards/PageIterator.java @@ -207,6 +207,11 @@ private static boolean isJSF41(WebModule wm) { ClassPath classpath = ClassPath.getClassPath(wm.getDocumentBase(), ClassPath.COMPILE); return classpath != null && classpath.findResource("jakarta/faces/convert/UUIDConverter.class") != null; //NOI18N } + + private static boolean isJSF50(WebModule wm) { + ClassPath classpath = ClassPath.getClassPath(wm.getDocumentBase(), ClassPath.COMPILE); + return classpath != null && classpath.findResource("jakarta/faces/CurrentThreadToServletContext.class") != null; //NOI18N + } public Set instantiate(TemplateWizard wiz) throws IOException { // Here is the default plain behavior. Simply takes the selected @@ -241,7 +246,9 @@ public Set instantiate(TemplateWizard wiz) throws IOException { template = templateParent.getFileObject("JSP", "xhtml"); //NOI18N WebModule wm = WebModule.getWebModule(df.getPrimaryFile()); if (wm != null) { - if (isJSF41(wm)) { + if (isJSF50(wm)) { + wizardProps.put("isJSF50", Boolean.TRUE); + } else if (isJSF41(wm)) { wizardProps.put("isJSF41", Boolean.TRUE); } else if (isJSF40(wm)) { wizardProps.put("isJSF40", Boolean.TRUE); diff --git a/enterprise/web.jsf.editor/src/org/netbeans/modules/web/jsf/editor/facelets/mojarra/ConfigManager.java b/enterprise/web.jsf.editor/src/org/netbeans/modules/web/jsf/editor/facelets/mojarra/ConfigManager.java index f8b0b7c9561b..52bb12bbc7eb 100644 --- a/enterprise/web.jsf.editor/src/org/netbeans/modules/web/jsf/editor/facelets/mojarra/ConfigManager.java +++ b/enterprise/web.jsf.editor/src/org/netbeans/modules/web/jsf/editor/facelets/mojarra/ConfigManager.java @@ -125,7 +125,6 @@ import org.netbeans.api.xml.services.UserCatalog; import org.netbeans.modules.web.jsf.editor.facelets.DefaultFaceletLibraries; import org.netbeans.modules.web.jsfapi.api.JsfNamespaces; -import org.openide.util.Exceptions; import org.w3c.dom.*; import org.w3c.dom.ls.LSInput; import org.w3c.dom.ls.LSResourceResolver; @@ -258,7 +257,7 @@ public class ConfigManager { // initialize the resource providers for faces-config documents List facesConfigProviders = - new ArrayList(3); + new ArrayList(8); facesConfigProviders.add(new MojarraFacesConfigResourceProvider()); facesConfigProviders.add(new MetaInfFacesConfigResourceProvider()); facesConfigProviders.add(new WebAppFlowConfigResourceProvider()); @@ -267,7 +266,7 @@ public class ConfigManager { // initialize the resource providers for facelet-taglib documents List faceletTaglibProviders = - new ArrayList(3); + new ArrayList(4); faceletTaglibProviders.add(new MetaInfFaceletTaglibraryConfigProvider()); faceletTaglibProviders.add(new WebFaceletTaglibResourceProvider()); FACELET_TAGLIBRARY_RESOURCE_PROVIDERS = Collections.unmodifiableList(faceletTaglibProviders); @@ -972,7 +971,8 @@ private static class ParseTask implements Callable { private static final Map VERSION_FACES_SCHEMA_FACES_MAPPING; static { - Map map = new HashMap<>(); + Map map = new HashMap<>(16); + map.put("5.0", "com/sun/faces/web-facesconfig_5_0.xsd"); map.put("4.1", "com/sun/faces/web-facesconfig_4_1.xsd"); map.put("4.0", "com/sun/faces/web-facesconfig_4_0.xsd"); map.put("3.0", "com/sun/faces/web-facesconfig_3_0.xsd"); @@ -986,7 +986,8 @@ private static class ParseTask implements Callable { private static final Map VERSION_FACES_SCHEMA_FACELET_TAGLIB_MAPPING; static { - Map map = new HashMap<>(); + Map map = new HashMap<>(16); + map.put("5.0", "com/sun/faces/web-facelettaglibrary_5_0.xsd"); map.put("4.1", "com/sun/faces/web-facelettaglibrary_4_1.xsd"); map.put("4.0", "com/sun/faces/web-facelettaglibrary_4_0.xsd"); map.put("3.0", "com/sun/faces/web-facelettaglibrary_3_0.xsd"); diff --git a/enterprise/web.jsf/licenseinfo.xml b/enterprise/web.jsf/licenseinfo.xml index 54a3274a6561..14ca4bc50fbb 100644 --- a/enterprise/web.jsf/licenseinfo.xml +++ b/enterprise/web.jsf/licenseinfo.xml @@ -106,6 +106,8 @@ src/org/netbeans/modules/web/jsf/resources/web-facesconfig_4_0.xsd src/org/netbeans/modules/web/jsf/resources/web-facelettaglibrary_4_1.xsd src/org/netbeans/modules/web/jsf/resources/web-facesconfig_4_1.xsd + src/org/netbeans/modules/web/jsf/resources/web-facelettaglibrary_5_0.xsd + src/org/netbeans/modules/web/jsf/resources/web-facesconfig_5_0.xsd diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFCatalog.java b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFCatalog.java index 20e04c815aa4..056a5c41d4a6 100644 --- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFCatalog.java +++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFCatalog.java @@ -20,6 +20,7 @@ package org.netbeans.modules.web.jsf; +import java.io.IOException; import java.util.List; import java.util.ArrayList; @@ -28,6 +29,8 @@ import org.openide.util.NbBundle; import org.w3c.dom.Document; import org.w3c.dom.DocumentType; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; /** * @@ -40,18 +43,20 @@ public class JSFCatalog implements CatalogReader, CatalogDescriptor2, org.xml.sa private static final String URL_JSF_1_0 ="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_1_0.dtd"; // NOI18N private static final String URL_JSF_1_1 ="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_1_1.dtd"; // NOI18N - private static final String URL_JSF_1_2="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_1_2.xsd"; // NOI18N - private static final String URL_JSF_2_0="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_2_0.xsd"; // NOI18N - private static final String URL_JSF_2_1="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_2_1.xsd"; // NOI18N - private static final String URL_JSF_2_2="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_2_2.xsd"; // NOI18N - private static final String URL_JSF_2_3="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_2_3.xsd"; // NOI18N - private static final String URL_JSF_3_0="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_3_0.xsd"; // NOI18N - private static final String URL_JSF_4_0="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_4_0.xsd"; // NOI18N - private static final String URL_JSF_4_1="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_4_1.xsd"; // NOI18N + private static final String URL_JSF_1_2 ="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_1_2.xsd"; // NOI18N + private static final String URL_JSF_2_0 ="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_2_0.xsd"; // NOI18N + private static final String URL_JSF_2_1 ="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_2_1.xsd"; // NOI18N + private static final String URL_JSF_2_2 ="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_2_2.xsd"; // NOI18N + private static final String URL_JSF_2_3 ="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_2_3.xsd"; // NOI18N + private static final String URL_JSF_3_0 ="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_3_0.xsd"; // NOI18N + private static final String URL_JSF_4_0 ="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_4_0.xsd"; // NOI18N + private static final String URL_JSF_4_1 ="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_4_1.xsd"; // NOI18N + private static final String URL_JSF_5_0 ="nbres:/org/netbeans/modules/web/jsf/resources/web-facesconfig_5_0.xsd"; // NOI18N public static final String JAVAEE_NS = "http://java.sun.com/xml/ns/javaee"; // NOI18N public static final String NEW_JAVAEE_NS = "http://xmlns.jcp.org/xml/ns/javaee"; //NOI18N public static final String JAKARTAEE_NS = "https://jakarta.ee/xml/ns/jakartaee"; //NOI18N + private static final String JSF_1_2_XSD="web-facesconfig_1_2.xsd"; // NOI18N private static final String JSF_2_0_XSD="web-facesconfig_2_0.xsd"; // NOI18N private static final String JSF_2_1_XSD="web-facesconfig_2_1.xsd"; // NOI18N @@ -60,14 +65,18 @@ public class JSFCatalog implements CatalogReader, CatalogDescriptor2, org.xml.sa private static final String JSF_3_0_XSD="web-facesconfig_3_0.xsd"; // NOI18N private static final String JSF_4_0_XSD="web-facesconfig_4_0.xsd"; // NOI18N private static final String JSF_4_1_XSD="web-facesconfig_4_1.xsd"; // NOI18N - private static final String JSF_1_2=JAVAEE_NS+"/"+JSF_1_2_XSD; // NOI18N - private static final String JSF_2_0=JAVAEE_NS+"/"+JSF_2_0_XSD; // NOI18N - private static final String JSF_2_1=JAVAEE_NS+"/"+JSF_2_1_XSD; // NOI18N - private static final String JSF_2_2=NEW_JAVAEE_NS+"/"+JSF_2_2_XSD; // NOI18N - private static final String JSF_2_3=NEW_JAVAEE_NS+"/"+JSF_2_3_XSD; // NOI18N - private static final String JSF_3_0=JAKARTAEE_NS+"/"+JSF_3_0_XSD; // NOI18N - private static final String JSF_4_0=JAKARTAEE_NS+"/"+JSF_4_0_XSD; // NOI18N - private static final String JSF_4_1=JAKARTAEE_NS+"/"+JSF_4_1_XSD; // NOI18N + private static final String JSF_5_0_XSD="web-facesconfig_5_0.xsd"; // NOI18N + + public static final String JSF_1_2=JAVAEE_NS+"/"+JSF_1_2_XSD; // NOI18N + public static final String JSF_2_0=JAVAEE_NS+"/"+JSF_2_0_XSD; // NOI18N + public static final String JSF_2_1=JAVAEE_NS+"/"+JSF_2_1_XSD; // NOI18N + public static final String JSF_2_2=NEW_JAVAEE_NS+"/"+JSF_2_2_XSD; // NOI18N + public static final String JSF_2_3=NEW_JAVAEE_NS+"/"+JSF_2_3_XSD; // NOI18N + public static final String JSF_3_0=JAKARTAEE_NS+"/"+JSF_3_0_XSD; // NOI18N + public static final String JSF_4_0=JAKARTAEE_NS+"/"+JSF_4_0_XSD; // NOI18N + public static final String JSF_4_1=JAKARTAEE_NS+"/"+JSF_4_1_XSD; // NOI18N + public static final String JSF_5_0=JAKARTAEE_NS+"/"+JSF_5_0_XSD; // NOI18N + public static final String JSF_ID_1_2="SCHEMA:"+JSF_1_2; // NOI18N public static final String JSF_ID_2_0="SCHEMA:"+JSF_2_0; // NOI18N public static final String JSF_ID_2_1="SCHEMA:"+JSF_2_1; // NOI18N @@ -76,6 +85,7 @@ public class JSFCatalog implements CatalogReader, CatalogDescriptor2, org.xml.sa public static final String JSF_ID_3_0="SCHEMA:"+JSF_3_0; // NOI18N public static final String JSF_ID_4_0="SCHEMA:"+JSF_4_0; // NOI18N public static final String JSF_ID_4_1="SCHEMA:"+JSF_4_1; // NOI18N + public static final String JSF_ID_5_0="SCHEMA:"+JSF_5_0; // NOI18N // faces-config resources @@ -88,8 +98,10 @@ public class JSFCatalog implements CatalogReader, CatalogDescriptor2, org.xml.sa public static final String RES_FACES_CONFIG_3_0 = "faces-config_3_0.xml"; public static final String RES_FACES_CONFIG_4_0 = "faces-config_4_0.xml"; public static final String RES_FACES_CONFIG_4_1 = "faces-config_4_1.xml"; + public static final String RES_FACES_CONFIG_5_0 = "faces-config_5_0.xml"; //facelets + private static final String FILE_FACELETS_TAGLIB_SCHEMA_50="web-facelettaglibrary_5_0.xsd"; //NOI18N private static final String FILE_FACELETS_TAGLIB_SCHEMA_41="web-facelettaglibrary_4_1.xsd"; //NOI18N private static final String FILE_FACELETS_TAGLIB_SCHEMA_40="web-facelettaglibrary_4_0.xsd"; //NOI18N private static final String FILE_FACELETS_TAGLIB_SCHEMA_30="web-facelettaglibrary_3_0.xsd"; //NOI18N @@ -98,6 +110,8 @@ public class JSFCatalog implements CatalogReader, CatalogDescriptor2, org.xml.sa private static final String FILE_FACELETS_TAGLIB_SCHEMA_20="web-facelettaglibrary_2_0.xsd"; //NOI18N private static final String FILE_FACELETS_TAGLIB_DTD_10="facelet-taglib_1_0.dtd"; //NOI18N + private static final String URL_FACELETS_TAGLIB_SCHEMA_50 = JAKARTAEE_NS + "/" + FILE_FACELETS_TAGLIB_SCHEMA_50; // NOI18N + private static final String ID_FACELETS_TAGLIB_SCHEMA_50 ="SCHEMA:" + URL_FACELETS_TAGLIB_SCHEMA_50; private static final String URL_FACELETS_TAGLIB_SCHEMA_41 = JAKARTAEE_NS + "/" + FILE_FACELETS_TAGLIB_SCHEMA_41; // NOI18N private static final String ID_FACELETS_TAGLIB_SCHEMA_41 ="SCHEMA:" + URL_FACELETS_TAGLIB_SCHEMA_41; private static final String URL_FACELETS_TAGLIB_SCHEMA_40 = JAKARTAEE_NS + "/" + FILE_FACELETS_TAGLIB_SCHEMA_40; // NOI18N @@ -112,6 +126,7 @@ public class JSFCatalog implements CatalogReader, CatalogDescriptor2, org.xml.sa private static final String ID_FACELETS_TAGLIB_SCHEMA_20 ="SCHEMA:" + URL_FACELETS_TAGLIB_SCHEMA_20; private static final String ID_FACELETS_TAGLIB_DTD_10 = "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"; //NOI18N + private static final String RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_50 ="nbres:/org/netbeans/modules/web/jsf/resources/" + FILE_FACELETS_TAGLIB_SCHEMA_50; // NOI18N private static final String RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_41 ="nbres:/org/netbeans/modules/web/jsf/resources/" + FILE_FACELETS_TAGLIB_SCHEMA_41; // NOI18N private static final String RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_40 ="nbres:/org/netbeans/modules/web/jsf/resources/" + FILE_FACELETS_TAGLIB_SCHEMA_40; // NOI18N private static final String RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_30 ="nbres:/org/netbeans/modules/web/jsf/resources/" + FILE_FACELETS_TAGLIB_SCHEMA_30; // NOI18N @@ -140,6 +155,7 @@ public java.util.Iterator getPublicIDs() { list.add(JSF_ID_3_0); list.add(JSF_ID_4_0); list.add(JSF_ID_4_1); + list.add(JSF_ID_5_0); list.add(ID_FACELETS_TAGLIB_DTD_10); list.add(ID_FACELETS_TAGLIB_SCHEMA_20); list.add(ID_FACELETS_TAGLIB_SCHEMA_22); @@ -147,6 +163,7 @@ public java.util.Iterator getPublicIDs() { list.add(ID_FACELETS_TAGLIB_SCHEMA_30); list.add(ID_FACELETS_TAGLIB_SCHEMA_40); list.add(ID_FACELETS_TAGLIB_SCHEMA_41); + list.add(ID_FACELETS_TAGLIB_SCHEMA_50); return list.listIterator(); } @@ -179,6 +196,8 @@ public String getSystemID(String publicId) { return URL_JSF_4_0; case JSF_ID_4_1: return URL_JSF_4_1; + case JSF_ID_5_0: + return URL_JSF_5_0; case ID_FACELETS_TAGLIB_DTD_10: return RESOURCE_URL_FACELETS_TAGLIB_DTD_10; case ID_FACELETS_TAGLIB_SCHEMA_20: @@ -193,6 +212,8 @@ public String getSystemID(String publicId) { return RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_40; case ID_FACELETS_TAGLIB_SCHEMA_41: return RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_41; + case ID_FACELETS_TAGLIB_SCHEMA_50: + return RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_50; default: return null; } @@ -250,77 +271,90 @@ public String getShortDescription() { } /** - * Resolves schema definition file for taglib descriptor (spec.1_1, 1_2, 2_0, 2_1, 2_2, 2_3, 3_0, 4_0, 4_1) + * Resolves schema definition file for taglib descriptor (spec.1_1, 1_2, 2_0, 2_1, 2_2, 2_3, 3_0, 4_0, 4_1, 5_0) * @param publicId publicId for resolved entity (null in our case) * @param systemId systemId for resolved entity - * @return InputSource for publisId, + * @return InputSource for publicId, */ - public org.xml.sax.InputSource resolveEntity(String publicId, String systemId) throws org.xml.sax.SAXException, java.io.IOException { - if (JSF_ID_1_0.equals(publicId)) { - return new org.xml.sax.InputSource(URL_JSF_1_0); - } else if (JSF_ID_1_1.equals(publicId)) { - return new org.xml.sax.InputSource(URL_JSF_1_1); - } else if(ID_FACELETS_TAGLIB_DTD_10.equals(publicId)) { - return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_DTD_10); - } else if (JSF_1_2.equals(systemId)) { - return new org.xml.sax.InputSource(URL_JSF_1_2); - } else if (JSF_2_0.equals(systemId)) { - return new org.xml.sax.InputSource(URL_JSF_2_0); - } else if (JSF_2_1.equals(systemId)) { - return new org.xml.sax.InputSource(URL_JSF_2_1); - } else if (JSF_2_2.equals(systemId)) { - return new org.xml.sax.InputSource(URL_JSF_2_2); - } else if (JSF_2_3.equals(systemId)) { - return new org.xml.sax.InputSource(URL_JSF_2_3); - } else if (JSF_3_0.equals(systemId)) { - return new org.xml.sax.InputSource(URL_JSF_3_0); - } else if (JSF_4_0.equals(systemId)) { - return new org.xml.sax.InputSource(URL_JSF_4_0); - } else if (JSF_4_1.equals(systemId)) { - return new org.xml.sax.InputSource(URL_JSF_4_1); - } else if (URL_FACELETS_TAGLIB_SCHEMA_20.equals(systemId)) { - return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_20); - } else if (URL_FACELETS_TAGLIB_SCHEMA_22.equals(systemId)) { - return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_22); - } else if (URL_FACELETS_TAGLIB_SCHEMA_23.equals(systemId)) { - return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_23); - } else if (URL_FACELETS_TAGLIB_SCHEMA_30.equals(systemId)) { - return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_30); - } else if (URL_FACELETS_TAGLIB_SCHEMA_40.equals(systemId)) { - return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_40); - } else if (URL_FACELETS_TAGLIB_SCHEMA_41.equals(systemId)) { - return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_41); - } else if (systemId!=null && systemId.endsWith(JSF_1_2_XSD)) { - return new org.xml.sax.InputSource(URL_JSF_1_2); - } else if (systemId!=null && systemId.endsWith(JSF_2_0_XSD)) { - return new org.xml.sax.InputSource(URL_JSF_2_0); - } else if (systemId!=null && systemId.endsWith(JSF_2_1_XSD)) { - return new org.xml.sax.InputSource(URL_JSF_2_1); - } else if (systemId!=null && systemId.endsWith(JSF_2_2_XSD)) { - return new org.xml.sax.InputSource(URL_JSF_2_2); - } else if (systemId!=null && systemId.endsWith(JSF_2_3_XSD)) { - return new org.xml.sax.InputSource(URL_JSF_2_3); - } else if (systemId!=null && systemId.endsWith(JSF_3_0_XSD)) { - return new org.xml.sax.InputSource(URL_JSF_3_0); - } else if (systemId!=null && systemId.endsWith(JSF_4_0_XSD)) { - return new org.xml.sax.InputSource(URL_JSF_4_0); - } else if (systemId!=null && systemId.endsWith(JSF_4_1_XSD)) { - return new org.xml.sax.InputSource(URL_JSF_4_1); - } else if (systemId!=null && systemId.endsWith(FILE_FACELETS_TAGLIB_SCHEMA_20)) { - return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_20); - } else if (systemId!=null && systemId.endsWith(FILE_FACELETS_TAGLIB_SCHEMA_22)) { - return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_22); - } else if (systemId!=null && systemId.endsWith(FILE_FACELETS_TAGLIB_SCHEMA_23)) { - return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_23); - } else if (systemId!=null && systemId.endsWith(FILE_FACELETS_TAGLIB_SCHEMA_30)) { - return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_30); - } else if (systemId!=null && systemId.endsWith(FILE_FACELETS_TAGLIB_SCHEMA_40)) { - return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_40); - } else if (systemId!=null && systemId.endsWith(FILE_FACELETS_TAGLIB_SCHEMA_41)) { - return new org.xml.sax.InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_41); - } else { - return null; + @Override + public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { + + InputSource schema = null; + + // Match by publicId + if (null != publicId) { + switch (publicId) { + case JSF_ID_1_0 -> schema = new InputSource(URL_JSF_1_0); + case JSF_ID_1_1 -> schema = new InputSource(URL_JSF_1_1); + case ID_FACELETS_TAGLIB_DTD_10 -> schema = new InputSource(RESOURCE_URL_FACELETS_TAGLIB_DTD_10); + default -> {} + } + } + + if (null != schema || null == systemId) { + return schema; + } + + // Match by systemId + switch (systemId) { + case JSF_1_2 -> schema = new InputSource(URL_JSF_1_2); + case JSF_2_0 -> schema = new InputSource(URL_JSF_2_0); + case JSF_2_1 -> schema = new InputSource(URL_JSF_2_1); + case JSF_2_2 -> schema = new InputSource(URL_JSF_2_2); + case JSF_2_3 -> schema = new InputSource(URL_JSF_2_3); + case JSF_3_0 -> schema = new InputSource(URL_JSF_3_0); + case JSF_4_0 -> schema = new InputSource(URL_JSF_4_0); + case JSF_4_1 -> schema = new InputSource(URL_JSF_4_1); + case JSF_5_0 -> schema = new InputSource(URL_JSF_5_0); + case URL_FACELETS_TAGLIB_SCHEMA_20 -> schema = new InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_20); + case URL_FACELETS_TAGLIB_SCHEMA_22 -> schema = new InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_22); + case URL_FACELETS_TAGLIB_SCHEMA_23 -> schema = new InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_23); + case URL_FACELETS_TAGLIB_SCHEMA_30 -> schema = new InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_30); + case URL_FACELETS_TAGLIB_SCHEMA_40 -> schema = new InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_40); + case URL_FACELETS_TAGLIB_SCHEMA_41 -> schema = new InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_41); + case URL_FACELETS_TAGLIB_SCHEMA_50 -> schema = new InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_50); + default -> {} + } + + if (null != schema) { + return schema; + } + + if (systemId.endsWith(JSF_1_2_XSD)) { + schema = new InputSource(URL_JSF_1_2); + } else if (systemId.endsWith(JSF_2_0_XSD)) { + schema = new InputSource(URL_JSF_2_0); + } else if (systemId.endsWith(JSF_2_1_XSD)) { + schema = new InputSource(URL_JSF_2_1); + } else if (systemId.endsWith(JSF_2_2_XSD)) { + schema = new InputSource(URL_JSF_2_2); + } else if (systemId.endsWith(JSF_2_3_XSD)) { + schema = new InputSource(URL_JSF_2_3); + } else if (systemId.endsWith(JSF_3_0_XSD)) { + schema = new InputSource(URL_JSF_3_0); + } else if (systemId.endsWith(JSF_4_0_XSD)) { + schema = new InputSource(URL_JSF_4_0); + } else if (systemId.endsWith(JSF_4_1_XSD)) { + schema = new InputSource(URL_JSF_4_1); + } else if (systemId.endsWith(JSF_5_0_XSD)) { + schema = new InputSource(URL_JSF_5_0); + } else if (systemId.endsWith(FILE_FACELETS_TAGLIB_SCHEMA_20)) { + schema = new InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_20); + } else if (systemId.endsWith(FILE_FACELETS_TAGLIB_SCHEMA_22)) { + schema = new InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_22); + } else if (systemId.endsWith(FILE_FACELETS_TAGLIB_SCHEMA_23)) { + schema = new InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_23); + } else if (systemId.endsWith(FILE_FACELETS_TAGLIB_SCHEMA_30)) { + schema = new InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_30); + } else if (systemId.endsWith(FILE_FACELETS_TAGLIB_SCHEMA_40)) { + schema = new InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_40); + } else if (systemId.endsWith(FILE_FACELETS_TAGLIB_SCHEMA_41)) { + schema = new InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_41); + } else if (systemId.endsWith(FILE_FACELETS_TAGLIB_SCHEMA_50)) { + schema = new InputSource(RESOURCE_URL_FACELETS_TAGLIB_SCHEMA_50); } + + return schema; } /** @@ -341,42 +375,23 @@ public String resolvePublic(String publicId) { public static JsfVersion extractVersion(Document document) { // first check the doc type to see if there is one DocumentType dt = document.getDoctype(); - JsfVersion value = JsfVersion.JSF_1_0; // This is the default version + JsfVersion value = JsfVersion.JSF_2_3; if (dt != null) { switch (dt.getPublicId()) { - case JSF_ID_1_0: - value = JsfVersion.JSF_1_0; - break; - case JSF_ID_1_1: - value = JsfVersion.JSF_1_1; - break; - case JSF_ID_1_2: - value = JsfVersion.JSF_1_2; - break; - case JSF_ID_2_0: - value = JsfVersion.JSF_2_0; - break; - case JSF_ID_2_1: - value = JsfVersion.JSF_2_1; - break; - case JSF_ID_2_2: - value = JsfVersion.JSF_2_2; - break; - case JSF_ID_2_3: - value = JsfVersion.JSF_2_3; - break; - case JSF_ID_3_0: - value = JsfVersion.JSF_3_0; - break; - case JSF_ID_4_0: - value = JsfVersion.JSF_4_0; - break; - case JSF_ID_4_1: - value = JsfVersion.JSF_4_1; - break; - default: - break; + case JSF_ID_1_0 -> value = JsfVersion.JSF_1_0; + case JSF_ID_1_1 -> value = JsfVersion.JSF_1_1; + case JSF_ID_1_2 -> value = JsfVersion.JSF_1_2; + case JSF_ID_2_0 -> value = JsfVersion.JSF_2_0; + case JSF_ID_2_1 -> value = JsfVersion.JSF_2_1; + case JSF_ID_2_2 -> value = JsfVersion.JSF_2_2; + case JSF_ID_2_3 -> value = JsfVersion.JSF_2_3; + case JSF_ID_3_0 -> value = JsfVersion.JSF_3_0; + case JSF_ID_4_0 -> value = JsfVersion.JSF_4_0; + case JSF_ID_4_1 -> value = JsfVersion.JSF_4_1; + case JSF_ID_5_0 -> value = JsfVersion.JSF_5_0; + default -> { + } } } return value; diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFFrameworkProvider.java b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFFrameworkProvider.java index 79e56e14b95e..e83f4bd2b565 100644 --- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFFrameworkProvider.java +++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFFrameworkProvider.java @@ -577,7 +577,9 @@ public void run() { if (ddRoot != null) { Profile profile = webModule.getJ2eeProfile(); if (profile != null && profile.isAtLeast(Profile.JAVA_EE_5) && jsfVersion != null) { - if (jsfVersion.isAtLeast(JsfVersion.JSF_4_1)) { + if (jsfVersion.isAtLeast(JsfVersion.JSF_5_0)) { + facesConfigTemplate = JSFCatalog.RES_FACES_CONFIG_5_0; + } else if (jsfVersion.isAtLeast(JsfVersion.JSF_4_1)) { facesConfigTemplate = JSFCatalog.RES_FACES_CONFIG_4_1; } else if (jsfVersion.isAtLeast(JsfVersion.JSF_4_0)) { facesConfigTemplate = JSFCatalog.RES_FACES_CONFIG_4_0; @@ -700,7 +702,9 @@ public void run() { FileObject template = FileUtil.getConfigRoot().getFileObject(WELCOME_XHTML_TEMPLATE); HashMap params = new HashMap<>(); if (jsfVersion != null) { - if (jsfVersion.isAtLeast(JsfVersion.JSF_4_1)) { + if (jsfVersion.isAtLeast(JsfVersion.JSF_5_0)) { + params.put("isJSF50", Boolean.TRUE); //NOI18N + } else if (jsfVersion.isAtLeast(JsfVersion.JSF_4_1)) { params.put("isJSF41", Boolean.TRUE); //NOI18N } if (jsfVersion.isAtLeast(JsfVersion.JSF_4_0)) { params.put("isJSF40", Boolean.TRUE); //NOI18N @@ -755,7 +759,8 @@ private boolean isGlassFishv3(String serverInstanceID) { String shortName; try { shortName = Deployment.getDefault().getServerInstance(serverInstanceID).getServerID(); - if ("gfv800ee11".equals(shortName) || "gfv700ee10".equals(shortName) + if ("gfv900ee12".equals(shortName) + || "gfv800ee11".equals(shortName) || "gfv700ee10".equals(shortName) || "gfv610ee9".equals(shortName) || "gfv6ee9".equals(shortName) || "gfv510ee8".equals(shortName) || "gfv5ee8".equals(shortName) || "gfv5".equals(shortName) || "gfv4ee7".equals(shortName) diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFUtils.java b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFUtils.java index e137a0b891cc..7891f968b7a1 100644 --- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFUtils.java +++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/JSFUtils.java @@ -71,6 +71,7 @@ public class JSFUtils { public static final String DEFAULT_JSF_3_0_NAME = "jsf30"; //NOI18N public static final String DEFAULT_JSF_4_0_NAME = "jsf40"; //NOI18N public static final String DEFAULT_JSF_4_1_NAME = "jsf41"; //NOI18N + public static final String DEFAULT_JSF_5_0_NAME = "jsf50"; //NOI18N // the name of jstl library public static final String DEFAULT_JSTL_1_1_NAME = "jstl11"; //NOI18N @@ -88,6 +89,7 @@ public class JSFUtils { public static final String JSF_3_0__API_SPECIFIC_CLASS = "jakarta.faces.push.PushContext"; //NOI18N public static final String JSF_4_0__API_SPECIFIC_CLASS = "jakarta.faces.lifecycle.ClientWindowScoped"; //NOI18N public static final String JSF_4_1__API_SPECIFIC_CLASS = "jakarta.faces.convert.UUIDConverter"; //NOI18N + public static final String JSF_5_0__API_SPECIFIC_CLASS = "jakarta.faces.CurrentThreadToServletContext"; //NOI18N public static final String MYFACES_SPECIFIC_CLASS = "org.apache.myfaces.webapp.StartupServletContextListener"; //NOI18N //constants for web.xml (Java EE) diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/api/ConfigurationUtils.java b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/api/ConfigurationUtils.java index 2fc70b674022..c973da408808 100644 --- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/api/ConfigurationUtils.java +++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/api/ConfigurationUtils.java @@ -103,8 +103,8 @@ public static Servlet getFacesServlet(WebModule webModule) { WebApp webApp = DDProvider.getDefault().getDDRoot(deploymentDescriptor); // Try to find according the servlet class name. The javax.faces.webapp.FacesServlet is final, so // it can not be extended. - if (WebApp.VERSION_6_1.equals(webApp.getVersion()) || WebApp.VERSION_6_0.equals(webApp.getVersion()) || - WebApp.VERSION_5_0.equals(webApp.getVersion())) { + if (WebApp.VERSION_6_2.equals(webApp.getVersion()) || WebApp.VERSION_6_1.equals(webApp.getVersion()) + || WebApp.VERSION_6_0.equals(webApp.getVersion()) || WebApp.VERSION_5_0.equals(webApp.getVersion())) { return (Servlet) webApp .findBeanByName("Servlet", "ServletClass", "jakarta.faces.webapp.FacesServlet"); //NOI18N; } else { diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/api/facesmodel/JsfVersionUtils.java b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/api/facesmodel/JsfVersionUtils.java index 45b6fb5abfd5..52796e7814b5 100644 --- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/api/facesmodel/JsfVersionUtils.java +++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/api/facesmodel/JsfVersionUtils.java @@ -52,7 +52,6 @@ import org.openide.filesystems.FileUtil; import org.openide.util.Exceptions; import org.openide.util.Parameters; -import org.openide.util.RequestProcessor; import org.openide.util.WeakListeners; /** @@ -61,9 +60,10 @@ */ public final class JsfVersionUtils { - private static final LinkedHashMap SPECIFIC_CLASS_NAMES = new LinkedHashMap<>(); + private static final LinkedHashMap SPECIFIC_CLASS_NAMES = new LinkedHashMap<>(16); static { + SPECIFIC_CLASS_NAMES.put(JsfVersion.JSF_5_0, JSFUtils.JSF_5_0__API_SPECIFIC_CLASS); SPECIFIC_CLASS_NAMES.put(JsfVersion.JSF_4_1, JSFUtils.JSF_4_1__API_SPECIFIC_CLASS); SPECIFIC_CLASS_NAMES.put(JsfVersion.JSF_4_0, JSFUtils.JSF_4_0__API_SPECIFIC_CLASS); SPECIFIC_CLASS_NAMES.put(JsfVersion.JSF_3_0, JSFUtils.JSF_3_0__API_SPECIFIC_CLASS); @@ -198,7 +198,9 @@ public static JsfVersion forClasspath(@NonNull List classpath) { public static JsfVersion forServerLibrary(@NonNull ServerLibrary lib) { Parameters.notNull("serverLibrary", lib); //NOI18N if ("JavaServer Faces".equals(lib.getSpecificationTitle())) { // NOI18N - if (Version.fromJsr277NotationWithFallback("4.1").equals(lib.getSpecificationVersion())) { //NOI18N + if (Version.fromJsr277NotationWithFallback("5.0").equals(lib.getSpecificationVersion())) { //NOI18N + return JsfVersion.JSF_5_0; + } else if (Version.fromJsr277NotationWithFallback("4.1").equals(lib.getSpecificationVersion())) { //NOI18N return JsfVersion.JSF_4_1; } else if (Version.fromJsr277NotationWithFallback("4.0").equals(lib.getSpecificationVersion())) { //NOI18N return JsfVersion.JSF_4_0; diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/facelets/resources/templates/simpleFacelets.template b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/facelets/resources/templates/simpleFacelets.template index 6c7ded997d50..f87846ff1057 100644 --- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/facelets/resources/templates/simpleFacelets.template +++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/facelets/resources/templates/simpleFacelets.template @@ -1,6 +1,6 @@ -<#if isJSF40?? || isJSF41??> +<#if isJSF40?? || isJSF41?? || isJSF50??> <#elseif isJSF22?? || isJSF30??> @@ -12,7 +12,7 @@ <#else> -<#if isJSF20?? || isJSF22?? || isJSF30?? || isJSF40?? || isJSF41??> +<#if isJSF20?? || isJSF22?? || isJSF30?? || isJSF40?? || isJSF41?? || isJSF50??> Facelet Title diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/impl/facesmodel/JSFConfigModelImpl.java b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/impl/facesmodel/JSFConfigModelImpl.java index 9c017f5e1a5d..b63ff981e769 100644 --- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/impl/facesmodel/JSFConfigModelImpl.java +++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/impl/facesmodel/JSFConfigModelImpl.java @@ -24,11 +24,11 @@ import java.util.logging.Logger; import javax.xml.XMLConstants; import javax.xml.namespace.QName; +import org.netbeans.modules.web.jsf.JSFCatalog; import org.netbeans.modules.web.jsf.api.facesmodel.FacesConfig; import org.netbeans.modules.web.jsf.api.facesmodel.JSFConfigComponent; import org.netbeans.modules.web.jsf.api.facesmodel.JSFConfigComponentFactory; import org.netbeans.modules.web.jsf.api.facesmodel.JSFConfigModel; -import org.netbeans.modules.web.jsf.api.facesmodel.JsfVersionUtils; import org.netbeans.modules.web.jsf.api.metamodel.JsfModel; import org.netbeans.modules.web.jsfapi.api.JsfVersion; import org.netbeans.modules.xml.xam.ComponentUpdater; @@ -88,57 +88,41 @@ public JSFConfigComponentFactory getFactory() { return componentFactory; } + @Override public JsfVersion getVersion() { String namespaceURI = getRootComponent().getPeer().getNamespaceURI(); - JsfVersion version = JsfVersion.JSF_1_1; - if (JSFConfigQNames.JSF_4_1_NS.equals(namespaceURI) - && (getRootComponent().getVersion().equals("4.1") //NOI18N - || checkSchemaLocation( - getRootComponent().getPeer(), - "https://jakarta.ee/xml/ns/jakartaee/web-facesconfig_4_1.xsd"))) { //NOI18N - version = JsfVersion.JSF_4_1; - } else if (JSFConfigQNames.JSF_4_0_NS.equals(namespaceURI) - && (getRootComponent().getVersion().equals("4.0") //NOI18N - || checkSchemaLocation( - getRootComponent().getPeer(), - "https://jakarta.ee/xml/ns/jakartaee/web-facesconfig_4_0.xsd"))) { //NOI18N - version = JsfVersion.JSF_4_0; - } else if (JSFConfigQNames.JSF_3_0_NS.equals(namespaceURI) - && (getRootComponent().getVersion().equals("3.0") //NOI18N - || checkSchemaLocation( - getRootComponent().getPeer(), - "https://jakarta.ee/xml/ns/jakartaee/web-facesconfig_3_0.xsd"))) { //NOI18N - version = JsfVersion.JSF_3_0; - } else if (JSFConfigQNames.JSF_2_3_NS.equals(namespaceURI) - && (getRootComponent().getVersion().equals("2.3") //NOI18N - || checkSchemaLocation( - getRootComponent().getPeer(), - "http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_3.xsd"))) { //NOI18N - version = JsfVersion.JSF_2_3; - } else if (JSFConfigQNames.JSF_2_2_NS.equals(namespaceURI) - && (getRootComponent().getVersion().equals("2.2") //NOI18N - || checkSchemaLocation( - getRootComponent().getPeer(), - "http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"))) { //NOI18N - version = JsfVersion.JSF_2_2; - } else if (JSFConfigQNames.JSF_2_1_NS.equals(namespaceURI) - && (getRootComponent().getVersion().equals("2.1") //NOI18N - || checkSchemaLocation( - getRootComponent().getPeer(), - "http://java.sun.com/xml/ns/javaee/web-facesconfig_2_1.xsd"))) { //NOI18N - version = JsfVersion.JSF_2_1; - } else if (JSFConfigQNames.JSF_2_0_NS.equals(namespaceURI) - && (getRootComponent().getVersion().equals("2.0") //NOI18N - || checkSchemaLocation( - getRootComponent().getPeer(), - "http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"))) { //NOI18N - version = JsfVersion.JSF_2_0; - } else if (JSFConfigQNames.JSF_1_2_NS.equals(namespaceURI)) { - version = JsfVersion.JSF_1_2; + Element element = getRootComponent().getPeer(); + String componentVersion = getRootComponent().getVersion(); + JsfVersion jsfVersion = JsfVersion.JSF_1_1; + if (JSFConfigQNames.JSF_JAKARTA_NS.equals(namespaceURI)) { + if (JsfVersion.JSF_5_0.getVersion().equals(componentVersion) || checkSchemaLocation(element, JSFCatalog.JSF_5_0)) { + jsfVersion = JsfVersion.JSF_5_0; + } else if (JsfVersion.JSF_4_1.getVersion().equals(componentVersion) || checkSchemaLocation(element, JSFCatalog.JSF_4_1)) { + jsfVersion = JsfVersion.JSF_4_1; + } else if (JsfVersion.JSF_4_0.getVersion().equals(componentVersion) || checkSchemaLocation(element, JSFCatalog.JSF_4_0)) { + jsfVersion = JsfVersion.JSF_4_0; + } else if (JsfVersion.JSF_3_0.getVersion().equals(componentVersion) || checkSchemaLocation(element, JSFCatalog.JSF_3_0)) { + jsfVersion = JsfVersion.JSF_3_0; + } + } else if (JSFConfigQNames.JSF_ORACLE_NS.equals(namespaceURI)) { + if (JsfVersion.JSF_2_3.getVersion().equals(componentVersion) || checkSchemaLocation(element, JSFCatalog.JSF_2_3)) { + jsfVersion = JsfVersion.JSF_2_3; + } else if (JsfVersion.JSF_2_2.getVersion().equals(componentVersion) || checkSchemaLocation(element, JSFCatalog.JSF_2_2)) { + jsfVersion = JsfVersion.JSF_2_2; + } + } else if (JSFConfigQNames.JSF_SUN_NS.equals(namespaceURI)) { + if (JsfVersion.JSF_2_1.getVersion().equals(componentVersion) || checkSchemaLocation(element, JSFCatalog.JSF_2_1)) { + jsfVersion = JsfVersion.JSF_2_1; + } else if (JsfVersion.JSF_2_0.getVersion().equals(componentVersion) || checkSchemaLocation(element, JSFCatalog.JSF_2_0)) { + jsfVersion = JsfVersion.JSF_2_0; + } else if (JsfVersion.JSF_1_2.getVersion().equals(componentVersion) || checkSchemaLocation(element, JSFCatalog.JSF_1_2)) { + jsfVersion = JsfVersion.JSF_1_2; + } } - return version; + return jsfVersion; } + @Override public Set getQNames() { return JSFConfigQNames.getMappedQNames(getVersion()); } diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/impl/facesmodel/JSFConfigQNames.java b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/impl/facesmodel/JSFConfigQNames.java index 42319595ef2f..deb6800a50b3 100644 --- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/impl/facesmodel/JSFConfigQNames.java +++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/impl/facesmodel/JSFConfigQNames.java @@ -25,7 +25,6 @@ import javax.xml.namespace.QName; -import org.netbeans.modules.web.jsf.api.facesmodel.JsfVersionUtils; import org.netbeans.modules.web.jsfapi.api.JsfVersion; import org.netbeans.modules.xml.xam.dom.AbstractDocumentComponent; import org.w3c.dom.Element; @@ -198,59 +197,51 @@ public enum JSFConfigQNames { // protected views PROTECTED_VIEWS("protected-views"); //NOI18N - private QName qname_1_1; - private QName qname_1_2; - private QName qname_2_0; - private QName qname_2_1; - private QName qname_2_2; - private QName qname_2_3; - private QName qname_3_0; - private QName qname_4_0; - private QName qname_4_1; + private final QName qname_1_1; + private final QName qname_1_2; + private final QName qname_2_0; + private final QName qname_2_1; + private final QName qname_2_2; + private final QName qname_2_3; + private final QName qname_3_0; + private final QName qname_4_0; + private final QName qname_4_1; + private final QName qname_5_0; + + public static final String JSF_SUN_NS = "http://java.sun.com/xml/ns/javaee"; //NOI18N + public static final String JSF_ORACLE_NS = "http://xmlns.jcp.org/xml/ns/javaee"; //NOI18N + public static final String JSF_JAKARTA_NS = "https://jakarta.ee/xml/ns/jakartaee"; //NOI18N - - public static final String JSF_1_2_NS = "http://java.sun.com/xml/ns/javaee"; //NOI18N - public static final String JSF_2_0_NS = "http://java.sun.com/xml/ns/javaee"; //NOI18N - public static final String JSF_2_1_NS = "http://java.sun.com/xml/ns/javaee"; //NOI18N - public static final String JSF_2_2_NS = "http://xmlns.jcp.org/xml/ns/javaee"; //NOI18N - public static final String JSF_2_3_NS = "http://xmlns.jcp.org/xml/ns/javaee"; //NOI18N - public static final String JSF_3_0_NS = "https://jakarta.ee/xml/ns/jakartaee"; //NOI18N - public static final String JSF_4_0_NS = "https://jakarta.ee/xml/ns/jakartaee"; //NOI18N - public static final String JSF_4_1_NS = "https://jakarta.ee/xml/ns/jakartaee"; //NOI18N public static final String JSF_1_1_NS = javax.xml.XMLConstants.NULL_NS_URI; public static final String JSFCONFIG_PREFIX = javax.xml.XMLConstants.DEFAULT_NS_PREFIX; JSFConfigQNames(String localName) { qname_1_1 = new QName(JSF_1_1_NS, localName, JSFCONFIG_PREFIX); - qname_1_2 = new QName(JSF_1_2_NS, localName, JSFCONFIG_PREFIX); - qname_2_0 = new QName(JSF_2_0_NS, localName, JSFCONFIG_PREFIX); - qname_2_1 = new QName(JSF_2_1_NS, localName, JSFCONFIG_PREFIX); - qname_2_2 = new QName(JSF_2_2_NS, localName, JSFCONFIG_PREFIX); - qname_2_3 = new QName(JSF_2_3_NS, localName, JSFCONFIG_PREFIX); - qname_3_0 = new QName(JSF_3_0_NS, localName, JSFCONFIG_PREFIX); - qname_4_0 = new QName(JSF_4_0_NS, localName, JSFCONFIG_PREFIX); - qname_4_1 = new QName(JSF_4_1_NS, localName, JSFCONFIG_PREFIX); + qname_1_2 = new QName(JSF_SUN_NS, localName, JSFCONFIG_PREFIX); + qname_2_0 = new QName(JSF_SUN_NS, localName, JSFCONFIG_PREFIX); + qname_2_1 = new QName(JSF_SUN_NS, localName, JSFCONFIG_PREFIX); + qname_2_2 = new QName(JSF_ORACLE_NS, localName, JSFCONFIG_PREFIX); + qname_2_3 = new QName(JSF_ORACLE_NS, localName, JSFCONFIG_PREFIX); + qname_3_0 = new QName(JSF_JAKARTA_NS, localName, JSFCONFIG_PREFIX); + qname_4_0 = new QName(JSF_JAKARTA_NS, localName, JSFCONFIG_PREFIX); + qname_4_1 = new QName(JSF_JAKARTA_NS, localName, JSFCONFIG_PREFIX); + qname_5_0 = new QName(JSF_JAKARTA_NS, localName, JSFCONFIG_PREFIX); } public QName getQName(JsfVersion version) { QName value = qname_1_1; - if (version.equals(JsfVersion.JSF_1_2)) { - value = qname_1_2; - } else if (version.equals(JsfVersion.JSF_2_0)) { - value = qname_2_0; - } else if (version.equals(JsfVersion.JSF_2_1)) { - value = qname_2_1; - } else if (version.equals(JsfVersion.JSF_2_2)) { - value = qname_2_2; - } else if (version.equals(JsfVersion.JSF_2_3)) { - value = qname_2_3; - } else if (version.equals(JsfVersion.JSF_3_0)) { - value = qname_3_0; - } else if (version.equals(JsfVersion.JSF_4_0)) { - value = qname_4_0; - } else if (version.equals(JsfVersion.JSF_4_1)) { - value = qname_4_1; + switch (version) { + case JSF_1_2 -> value = qname_1_2; + case JSF_2_0 -> value = qname_2_0; + case JSF_2_1 -> value = qname_2_1; + case JSF_2_2 -> value = qname_2_2; + case JSF_2_3 -> value = qname_2_3; + case JSF_3_0 -> value = qname_3_0; + case JSF_4_0 -> value = qname_4_0; + case JSF_4_1 -> value = qname_4_1; + case JSF_5_0 -> value = qname_5_0; + default -> {} } return value; } @@ -273,35 +264,51 @@ public String getQualifiedName(JsfVersion version) { public static boolean areSameQName(JSFConfigQNames jsfqname, Element element) { QName qname = AbstractDocumentComponent.getQName(element); - if (JSFConfigQNames.JSF_1_2_NS.equals(element.getNamespaceURI())) { - return jsfqname.getQName(JsfVersion.JSF_1_2).equals(qname); - } else if (JSFConfigQNames.JSF_2_0_NS.equals(element.getNamespaceURI())) { - return jsfqname.getQName(JsfVersion.JSF_2_0).equals(qname); - } else if (JSFConfigQNames.JSF_2_1_NS.equals(element.getNamespaceURI())) { - return jsfqname.getQName(JsfVersion.JSF_2_1).equals(qname); - } else if (JSFConfigQNames.JSF_2_2_NS.equals(element.getNamespaceURI())) { - return jsfqname.getQName(JsfVersion.JSF_2_2).equals(qname); - } else if (JSFConfigQNames.JSF_2_3_NS.equals(element.getNamespaceURI())) { - return jsfqname.getQName(JsfVersion.JSF_2_3).equals(qname); - } else if (JSFConfigQNames.JSF_3_0_NS.equals(element.getNamespaceURI())) { - return jsfqname.getQName(JsfVersion.JSF_3_0).equals(qname); - } else if (JSFConfigQNames.JSF_4_0_NS.equals(element.getNamespaceURI())) { - return jsfqname.getQName(JsfVersion.JSF_4_0).equals(qname); - } else if (JSFConfigQNames.JSF_4_1_NS.equals(element.getNamespaceURI())) { - return jsfqname.getQName(JsfVersion.JSF_4_1).equals(qname); + final String NS_URI = element.getNamespaceURI(); + if (null != NS_URI) switch (NS_URI) { + case JSFConfigQNames.JSF_JAKARTA_NS -> { + if (jsfqname.getQName(JsfVersion.JSF_5_0).equals(qname)) { + return true; + } else if (jsfqname.getQName(JsfVersion.JSF_4_1).equals(qname)) { + return true; + } else if (jsfqname.getQName(JsfVersion.JSF_4_0).equals(qname)) { + return true; + } else if (jsfqname.getQName(JsfVersion.JSF_3_0).equals(qname)) { + return true; + } + } + case JSFConfigQNames.JSF_ORACLE_NS -> { + if (jsfqname.getQName(JsfVersion.JSF_2_3).equals(qname)) { + return true; + } else if (jsfqname.getQName(JsfVersion.JSF_2_2).equals(qname)) { + return true; + } + } + case JSFConfigQNames.JSF_SUN_NS -> { + if (jsfqname.getQName(JsfVersion.JSF_2_1).equals(qname)) { + return true; + } else if (jsfqname.getQName(JsfVersion.JSF_2_0).equals(qname)) { + return true; + } else if (jsfqname.getQName(JsfVersion.JSF_1_2).equals(qname)) { + return true; + } + } + default -> { + } } return jsfqname.getLocalName().equals(qname.getLocalPart()); } - private static final Set mappedQNames_1_1 = new HashSet(); - private static final Set mappedQNames_1_2 = new HashSet(); - private static final Set mappedQNames_2_0 = new HashSet(); - private static final Set mappedQNames_2_1 = new HashSet(); - private static final Set mappedQNames_2_2 = new HashSet(); - private static final Set mappedQNames_2_3 = new HashSet(); - private static final Set mappedQNames_3_0 = new HashSet(); - private static final Set mappedQNames_4_0 = new HashSet(); - private static final Set mappedQNames_4_1 = new HashSet(); + private static final Set mappedQNames_1_1 = new HashSet<>(); + private static final Set mappedQNames_1_2 = new HashSet<>(); + private static final Set mappedQNames_2_0 = new HashSet<>(); + private static final Set mappedQNames_2_1 = new HashSet<>(); + private static final Set mappedQNames_2_2 = new HashSet<>(); + private static final Set mappedQNames_2_3 = new HashSet<>(); + private static final Set mappedQNames_3_0 = new HashSet<>(); + private static final Set mappedQNames_4_0 = new HashSet<>(); + private static final Set mappedQNames_4_1 = new HashSet<>(); + private static final Set mappedQNames_5_0 = new HashSet<>(); static { mappedQNames_1_1.add(FACES_CONFIG.getQName(JsfVersion.JSF_1_1)); @@ -315,6 +322,7 @@ public static boolean areSameQName(JSFConfigQNames jsfqname, Element element) { mappedQNames_1_1.add(APPLICATION.getQName(JsfVersion.JSF_1_1)); mappedQNames_1_1.add(VIEW_HANDLER.getQName(JsfVersion.JSF_1_1)); mappedQNames_1_1.add(RESOURCE_BUNDLE.getQName(JsfVersion.JSF_1_1)); + mappedQNames_1_2.add(FACES_CONFIG.getQName(JsfVersion.JSF_1_2)); mappedQNames_1_2.add(MANAGED_BEAN.getQName(JsfVersion.JSF_1_2)); mappedQNames_1_2.add(CONVERTER.getQName(JsfVersion.JSF_1_2)); @@ -367,6 +375,7 @@ public static boolean areSameQName(JSFConfigQNames jsfqname, Element element) { mappedQNames_1_2.add(VALIDATOR_EXTENSION.getQName(JsfVersion.JSF_1_2)); mappedQNames_1_2.add(FACES_CONFIG_EXTENSION.getQName(JsfVersion.JSF_1_2)); mappedQNames_1_2.add(RENDERER.getQName(JsfVersion.JSF_1_2)); + mappedQNames_2_0.add(FACES_CONFIG.getQName(JsfVersion.JSF_2_0)); mappedQNames_2_0.add(MANAGED_BEAN.getQName(JsfVersion.JSF_2_0)); mappedQNames_2_0.add(CONVERTER.getQName(JsfVersion.JSF_2_0)); @@ -441,6 +450,7 @@ public static boolean areSameQName(JSFConfigQNames jsfqname, Element element) { mappedQNames_2_0.add(CLIENT_BEHAVIOR_RENDERER.getQName(JsfVersion.JSF_2_0)); mappedQNames_2_0.add(BEHAVIOR.getQName(JsfVersion.JSF_2_0)); mappedQNames_2_0.add(BEHAVIOR_EXTENSION.getQName(JsfVersion.JSF_2_0)); + mappedQNames_2_1.add(FACES_CONFIG.getQName(JsfVersion.JSF_2_1)); mappedQNames_2_1.add(MANAGED_BEAN.getQName(JsfVersion.JSF_2_1)); mappedQNames_2_1.add(CONVERTER.getQName(JsfVersion.JSF_2_1)); @@ -516,6 +526,7 @@ public static boolean areSameQName(JSFConfigQNames jsfqname, Element element) { mappedQNames_2_1.add(CLIENT_BEHAVIOR_RENDERER.getQName(JsfVersion.JSF_2_1)); mappedQNames_2_1.add(BEHAVIOR.getQName(JsfVersion.JSF_2_1)); mappedQNames_2_1.add(BEHAVIOR_EXTENSION.getQName(JsfVersion.JSF_2_1)); + mappedQNames_2_2.add(FACES_CONFIG.getQName(JsfVersion.JSF_2_2)); mappedQNames_2_2.add(MANAGED_BEAN.getQName(JsfVersion.JSF_2_2)); mappedQNames_2_2.add(CONVERTER.getQName(JsfVersion.JSF_2_2)); @@ -614,6 +625,7 @@ public static boolean areSameQName(JSFConfigQNames jsfqname, Element element) { mappedQNames_2_2.add(METHOD.getQName(JsfVersion.JSF_2_2)); mappedQNames_2_2.add(FLOW_DEFINITION.getQName(JsfVersion.JSF_2_2)); mappedQNames_2_2.add(PROTECTED_VIEWS.getQName(JsfVersion.JSF_2_2)); + mappedQNames_2_3.add(FACES_CONFIG.getQName(JsfVersion.JSF_2_3)); mappedQNames_2_3.add(MANAGED_BEAN.getQName(JsfVersion.JSF_2_3)); mappedQNames_2_3.add(CONVERTER.getQName(JsfVersion.JSF_2_3)); @@ -712,6 +724,7 @@ public static boolean areSameQName(JSFConfigQNames jsfqname, Element element) { mappedQNames_2_3.add(METHOD.getQName(JsfVersion.JSF_2_3)); mappedQNames_2_3.add(FLOW_DEFINITION.getQName(JsfVersion.JSF_2_3)); mappedQNames_2_3.add(PROTECTED_VIEWS.getQName(JsfVersion.JSF_2_3)); + mappedQNames_3_0.add(FACES_CONFIG.getQName(JsfVersion.JSF_3_0)); mappedQNames_3_0.add(MANAGED_BEAN.getQName(JsfVersion.JSF_3_0)); mappedQNames_3_0.add(CONVERTER.getQName(JsfVersion.JSF_3_0)); @@ -1009,26 +1022,120 @@ public static boolean areSameQName(JSFConfigQNames jsfqname, Element element) { mappedQNames_4_1.add(FLOW_DEFINITION.getQName(JsfVersion.JSF_4_1)); mappedQNames_4_1.add(PROTECTED_VIEWS.getQName(JsfVersion.JSF_4_1)); + mappedQNames_5_0.add(FACES_CONFIG.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(MANAGED_BEAN.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(CONVERTER.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(NAVIGATION_RULE.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(NAVIGATION_CASE.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(DESCRIPTION.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(DISPLAY_NAME.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(ICON.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(APPLICATION.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(VIEW_HANDLER.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(RESOURCE_BUNDLE.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(FACTORY.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(COMPONENT.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(REFERENCED_BEAN.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(RENDER_KIT.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(LIFECYCLE.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(VALIDATOR.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(FACES_CONFIG_EXTENSION.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(RESOURCE_BUNDLE.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(ACTION_LISTENER.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(DEFAULT_RENDER_KIT_ID.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(MESSAGE_BUNDLE.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(NAVIGATION_HANDLER.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(STATE_MANAGER.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(EL_RESOLVER.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(PROPERTY_RESOLVER.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(VARIABLE_RESOLVER.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(LOCALE_CONFIG.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(APPLICATION_EXTENSION.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(DEFAULT_LOCALE.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(SUPPORTED_LOCALE.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(APPLICATION_FACTORY.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(FACES_CONTEXT_FACTORY.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(FACELET_CACHE_FACTORY.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(LIFECYCLE_FACTORY.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(RENDER_KIT_FACTORY.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(FACTORY_EXTENSION.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(FACET.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(ATTRIBUTE.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(PROPERTY.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(COMPONENT_EXTENSION.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(CONVERTER_EXTENSION.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(MANAGED_PROPERTY.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(MAP_ENTRIES.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(LIST_ENTRIES.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(MANAGED_BEAN_EXTENSION.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(NAVIGATION_RULE_EXTENSION.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(RENDER_KIT_EXTENSION.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(PHASE_LISTENER.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(LIFECYCLE_EXTENSION.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(VALIDATOR_EXTENSION.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(FACES_CONFIG_EXTENSION.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(IF.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(REDIRECT.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(VIEW_PARAM.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(PARTIAL_TRAVERSAL.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(SYSTEM_EVENT_LISTENER.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(RESOURCE_HANDLER.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(DEFAULT_VALIDATORS.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(ORDERING.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(AFTER.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(BEFORE.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(ABSOLUTE_ORDERING.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(OTHERS.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(EXCEPTION_HANDLER_FACTORY.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(EXTERNAL_CONTEXT_FACTORY.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(PARTIAL_VIEW_CONTEXT_FACTORY.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(VIEW_DECLARATION_LANGUAGE_FACTORY.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(TAG_HANDLER_DELEGATE_FACTORY.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(VISIT_CONTEXT_FACTORY.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(NAME.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(RENDERER.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(CLIENT_BEHAVIOR_RENDERER.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(BEHAVIOR.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(BEHAVIOR_EXTENSION.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(RESOURCE_LIBRARY_CONTRACTS.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(RESOURCE_BUNDLE.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(RESOURCE_HANDLER.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(URL_PATTERN.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(FLOW_HANDLER_FACTORY.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(FLASH_FACTORY.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(START_NODE.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(VIEW.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(VDL_DOCUMENT.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(DEFAULT_OUTCOME.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(SWITCH.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(METHOD_CALL.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(FLOW_RETURN.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(INITIALIZER.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(FINALIZER.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(FLOW_CALL.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(INBOUND_PARAMETER.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(OUTBOUND_PARAMETER.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(FLOW_REFERENCE.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(FLOW_ID.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(METHOD.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(FLOW_DEFINITION.getQName(JsfVersion.JSF_5_0)); + mappedQNames_5_0.add(PROTECTED_VIEWS.getQName(JsfVersion.JSF_5_0)); } public static Set getMappedQNames(JsfVersion version) { Set mappedQNames = mappedQNames_1_1; - if (version.equals(JsfVersion.JSF_1_2)) { - mappedQNames = mappedQNames_1_2; - } else if (version.equals(JsfVersion.JSF_2_0)) { - mappedQNames = mappedQNames_2_0; - } else if (version.equals(JsfVersion.JSF_2_1)) { - mappedQNames = mappedQNames_2_1; - } else if (version.equals(JsfVersion.JSF_2_2)) { - mappedQNames = mappedQNames_2_2; - } else if (version.equals(JsfVersion.JSF_2_3)) { - mappedQNames = mappedQNames_2_3; - } else if (version.equals(JsfVersion.JSF_3_0)) { - mappedQNames = mappedQNames_3_0; - } else if (version.equals(JsfVersion.JSF_4_0)) { - mappedQNames = mappedQNames_4_0; - } else if (version.equals(JsfVersion.JSF_4_1)) { - mappedQNames = mappedQNames_4_1; + switch (version) { + case JSF_1_2 -> mappedQNames = mappedQNames_1_2; + case JSF_2_0 -> mappedQNames = mappedQNames_2_0; + case JSF_2_1 -> mappedQNames = mappedQNames_2_1; + case JSF_2_2 -> mappedQNames = mappedQNames_2_2; + case JSF_2_3 -> mappedQNames = mappedQNames_2_3; + case JSF_3_0 -> mappedQNames = mappedQNames_3_0; + case JSF_4_0 -> mappedQNames = mappedQNames_4_0; + case JSF_4_1 -> mappedQNames = mappedQNames_4_1; + case JSF_5_0 -> mappedQNames = mappedQNames_5_0; + default -> { + } } return Collections.unmodifiableSet(mappedQNames); } diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/faces-config_5_0.xml b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/faces-config_5_0.xml new file mode 100644 index 000000000000..bc04058efdf7 --- /dev/null +++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/faces-config_5_0.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/templates/compositeComponent.template b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/templates/compositeComponent.template index 651c9be3849c..aa67a43fbac5 100644 --- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/templates/compositeComponent.template +++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/templates/compositeComponent.template @@ -1,7 +1,7 @@ +<#if isJSF40?? || isJSF41?? || isJSF50??> xmlns:cc="jakarta.faces.composite"> <#elseif isJSF22?? || isJSF30??> xmlns:cc="http://xmlns.jcp.org/jsf/composite"> diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/web-facelettaglibrary_5_0.xsd b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/web-facelettaglibrary_5_0.xsd new file mode 100644 index 000000000000..b52401e59237 --- /dev/null +++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/web-facelettaglibrary_5_0.xsd @@ -0,0 +1,751 @@ + + + + + + + + Copyright (c) 2009, 2023 Oracle and/or its affiliates. All rights reserved. + + This program and the accompanying materials are made available under the + terms of the Eclipse Public License v. 2.0, which is available at + http://www.eclipse.org/legal/epl-2.0. + + This Source Code may also be made available under the following Secondary + Licenses when the conditions for such availability set forth in the + Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + version 2 with the GNU Classpath Exception, which is available at + https://www.gnu.org/software/classpath/license.html. + + SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + + + + + + + The XML Schema for the Tag Libraries in the Jakarta Faces + Standard Facelets View Declaration Language (Facelets VDL) + (Version 5.0).

+ +

Jakarta Faces 5.0 Facelet Tag Libraries that wish to conform to + this schema must declare it in the following manner.

+ + <facelet-taglib xmlns="https://jakarta.ee/xml/ns/jakartaee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-facelettaglibrary_5_0.xsd" + version="5.0"> + + ... + + </facelet-taglib> + +

The instance documents may indicate the published + version of the schema using xsi:schemaLocation attribute + for jakartaee namespace with the following location:

+ +

https://jakarta.ee/xml/ns/jakartaee/web-facelettaglibrary_5_0.xsd

+ + ]]> + + + + + + + + + + + + + tag-names must be unique within a document. + +

+ ]]> +
+
+ + +
+ + + + + + Behavior IDs must be unique within a document. + +

+ ]]> +
+
+ + +
+ + + + + + Converter IDs must be unique within a document. + +

+ ]]> +
+
+ + +
+ + + + + + Validator IDs must be unique within a document. + +

+ ]]> +
+
+ + +
+
+ + + + + + + + + + The top level XML element in a facelet tag library XML file. + +

+ ]]> +
+
+ + + + + + + + + + + + An advisory short name for usages of tags from this tag library. + +

+ ]]> +
+
+
+ + + + + +
+
+ +
+ + +
+ + + + + + + + + + Extension element for facelet-taglib. It may contain + implementation specific content. + +

+ ]]> +
+
+ + + + +
+ + + + + + + + If the tag library XML + file contains individual tag declarations rather than pointing + to a library-class or a declaring a composite-library name, the + individual tags are enclosed in tag elements.

+ + ]]> +
+
+ + + + + + + + + + + + + + +
+ + + + + + + + + +

The attribute element defines an attribute for the nesting + tag. The attribute element may have several subelements + defining:

+ +
+ +
description

a description of the attribute +

+ +
name

the name of the attribute +

+ +
required

whether the attribute is required or + optional +

+ +
type

the type of the attribute +

+ +
+ +

+ ]]> +
+
+ + + + + + + Defines if the nesting attribute is required or + optional.

+ +

If not present then the default is "false", i.e + the attribute is optional.

+ + ]]> +
+
+
+ + + + + + + Defines the Java type of the attributes + value. If this element is omitted, the + expected type is assumed to be + "java.lang.Object".

+ + ]]> +
+
+
+ + + + + + Defines the method signature for a MethodExpression- + enabled attribute. The syntax of the method-signature + element is as follows (taken from the function-signature + EBNF in web-jsptaglibrary_2_1.xsd):

+ + + +

MethodSignature ::= ReturnType S MethodName S? '(' S? Parameters? S? ')'

+ +

ReturnType ::= Type

+ +

MethodName ::= Identifier

+ +

Parameters ::= Parameter | ( Parameter S? ',' S? Parameters )

+ +

Parameter ::= Type

+ +
+ +

Where:

+ +
    + +
  • Type is a basic type or a fully qualified + Java class name (including package name), as per the 'Type' + production in the Java Language Specification, Second Edition, + Chapter 18.

  • + +
  • Identifier is a Java identifier, as per the + 'Identifier' production in the Java Language Specification, + Second Edition, Chapter 18.

  • + +
+ +

Example:

+ +

java.lang.String nickName( java.lang.String, int )

+ + ]]> +
+
+
+
+
+ +
+ + + + + + + + + + Extension element for tag It may contain + implementation specific content. + +

+ ]]> +
+
+ + + + +
+ + + + + + + + + + If the tag library XML file contains individual function + declarations rather than pointing to a library-class or a + declaring a composite-library name, the individual functions are + enclosed in function elements. + +

+ ]]> +
+
+ + + + + + +
+ + + + + + + + + + Within a tag element, the behavior element encapsulates + information specific to a Faces Behavior. + +

+ ]]> +
+
+ + + + + + +
+ + + + + + + + + + Extension element for behavior. It may contain + implementation specific content. + +

+ ]]> +
+
+ + + + +
+ + + + + + + + Within a tag element, the component + element encapsulates information specific to a Faces UIComponent.

+ +
+ +

As of 3.0 of the specification, this requirement is no longer + present: This element must have exactly one of + <component-type>, <resource-id>, + or <handler-class> among its child elements.

+ +
+ + ]]> +
+
+ + + + + + + + + A valid resource identifier + as specified in the Jakarta Faces Specification Document section 2.6.1.3 "Resource Identifiers". + For example:

+ +

<resource-id>myCC/ccName.xhtml</resource-id>

+ + ]]> +
+
+
+ +
+
+ + + + + + + + + + Extension element for component It may contain + implementation specific content. + +

+ ]]> +
+
+ + + + +
+ + + + + + + + + + Within a tag element, the converter element encapsulates + information specific to a Faces Converter. + +

+ ]]> +
+
+ + + + + + +
+ + + + + + + + + + Extension element for converter It may contain + implementation specific content. + +

+ ]]> +
+
+ + + + +
+ + + + + + + + + + Within a tag element, the validator element encapsulates + information specific to a Faces Validator. + +

+ ]]> +
+
+ + + + + + +
+ + + + + + + + + + Extension element for validator It may contain + implementation specific content. + +

+ ]]> +
+
+ + + + +
+ + + + + + + This type contains the recognized versions of + facelet-taglib supported. + +

+ ]]> +
+
+ + + +
+ + + + + + + + + +

Defines the canonical name of a tag or attribute being + defined.

+ +

The name must conform to the lexical rules for an NCName

+ +

+ ]]> +
+
+ + + + + +
+ + diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/web-faces-mime-resolver.xml b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/web-faces-mime-resolver.xml index 3d712f867e04..7952c3a1db65 100644 --- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/web-faces-mime-resolver.xml +++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/web-faces-mime-resolver.xml @@ -122,4 +122,14 @@ + + + + + + + + + + diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/web-facesconfig_5_0.xsd b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/web-facesconfig_5_0.xsd new file mode 100644 index 000000000000..309dfc8e7938 --- /dev/null +++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/resources/web-facesconfig_5_0.xsd @@ -0,0 +1,3447 @@ + + + + + + + + Copyright (c) 2009, 2021 Oracle and/or its affiliates. All rights reserved. + + This program and the accompanying materials are made available under the + terms of the Eclipse Public License v. 2.0, which is available at + http://www.eclipse.org/legal/epl-2.0. + + This Source Code may also be made available under the following Secondary + Licenses when the conditions for such availability set forth in the + Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + version 2 with the GNU Classpath Exception, which is available at + https://www.gnu.org/software/classpath/license.html. + + SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + + + + + + + The XML Schema for the Jakarta Faces Application + Configuration File (Version 5.0).

+ +

All Jakarta Faces configuration files must indicate + the Jakarta Faces schema by indicating the + Jakarta Faces namespace:

+ +

https://jakarta.ee/xml/ns/jakartaee

+ +

and by indicating the version of the schema by + using the version element as shown below:

+ +
<faces-config xmlns="https://jakarta.ee/xml/ns/jakartaee"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xsi:schemaLocation="..."
+      version="5.0">
+      ...
+      </faces-config>
+ +

The instance documents may indicate the published + version of the schema using xsi:schemaLocation attribute + for jakartaee namespace with the following location:

+ +

https://jakarta.ee/xml/ns/jakartaee/web-facesconfig_5_0.xsd

+ + ]]> +
+
+ + + + + + + + The "faces-config" element is the root of the configuration + information hierarchy, and contains nested elements for all + of the other configuration settings.

+ + ]]> +
+
+ + + + Behavior IDs must be unique within a document.

+ + ]]> +
+
+ + +
+ + + + Converter IDs must be unique within a document.

+ + ]]> +
+
+ + +
+ + + + 'converter-for-class' element values must be unique + within a document.

+ + ]]> +
+
+ + +
+ + + + Validator IDs must be unique within a document.

+ + ]]> +
+
+ + +
+
+ + + + + + + + The "faces-config" element is the root of the configuration + information hierarchy, and contains nested elements for all + of the other configuration settings.

+ + ]]> +
+
+ + + + + + + + + + + + The "name" element + within the top level "faces-config" + element declares the name of this application + configuration resource. Such names are used + in the document ordering scheme specified in section + 11.3.8 "Ordering of Artifacts" of the Jakarta Faces Specification Document.

+ +

This value is taken to be the + defining document id of any <flow-definition> elements + defined in this Application Configuration Resource file. If this + element is not specified, the runtime must take the empty string + as its value.

+ + ]]> +
+
+
+ + + + + + + + +
+ + + + + The metadata-complete attribute defines whether this + Faces application is complete, or whether + the class files available to this module and packaged with + this application should be examined for annotations + that specify configuration information. + + This attribute is only inspected on the application + configuration resource file located at "WEB-INF/faces-config.xml". + The presence of this attribute on any application configuration + resource other than the one located at "WEB-INF/faces-config.xml", + including any files named using the jakarta.faces.CONFIG_FILES + attribute, must be ignored. + + If metadata-complete is set to "true", the Faces + runtime must ignore any annotations that specify configuration + information, which might be present in the class files + of the application. + + If metadata-complete is not specified or is set to + "false", the Faces runtime must examine the class + files of the application for annotations, as specified by + the specification. + + If "WEB-INF/faces-config.xml" is not present, the + Faces runtime will assume metadata-complete to be "false". + + The value of this attribute will have no impact on + runtime annotations such as @ResourceDependency or + @ListenerFor. + + + + + + +
+ + + + + + + + Extension element for faces-config. It may contain + implementation specific content.

+ + ]]> +
+
+ + + + +
+ + + + + + + + Please see section + 11.3.8 "Ordering of Artifacts" of the Jakarta Faces Specification Document + for the specification of this element.

+ + ]]> +
+
+ + + + + +
+ + + + + + + + This element contains a sequence of "id" elements, each of which + refers to an application configuration resource by the "id" + declared on its faces-config element. This element can also contain + a single "others" element which specifies that this document comes + before or after other documents within the application.

+ + ]]> +
+
+ + + + + +
+ + + + + + + + This element indicates that the ordering sub-element in which + it was placed should take special action regarding the ordering + of this application resource relative to other + application configuration resources. + See section 11.3.8 "Ordering of Artifacts" of the Jakarta Faces Specification Document + for the complete specification.

+ + ]]> +
+
+ +
+ + + + + + + + Only relevant if this is placed within the /WEB-INF/faces-config.xml. + Please see + section 11.3.8 "Ordering of Artifacts" of the Jakarta Faces Specification Document + for the specification for details.

+ + ]]> +
+
+ + + + + +
+ + + + + + + + The "application" element provides a mechanism to define the + various per-application-singleton implementation artifacts for + a particular web application that is utilizing + Jakarta Faces. For nested elements that are not specified, + the Jakarta Faces implementation must provide a suitable + default.

+ + ]]> +
+
+ + + + + The "action-listener" element contains the fully + qualified class name of the concrete + ActionListener implementation class that will be + called during the Invoke Application phase of the + request processing lifecycle.

+ + ]]> +
+
+
+ + + + The "default-render-kit-id" element allows the + application to define a renderkit to be used other + than the standard one.

+ + ]]> +
+
+
+ + + + The base name of a resource bundle representing + the message resources for this application. See + the JavaDocs for the "java.util.ResourceBundle" + class for more information on the syntax of + resource bundle names.

+ + ]]> +
+
+
+ + + + The "navigation-handler" element contains the + fully qualified class name of the concrete + NavigationHandler implementation class that will + be called during the Invoke Application phase + of the request processing lifecycle, if the + default ActionListener (provided by the Jakarta Faces + implementation) is used.

+ + ]]> +
+
+
+ + + + The "view-handler" element contains the fully + qualified class name of the concrete ViewHandler + implementation class that will be called during + the Restore View and Render Response phases of the + request processing lifecycle. The faces + implementation must provide a default + implementation of this class.

+ + ]]> +
+
+
+ + + + The "state-manager" element contains the fully + qualified class name of the concrete StateManager + implementation class that will be called during + the Restore View and Render Response phases of the + request processing lifecycle. The faces + implementation must provide a default + implementation of this class.

+ + ]]> +
+
+
+ + + + The "el-resolver" element contains the fully + qualified class name of the concrete + jakarta.el.ELResolver implementation class + that will be used during the processing of + EL expressions.

+ + ]]> +
+
+
+ + + + The "resource-handler" element contains the + fully qualified class name of the concrete + ResourceHandler implementation class that + will be used during rendering and decoding + of resource requests The standard + constructor based decorator pattern used for + other application singletons will be + honored.

+ + ]]> +
+
+
+ + + + The "resource-library-contracts" element + specifies the mappings between views in the application and resource + library contracts that, if present in the application, must be made + available for use as templates of the specified views. +

+ + ]]> +
+
+
+ + + + The "search-expression-handler" + element contains the fully qualified class name of the + concrete jakarta.faces.component.search.SearchExpressionHandler + implementation class that will be used for processing of a + search expression.

+ + ]]> +
+
+
+ + + + The "search-keyword-resolver" + element contains the fully qualified class name of the + concrete jakarta.faces.component.search.SearchKeywordResolver + implementation class that will be used during the processing + of a search expression keyword.

+ + ]]> +
+
+
+ + + + + +
+ +
+ + + + + + + + The resource-bundle element inside the application element + references a java.util.ResourceBundle instance by name + using the var element. ResourceBundles referenced in this + manner may be returned by a call to + Application.getResourceBundle() passing the current + FacesContext for this request and the value of the var + element below.

+ + ]]> +
+
+ + + + + + The fully qualified class name of the + java.util.ResourceBundle instance.

+ + ]]> +
+
+
+ + + + The name by which this ResourceBundle instance + is retrieved by a call to + Application.getResourceBundle().

+ + ]]> +
+
+
+
+ +
+ + + + + + + + The "resource-library-contracts" element + specifies the mappings between views in the application and resource + library contracts that, if present in the application, must be made + available for use as templates of the specified views. +

+ + ]]> +
+
+ + + + + + Declare a mapping between a collection + of views in the application and the list of contracts (if present in the application) + that may be used as a source for templates and resources for those views.

+ + ]]> +
+
+
+
+ +
+ + + + + + + + The "contract-mapping" element + specifies the mappings between a collection of views in the application and resource + library contracts that, if present in the application, must be made + available for use as templates of the specified views. +

+ + ]]> +
+
+ + + + + + The "url-pattern" element + specifies the collection of views in this application that + are allowed to use the corresponding contracts. +

+ + ]]> +
+
+
+ + + + The "contracts" element + is a comma separated list of resource library contracts that, + if available to the application, may be used by the views + matched by the corresponding "url-pattern" +

+ + ]]> +
+
+
+
+ +
+ + + + + + + + Extension element for application. It may contain + implementation specific content.

+ + ]]> +
+
+ + + + +
+ + + + + + + + The "factory" element provides a mechanism to define the + various Factories that comprise parts of the implementation + of Jakarta Faces. For nested elements that are not + specified, the Jakarta Faces implementation must provide a + suitable default.

+ + ]]> +
+
+ + + + + The "application-factory" element contains the + fully qualified class name of the concrete + ApplicationFactory implementation class that will + be called when + FactoryFinder.getFactory(APPLICATION_FACTORY) is + called.

+ + ]]> +
+
+
+ + + + The "exception-handler-factory" element contains the + fully qualified class name of the concrete + ExceptionHandlerFactory implementation class that will + be called when + FactoryFinder.getFactory(EXCEPTION_HANDLER_FACTORY) + is called.

+ + ]]> +
+
+
+ + + + The "external-context-factory" element contains the + fully qualified class name of the concrete + ExternalContextFactory implementation class that will + be called when + FactoryFinder.getFactory(EXTERNAL_CONTEXT_FACTORY) + is called.

+ + ]]> +
+
+
+ + + + The "faces-context-factory" element contains the + fully qualified class name of the concrete + FacesContextFactory implementation class that will + be called when + FactoryFinder.getFactory(FACES_CONTEXT_FACTORY) + is called.

+ + ]]> +
+
+
+ + + + The "facelet-cache-factory" element contains the + fully qualified class name of the concrete + FaceletCacheFactory implementation class that will + be called when + FactoryFinder.getFactory(FACELET_CACHE_FACTORY) + is called.

+ + ]]> +
+
+
+ + + + The "partial-view-context-factory" element contains the + fully qualified class name of the concrete + PartialViewContextFactory implementation class that will + be called when FactoryFinder.getFactory + (FactoryFinder.PARTIAL_VIEW_CONTEXT_FACTORY) is called.

+ + ]]> +
+
+
+ + + + The "lifecycle-factory" element contains the fully + qualified class name of the concrete LifecycleFactory + implementation class that will be called when + FactoryFinder.getFactory(LIFECYCLE_FACTORY) is called.

+ + ]]> +
+
+
+ + + + The "view-declaration-language-factory" element contains + the fully qualified class name of the concrete + ViewDeclarationLanguageFactory + implementation class that will be called when + FactoryFinder.getFactory(VIEW_DECLARATION_FACTORY) is called.

+ + ]]> +
+
+
+ + + + The "tag-handler-delegate-factory" element contains + the fully qualified class name of the concrete + ViewDeclarationLanguageFactory + implementation class that will be called when + FactoryFinder.getFactory(TAG_HANDLER_DELEGATE_FACTORY) is called.

+ + ]]> +
+
+
+ + + + The "render-kit-factory" element contains the fully + qualified class name of the concrete RenderKitFactory + implementation class that will be called when + FactoryFinder.getFactory(RENDER_KIT_FACTORY) is + called.

+ + ]]> +
+
+
+ + + + The "visit-context-factory" element contains the fully + qualified class name of the concrete VisitContextFactory + implementation class that will be called when + FactoryFinder.getFactory(VISIT_CONTEXT_FACTORY) is + called.

+ + ]]> +
+
+
+ + + + The "flash-factory" element contains the + fully qualified class name of the concrete + FaceletFactory implementation class that will + be called when + FactoryFinder.getFactory(FLASH_FACTORY) is + called.

+ + ]]> +
+
+
+ + + + The "flow-handler-factory" element contains the + fully qualified class name of the concrete + FlowHandlerFactory implementation class that will + be called when + FactoryFinder.getFactory(FLOW_HANDLER_FACTORY) is + called.

+ + ]]> +
+
+
+ + + + The "client-window-factory" element contains the fully + qualified class name of the concrete ClientWindowFactory implementation class that + will be called when FactoryFinder.getFactory(CLIENT_WINDOW_FACTORY) is called.

+ + ]]> +
+
+
+ + + + The + "search-expression-context-factory" element contains the + fully qualified class name of the concrete + SearchExpressionContextFactory implementation class that will + be called when + FactoryFinder.getFactory(SEARCH_EXPRESSION_CONTEXT_FACTORY) + is called.

+ + ]]> +
+
+
+ +
+ +
+ + + + + + + + Extension element for factory. It may contain + implementation specific content.

+ + ]]> +
+
+ + + + +
+ + + + + + + + The "attribute" element represents a named, typed, value + associated with the parent UIComponent via the generic + attributes mechanism.

+ +

Attribute names must be unique within the scope of the parent + (or related) component.

+ + ]]> +
+
+ + + + + + The "attribute-name" element represents the name under + which the corresponding value will be stored, in the + generic attributes of the UIComponent we are related + to.

+ + ]]> +
+
+
+ + + + The "attribute-class" element represents the Java type + of the value associated with this attribute name.

+ + ]]> +
+
+
+ + + +
+ +
+ + + + + + + + Extension element for attribute. It may contain + implementation specific content.

+ + ]]> +
+
+ + + + +
+ + + + + + + + The "component" element represents a concrete UIComponent + implementation class that should be registered under the + specified type identifier, along with its associated + properties and attributes. Component types must be unique + within the entire web application.

+ +

Nested "attribute" elements identify generic attributes that + are recognized by the implementation logic of this component. + Nested "property" elements identify JavaBeans properties of + the component class that may be exposed for manipulation + via tools.

+ + ]]> +
+
+ + + + + + The "component-type" element represents the name under + which the corresponding UIComponent class should be + registered.

+ + ]]> +
+
+
+ + + + The "component-class" element represents the fully + qualified class name of a concrete UIComponent + implementation class.

+ + ]]> +
+
+
+ + + + +
+ +
+ + + + + + + + Extension element for component. It may contain + implementation specific content.

+ + ]]> +
+
+ + + + +
+ + + + + + + + The "default-locale" element declares the default locale + for this application instance.

+ +

+ To facilitate BCP 47 this element first needs to be parsed by the + Locale.forLanguageTag method. If it does not return a Locale with + a language the old specification below needs to take effect. +

+ +

It must be specified as :language:[_:country:[_:variant:]] + without the colons, for example "ja_JP_SJIS". The + separators between the segments may be '-' or '_'.

+ + ]]> +
+
+ + + + + +
+ + + + + + + + The "default-value" contains the value for the property or + attribute in which this element resides. This value differs + from the "suggested-value" in that the property or attribute + must take the value, whereas in "suggested-value" taking the + value is optional.

+ + ]]> +
+
+ + + + + +
+ + + + + EL expressions present within a faces config file + must start with the character sequence of '#{' and + end with '}'.

+ + ]]> +
+
+ + + +
+ + + + + + + + Define the name and other design-time information for a facet + that is associated with a renderer or a component.

+ + ]]> +
+
+ + + + + + The "facet-name" element represents the facet name + under which a UIComponent will be added to its parent. + It must be of type "Identifier".

+ + ]]> +
+
+
+ +
+ +
+ + + + + + + + Extension element for facet. It may contain implementation + specific content.

+ + ]]> +
+
+ + + + +
+ + + + + + + + The + value of from-view-id must contain one of the following + values:

+ +
    + +
  • The exact match for a view identifier that is recognized + by the the ViewHandler implementation being used (such as + "/index.jsp" if you are using the default ViewHandler).

  • + +
  • The exact match of a flow node id + in the current flow, or a flow id of another flow.

  • + +
  • A proper prefix of a view identifier, plus a trailing + "*" character. This pattern indicates that all view + identifiers that match the portion of the pattern up to the + asterisk will match the surrounding rule. When more than one + match exists, the match with the longest pattern is selected. +

  • + +
  • An "*" character, which means that this pattern applies + to all view identifiers.

  • + +
+ + ]]> +
+
+ + + + + +
+ + + + + + + + The "from-action" element contains an action reference + expression that must have been executed (by the default + ActionListener for handling application level events) + in order to select the navigation rule. If not specified, + this rule will be relevant no matter which action reference + was executed (or if no action reference was executed).

+ + ]]> +
+
+ + + + + +
+ + + + + + + + The "if" element defines a condition that must resolve + to true in order for the navigation case on which it is + defined to be matched, with the existing match criteria + (action method and outcome) as a prerequiste, if present. + The condition is defined declaratively using a value + expression in the body of this element. The expression is + evaluated at the time the navigation case is being matched. + If the "from-outcome" is omitted and this element is + present, the navigation handler will match a null outcome + and use the condition return value to determine if the + case should be considered a match.

+ +
+ +

When used in a <switch> within a flow, if the + expresion returns true, the + <from-outcome> sibling element's outcome is used as + the id of the node in the flow graph to which control must be + passed.

+ +
+ + ]]> +
+
+ + + + + +
+ + + + + + + +

+ +
+ +
+ + ]]> +
+
+ + + + + +
+ + + + + + + + The "converter" element represents a concrete Converter + implementation class that should be registered under the + specified converter identifier. Converter identifiers must + be unique within the entire web application.

+ +

Nested "attribute" elements identify generic attributes that + may be configured on the corresponding UIComponent in order + to affect the operation of the Converter. Nested "property" + elements identify JavaBeans properties of the Converter + implementation class that may be configured to affect the + operation of the Converter. "attribute" and "property" + elements are intended to allow component developers to + more completely describe their components to tools and users. + These elements have no required runtime semantics.

+ + ]]> +
+
+ + + + + + + The "converter-id" element represents the + identifier under which the corresponding + Converter class should be registered.

+ + ]]> +
+
+
+ + + + The "converter-for-class" element represents the + fully qualified class name for which a Converter + class will be registered.

+ + ]]> +
+
+
+
+ + + + The "converter-class" element represents the fully + qualified class name of a concrete Converter + implementation class.

+ + ]]> +
+
+
+ + + + Nested "attribute" elements identify generic + attributes that may be configured on the + corresponding UIComponent in order to affect the + operation of the Converter. This attribute is + primarily for design-time tools and is not + specified to have any meaning at runtime.

+ + ]]> +
+
+
+ + + + Nested "property" elements identify JavaBeans + properties of the Converter implementation class + that may be configured to affect the operation of + the Converter. This attribute is primarily for + design-time tools and is not specified to have + any meaning at runtime.

+ + ]]> +
+
+
+ +
+ +
+ + + + + + + + Extension element for converter. It may contain + implementation specific content.

+ + ]]> +
+
+ + + + +
+ + + + + + + + The "lifecycle" element provides a mechanism to specify + modifications to the behaviour of the default Lifecycle + implementation for this web application.

+ + ]]> +
+
+ + + + + The "phase-listener" element contains the fully + qualified class name of the concrete PhaseListener + implementation class that will be registered on + the Lifecycle.

+ + ]]> +
+
+
+ +
+ +
+ + + + + + + + Extension element for lifecycle. It may contain + implementation specific content.

+ + ]]> +
+
+ + + + +
+ + + + + The localeType defines valid locale defined by ISO-639-1 + and ISO-3166.

+ + ]]> +
+
+ + + +
+ + + + + + + + The "locale-config" element allows the app developer to + declare the supported locales for this application.

+ + ]]> +
+
+ + + + + +
+ + + + + + + + The "default-validators" element allows the app developer to + register a set of validators, referenced by identifier, that + are automatically assigned to any EditableValueHolder component + in the application, unless overridden or disabled locally.

+ + ]]> +
+
+ + + + + The "validator-id" element represents the identifier + of a registered validator.

+ + ]]> +
+
+
+
+ +
+ + + + + + + + + Top level element for a flow + definition.

+ +
+ +

If there is no <start-node> element declared, it + is assumed to be <flowName>.xhtml.

+ +
+ + ]]> +
+
+ + + + + + Declare the id of the starting node in the + flow graph. The start node may be any of the node types mentioned in + the class javadocs for FlowHandler.

+ + ]]> +
+
+
+ + + + + + + + + +
+ + + + The id of this flow. The id + must be unique within the Application configuration Resource + file in which this flow is defined. The value of this attribute, + combined with the value of the <faces-config><name> element + must globally identify the flow within the application.

+ + ]]> + + + + + + + + + + + + Invoke a method, passing parameters if necessary. + The return from the method is used as the outcome for where to go next in the + flow. If the method is a void method, the default outcome is used.

+ + ]]> + + + + + + + + + A parameter to pass when calling the method + identified in the "method" element that is a sibling of this element.

+ + ]]> + + + + + + + + + + + + + + + + + + + + + + + + A parameter to pass when calling the method + identified in the "method" element that is a sibling of this element.

+ + ]]> + + + + + + + The optional "class" element within a "parameter" element + will be interpreted as the fully qualified class name for the type + of the "value" element.

+ + ]]> +
+
+ + + + + The "value" element within an "parameter" + must be a literal string or an EL Expression whose "get" will be called when the "method" + associated with this element is invoked.

+ + ]]> +
+
+
+ +
+ + + + + + + + Define a view node in a flow graph.

+ +

This element must contain exactly one + <vdl-document> element.

+ + ]]> +
+
+ + + + + + Define the path to the vdl-document for the enclosing view. +

+ + ]]> + + + + + + + + The id of this view. It must be + unique within the flow.

+ + ]]> +
+
+ +
+ + + + + + + + Define a switch node in a flow graph.

+ +
+ +

This element must contain one or more + <case> elements. When control passes to the + <switch> node, each of the cases must be considered + in order and control must past to the <from-outcome> + of the first one whose <if> expression evaluates to + true.

+ +
+ + ]]> +
+
+ + + + + Defines a case that must be + considered in the list of cases in the + <switch>.

+ + ]]> +
+
+
+ + + + Defines the default case that will + be taken if none of the other cases in the + <switch> are taken.

+ + ]]> +
+
+
+
+ + + + The id of this switch. It must be + unique within the flow.

+ + ]]> +
+
+
+
+ + + + + + + + Defines a case that will + be considered in the <switch>.

+ + ]]> +
+
+ + + + + + If this EL expression evaluates to + true, the corresponding from-outcome will + be the outcome taken by the enclosing <switch>

+ + ]]> +
+
+
+ + + + The "from-outcome" element contains a logical outcome + string returned by the execution of an application + action method selected via an "actionRef" property + (or a literal value specified by an "action" property) + of a UICommand component. If specified, this rule + will be relevant only if the outcome value matches + this element's value. If not specified, this rule + will be relevant if the outcome value is non-null + or, if the "if" element is present, will be relevant + for any outcome value, with the assumption that the + condition specified in the "if" element ultimately + determines if this rule is a match.

+ +

If used in a faces flow, this element + represents the node id to which control will be passed.

+ + ]]> +
+
+
+
+ + +
+ + + + + + + + Define a return node in a flow graph.

+ +
+ +

This element must contain exactly one <from-outcome> element.

+
+ + ]]> +
+
+ + + + + This element + represents the node id to which control will be passed.

+ + ]]> +
+
+
+
+ + + + The id of this flow-return.

+ + ]]> +
+
+
+
+ + + + + + + + Define a call node in a flow graph.

+ +
+ +

This element must contain exactly one <flow-reference> element, + which must contain exactly one <flow-id> element.

+
+ + ]]> +
+
+ + + + + The flow id of the called flow.

+ + ]]> + + + + + + + A parameter to pass when calling the flow + identified in the "flow-reference" element that is a sibling of this element.

+ + ]]> + + + + + + + + The id of this flow-return.

+ + ]]> +
+
+ +
+ + + + + + + + Identifiy the called flow.

+ +
+ +
+ + ]]> +
+
+ + + + + The document id of the called flow.

+ + ]]> +
+
+
+ + + + The id of the called flow.

+ + ]]> +
+
+
+
+
+ + + + + + + + A MethodExpression that will be invoked when the flow is entered.

+ + ]]> + + + + + + + + + + + + + + + + A MethodExpression that will be invoked when the flow is exited.

+ + ]]> + + + + + + + + + + + + + + + + A named parameter whose value will be populated + with a correspondingly named parameter within an "outbound-parameter" element.

+ + ]]> + + + + + + + The "name" element within an "inbound-parameter" + element declares the name of this parameter + to be passed into a flow. There must be + a sibling "value" element in the same parent as this element.

+ + ]]> +
+
+ + + + + The "value" element within an "inbound-parameter" + must be an EL Expression whose value will be set with the correspondingly + named "outbound-parameter" when this flow is entered, if such a + parameter exists.

+ + ]]> +
+
+
+ +
+ + + + + + + + A named parameter whose value will be + passed to a correspondingly named parameter within an "inbound-parameter" element + on the target flow.

+ + ]]> + + + + + + + The "name" element within an "outbound-parameter" element + declares the name of this parameter to be passed out of a flow. There must be + a sibling "value" element in the same parent as this element.

+ + ]]> +
+
+ + + + + The "value" element within an "outbound-parameter" + must be a literal string or an EL Expression whose "get" will be called when the "flow-call" + containing this element is traversed to go to a new flow.

+ + ]]> +
+
+
+ +
+ + + + + + + + + The + "navigation-case" element describes a particular + combination of conditions that must match for this case to + be executed, and the view id of the component tree that + should be selected next.

+ + ]]> +
+
+ + + + + + + The "from-outcome" element contains a logical outcome + string returned by the execution of an application + action method selected via an "actionRef" property + (or a literal value specified by an "action" property) + of a UICommand component. If specified, this rule + will be relevant only if the outcome value matches + this element's value. If not specified, this rule + will be relevant if the outcome value is non-null + or, if the "if" element is present, will be relevant + for any outcome value, with the assumption that the + condition specified in the "if" element ultimately + determines if this rule is a match.

+ + ]]> +
+
+
+ + + + Please see section 7.4.2 "Default NavigationHandler Algorithm" of the Jakarta Faces Specification Document + for the specification of this element.

+ + ]]> +
+
+
+ + + + The "to-view-id" element + contains the view identifier (or + flow node id, or flow id) + of the next view (or flow node or + flow) that should be displayed if this + navigation rule is matched. If the contents is a + value expression, it should be resolved by the + navigation handler to obtain the view ( + or flow node or flow) + identifier.

+ + ]]> +
+
+
+ + + + The document id of the called flow. + If this element appears in a <navigation-case> nested within + a <flow-definition>, it must be ignored because navigation + cases within flows may only navigate among the view nodes of that + flow.

+ + ]]> +
+
+
+ +
+ +
+ + + + + + + + The "navigation-rule" element represents an individual + decision rule that will be utilized by the default + NavigationHandler implementation to make decisions on + what view should be displayed next, based on the + view id being processed.

+ + ]]> +
+
+ + + + + + + +
+ + + + + + + + Extension element for navigation-rule. It may contain + implementation specific content.

+ + ]]> +
+
+ + + + +
+ + + + + + + + The "null-value" element indicates that the managed + property in which we are nested will be explicitly + set to null if our managed bean is automatically + created. This is different from omitting the managed + property element entirely, which will cause no + property setter to be called for this property.

+ +

The "null-value" element can only be used when the + associated "property-class" identifies a Java class, + not a Java primitive.

+ + ]]> +
+
+ +
+ + + + + + + + The "property" element represents a JavaBean property of the + Java class represented by our parent element.

+ +

Property names must be unique within the scope of the Java + class that is represented by the parent element, and must + correspond to property names that will be recognized when + performing introspection against that class via + java.beans.Introspector.

+ + ]]> +
+
+ + + + + + The "property-name" element represents the JavaBeans + property name under which the corresponding value + may be stored.

+ + ]]> +
+
+
+ + + + The "property-class" element represents the Java type + of the value associated with this property name. + If not specified, it can be inferred from existing + classes; however, this element should be specified if + the configuration file is going to be the source for + generating the corresponding classes.

+ + ]]> +
+
+
+ + + +
+ +
+ + + + + + + + Any view that matches any of the + url-patterns in this element may only be reached from another Jakarta Faces + view in the same web application. Because the runtime is aware of + which views are protected, any navigation from an unprotected + view to a protected view is automatically subject to + protection.

+ + ]]> +
+
+ + + +
+ + + + + + + + Extension element for property. It may contain + implementation specific content.

+ + ]]> +
+
+ + + + +
+ + + + + + + + The "redirect" element indicates that navigation to the + specified "to-view-id" should be accomplished by + performing an HTTP redirect rather than the usual + ViewHandler mechanisms.

+ + ]]> +
+
+ + + + + +
+ + + + + + + + This element was introduced due to a specification + error, and is now deprecated. The correct name for + this element is "redirect-param" and its meaning is + documented therein. The "view-param" element is + maintained to preserve backwards compatibility. + Implementations must treat this element the same as + "redirect-param".

+ + ]]> +
+
+ + + + + +
+ + + + + + + + The "redirect-param" element, only valid within + a "redirect" element, contains child "name" + and "value" elements that must be included in the + redirect url when the redirect is performed.

+ + ]]> +
+
+ + + + + +
+ + + + + + + + The "referenced-bean" element represents at design time the + promise that a Java object of the specified type will exist at + runtime in some scope, under the specified key. This can be + used by design time tools to construct user interface dialogs + based on the properties of the specified class. The presence + or absence of a referenced bean element has no impact on the + Jakarta Faces runtime environment inside a web application.

+ + ]]> +
+
+ + + + + + The "referenced-bean-name" element represents the + attribute name under which the corresponding + referenced bean may be assumed to be stored, in one + of 'request', 'session', 'view', 'application' + or a custom scope.

+ + ]]> +
+
+
+ + + + The "referenced-bean-class" element represents the + fully qualified class name of the Java class + (either abstract or concrete) or Java interface + implemented by the corresponding referenced bean.

+ + ]]> +
+
+
+
+ +
+ + + + + + + + The "render-kit" element represents a concrete RenderKit + implementation that should be registered under the specified + render-kit-id. If no render-kit-id is specified, the + identifier of the default RenderKit + (RenderKitFactory.DEFAULT_RENDER_KIT) is assumed.

+ + ]]> +
+
+ + + + + + The "render-kit-id" element represents an identifier + for the RenderKit represented by the parent + "render-kit" element.

+ + ]]> +
+
+
+ + + + The "render-kit-class" element represents the fully + qualified class name of a concrete RenderKit + implementation class.

+ + ]]> +
+
+
+ + + +
+ +
+ + + + + + + + The "client-behavior-renderer" element represents a concrete + ClientBehaviorRenderer implementation class that should be + registered under the specified behavior renderer type identifier, + in the RenderKit associated with the parent "render-kit" + element. Client Behavior renderer type must be unique within the RenderKit + associated with the parent "render-kit" element.

+ +

Nested "attribute" elements identify generic component + attributes that are recognized by this renderer.

+ + ]]> +
+
+ + + + + The "client-behavior-renderer-type" element represents a renderer type + identifier for the Client Behavior Renderer represented by the parent + "client-behavior-renderer" element.

+ + ]]> +
+
+
+ + + + The "client-behavior-renderer-class" element represents the fully + qualified class name of a concrete Client Behavior Renderer + implementation class.

+ + ]]> +
+
+
+
+ +
+ + + + + + + + The "renderer" element represents a concrete Renderer + implementation class that should be registered under the + specified component family and renderer type identifiers, + in the RenderKit associated with the parent "render-kit" + element. Combinations of component family and + renderer type must be unique within the RenderKit + associated with the parent "render-kit" element.

+ +

Nested "attribute" elements identify generic component + attributes that are recognized by this renderer.

+ + ]]> +
+
+ + + + + + The "component-family" element represents the + component family for which the Renderer represented + by the parent "renderer" element will be used.

+ + ]]> +
+
+
+ + + + The "renderer-type" element represents a renderer type + identifier for the Renderer represented by the parent + "renderer" element.

+ + ]]> +
+
+
+ + + + The "renderer-class" element represents the fully + qualified class name of a concrete Renderer + implementation class.

+ + ]]> +
+
+
+ + + +
+ +
+ + + + + + + + Extension element for renderer. It may contain implementation + specific content.

+ + ]]> +
+
+ + + + +
+ + + + + + + + Extension element for render-kit. It may contain + implementation specific content.

+ + ]]> +
+
+ + + + +
+ + + + + + + + The "suggested-value" contains the value for the property or + attribute in which this element resides. This value is + advisory only and is intended for tools to use when + populating pallettes.

+ + ]]> +
+
+ + + +
+ + + + + + + + The "supported-locale" element allows authors to declare + which locales are supported in this application instance.

+ +

+ To facilitate BCP 47 this element first needs to be parsed by the + Locale.forLanguageTag method. If it does not return a Locale with + a language the old specification below needs to take effect. +

+ +

It must be specified as :language:[_:country:[_:variant:]] + without the colons, for example "ja_JP_SJIS". The + separators between the segments may be '-' or '_'.

+ + ]]> +
+
+ + + + + +
+ + + + + + + + The "behavior" element represents a concrete Behavior + implementation class that should be registered under the + specified behavior identifier. Behavior identifiers must + be unique within the entire web application.

+ +

Nested "attribute" elements identify generic attributes that + may be configured on the corresponding UIComponent in order + to affect the operation of the Behavior. Nested "property" + elements identify JavaBeans properties of the Behavior + implementation class that may be configured to affect the + operation of the Behavior. "attribute" and "property" + elements are intended to allow component developers to + more completely describe their components to tools and users. + These elements have no required runtime semantics.

+ + ]]> +
+
+ + + + + + The "behavior-id" element represents the identifier + under which the corresponding Behavior class should + be registered.

+ + ]]> +
+
+
+ + + + The "behavior-class" element represents the fully + qualified class name of a concrete Behavior + implementation class.

+ + ]]> +
+
+
+ + + + Nested "attribute" elements identify generic + attributes that may be configured on the + corresponding UIComponent in order to affect the + operation of the Behavior. This attribute is + primarily for design-time tools and is not + specified to have any meaning at runtime.

+ + ]]> +
+
+
+ + + + Nested "property" elements identify JavaBeans + properties of the Behavior implementation class + that may be configured to affect the operation of + the Behavior. This attribute is primarily for + design-time tools and is not specified to have + any meaning at runtime.

+ + ]]> +
+
+
+ +
+ +
+ + + + + + + + Extension element for behavior. It may contain + implementation specific content.

+ + ]]> +
+
+ + + + +
+ + + + + + + + The "validator" element represents a concrete Validator + implementation class that should be registered under the + specified validator identifier. Validator identifiers must + be unique within the entire web application.

+ +

Nested "attribute" elements identify generic attributes that + may be configured on the corresponding UIComponent in order + to affect the operation of the Validator. Nested "property" + elements identify JavaBeans properties of the Validator + implementation class that may be configured to affect the + operation of the Validator. "attribute" and "property" + elements are intended to allow component developers to + more completely describe their components to tools and users. + These elements have no required runtime semantics.

+ + ]]> +
+
+ + + + + + The "validator-id" element represents the identifier + under which the corresponding Validator class should + be registered.

+ + ]]> +
+
+
+ + + + The "validator-class" element represents the fully + qualified class name of a concrete Validator + implementation class.

+ + ]]> +
+
+
+ + + + Nested "attribute" elements identify generic + attributes that may be configured on the + corresponding UIComponent in order to affect the + operation of the Validator. This attribute is + primarily for design-time tools and is not + specified to have any meaning at runtime.

+ + ]]> +
+
+
+ + + + Nested "property" elements identify JavaBeans + properties of the Validator implementation class + that may be configured to affect the operation of + the Validator. This attribute is primarily for + design-time tools and is not specified to have + any meaning at runtime.

+ + ]]> +
+
+
+ +
+ +
+ + + + + + + + Extension element for validator. It may contain + implementation specific content.

+ + ]]> +
+
+ + + + +
+ + + + + The "value" element is the String representation of + a literal value to which a scalar managed property + will be set, or a value binding expression ("#{...}") + that will be used to calculate the required value. + It will be converted as specified for the actual + property type.

+ + ]]> +
+
+ +
+ + + + + + + + The presence of this element within the "application" element in + an application configuration resource file indicates the + developer wants to add an SystemEventListener to this + application instance. Elements nested within this element allow + selecting the kinds of events that will be delivered to the + listener instance, and allow selecting the kinds of classes that + can be the source of events that are delivered to the listener + instance.

+ + ]]> +
+
+ + + + + The "system-event-listener-class" element contains + the fully qualified class name of the concrete + SystemEventListener implementation class that will be + called when events of the type specified by the + "system-event-class" are sent by the runtime.

+ + ]]> +
+
+
+ + + + The "system-event-class" element contains the fully + qualified class name of the SystemEvent subclass for + which events will be delivered to the class whose fully + qualified class name is given by the + "system-event-listener-class" element.

+ + ]]> +
+
+
+ + + + The "source-class" element, if present, contains the + fully qualified class name of the class that will be the + source for the event to be delivered to the class whose + fully qualified class name is given by the + "system-event-listener-class" element.

+ + ]]> +
+
+
+
+ +
+ + + + + This type contains the recognized versions of + faces-config supported.

+ + ]]> +
+
+ + + +
+ +
diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/CompositeComponentWizardIterator.java b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/CompositeComponentWizardIterator.java index b82c3b32404c..024b6db52781 100644 --- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/CompositeComponentWizardIterator.java +++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/CompositeComponentWizardIterator.java @@ -72,7 +72,9 @@ public Set instantiate(TemplateWizard wiz) throws IOException { WebModule webModule = WebModule.getWebModule(project.getProjectDirectory()); if (webModule != null) { JsfVersion version = JsfVersionUtils.forWebModule(webModule); - if (version != null && version.isAtLeast(JsfVersion.JSF_4_1)) { + if (version != null && version.isAtLeast(JsfVersion.JSF_5_0)) { + templateProperties.put("isJSF50", Boolean.TRUE); //NOI18N + } else if (version != null && version.isAtLeast(JsfVersion.JSF_4_1)) { templateProperties.put("isJSF41", Boolean.TRUE); //NOI18N } else if (version != null && version.isAtLeast(JsfVersion.JSF_4_0)) { templateProperties.put("isJSF40", Boolean.TRUE); //NOI18N diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/FacesConfigIterator.java b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/FacesConfigIterator.java index bd6106c6e2eb..cf8e6db3cb1f 100644 --- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/FacesConfigIterator.java +++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/FacesConfigIterator.java @@ -57,6 +57,7 @@ import static org.netbeans.modules.web.jsfapi.api.JsfVersion.JSF_2_3; import static org.netbeans.modules.web.jsfapi.api.JsfVersion.JSF_3_0; import static org.netbeans.modules.web.jsfapi.api.JsfVersion.JSF_4_0; +import static org.netbeans.modules.web.jsfapi.api.JsfVersion.JSF_5_0; import org.netbeans.modules.web.wizards.Utilities; import org.netbeans.spi.java.classpath.ClassPathProvider; import org.netbeans.spi.project.ui.templates.support.Templates; @@ -141,7 +142,10 @@ public static FileObject createFacesConfig(Project project, FileObject targetDir for (InitParam param : parameters) { if (param.getParamName().equals(FACES_CONFIG_PARAM) || param.getParamName().equals(JAKARTAEE_FACES_CONFIG_PARAM)) { found = true; - String value = param.getParamValue() + ",\n /" + FileUtil.getRelativePath(wm.getDocumentBase(), targetDir) + "/" + targetName + ".xml"; //NOI18N + String value = param.getParamValue() + + ",\n /" + + FileUtil.getRelativePath(wm.getDocumentBase(), targetDir) + + "/" + targetName + ".xml"; //NOI18N ddRoot.removeContextParam(param); InitParam newParameter = (InitParam) ddRoot.createBean(INIT_PARAM); newParameter.setParamName(param.getParamName()); @@ -153,8 +157,10 @@ public static FileObject createFacesConfig(Project project, FileObject targetDir } if (!found) { InitParam contextParam = (InitParam) ddRoot.createBean(INIT_PARAM); - if(WebApp.VERSION_6_1.equals(ddRoot.getVersion()) || WebApp.VERSION_6_0.equals(ddRoot.getVersion()) || - WebApp.VERSION_5_0.equals(ddRoot.getVersion())) { + if(WebApp.VERSION_6_2.equals(ddRoot.getVersion()) + || WebApp.VERSION_6_1.equals(ddRoot.getVersion()) + || WebApp.VERSION_6_0.equals(ddRoot.getVersion()) + || WebApp.VERSION_5_0.equals(ddRoot.getVersion())) { contextParam.setParamName(JAKARTAEE_FACES_CONFIG_PARAM); } else { contextParam.setParamName(FACES_CONFIG_PARAM); @@ -191,7 +197,9 @@ private static String findFacesConfigTemplate(WebModule wm) { // not found on project classpath (case of Maven project with JSF in deps) if (jsfVersion == null) { Profile profile = wm.getJ2eeProfile(); - if (profile.isAtLeast(Profile.JAKARTA_EE_11_WEB)) { + if (profile.isAtLeast(Profile.JAKARTA_EE_12_WEB)) { + return JSFCatalog.RES_FACES_CONFIG_5_0; + } else if (profile.isAtLeast(Profile.JAKARTA_EE_11_WEB)) { return JSFCatalog.RES_FACES_CONFIG_4_1; } else if (profile.isAtLeast(Profile.JAKARTA_EE_10_WEB)) { return JSFCatalog.RES_FACES_CONFIG_4_0; @@ -227,6 +235,8 @@ private static String findFacesConfigTemplate(WebModule wm) { private static String facesConfigForVersion(JsfVersion jsfVersion) { switch (jsfVersion) { + case JSF_5_0: + return JSFCatalog.RES_FACES_CONFIG_5_0; case JSF_4_1: return JSFCatalog.RES_FACES_CONFIG_4_1; case JSF_4_0: diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/JSFConfigurationPanel.java b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/JSFConfigurationPanel.java index d4b566b8aaf1..f5e408d9cb52 100644 --- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/JSFConfigurationPanel.java +++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/JSFConfigurationPanel.java @@ -21,16 +21,11 @@ import java.io.File; import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; import java.util.List; import java.util.Set; -import java.util.prefs.Preferences; -import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import org.netbeans.api.project.FileOwnerQuery; import org.netbeans.api.project.Project; -import org.netbeans.api.project.ProjectUtils; import org.netbeans.api.project.libraries.Library; import org.netbeans.modules.j2ee.deployment.plugins.api.ServerLibrary; import org.netbeans.modules.web.api.webmodule.ExtenderController; @@ -205,10 +200,10 @@ protected boolean isMaven() { return isMaven != null && isMaven; } - @Deprecated - /* - * Use getFacesMapping() instead + /** + * @deprecated Use {@link getFacesMapping()} instead */ + @Deprecated public String getURLPattern(){ return component.getURLPattern(); } diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/JSFConfigurationPanelVisual.java b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/JSFConfigurationPanelVisual.java index e8b93a689852..fdd98d9c51d5 100644 --- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/JSFConfigurationPanelVisual.java +++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/JSFConfigurationPanelVisual.java @@ -154,8 +154,8 @@ public class JSFConfigurationPanelVisual extends javax.swing.JPanel implements H private static final List JSF_LIBRARIES_CACHE = new CopyOnWriteArrayList<>(); /** Maps used for faster seek of JSF/Jakarta Faces registered libraries. */ - private static final Map JSF_SEEKING_MAP = new LinkedHashMap<>(2); - private static final Map JSF_SEEKING_MAP_JAKARTA = new LinkedHashMap<>(2); + private static final Map JSF_SEEKING_MAP = new LinkedHashMap<>(4); + private static final Map JSF_SEEKING_MAP_JAKARTA = new LinkedHashMap<>(4); static { JSF_SEEKING_MAP.put(false, JSFUtils.EJB_STATELESS); @@ -1811,17 +1811,20 @@ public void run() { public void run() { setServerLibraryModel(serverJsfLibraries); if (serverJsfLibraries.isEmpty()) { - Library preferredLibrary; - if (getProfile() != null && getProfile().isAtLeast(Profile.JAKARTA_EE_11_WEB)) { - preferredLibrary = LibraryManager.getDefault().getLibrary(JSFUtils.DEFAULT_JSF_4_1_NAME); - } else if (getProfile() != null && getProfile().isAtLeast(Profile.JAKARTA_EE_10_WEB)) { - preferredLibrary = LibraryManager.getDefault().getLibrary(JSFUtils.DEFAULT_JSF_4_0_NAME); - } else if (getProfile() != null && getProfile().isAtLeast(Profile.JAKARTA_EE_9_WEB)) { - preferredLibrary = LibraryManager.getDefault().getLibrary(JSFUtils.DEFAULT_JSF_3_0_NAME); - } else if (getProfile() != null && getProfile().isAtLeast(Profile.JAVA_EE_5)) { - preferredLibrary = LibraryManager.getDefault().getLibrary(JSFUtils.DEFAULT_JSF_2_0_NAME); - } else { - preferredLibrary = LibraryManager.getDefault().getLibrary(JSFUtils.DEFAULT_JSF_1_2_NAME); + Library preferredLibrary = LibraryManager.getDefault().getLibrary(JSFUtils.DEFAULT_JSF_1_2_NAME); + Profile profile = getProfile(); + if (null != profile) { + if (profile.isAtLeast(Profile.JAKARTA_EE_12_WEB)) { + preferredLibrary = LibraryManager.getDefault().getLibrary(JSFUtils.DEFAULT_JSF_5_0_NAME); + } else if (profile.isAtLeast(Profile.JAKARTA_EE_11_WEB)) { + preferredLibrary = LibraryManager.getDefault().getLibrary(JSFUtils.DEFAULT_JSF_4_1_NAME); + } else if (profile.isAtLeast(Profile.JAKARTA_EE_10_WEB)) { + preferredLibrary = LibraryManager.getDefault().getLibrary(JSFUtils.DEFAULT_JSF_4_0_NAME); + } else if (profile.isAtLeast(Profile.JAKARTA_EE_9_WEB)) { + preferredLibrary = LibraryManager.getDefault().getLibrary(JSFUtils.DEFAULT_JSF_3_0_NAME); + } else if (profile.isAtLeast(Profile.JAVA_EE_5)) { + preferredLibrary = LibraryManager.getDefault().getLibrary(JSFUtils.DEFAULT_JSF_2_0_NAME); + } } if (preferredLibrary != null) { diff --git a/enterprise/web.jsfapi/nbproject/project.properties b/enterprise/web.jsfapi/nbproject/project.properties index 0f4ec98bc91a..73811063fd2b 100644 --- a/enterprise/web.jsfapi/nbproject/project.properties +++ b/enterprise/web.jsfapi/nbproject/project.properties @@ -14,5 +14,5 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -javac.source=1.8 +javac.release=17 javac.compilerargs=-Xlint -Xlint:-serial diff --git a/enterprise/web.jsfapi/src/org/netbeans/modules/web/jsfapi/api/JsfVersion.java b/enterprise/web.jsfapi/src/org/netbeans/modules/web/jsfapi/api/JsfVersion.java index 3d7df12c03f9..82c6225ada9f 100644 --- a/enterprise/web.jsfapi/src/org/netbeans/modules/web/jsfapi/api/JsfVersion.java +++ b/enterprise/web.jsfapi/src/org/netbeans/modules/web/jsfapi/api/JsfVersion.java @@ -35,7 +35,8 @@ public enum JsfVersion { JSF_2_3("2.3"), JSF_3_0("3.0"), JSF_4_0("4.0"), - JSF_4_1("4.1"); + JSF_4_1("4.1"), + JSF_5_0("5.0"); private final String version; @@ -49,6 +50,14 @@ public String getShortName() { } return "JSF " + version; } + + /** + * + * @return String representation + */ + public String getVersion() { + return this.version; + } /** * Find out if the version of the JsfVersion is equal or higher to given diff --git a/enterprise/web.jsfapi/test/unit/src/org/netbeans/modules/web/jsfapi/api/JsfVersionTest.java b/enterprise/web.jsfapi/test/unit/src/org/netbeans/modules/web/jsfapi/api/JsfVersionTest.java index 51996c1b30a6..0eb452925e24 100644 --- a/enterprise/web.jsfapi/test/unit/src/org/netbeans/modules/web/jsfapi/api/JsfVersionTest.java +++ b/enterprise/web.jsfapi/test/unit/src/org/netbeans/modules/web/jsfapi/api/JsfVersionTest.java @@ -43,6 +43,7 @@ public void testVersionComparison_JSF_1_0() { assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_3_0)); assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_0)); assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_1)); + assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_5_0)); } @Test @@ -59,6 +60,7 @@ public void testVersionComparison_JSF_1_1() { assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_3_0)); assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_0)); assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_1)); + assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_5_0)); } @Test @@ -75,6 +77,7 @@ public void testVersionComparison_JSF_1_2() { assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_3_0)); assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_0)); assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_1)); + assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_5_0)); } @Test @@ -91,6 +94,7 @@ public void testVersionComparison_JSF_2_0() { assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_3_0)); assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_0)); assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_1)); + assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_5_0)); } @Test @@ -107,6 +111,7 @@ public void testVersionComparison_JSF_2_1() { assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_3_0)); assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_0)); assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_1)); + assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_5_0)); } @Test @@ -123,6 +128,7 @@ public void testVersionComparison_JSF_2_2() { assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_3_0)); assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_0)); assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_1)); + assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_5_0)); } @Test @@ -139,6 +145,7 @@ public void testVersionComparison_JSF_2_3() { assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_3_0)); assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_0)); assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_1)); + assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_5_0)); } @Test @@ -155,6 +162,7 @@ public void testVersionComparison_JSF_3_0() { assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_3_0)); assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_0)); assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_1)); + assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_5_0)); } @Test @@ -171,6 +179,7 @@ public void testVersionComparison_JSF_4_0() { assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_3_0)); assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_4_0)); assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_4_1)); + assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_5_0)); } @Test @@ -187,6 +196,24 @@ public void testVersionComparison_JSF_4_1() { assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_3_0)); assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_4_0)); assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_4_1)); + assertFalse(jsfVersion.isAtLeast(JsfVersion.JSF_5_0)); + } + + @Test + public void testVersionComparison_JSF_5_0() { + JsfVersion jsfVersion = JsfVersion.JSF_5_0; + + assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_1_0)); + assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_1_1)); + assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_1_2)); + assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_2_0)); + assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_2_1)); + assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_2_2)); + assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_2_3)); + assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_3_0)); + assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_4_0)); + assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_4_1)); + assertTrue(jsfVersion.isAtLeast(JsfVersion.JSF_5_0)); } @Test @@ -201,10 +228,11 @@ public void testShortName() { assertEquals("JSF 3.0", JsfVersion.JSF_3_0.getShortName()); assertEquals("Faces 4.0", JsfVersion.JSF_4_0.getShortName()); assertEquals("Faces 4.1", JsfVersion.JSF_4_1.getShortName()); + assertEquals("Faces 5.0", JsfVersion.JSF_5_0.getShortName()); } @Test public void testLatest() { - assertEquals(JsfVersion.JSF_4_1, JsfVersion.latest()); + assertEquals(JsfVersion.JSF_5_0, JsfVersion.latest()); } } diff --git a/enterprise/web.jspparser/nbproject/project.properties b/enterprise/web.jspparser/nbproject/project.properties index 1daa2d5ede6f..de942b6fd1de 100644 --- a/enterprise/web.jspparser/nbproject/project.properties +++ b/enterprise/web.jspparser/nbproject/project.properties @@ -42,7 +42,7 @@ test-unit-sys-prop.jsp.parser.jars-jakarta=\ ${o.apache.tools.ant.module.dir}/ant/lib/ant.jar:\ ${web.jspparser.dir}/modules/ext/glassfish-jspparser-7.0.25.jar:\ ${servletjspapi.dir}/modules/ext/jsp-parser-ext-jakarta.jar:\ - ${servletjspapi.dir}/modules/ext/servlet-jsp-api-6.1_3.0.jar:\ + ${servletjspapi.dir}/modules/ext/servlet-jsp-api-6.2_4.1.jar:\ ${o.apache.tools.ant.module.dir}/ant/lib/ant-launcher.jar test-unit-sys-prop.jstl.jars=\ diff --git a/enterprise/web.jspparser/src/org/netbeans/modules/web/jspparser/JspParserImpl.java b/enterprise/web.jspparser/src/org/netbeans/modules/web/jspparser/JspParserImpl.java index 0a518aa5c1ac..bca8525cd753 100644 --- a/enterprise/web.jspparser/src/org/netbeans/modules/web/jspparser/JspParserImpl.java +++ b/enterprise/web.jspparser/src/org/netbeans/modules/web/jspparser/JspParserImpl.java @@ -91,7 +91,7 @@ public JspParserImpl() { "modules/ext/jsp-parser-ext-jakarta.jar", //NOI18N "modules/ext/jstl-jakarta-api.jar", //NOI18N "modules/ext/jstl-jakarta-impl.jar", //NOI18N - "modules/ext/servlet-jsp-api-6.1_3.0.jar", //NOI18N + "modules/ext/servlet-jsp-api-6.2_4.1.jar", //NOI18N "ant/lib/ant-launcher.jar" //Glassfish V2 //NOI18N }; diff --git a/enterprise/web.project/src/org/netbeans/modules/web/project/ProjectWebModule.java b/enterprise/web.project/src/org/netbeans/modules/web/project/ProjectWebModule.java index 4a2530c13bcd..93aa50841ac4 100644 --- a/enterprise/web.project/src/org/netbeans/modules/web/project/ProjectWebModule.java +++ b/enterprise/web.project/src/org/netbeans/modules/web/project/ProjectWebModule.java @@ -400,9 +400,9 @@ public String getServerID () { String inst = getServerInstanceID (); if (inst != null) { String id = Deployment.getDefault().getServerID(inst); - if (id != null) { - return id; - } + if (id != null) { + return id; + } } return helper.getAntProjectHelper().getStandardPropertyEvaluator ().getProperty (WebProjectProperties.J2EE_SERVER_TYPE); } @@ -561,6 +561,9 @@ public String getModuleVersion () { if (null == platformVersion) { return WebApp.VERSION_3_1; } else switch (platformVersion) { + case JAKARTA_EE_12_FULL: + case JAKARTA_EE_12_WEB: + return WebApp.VERSION_6_2; case JAKARTA_EE_11_FULL: case JAKARTA_EE_11_WEB: return WebApp.VERSION_6_1; diff --git a/enterprise/web.project/src/org/netbeans/modules/web/project/WebJPAModuleInfo.java b/enterprise/web.project/src/org/netbeans/modules/web/project/WebJPAModuleInfo.java index c17368708536..b180e89ab12e 100644 --- a/enterprise/web.project/src/org/netbeans/modules/web/project/WebJPAModuleInfo.java +++ b/enterprise/web.project/src/org/netbeans/modules/web/project/WebJPAModuleInfo.java @@ -20,6 +20,7 @@ package org.netbeans.modules.web.project; import org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment; +import org.netbeans.modules.j2ee.deployment.devmodules.api.InstanceRemovedException; import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eePlatform; import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleProvider; import org.netbeans.modules.j2ee.persistence.dd.common.Persistence; @@ -56,21 +57,27 @@ public String getVersion() { @Override public Boolean isJPAVersionSupported(String version) { J2eeModuleProvider j2eeModuleProvider = project.getLookup().lookup(J2eeModuleProvider.class); - J2eePlatform platform = Deployment.getDefault().getJ2eePlatform(j2eeModuleProvider.getServerInstanceID()); - - if (platform == null) { - return null; - } - JpaSupport support = JpaSupport.getInstance(platform); - JpaProvider provider = support.getDefaultProvider(); - if (provider != null) { - return (Persistence.VERSION_3_2.equals(version) && provider.isJpa32Supported()) - || (Persistence.VERSION_3_1.equals(version) && provider.isJpa31Supported()) - || (Persistence.VERSION_3_0.equals(version) && provider.isJpa30Supported()) - || (Persistence.VERSION_2_2.equals(version) && provider.isJpa22Supported()) - || (Persistence.VERSION_2_1.equals(version) && provider.isJpa21Supported()) - || (Persistence.VERSION_2_0.equals(version) && provider.isJpa2Supported()) - || (Persistence.VERSION_1_0.equals(version) && provider.isJpa1Supported()); + String serverInstanceID = j2eeModuleProvider.getServerInstanceID(); + try { + J2eePlatform platform = Deployment.getDefault().getServerInstance(serverInstanceID).getJ2eePlatform(); + + if (platform == null) { + return null; + } + JpaSupport support = JpaSupport.getInstance(platform); + JpaProvider provider = support.getDefaultProvider(); + if (provider != null) { + return (Persistence.VERSION_4_0.equals(version) && provider.isJpa40Supported()) + || (Persistence.VERSION_3_2.equals(version) && provider.isJpa32Supported()) + || (Persistence.VERSION_3_1.equals(version) && provider.isJpa31Supported()) + || (Persistence.VERSION_3_0.equals(version) && provider.isJpa30Supported()) + || (Persistence.VERSION_2_2.equals(version) && provider.isJpa22Supported()) + || (Persistence.VERSION_2_1.equals(version) && provider.isJpa21Supported()) + || (Persistence.VERSION_2_0.equals(version) && provider.isJpa2Supported()) + || (Persistence.VERSION_1_0.equals(version) && provider.isJpa1Supported()); + } + } catch (InstanceRemovedException ex) { + //noop } return null; } diff --git a/enterprise/web.project/src/org/netbeans/modules/web/project/WebProject.java b/enterprise/web.project/src/org/netbeans/modules/web/project/WebProject.java index c7e301d22206..16368bfd2123 100644 --- a/enterprise/web.project/src/org/netbeans/modules/web/project/WebProject.java +++ b/enterprise/web.project/src/org/netbeans/modules/web/project/WebProject.java @@ -540,7 +540,7 @@ private PropertyEvaluator createEvaluator() { private static final PropertyProvider UPDATE_PROPERTIES; static { - Map defs = new HashMap(); + Map defs = new HashMap<>(16); defs.put(ProjectProperties.ANNOTATION_PROCESSING_ENABLED, "true"); //NOI18N defs.put(ProjectProperties.ANNOTATION_PROCESSING_ENABLED_IN_EDITOR, "true"); //NOI18N @@ -1520,6 +1520,7 @@ private final class RecommendedTemplatesImpl implements RecommendedTemplates, private boolean isEE5 = false; private boolean serverSupportsEJB31 = false; private boolean serverSupportsEJB40 = false; + private boolean serverSupportsEJB41 = false; @Override public String[] getRecommendedTypes() { @@ -1529,7 +1530,7 @@ public String[] getRecommendedTypes() { } else if (projectCap.isEjb31LiteSupported() || projectCap.isEjb40LiteSupported()) { Set set = new HashSet<>(Arrays.asList(TYPES)); if (projectCap.isEjb31Supported() || projectCap.isEjb40Supported() - || serverSupportsEJB31 || serverSupportsEJB40) { + || serverSupportsEJB31 || serverSupportsEJB40 || serverSupportsEJB41) { set.addAll(Arrays.asList(TYPES_EJB31)); } @@ -1554,7 +1555,7 @@ public String[] getPrivilegedTemplates() { if (projectCap.isEjb31LiteSupported()) { set.addAll(getPrivilegedTemplatesEE5()); if (projectCap.isEjb31Supported() || projectCap.isEjb40Supported() - || serverSupportsEJB31 || serverSupportsEJB40) { + || serverSupportsEJB31 || serverSupportsEJB40 || serverSupportsEJB41) { set.addAll(Arrays.asList(PRIVILEGED_NAMES_EE6_FULL)); } @@ -1585,7 +1586,10 @@ private void checkEnvironment() { for (Profile _profile : ProjectUtil.getSupportedProfiles(project)) { if (_profile.isFullProfile()) { - if (_profile.isAtLeast(Profile.JAKARTA_EE_9_FULL)) { + if (_profile.isAtLeast(Profile.JAKARTA_EE_12_FULL)) { + serverSupportsEJB41 = true; + break; + } else if (_profile.isAtLeast(Profile.JAKARTA_EE_9_FULL)) { serverSupportsEJB40 = true; break; } else if (_profile.isAtLeast(Profile.JAVA_EE_6_FULL)) { @@ -1995,24 +1999,11 @@ private void handleCopyFileToDestDir(String prefix, FileObject baseDir, FileObje } FileObject destFile = ensureDestinationFileExists(webBuildBase, path, fo.isFolder()); if (!fo.isFolder()) { - InputStream is = null; - OutputStream os = null; - FileLock fl = null; - try { - is = fo.getInputStream(); - fl = destFile.lock(); - os = destFile.getOutputStream(fl); + try (InputStream is = fo.getInputStream(); + FileLock fl = destFile.lock(); + OutputStream os = destFile.getOutputStream(fl)) { FileUtil.copy(is, os); } finally { - if (is != null) { - is.close(); - } - if (os != null) { - os.close(); - } - if (fl != null) { - fl.releaseLock(); - } File file = FileUtil.toFile(destFile); if (file != null) { fireArtifactChange(Collections.singleton(ArtifactListener.Artifact.forFile(file))); @@ -2150,9 +2141,7 @@ protected Artifact filterArtifact(Artifact artifact, RelocationType type) { private boolean containsTLD(File f) { if (f.exists() && f.isFile() && f.canRead()) { - ZipFile zip = null; - try { - zip = new ZipFile(f); + try (ZipFile zip = new ZipFile(f)) { for (Enumeration entries = zip.entries(); entries.hasMoreElements();) { String zipEntryName = ((ZipEntry) entries.nextElement()).getName(); if (TLD_PATTERN.matcher(zipEntryName).matches()) { @@ -2162,14 +2151,6 @@ private boolean containsTLD(File f) { return false; } catch (IOException ex) { LOGGER.log(Level.INFO, null, ex); - } finally { - if (zip != null) { - try { - zip.close(); - } catch (IOException ex) { - LOGGER.log(Level.INFO, null, ex); - } - } } } @@ -2437,15 +2418,9 @@ public WebProjectLookup(WebProject project, Lookup base, Lookup ee6, ProjectBrow private void updateLookup(){ List lookups = new ArrayList<>(); lookups.add(base); + // profile will be null at the beginning Profile profile = Profile.fromPropertiesString(project.evaluator().getProperty(WebProjectProperties.J2EE_PLATFORM)); - if (Profile.JAVA_EE_6_FULL.equals(profile) || Profile.JAVA_EE_6_WEB.equals(profile) - || Profile.JAVA_EE_7_FULL.equals(profile) || Profile.JAVA_EE_7_WEB.equals(profile) - || Profile.JAVA_EE_8_FULL.equals(profile) || Profile.JAVA_EE_8_WEB.equals(profile) - || Profile.JAKARTA_EE_8_FULL.equals(profile) || Profile.JAKARTA_EE_8_WEB.equals(profile) - || Profile.JAKARTA_EE_9_FULL.equals(profile) || Profile.JAKARTA_EE_9_WEB.equals(profile) - || Profile.JAKARTA_EE_9_1_FULL.equals(profile) || Profile.JAKARTA_EE_9_1_WEB.equals(profile) - || Profile.JAKARTA_EE_10_FULL.equals(profile) || Profile.JAKARTA_EE_10_WEB.equals(profile) - || Profile.JAKARTA_EE_11_FULL.equals(profile) || Profile.JAKARTA_EE_11_WEB.equals(profile)) { + if (null != profile && profile.isAtLeast(Profile.JAVA_EE_6_WEB)) { lookups.add(ee6); } if ("true".equals(project.evaluator().getProperty(WebProjectProperties.DISPLAY_BROWSER))) { diff --git a/enterprise/web.project/src/org/netbeans/modules/web/project/api/WebProjectUtilities.java b/enterprise/web.project/src/org/netbeans/modules/web/project/api/WebProjectUtilities.java index 10cb463febf6..9d02472e6c08 100644 --- a/enterprise/web.project/src/org/netbeans/modules/web/project/api/WebProjectUtilities.java +++ b/enterprise/web.project/src/org/netbeans/modules/web/project/api/WebProjectUtilities.java @@ -213,13 +213,11 @@ private static AntProjectHelper createProjectImpl(final WebProjectCreateData cre if(confFolderFO != null) { String manifestText = readResource(WebProjectUtilities.class.getResourceAsStream(RESOURCE_FOLDER + "MANIFEST.MF")); //NOI18N FileObject manifest = FileUtil.createData(confFolderFO, "MANIFEST.MF"); //NOI18N - FileLock lock = manifest.lock(); - BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(manifest.getOutputStream(lock), FileEncodingQuery.getEncoding(manifest))); - try { + Charset charset = FileEncodingQuery.getEncoding(manifest); + try (FileLock lock = manifest.lock(); + OutputStreamWriter osw = new OutputStreamWriter(manifest.getOutputStream(lock), charset); + BufferedWriter bw = new BufferedWriter(osw)) { bw.write(manifestText); - } finally { - bw.close(); - lock.releaseLock(); } } @@ -894,18 +892,15 @@ private static String readResource(InputStream is) throws IOException { // read the config from resource first StringBuilder sb = new StringBuilder(); String lineSep = System.getProperty("line.separator"); // NOI18N - BufferedReader br = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8)); - try { + try (BufferedReader br = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8))) { String line = br.readLine(); while (line != null) { sb.append(line); sb.append(lineSep); line = br.readLine(); } - } finally { - br.close(); } - + return sb.toString(); } diff --git a/enterprise/web.project/src/org/netbeans/modules/web/project/jaxws/WebProjectJAXWSClientSupport.java b/enterprise/web.project/src/org/netbeans/modules/web/project/jaxws/WebProjectJAXWSClientSupport.java index 49636e6ceae7..1cc5ae090858 100644 --- a/enterprise/web.project/src/org/netbeans/modules/web/project/jaxws/WebProjectJAXWSClientSupport.java +++ b/enterprise/web.project/src/org/netbeans/modules/web/project/jaxws/WebProjectJAXWSClientSupport.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; -import org.netbeans.api.j2ee.core.Profile; import org.netbeans.api.java.classpath.ClassPath; import org.netbeans.api.java.project.classpath.ProjectClassPathModifier; import org.netbeans.api.project.SourceGroup; @@ -135,6 +134,9 @@ protected String getProjectJavaEEVersion() { case JAKARTA_EE_11_WEB: case JAKARTA_EE_11_FULL: return JAKARTA_EE_VERSION_11; + case JAKARTA_EE_12_WEB: + case JAKARTA_EE_12_FULL: + return JAKARTA_EE_VERSION_12; case JAVA_EE_5: return JAVA_EE_VERSION_15; default: diff --git a/enterprise/web.project/src/org/netbeans/modules/web/project/jaxws/WebProjectJAXWSSupport.java b/enterprise/web.project/src/org/netbeans/modules/web/project/jaxws/WebProjectJAXWSSupport.java index 42ab71f7bc2f..1862de2092fa 100644 --- a/enterprise/web.project/src/org/netbeans/modules/web/project/jaxws/WebProjectJAXWSSupport.java +++ b/enterprise/web.project/src/org/netbeans/modules/web/project/jaxws/WebProjectJAXWSSupport.java @@ -24,7 +24,6 @@ import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; -import org.netbeans.api.j2ee.core.Profile; import org.netbeans.api.java.classpath.ClassPath; import org.netbeans.api.java.project.classpath.ProjectClassPathModifier; import org.netbeans.api.project.Project; @@ -371,24 +370,13 @@ protected void addJaxwsArtifacts(Project project, String wsName, String serviceI endpoint.setImplementation(serviceImpl); endpoint.setUrlPattern("/" + wsName); endpoints.addEnpoint(endpoint); - FileLock lock = null; - OutputStream os = null; synchronized (this) { - try{ - lock = sunjaxwsFile.lock(); - os = sunjaxwsFile.getOutputStream(lock); + try (FileLock lock = sunjaxwsFile.lock(); + OutputStream os = sunjaxwsFile.getOutputStream(lock)) { endpoints.write(os); - }finally{ - if(lock != null) { - lock.releaseLock(); - } - - if(os != null) { - os.close(); - } } } - }else{ + } else { String mes = NbBundle.getMessage(WebProjectJAXWSSupport.class, "MSG_CannotFindWEB-INF"); // NOI18N NotifyDescriptor desc = new NotifyDescriptor.Message(mes, NotifyDescriptor.Message.ERROR_MESSAGE); DialogDisplayer.getDefault().notify(desc); @@ -441,45 +429,30 @@ public void removeNonJsr109Entries(String serviceName) throws IOException { if(ddFolder != null){ FileObject sunjaxwsFile = ddFolder.getFileObject("sun-jaxws.xml"); if(sunjaxwsFile != null){ - FileLock lock = null; //if there are no more services, delete the file JaxWsModel jaxWsModel = project.getLookup().lookup(JaxWsModel.class); if(jaxWsModel.getServices().length == 0) { synchronized(this) { - try{ - lock = sunjaxwsFile.lock(); + try (FileLock lock = sunjaxwsFile.lock()) { sunjaxwsFile.delete(lock); - } finally{ - if(lock != null){ - lock.releaseLock(); - } } } - } else{ + } else { //remove the entry from the sunjaxwsFile Endpoints endpoints = EndpointsProvider.getDefault().getEndpoints(sunjaxwsFile); Endpoint endpoint = endpoints.findEndpointByName(serviceName); if(endpoint != null){ endpoints.removeEndpoint(endpoint); - OutputStream os = null; synchronized(this) { - try{ - lock = sunjaxwsFile.lock(); - os = sunjaxwsFile.getOutputStream(lock); + try (FileLock lock = sunjaxwsFile.lock(); + OutputStream os = sunjaxwsFile.getOutputStream(lock)) { endpoints.write(os); - }finally{ - if(lock != null){ - lock.releaseLock(); - } - if(os != null){ - os.close(); - } } } } } } - }else{ + } else { String mes = NbBundle.getMessage(WebProjectJAXWSSupport.class, "MSG_CannotFindDDDirectory"); // NOI18N NotifyDescriptor desc = new NotifyDescriptor.Message(mes, NotifyDescriptor.Message.ERROR_MESSAGE); DialogDisplayer.getDefault().notify(desc); @@ -620,6 +593,9 @@ protected String getProjectJavaEEVersion() { case JAKARTA_EE_11_WEB: case JAKARTA_EE_11_FULL: return JAKARTA_EE_VERSION_11; + case JAKARTA_EE_12_WEB: + case JAKARTA_EE_12_FULL: + return JAKARTA_EE_VERSION_12; case JAVA_EE_5: return JAVA_EE_VERSION_15; default: diff --git a/enterprise/web.project/src/org/netbeans/modules/web/project/ui/customizer/WebProjectProperties.java b/enterprise/web.project/src/org/netbeans/modules/web/project/ui/customizer/WebProjectProperties.java index 5dc8775dc836..59c6d14487cb 100644 --- a/enterprise/web.project/src/org/netbeans/modules/web/project/ui/customizer/WebProjectProperties.java +++ b/enterprise/web.project/src/org/netbeans/modules/web/project/ui/customizer/WebProjectProperties.java @@ -377,6 +377,9 @@ private void init() { Profile profile = Profile.fromPropertiesString(evaluator.getProperty(J2EE_PLATFORM)); if (profile != null) { switch (profile) { + case JAKARTA_EE_12_FULL: + minimalSourceLevel = new SpecificationVersion("21"); + break; case JAKARTA_EE_11_FULL: minimalSourceLevel = new SpecificationVersion("17"); break; diff --git a/enterprise/web.project/test/unit/src/org/netbeans/modules/web/project/WebProjectTest.java b/enterprise/web.project/test/unit/src/org/netbeans/modules/web/project/WebProjectTest.java index f4a970b2f82e..424319ab8f6e 100644 --- a/enterprise/web.project/test/unit/src/org/netbeans/modules/web/project/WebProjectTest.java +++ b/enterprise/web.project/test/unit/src/org/netbeans/modules/web/project/WebProjectTest.java @@ -119,6 +119,8 @@ public void testJavaEEProjectSettingsInWebProject() throws Exception { assertEquals(Profile.JAKARTA_EE_10_WEB, obtainedProfileJakartaEE10); Profile obtainedProfileJakartaEE11 = JavaEEProjectSettings.getProfile(webProject); assertEquals(Profile.JAKARTA_EE_11_WEB, obtainedProfileJakartaEE11); + Profile obtainedProfileJakartaEE12 = JavaEEProjectSettings.getProfile(webProject); + assertEquals(Profile.JAKARTA_EE_12_WEB, obtainedProfileJakartaEE12); } /** diff --git a/enterprise/websocket/src/org/netbeans/modules/websocket/editor/WebSocketMethodsTask.java b/enterprise/websocket/src/org/netbeans/modules/websocket/editor/WebSocketMethodsTask.java index d0ae40d67979..8bd9134ee895 100644 --- a/enterprise/websocket/src/org/netbeans/modules/websocket/editor/WebSocketMethodsTask.java +++ b/enterprise/websocket/src/org/netbeans/modules/websocket/editor/WebSocketMethodsTask.java @@ -150,7 +150,7 @@ private boolean hasAnnotation(Element element, String... annotationFqns) { } private Map suggestWebSocketMethod() { - Map result = new HashMap(); + Map result = new HashMap<>(8); result.put("javax.websocket.OnMessage", "onMessage"); // NOI18N result.put("javax.websocket.OnOpen", "onOpen"); // NOI18N result.put("javax.websocket.OnClose", "onClose"); // NOI18N @@ -217,7 +217,7 @@ private List getElementPosition(CompilationInfo info, Tree tree) { } } - List result = new ArrayList(2); + List result = new ArrayList<>(4); result.add(startOffset); result.add(endOffset); return result; @@ -274,7 +274,9 @@ void run() { } private boolean isEndpoint(TypeElement clazz) { - return hasAnnotation(clazz, "javax.websocket.server.ServerEndpoint"); // NOI18N + final String javaxAnnotation = "javax.websocket.server.ServerEndpoint"; // NOI18N + final String jakartaAnnotation = "jakarta.websocket.server.ServerEndpoint"; // NOI18N + return hasAnnotation(clazz, javaxAnnotation, jakartaAnnotation); } Collection getDescriptions() { diff --git a/enterprise/websvc.clientapi/src/org/netbeans/modules/websvc/spi/jaxws/client/ProjectJAXWSClientSupport.java b/enterprise/websvc.clientapi/src/org/netbeans/modules/websvc/spi/jaxws/client/ProjectJAXWSClientSupport.java index 61fc07f5754d..9833990c8729 100644 --- a/enterprise/websvc.clientapi/src/org/netbeans/modules/websvc/spi/jaxws/client/ProjectJAXWSClientSupport.java +++ b/enterprise/websvc.clientapi/src/org/netbeans/modules/websvc/spi/jaxws/client/ProjectJAXWSClientSupport.java @@ -54,7 +54,6 @@ import org.openide.execution.ExecutorTask; import org.openide.filesystems.FileLock; import org.openide.filesystems.FileObject; -import org.openide.filesystems.FileStateInvalidException; import org.openide.filesystems.FileUtil; import org.openide.nodes.Node; import org.openide.util.Mutex; @@ -87,6 +86,7 @@ public abstract class ProjectJAXWSClientSupport implements JAXWSClientSupportImp protected static final String JAKARTA_EE_VERSION_91="jakarta-ee-version-91"; //NOI18N protected static final String JAKARTA_EE_VERSION_10="jakarta-ee-version-10"; //NOI18N protected static final String JAKARTA_EE_VERSION_11="jakarta-ee-version-11"; //NOI18N + protected static final String JAKARTA_EE_VERSION_12="jakarta-ee-version-12"; //NOI18N Project project; private AntProjectHelper helper; diff --git a/enterprise/websvc.jaxwsapi/src/org/netbeans/modules/websvc/jaxws/spi/ProjectJAXWSSupport.java b/enterprise/websvc.jaxwsapi/src/org/netbeans/modules/websvc/jaxws/spi/ProjectJAXWSSupport.java index cc8bbe18aa9c..8aba1c413e72 100644 --- a/enterprise/websvc.jaxwsapi/src/org/netbeans/modules/websvc/jaxws/spi/ProjectJAXWSSupport.java +++ b/enterprise/websvc.jaxwsapi/src/org/netbeans/modules/websvc/jaxws/spi/ProjectJAXWSSupport.java @@ -53,7 +53,6 @@ import org.openide.execution.ExecutorTask; import org.openide.filesystems.FileLock; import org.openide.filesystems.FileObject; -import org.openide.filesystems.FileStateInvalidException; import org.openide.filesystems.FileSystem.AtomicAction; import org.openide.filesystems.FileUtil; import org.openide.util.NbBundle; @@ -83,6 +82,7 @@ public abstract class ProjectJAXWSSupport implements JAXWSSupportImpl { protected static final String JAKARTA_EE_VERSION_91="jakarta-ee-version-91"; //NOI18N protected static final String JAKARTA_EE_VERSION_10="jakarta-ee-version-10"; //NOI18N protected static final String JAKARTA_EE_VERSION_11="jakarta-ee-version-11"; //NOI18N + protected static final String JAKARTA_EE_VERSION_12="jakarta-ee-version-12"; //NOI18N private Project project; private AntProjectHelper antProjectHelper; @@ -332,22 +332,11 @@ private void writeJaxWsModel(final JaxWsModel jaxWsModel) { if (jaxWsFo != null) { jaxWsFo.getFileSystem().runAtomicAction(new AtomicAction() { public void run() { - FileLock lock=null; - OutputStream os=null; - try { - lock = jaxWsFo.lock(); - os = jaxWsFo.getOutputStream(lock); + try (FileLock lock = jaxWsFo.lock(); + OutputStream os = jaxWsFo.getOutputStream(lock)) { jaxWsModel.write(os); - os.close(); } catch (java.io.IOException ex) { ErrorManager.getDefault().notify(ex); - } finally { - if (os!=null) { - try { - os.close(); - } catch (IOException ex) {} - } - if (lock!=null) lock.releaseLock(); } } }); diff --git a/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/editor/AsyncConverter.java b/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/editor/AsyncConverter.java index a1950e4cde4e..19a5c1577c21 100644 --- a/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/editor/AsyncConverter.java +++ b/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/editor/AsyncConverter.java @@ -124,13 +124,16 @@ protected boolean isAsync(Element method){ TypeMirror type = param.asType(); if ( type instanceof DeclaredType ){ Element paramElement = ((DeclaredType)type).asElement(); - if ( paramElement instanceof TypeElement ){ - hasAsyncType = ((TypeElement)paramElement).getQualifiedName(). - contentEquals("javax.ws.rs.container.AsyncResponse"); // NOI18N + if ( paramElement instanceof TypeElement ) { + javax.lang.model.element.Name name = ((TypeElement)paramElement).getQualifiedName(); + hasAsyncType = name.contentEquals("javax.ws.rs.container.AsyncResponse") //NOI18N + || name.contentEquals("jakarta.ws.rs.container.AsyncResponse"); //NOI18N } } + if( hasAsyncType && hasAnnotation(param, - "javax.ws.rs.container.Suspended")){ // NOI18N + "javax.ws.rs.container.Suspended", // NOI18N + "jakarta.ws.rs.container.Suspended") ) { // NOI18N return true; } } @@ -331,8 +334,11 @@ private String convertMethodName(String name){ } private boolean isEjb(Element element){ - return hasAnnotation(element, "javax.ejb.Stateless", - "javax.ejb.Singleton");// NOI18N + return hasAnnotation(element, + "javax.ejb.Stateless", + "javax.ejb.Singleton", + "jakarta.ejb.Stateless", + "jakarta.ejb.Singleton"); // NOI18N } private ClassTree createAsyncMethod( TreeMaker maker, diff --git a/enterprise/websvc.restapi/src/org/netbeans/modules/websvc/rest/spi/RestSupport.java b/enterprise/websvc.restapi/src/org/netbeans/modules/websvc/rest/spi/RestSupport.java index 5da1857e28f1..ca3614c1eb91 100644 --- a/enterprise/websvc.restapi/src/org/netbeans/modules/websvc/rest/spi/RestSupport.java +++ b/enterprise/websvc.restapi/src/org/netbeans/modules/websvc/rest/spi/RestSupport.java @@ -87,6 +87,7 @@ public abstract class RestSupport { public static final String TEST_RESBEANS_CSS2 = "css_master-all.css";//NOI18N public static final String REST_SERVLET_ADAPTOR = "ServletAdaptor";//NOI18N public static final String JAX_RS_APPLICATION_CLASS = "javax.ws.rs.core.Application"; //NOI18N + public static final String JAX_RS_APPLICATION_JAKARTA_CLASS = "jakarta.ws.rs.core.Application"; //NOI18N public static final String REST_SERVLET_ADAPTOR_CLASS = "com.sun.jersey.spi.container.servlet.ServletContainer"; //NOI18N public static final String REST_SERVLET_ADAPTOR_CLASS_OLD = "com.sun.ws.rest.impl.container.servlet.ServletAdaptor"; //NOI18N public static final String REST_SERVLET_ADAPTOR_CLASS_2_0 = "org.glassfish.jersey.servlet.ServletContainer"; //NOI18N @@ -393,7 +394,10 @@ public AntProjectHelper getAntProjectHelper() { * Check to see if there is JTA support. */ public boolean hasJTASupport() { - return MiscPrivateUtilities.hasResource(getProject(), "javax/transaction/UserTransaction.class"); // NOI18N + final String javaxClazz = "javax/transaction/UserTransaction.class"; // NOI18N + final String jakartaClazz = "jakarta/transaction/UserTransaction.class"; // NOI18N + return MiscPrivateUtilities.hasResource(getProject(), javaxClazz) + || MiscPrivateUtilities.hasResource(getProject(), jakartaClazz); } /** @@ -498,6 +502,19 @@ public boolean isEESpecWithJaxRS(){ return (isJee6 && MiscPrivateUtilities.supportsTargetProfile(project, Profile.JAVA_EE_6_FULL)) || (profile != null && profile.isAtLeast(Profile.JAVA_EE_7_WEB)); } + + /** + * Is this a Jakarta EE 12 profile project? + */ + public boolean isJakartaEE12() { + WebModule webModule = WebModule.getWebModule(project.getProjectDirectory()); + if ( webModule == null ){ + return false; + } + Profile profile = webModule.getJ2eeProfile(); + return Profile.JAKARTA_EE_12_WEB.equals(profile) || + Profile.JAKARTA_EE_12_FULL.equals(profile); + } /** * Is this a Jakarta EE 11 profile project? @@ -653,7 +670,8 @@ public boolean hasJaxRsOnClasspath(boolean checkServerClasspath) { if (checkServerClasspath) { JaxRsStackSupport support = getJaxRsStackSupport(); if (support != null){ - return support.isBundled(JAX_RS_APPLICATION_CLASS); + return support.isBundled(JAX_RS_APPLICATION_CLASS) + || support.isBundled(JAX_RS_APPLICATION_JAKARTA_CLASS); } } return false; diff --git a/ide/parsing.indexing/src/org/netbeans/modules/parsing/impl/indexing/IndexerCache.java b/ide/parsing.indexing/src/org/netbeans/modules/parsing/impl/indexing/IndexerCache.java index e8e61687e5c5..d842e15cc1ff 100644 --- a/ide/parsing.indexing/src/org/netbeans/modules/parsing/impl/indexing/IndexerCache.java +++ b/ide/parsing.indexing/src/org/netbeans/modules/parsing/impl/indexing/IndexerCache.java @@ -261,6 +261,7 @@ public boolean equals(Object obj) { "text/x-persistence3.0", //NOI18N "text/x-persistence3.1", //NOI18N "text/x-persistence3.2", //NOI18N + "text/x-persistence4.0", //NOI18N "text/x-orm1.0", //NOI18N "text/x-orm2.0", //NOI18N "text/x-orm2.1", //NOI18N @@ -268,6 +269,7 @@ public boolean equals(Object obj) { "text/x-orm3.0", //NOI18N "text/x-orm3.1", //NOI18N "text/x-orm3.2", //NOI18N + "text/x-orm4.0", //NOI18N "application/xhtml+xml", //NOI18N "text/x-maven-pom+xml", //NOI18N "text/x-maven-profile+xml", //NOI18N @@ -286,18 +288,21 @@ public boolean equals(Object obj) { "text/x-dd-servlet5.0", //NOI18N "text/x-dd-servlet6.0", //NOI18N "text/x-dd-servlet6.1", //NOI18N + "text/x-dd-servlet6.2", //NOI18N "text/x-dd-servlet-fragment3.0", //NOI18N "text/x-dd-servlet-fragment3.1", //NOI18N "text/x-dd-servlet-fragment4.0", //NOI18N "text/x-dd-servlet-fragment5.0", //NOI18N "text/x-dd-servlet-fragment6.0", //NOI18N "text/x-dd-servlet-fragment6.1", //NOI18N + "text/x-dd-servlet-fragment6.2", //NOI18N "text/x-dd-ejbjar2.0", //NOI18N "text/x-dd-ejbjar2.1", //NOI18N "text/x-dd-ejbjar3.0", //NOI18N "text/x-dd-ejbjar3.1", //NOI18N "text/x-dd-ejbjar3.2", //NOI18N "text/x-dd-ejbjar4.0", //NOI18N + "text/x-dd-ejbjar4.1", //NOI18N "text/x-dd-client1.3", //NOI18N "text/x-dd-client1.4", //NOI18N "text/x-dd-client5.0", //NOI18N @@ -307,6 +312,7 @@ public boolean equals(Object obj) { "text/x-dd-client9.0", //NOI18N "text/x-dd-client10.0", //NOI18N "text/x-dd-client11.0", //NOI18N + "text/x-dd-client12.0", //NOI18N "text/x-dd-application1.4", //NOI18N "text/x-dd-application5.0", //NOI18N "text/x-dd-application6.0", //NOI18N @@ -315,6 +321,7 @@ public boolean equals(Object obj) { "text/x-dd-application9.0", //NOI18N "text/x-dd-application10.0", //NOI18N "text/x-dd-application11.0", //NOI18N + "text/x-dd-application12.0", //NOI18N "text/x-dd-sun-web+xml", //NOI18N "text/x-dd-sun-ejb-jar+xml", //NOI18N "text/x-dd-sun-application+xml", //NOI18N diff --git a/java/j2ee.persistence/licenseinfo.xml b/java/j2ee.persistence/licenseinfo.xml index da8619e6fa97..e3ea2ac17420 100644 --- a/java/j2ee.persistence/licenseinfo.xml +++ b/java/j2ee.persistence/licenseinfo.xml @@ -66,8 +66,10 @@ src/org/netbeans/modules/j2ee/persistence/dd/resources/orm_3_0.xsd src/org/netbeans/modules/j2ee/persistence/dd/resources/orm_3_1.xsd src/org/netbeans/modules/j2ee/persistence/dd/resources/orm_3_2.xsd + src/org/netbeans/modules/j2ee/persistence/dd/resources/orm_4_0.xsd src/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_3_0.xsd src/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_3_2.xsd + src/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_4_0.xsd Copyright (c) 2008, 2020 Oracle and/or its affiliates. All rights reserved. @@ -81,6 +83,7 @@ src/org/netbeans/modules/j2ee/persistence/ui/resources/persistence-3.0.xml src/org/netbeans/modules/j2ee/persistence/ui/resources/persistence-3.1.xml src/org/netbeans/modules/j2ee/persistence/ui/resources/persistence-3.2.xml + src/org/netbeans/modules/j2ee/persistence/ui/resources/persistence-4.0.xml src/org/netbeans/modules/j2ee/persistence/wizard/jpacontroller/resources/IllegalOrphanException.java.txt src/org/netbeans/modules/j2ee/persistence/wizard/jpacontroller/resources/NonexistentEntityException.java.txt src/org/netbeans/modules/j2ee/persistence/wizard/jpacontroller/resources/PreexistingEntityException.java.txt diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/PersistenceMetadata.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/PersistenceMetadata.java index 7d9d743268b0..658db08a695e 100644 --- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/PersistenceMetadata.java +++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/PersistenceMetadata.java @@ -41,7 +41,7 @@ public final class PersistenceMetadata { private Map ddMap; private PersistenceMetadata() { - ddMap = new WeakHashMap<>(5); + ddMap = new WeakHashMap<>(8); } /** @@ -79,21 +79,20 @@ public Persistence getRoot(FileObject fo) throws java.io.IOException { } try (InputStream is=fo.getInputStream()) { - if (Persistence.VERSION_3_2.equals(version)) { - persistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.Persistence.createGraph(is); - } else if(Persistence.VERSION_3_1.equals(version)) { - persistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.Persistence.createGraph(is); - } else if(Persistence.VERSION_3_0.equals(version)) { - persistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.Persistence.createGraph(is); - } else if(Persistence.VERSION_2_2.equals(version)) { - persistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.Persistence.createGraph(is); - } else if(Persistence.VERSION_2_1.equals(version)) { - persistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.Persistence.createGraph(is); - } else if(Persistence.VERSION_2_0.equals(version)) { - persistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.Persistence.createGraph(is); - } else {//1.0 - default + // 1.0 - default + if (null == version) { persistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.Persistence.createGraph(is); - } + } else persistence = switch (version) { + case Persistence.VERSION_4_0 -> org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.Persistence.createGraph(is); + case Persistence.VERSION_3_2 -> org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.Persistence.createGraph(is); + case Persistence.VERSION_3_1 -> org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.Persistence.createGraph(is); + case Persistence.VERSION_3_0 -> org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.Persistence.createGraph(is); + case Persistence.VERSION_2_2 -> org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.Persistence.createGraph(is); + case Persistence.VERSION_2_1 -> org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.Persistence.createGraph(is); + case Persistence.VERSION_2_0 -> org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.Persistence.createGraph(is); + default -> org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.Persistence.createGraph(is); + }; + } ddMap.put(fo, persistence); } diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/PersistenceUtils.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/PersistenceUtils.java index 29283e85ec87..a607a15bbb3f 100644 --- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/PersistenceUtils.java +++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/PersistenceUtils.java @@ -119,7 +119,7 @@ public static PersistenceUnit[] getPersistenceUnits(FileObject sourceFile) throw } } - return result.toArray(new PersistenceUnit[0]); + return result.toArray(PersistenceUnit[]::new); } /** @@ -202,7 +202,7 @@ public static PersistenceScope[] getPersistenceScopes(Project project, FileObjec /** * method check target compile classpath for presence of persitence classes of certain version * returns max supported specification - * @param project + * @param target * @return */ public static String getJPAVersion(Project target) @@ -213,7 +213,9 @@ public static String getJPAVersion(Project target) SourceGroup firstGroup=groups[0]; FileObject fo=firstGroup.getRootFolder(); ClassPath compile=ClassPath.getClassPath(fo, ClassPath.COMPILE); - if(compile.findResource("jakarta/persistence/criteria/CriteriaSelect.class")!=null) { + if(compile.findResource("jakarta/persistence/PostDelete.class")!=null) { + version=Persistence.VERSION_4_0; + } else if(compile.findResource("jakarta/persistence/criteria/CriteriaSelect.class")!=null) { version=Persistence.VERSION_3_2; } else if(compile.findResource("jakarta/persistence/spi/TransformerException.class")!=null) { version=Persistence.VERSION_3_1; @@ -233,9 +235,11 @@ public static String getJPAVersion(Project target) public static String getJPAVersion(Library lib) { List roots=lib.getContent("classpath"); - ClassPath cp = ClassPathSupport.createClassPath(roots.toArray(new URL[0])); + ClassPath cp = ClassPathSupport.createClassPath(roots.toArray(URL[]::new)); String version=null; - if(cp.findResource("jakarta/persistence/criteria/CriteriaSelect.class")!=null) { + if(cp.findResource("jakarta/persistence/PostDelete.class")!=null) { + version=Persistence.VERSION_4_0; + } else if(cp.findResource("jakarta/persistence/criteria/CriteriaSelect.class")!=null) { version=Persistence.VERSION_3_2; } else if(cp.findResource("jakarta/persistence/spi/TransformerException.class")!=null) { version=Persistence.VERSION_3_1; diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/common/JPAParseUtils.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/common/JPAParseUtils.java index 3cd978ac0373..d6595f9f6578 100644 --- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/common/JPAParseUtils.java +++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/common/JPAParseUtils.java @@ -95,18 +95,22 @@ public InputSource resolveEntity(String publicId, String systemId) { } String resource=null; // return a proper input source - if (systemId!=null && systemId.endsWith("persistence_3_2.xsd")) { - resource="/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_3_2.xsd"; //NOI18N - } else if (systemId!=null && systemId.endsWith("persistence_3_0.xsd")) { - resource="/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_3_0.xsd"; //NOI18N - } else if (systemId!=null && systemId.endsWith("persistence_2_2.xsd")) { - resource="/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_2_2.xsd"; //NOI18N - } else if (systemId!=null && systemId.endsWith("persistence_2_1.xsd")) { - resource="/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_2_1.xsd"; //NOI18N - } else if (systemId!=null && systemId.endsWith("persistence_2_0.xsd")) { - resource="/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_2_0.xsd"; //NOI18N - } else if (systemId!=null && systemId.endsWith("persistence_1_0.xsd")) { - resource="/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_1_0.xsd"; //NOI18N + if (systemId != null) { + if (systemId.endsWith("persistence_4_0.xsd")) { + resource="/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_4_0.xsd"; //NOI18N + } else if (systemId.endsWith("persistence_3_2.xsd")) { + resource="/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_3_2.xsd"; //NOI18N + } else if (systemId.endsWith("persistence_3_0.xsd")) { + resource="/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_3_0.xsd"; //NOI18N + } else if (systemId.endsWith("persistence_2_2.xsd")) { + resource="/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_2_2.xsd"; //NOI18N + } else if (systemId.endsWith("persistence_2_1.xsd")) { + resource="/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_2_1.xsd"; //NOI18N + } else if (systemId.endsWith("persistence_2_0.xsd")) { + resource="/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_2_0.xsd"; //NOI18N + } else if (systemId.endsWith("persistence_1_0.xsd")) { + resource="/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_1_0.xsd"; //NOI18N + } } // additional logging for #127276 if (LOGGER.isLoggable(Level.FINE)) { diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/common/Persistence.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/common/Persistence.java index ef2c481ca19c..a1df4636be69 100644 --- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/common/Persistence.java +++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/common/Persistence.java @@ -27,8 +27,12 @@ */ public interface Persistence { static public final String VERSION = "Version"; // NOI18N - static public final String PERSISTENCE_UNIT = "PersistenceUnit"; // NOI18N + static public final String PERSISTENCE_UNIT = "PersistenceUnit"; // NOI18N + /** + * Jakarta EE 12 - JPA 4.0 (Schema v4.0) + */ + public static final String VERSION_4_0="4.0"; //NOI18N /** * Jakarta EE 11 - JPA 3.2 (Schema v3.2) */ diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/orm/model_4_0/package-info.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/orm/model_4_0/package-info.java new file mode 100644 index 000000000000..656f4dc4fe40 --- /dev/null +++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/orm/model_4_0/package-info.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +@Schema2Beans( + schema="../../resources/orm_4_0.xsd", + docRoot="entity-mappings", + mddFile="../../resources/orm_4_0.mdd", + schemaType=SchemaType.XML_SCHEMA, + outputType=OutputType.TRADITIONAL_BASEBEAN, + useInterfaces=true, + validate=true, + attrProp=true, + removeUnreferencedNodes=true, + java5=true +) +@org.netbeans.api.annotations.common.SuppressWarnings(value="NM_SAME_SIMPLE_NAME_AS_INTERFACE", justification="Generated implementation classes") +package org.netbeans.modules.j2ee.persistence.dd.orm.model_4_0; + +import org.netbeans.modules.schema2beans.Schema2Beans; +import org.netbeans.modules.schema2beans.Schema2Beans.OutputType; +import org.netbeans.modules.schema2beans.Schema2Beans.SchemaType; diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/persistence/model_4_0/package-info.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/persistence/model_4_0/package-info.java new file mode 100644 index 000000000000..897c170e5cc8 --- /dev/null +++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/persistence/model_4_0/package-info.java @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +@Schema2Beans( + schema="../../resources/persistence_4_0.xsd", + mddFile="../../resources/persistence_4_0.mdd", + schemaType=SchemaType.XML_SCHEMA, + outputType=OutputType.TRADITIONAL_BASEBEAN, + useInterfaces=true, + validate=true, + attrProp=true, + removeUnreferencedNodes=true, + java5=true +) +@org.netbeans.api.annotations.common.SuppressWarnings(value="NM_SAME_SIMPLE_NAME_AS_INTERFACE", justification="Generated implementation classes") +package org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0; + +import org.netbeans.modules.schema2beans.Schema2Beans; +import org.netbeans.modules.schema2beans.Schema2Beans.OutputType; +import org.netbeans.modules.schema2beans.Schema2Beans.SchemaType; diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/resources/orm_4_0.mdd b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/resources/orm_4_0.mdd new file mode 100644 index 000000000000..efbdd8208c00 --- /dev/null +++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/resources/orm_4_0.mdd @@ -0,0 +1,377 @@ + + + + + entity-mappings + https://jakarta.ee/xml/ns/persistence/orm + EntityMappings + org.netbeans.modules.j2ee.persistence.api.metadata.orm.EntityMappings + + + string + http://www.w3.org/2001/XMLSchema + String + java.lang.String + + + persistence-unit-metadata + https://jakarta.ee/xml/ns/persistence/orm + PersistenceUnitMetadata + org.netbeans.modules.j2ee.persistence.api.metadata.orm.PersistenceUnitMetadata + + + access-type + https://jakarta.ee/xml/ns/persistence/orm + AccessType + java.lang.String + + + sequence-generator + https://jakarta.ee/xml/ns/persistence/orm + SequenceGenerator + org.netbeans.modules.j2ee.persistence.api.metadata.orm.SequenceGenerator + + + table-generator + https://jakarta.ee/xml/ns/persistence/orm + TableGenerator + org.netbeans.modules.j2ee.persistence.api.metadata.orm.TableGenerator + + + named-query + https://jakarta.ee/xml/ns/persistence/orm + NamedQuery + org.netbeans.modules.j2ee.persistence.api.metadata.orm.NamedQuery + + + named-native-query + https://jakarta.ee/xml/ns/persistence/orm + NamedNativeQuery + org.netbeans.modules.j2ee.persistence.api.metadata.orm.NamedNativeQuery + + + sql-result-set-mapping + https://jakarta.ee/xml/ns/persistence/orm + SqlResultSetMapping + org.netbeans.modules.j2ee.persistence.api.metadata.orm.SqlResultSetMapping + + + mapped-superclass + https://jakarta.ee/xml/ns/persistence/orm + MappedSuperclass + org.netbeans.modules.j2ee.persistence.api.metadata.orm.MappedSuperclass + + + entity + https://jakarta.ee/xml/ns/persistence/orm + Entity + org.netbeans.modules.j2ee.persistence.api.metadata.orm.Entity + + + embeddable + https://jakarta.ee/xml/ns/persistence/orm + Embeddable + org.netbeans.modules.j2ee.persistence.api.metadata.orm.Embeddable + + + embeddable-attributes + https://jakarta.ee/xml/ns/persistence/orm + EmbeddableAttributes + org.netbeans.modules.j2ee.persistence.api.metadata.orm.EmbeddableAttributes + + + basic + https://jakarta.ee/xml/ns/persistence/orm + Basic + org.netbeans.modules.j2ee.persistence.api.metadata.orm.Basic + + + transient + https://jakarta.ee/xml/ns/persistence/orm + Transient + org.netbeans.modules.j2ee.persistence.api.metadata.orm.Transient + + + column + https://jakarta.ee/xml/ns/persistence/orm + Column + org.netbeans.modules.j2ee.persistence.api.metadata.orm.Column + + + lob + https://jakarta.ee/xml/ns/persistence/orm + Lob + org.netbeans.modules.j2ee.persistence.api.metadata.orm.Lob + + + temporal + https://jakarta.ee/xml/ns/persistence/orm + Temporal + java.lang.String + + + enumerated + https://jakarta.ee/xml/ns/persistence/orm + Enumerated + java.lang.String + + + table + https://jakarta.ee/xml/ns/persistence/orm + Table + org.netbeans.modules.j2ee.persistence.api.metadata.orm.Table + + + secondary-table + https://jakarta.ee/xml/ns/persistence/orm + SecondaryTable + org.netbeans.modules.j2ee.persistence.api.metadata.orm.SecondaryTable + + + primary-key-join-column + https://jakarta.ee/xml/ns/persistence/orm + PrimaryKeyJoinColumn + org.netbeans.modules.j2ee.persistence.api.metadata.orm.PrimaryKeyJoinColumn + + + id-class + https://jakarta.ee/xml/ns/persistence/orm + IdClass + org.netbeans.modules.j2ee.persistence.api.metadata.orm.IdClass + + + inheritance + https://jakarta.ee/xml/ns/persistence/orm + Inheritance + org.netbeans.modules.j2ee.persistence.api.metadata.orm.Inheritance + + + discriminator-value + https://jakarta.ee/xml/ns/persistence/orm + DiscriminatorValue + java.lang.String + + + discriminator-column + https://jakarta.ee/xml/ns/persistence/orm + DiscriminatorColumn + org.netbeans.modules.j2ee.persistence.api.metadata.orm.DiscriminatorColumn + + + emptyType + https://jakarta.ee/xml/ns/persistence/orm + EmptyType + org.netbeans.modules.j2ee.persistence.api.metadata.orm.EmptyType + + + entity-listeners + https://jakarta.ee/xml/ns/persistence/orm + EntityListeners + org.netbeans.modules.j2ee.persistence.api.metadata.orm.EntityListeners + + + pre-persist + https://jakarta.ee/xml/ns/persistence/orm + PrePersist + org.netbeans.modules.j2ee.persistence.api.metadata.orm.PrePersist + + + post-persist + https://jakarta.ee/xml/ns/persistence/orm + PostPersist + org.netbeans.modules.j2ee.persistence.api.metadata.orm.PostPersist + + + pre-remove + https://jakarta.ee/xml/ns/persistence/orm + PreRemove + org.netbeans.modules.j2ee.persistence.api.metadata.orm.PreRemove + + + post-remove + https://jakarta.ee/xml/ns/persistence/orm + PostRemove + org.netbeans.modules.j2ee.persistence.api.metadata.orm.PostRemove + + + pre-update + https://jakarta.ee/xml/ns/persistence/orm + PreUpdate + org.netbeans.modules.j2ee.persistence.api.metadata.orm.PreUpdate + + + post-update + https://jakarta.ee/xml/ns/persistence/orm + PostUpdate + org.netbeans.modules.j2ee.persistence.api.metadata.orm.PostUpdate + + + post-load + https://jakarta.ee/xml/ns/persistence/orm + PostLoad + org.netbeans.modules.j2ee.persistence.api.metadata.orm.PostLoad + + + attribute-override + https://jakarta.ee/xml/ns/persistence/orm + AttributeOverride + org.netbeans.modules.j2ee.persistence.api.metadata.orm.AttributeOverride + + + association-override + https://jakarta.ee/xml/ns/persistence/orm + AssociationOverride + org.netbeans.modules.j2ee.persistence.api.metadata.orm.AssociationOverride + + + attributes + https://jakarta.ee/xml/ns/persistence/orm + Attributes + org.netbeans.modules.j2ee.persistence.api.metadata.orm.Attributes + + + version + https://jakarta.ee/xml/ns/persistence/orm + Version + org.netbeans.modules.j2ee.persistence.api.metadata.orm.Version + + + many-to-one + https://jakarta.ee/xml/ns/persistence/orm + ManyToOne + org.netbeans.modules.j2ee.persistence.api.metadata.orm.ManyToOne + + + one-to-many + https://jakarta.ee/xml/ns/persistence/orm + OneToMany + org.netbeans.modules.j2ee.persistence.api.metadata.orm.OneToMany + + + one-to-one + https://jakarta.ee/xml/ns/persistence/orm + OneToOne + org.netbeans.modules.j2ee.persistence.api.metadata.orm.OneToOne + + + many-to-many + https://jakarta.ee/xml/ns/persistence/orm + ManyToMany + org.netbeans.modules.j2ee.persistence.api.metadata.orm.ManyToMany + + + embedded + https://jakarta.ee/xml/ns/persistence/orm + Embedded + org.netbeans.modules.j2ee.persistence.api.metadata.orm.Embedded + + + order-by + https://jakarta.ee/xml/ns/persistence/orm + OrderBy + java.lang.String + + + map-key + https://jakarta.ee/xml/ns/persistence/orm + MapKey + org.netbeans.modules.j2ee.persistence.api.metadata.orm.MapKey + + + join-table + https://jakarta.ee/xml/ns/persistence/orm + JoinTable + org.netbeans.modules.j2ee.persistence.api.metadata.orm.JoinTable + + + cascade-type + https://jakarta.ee/xml/ns/persistence/orm + CascadeType + org.netbeans.modules.j2ee.persistence.api.metadata.orm.CascadeType + + + join-column + https://jakarta.ee/xml/ns/persistence/orm + JoinColumn + org.netbeans.modules.j2ee.persistence.api.metadata.orm.JoinColumn + + + unique-constraint + https://jakarta.ee/xml/ns/persistence/orm + UniqueConstraint + org.netbeans.modules.j2ee.persistence.api.metadata.orm.UniqueConstraint + + + id + https://jakarta.ee/xml/ns/persistence/orm + Id + org.netbeans.modules.j2ee.persistence.api.metadata.orm.Id + + + embedded-id + https://jakarta.ee/xml/ns/persistence/orm + EmbeddedId + org.netbeans.modules.j2ee.persistence.api.metadata.orm.EmbeddedId + + + generated-value + https://jakarta.ee/xml/ns/persistence/orm + GeneratedValue + org.netbeans.modules.j2ee.persistence.api.metadata.orm.GeneratedValue + + + entity-listener + https://jakarta.ee/xml/ns/persistence/orm + EntityListener + org.netbeans.modules.j2ee.persistence.api.metadata.orm.EntityListener + + + entity-result + https://jakarta.ee/xml/ns/persistence/orm + EntityResult + org.netbeans.modules.j2ee.persistence.api.metadata.orm.EntityResult + + + column-result + https://jakarta.ee/xml/ns/persistence/orm + ColumnResult + org.netbeans.modules.j2ee.persistence.api.metadata.orm.ColumnResult + + + field-result + https://jakarta.ee/xml/ns/persistence/orm + FieldResult + org.netbeans.modules.j2ee.persistence.api.metadata.orm.FieldResult + + + query-hint + https://jakarta.ee/xml/ns/persistence/orm + QueryHint + org.netbeans.modules.j2ee.persistence.api.metadata.orm.QueryHint + + + persistence-unit-defaults + https://jakarta.ee/xml/ns/persistence/orm + PersistenceUnitDefaults + org.netbeans.modules.j2ee.persistence.api.metadata.orm.PersistenceUnitDefaults + + \ No newline at end of file diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/resources/orm_4_0.xsd b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/resources/orm_4_0.xsd new file mode 100644 index 000000000000..d509334dd44b --- /dev/null +++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/resources/orm_4_0.xsd @@ -0,0 +1,2447 @@ + + + + + + + + ... + + + + ]]> + + + + + + + + + + + + + + + + + + The entity-mappings element is the root element of a mapping + file. It contains the following four types of elements: + + 1. The persistence-unit-metadata element contains metadata + for the entire persistence unit. It is undefined if this element + occurs in multiple mapping files within the same persistence unit. + + 2. The package, schema, catalog and access elements apply to all of + the entity, mapped-superclass and embeddable elements defined in + the same file in which they occur. + + 3. The sequence-generator, table-generator, converter, named-query, + named-native-query, named-stored-procedure-query, and + sql-result-set-mapping elements are global to the persistence + unit. It is undefined to have more than one sequence-generator + or table-generator of the same name in the same or different + mapping files in a persistence unit. It is undefined to have + more than one named-query, named-native-query, sql-result-set-mapping, + or named-stored-procedure-query of the same name in the same + or different mapping files in a persistence unit. It is also + undefined to have more than one converter for the same target + type in the same or different mapping files in a persistence unit. + + 4. The entity, mapped-superclass and embeddable elements each define + the mapping information for a managed persistent class. The mapping + information contained in these elements may be complete or it may + be partial. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Metadata that applies to the persistence unit and not just to + the mapping file in which it is contained. + + If the xml-mapping-metadata-complete element is specified, + the complete set of mapping metadata for the persistence unit + is contained in the XML mapping files for the persistence unit. + + + + + + + + + + + + + + + + + These defaults are applied to the persistence unit as a whole + unless they are overridden by local annotation or XML + element settings. + + schema - Used as the schema for all tables, secondary tables, join + tables, collection tables, sequence generators, and table + generators that apply to the persistence unit + catalog - Used as the catalog for all tables, secondary tables, join + tables, collection tables, sequence generators, and table + generators that apply to the persistence unit + delimited-identifiers - Used to treat database identifiers as + delimited identifiers. + access - Used as the access type for all managed classes in + the persistence unit + cascade-persist - Adds cascade-persist to the set of cascade options + in all entity relationships of the persistence unit + entity-listeners - List of default entity listeners to be invoked + on each entity in the persistence unit. + + + + + + + + + + + + + + + + + + + + Defines the settings and mappings for an entity. Is allowed to be + sparsely populated and used in conjunction with the annotations. + Alternatively, the metadata-complete attribute can be used to + indicate that no annotations on the entity class (and its fields + or properties) are to be processed. If this is the case then + the defaulting rules for the entity and its subelements will + be recursively applied. + + @Target(TYPE) @Retention(RUNTIME) + public @interface Entity { + String name() default ""; + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element determines how the persistence provider accesses the + state of an entity or embedded object. + + + + + + + + + + + + + + + + @Repeatable(AssociationOverrides.class) + @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME) + public @interface AssociationOverride { + String name(); + JoinColumn[] joinColumns() default{}; + ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT); + JoinTable joinTable() default @JoinTable; + } + + + + + + + + + + + + + + + + + + + + + + + @Repeatable(AttributeOverrides.class) + @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME) + public @interface AttributeOverride { + String name(); + Column column(); + } + + + + + + + + + + + + + + + + + This element contains the entity field or property mappings. + It may be sparsely populated to include only a subset of the + fields or properties. If metadata-complete for the entity is true + then the remainder of the attributes will be defaulted according + to the default rules. + + + + + + + + + + + + + + + + + + + + + + + + + + + + @Target({METHOD, FIELD}) @Retention(RUNTIME) + public @interface Basic { + FetchType fetch() default FetchType.EAGER; + boolean optional() default true; + } + + + + + + + + + + + + + + + + + + + + + + + + + public enum CascadeType { ALL, PERSIST, MERGE, REMOVE, REFRESH, DETACH } + + + + + + + + + + + + + + + + + + + + @Target({}) @Retention(RUNTIME) + public @interface CheckConstraint { + String name() default ""; + String constraint(); + String options() default ""; + } + + + + + + + + + + + + + + + @Target({METHOD, FIELD}) @Retention(RUNTIME) + public @interface CollectionTable { + String name() default ""; + String catalog() default ""; + String schema() default ""; + JoinColumn[] joinColumns() default {}; + ForeignKey foreignKey() default @ForeignKey(ConstraintMode.PROVIDER_DEFAULT); + UniqueConstraint[] uniqueConstraints() default {}; + Index[] indexes() default {}; + String options() default ""; + } + + + + + + + + + + + + + + + + + + + + + + + + + @Target({METHOD, FIELD}) @Retention(RUNTIME) + public @interface Column { + String name() default ""; + boolean unique() default false; + boolean nullable() default true; + boolean insertable() default true; + boolean updatable() default true; + String columnDefinition() default ""; + String options() default ""; + String table() default ""; + int length() default 255; + int precision() default 0; // decimal precision + int scale() default 0; // decimal scale + CheckConstraint[] check() default {}; + String comment() default ""; + } + + + + + + + + + + + + + + + + + + + + + + + + + type() default void.class; + } + + ]]> + + + + + + + + + + + + public enum ConstraintMode { CONSTRAINT, NO_CONSTRAINT, PROVIDER_DEFAULT } + + + + + + + + + + + + + + + + targetClass(); + ColumnResult[] columns(); + } + + ]]> + + + + + + + + + + + + converter() default AttributeConverter.class; + String attributeName() default ""; + boolean disableConversion() default false; + } + + ]]> + + + + + + + + + + + + + + + + @Target({TYPE}) @Retention(RUNTIME) + public @interface Converter { + boolean autoApply() default false; + } + + + + + + + + + + + + + + + + + @Target({TYPE}) @Retention(RUNTIME) + public @interface DiscriminatorColumn { + String name() default "DTYPE"; + DiscriminatorType discriminatorType() default STRING; + String columnDefinition() default ""; + String options() default ""; + int length() default 31; + } + + + + + + + + + + + + + + + + + public enum DiscriminatorType { STRING, CHAR, INTEGER } + + + + + + + + + + + + + + + + + @Target({TYPE}) @Retention(RUNTIME) + public @interface DiscriminatorValue { + String value(); + } + + + + + + + + + + + targetClass() default void.class; + FetchType fetch() default FetchType.LAZY; + } + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Defines the settings and mappings for embeddable objects. Is + allowed to be sparsely populated and used in conjunction with + the annotations. Alternatively, the metadata-complete attribute + can be used to indicate that no annotations are to be processed + in the class. If this is the case then the defaulting rules will + be recursively applied. + + @Target({TYPE}) @Retention(RUNTIME) + public @interface Embeddable {} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @Target({METHOD, FIELD}) @Retention(RUNTIME) + public @interface Embedded {} + + + + + + + + + + + + + + + + + + + @Target({METHOD, FIELD}) @Retention(RUNTIME) + public @interface EmbeddedId {} + + + + + + + + + + + + + + + + + Defines an entity listener to be invoked at lifecycle events + for the entities that list this listener. + + + + + + + + + + + + + + + + + + + + + [] value(); + } + + ]]> + + + + + + + + + + + entityClass(); + LockModeType lockMode() default LockModeType.OPTIMISTIC; + FieldResult[] fields() default {}; + String discriminatorColumn() default ""; + } + + ]]> + + + + + + + + + + + + + + + + public enum EnumType { ORDINAL, STRING } + + + + + + + + + + + + + + + + @Target({METHOD, FIELD}) @Retention(RUNTIME) + public @interface Enumerated { + EnumType value() default ORDINAL; + } + + + + + + + + + + + + + public enum FetchType { LAZY, EAGER } + + + + + + + + + + + + + + + + @Target({}) @Retention(RUNTIME) + public @interface FieldResult { + String name(); + String column(); + } + + + + + + + + + + + + + + @Target({}) @Retention(RUNTIME) + public @interface ForeignKey { + String name() default ""; + ConstraintMode value() default CONSTRAINT; + String foreign-key-definition() default ""; + String options() default ""; + } + + Note that the elements that embed the use of the annotation + default this use as @ForeignKey(PROVIDER_DEFAULT). + + + + + + + + + + + + + + + + + + + @Target({METHOD, FIELD}) @Retention(RUNTIME) + public @interface GeneratedValue { + GenerationType strategy() default AUTO; + String generator() default ""; + } + + + + + + + + + + + + + + public enum GenerationType { TABLE, SEQUENCE, IDENTITY, UUID, AUTO } + + + + + + + + + + + + + + + + + + + @Target({METHOD, FIELD}) @Retention(RUNTIME) + public @interface Id {} + + + + + + + + + + + + + + + + + + + value(); + } + + ]]> + + + + + + + + + + + @Target({}) @Retention(RUNTIME) + public @interface Index { + String name() default ""; + String columnList(); + boolean unique() default false; + String options() default ""; + } + + + + + + + + + + + + + + + + + + + @Target({TYPE}) @Retention(RUNTIME) + public @interface Inheritance { + InheritanceType strategy() default InheritanceType.SINGLE_TABLE; + } + + + + + + + + + + + + + public enum InheritanceType { SINGLE_TABLE, TABLE_PER_CLASS, JOINED } + + + + + + + + + + + + + + + + + @Repeatable(JoinColumns.class) + @Target({METHOD, FIELD}) @Retention(RUNTIME) + public @interface JoinColumn { + String name() default ""; + String referencedColumnName() default ""; + boolean unique() default false; + boolean nullable() default true; + boolean insertable() default true; + boolean updatable() default true; + String columnDefinition() default ""; + String options() default ""; + String table() default ""; + ForeignKey foreignKey() default @ForeignKey(); + CheckConstraint[] check() default {}; + String comment() default ""; + } + + + + + + + + + + + + + + + + + + + + + + + + + + @Target({METHOD, FIELD}) @Retention(RUNTIME) + public @interface JoinTable { + String name() default ""; + String catalog() default ""; + String schema() default ""; + JoinColumn[] joinColumns() default {}; + JoinColumn[] inverseJoinColumns() default {}; + ForeignKey foreignKey() default @ForeignKey(ConstraintMode.PROVIDER_DEFAULT); + ForeignKey inverseForeignKey() default @ForeignKey(ConstraintMode.PROVIDER_DEFAULT); + UniqueConstraint[] uniqueConstraints() default {}; + Index[] indexes() default {}; + CheckConstraint[] check() default {}; + String comment() default ""; + String options() default ""; + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @Target({METHOD, FIELD}) @Retention(RUNTIME) + public @interface Lob {} + + + + + + + + + + + + public enum LockModeType implements FindOption, RefreshOption { READ, WRITE, OPTIMISTIC, OPTIMISTIC_FORCE_INCREMENT, PESSIMISTIC_READ, PESSIMISTIC_WRITE, PESSIMISTIC_FORCE_INCREMENT, NONE} + + + + + + + + + + + + + + + + + + + + + targetEntity() default void.class; + CascadeType[] cascade() default {}; + FetchType fetch() default FetchType.LAZY; + String mappedBy() default ""; + } + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + targetEntity() default void.class; + CascadeType[] cascade() default {}; + FetchType fetch() default FetchType.EAGER; + boolean optional() default true; + } + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + @Target({METHOD, FIELD}) @Retention(RUNTIME) + public @interface MapKey { + String name() default ""; + } + + + + + + + + + + + value(); + } + + ]]> + + + + + + + + + + + @Target({METHOD, FIELD}) @Retention(RUNTIME) + public @interface MapKeyColumn { + String name() default ""; + boolean unique() default false; + boolean nullable() default false; + boolean insertable() default true; + boolean updatable() default true; + String columnDefinition() default ""; + String options() default ""; + String table() default ""; + int length() default 255; + int precision() default 0; // decimal precision + int scale() default 0; // decimal scale + } + + + + + + + + + + + + + + + + + + + + + + + @Repeatable(MapKeyJoinColumns.class) + @Target({METHOD, FIELD}) @Retention(RUNTIME) + public @interface MapKeyJoinColumn { + String name() default ""; + String referencedColumnName() default ""; + boolean unique() default false; + boolean nullable() default false; + boolean insertable() default true; + boolean updatable() default true; + String columnDefinition() default ""; + String options() default ""; + String table() default ""; + ForeignKey foreignKey() default @ForeignKey(ConstraintMode.PROVIDER_DEFAULT); + } + + + + + + + + + + + + + + + + + + + + + + + + + Defines the settings and mappings for a mapped superclass. Is + allowed to be sparsely populated and used in conjunction with + the annotations. Alternatively, the metadata-complete attribute + can be used to indicate that no annotations are to be processed + If this is the case then the defaulting rules will be recursively + applied. + + @Target(TYPE) @Retention(RUNTIME) + public @interface MappedSuperclass {} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @Target({}) @Retention(RUNTIME) + public @interface NamedAttributeNode { + String value(); + String subgraph() default ""; + String keySubgraph() default ""; + } + + + + + + + + + + + + + + + @Repeatable(NamedEntityGraphs.class) + @Target({TYPE}) @Retention(RUNTIME) + public @interface NamedEntityGraph { + String name() default ""; + NamedAttributeNode[] attributeNodes() default {}; + boolean includeAllAttributes() default false; + NamedSubgraph[] subgraphs() default {}; + NamedSubGraph[] subclassSubgraphs() default {}; + } + + + + + + + + + + + + + + + + + + resultClass() default void.class; + String resultSetMapping() default ""; //named SqlResultSetMapping + EntityResult[] entities() default {}; + ConstructorResult[] classes() default {}; + ColumnResult[] columns() default {}; + } + + ]]> + + + + + + + + + + + + + + + + + + + + + @Repeatable(NamedQueries.class) + @Target({TYPE}) @Retention(RUNTIME) + public @interface NamedQuery { + String name(); + String query(); + LockModeType lockMode() default LockModeType.NONE; + QueryHint[] hints() default {}; + } + + + + + + + + + + + + + + + + + + + @Repeatable(NamedStoredProcedureQueries.class) + @Target({TYPE}) @Retention(RUNTIME) + public @interface NamedStoredProcedureQuery { + String name(); + String procedureName(); + StoredProcedureParameter[] parameters() default {}; + Class[] resultClasses() default {}; + String[] resultSetMappings() default{}; + QueryHint[] hints() default {}; + } + + + + + + + + + + + + + + + + + + + type() default void.class; + NamedAttributeNode[] attributeNodes(); + } + + ]]> + + + + + + + + + + + + + targetEntity() default void.class; + CascadeType[] cascade() default {}; + FetchType fetch() default FetchType.LAZY; + String mappedBy() default ""; + boolean orphanRemoval() default false; + } + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + targetEntity() default void.class; + CascadeType[] cascade() default {}; + FetchType fetch() default FetchType.EAGER; + boolean optional() default true; + String mappedBy() default ""; + boolean orphanRemoval() default false; + } + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @Target({METHOD, FIELD}) @Retention(RUNTIME) + public @interface OrderBy { + String value() default ""; + } + + + + + + + + + + + + + @Target({METHOD, FIELD}) @Retention(RUNTIME) + public @interface OrderColumn { + String name() default ""; + boolean nullable() default true; + boolean insertable() default true; + boolean updatable() default true; + String columnDefinition() default ""; + String options() default ""; + } + + + + + + + + + + + + + + + + + + public enum ParameterMode { IN, INOUT, OUT, REF_CURSOR } + + + + + + + + + + + + + + + + + + @Target({METHOD}) @Retention(RUNTIME) + public @interface PostLoad {} + + + + + + + + + + + + + + + + @Target({METHOD}) @Retention(RUNTIME) + public @interface PostPersist {} + + + + + + + + + + + + + + + + @Target({METHOD}) @Retention(RUNTIME) + public @interface PostRemove {} + + + + + + + + + + + + + + + + @Target({METHOD}) @Retention(RUNTIME) + public @interface PostUpdate {} + + + + + + + + + + + + + + + + @Target({METHOD}) @Retention(RUNTIME) + public @interface PrePersist {} + + + + + + + + + + + + + + + + @Target({METHOD}) @Retention(RUNTIME) + public @interface PreRemove {} + + + + + + + + + + + + + + + + @Target({METHOD}) @Retention(RUNTIME) + public @interface PreUpdate {} + + + + + + + + + + + + + + + + @Repeatable(PrimaryKeyJoinColumns.class) + @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME) + public @interface PrimaryKeyJoinColumn { + String name() default ""; + String referencedColumnName() default ""; + String columnDefinition() default ""; + String options() default ""; + ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT); + } + + + + + + + + + + + + + + + + + + + @Target({}) @Retention(RUNTIME) + public @interface QueryHint { + String name(); + String value(); + } + + + + + + + + + + + + + + + + + @Repeatable(SecondaryTables.class) + @Target({TYPE}) @Retention(RUNTIME) + public @interface SecondaryTable { + String name(); + String catalog() default ""; + String schema() default ""; + PrimaryKeyJoinColumn[] pkJoinColumns() default {}; + ForeignKey foreignKey() default @ForeignKey(ConstraintMode.PROVIDER_DEFAULT); + UniqueConstraint[] uniqueConstraints() default {}; + Index[] indexes() default {}; + CheckConstraint[] check() default {}; + String comment() default ""; + String options() default ""; + } + + + + + + + + + + + + + + + + + + + + + + + + + + + @Repeatable(SequenceGenerators.class) + @Target({TYPE, METHOD, FIELD, PACKAGE}) @Retention(RUNTIME) + public @interface SequenceGenerator { + String name() default ""; + String sequenceName() default ""; + String catalog() default ""; + String schema() default ""; + int initialValue() default 1; + int allocationSize() default 50; + String options() default ""; + } + + + + + + + + + + + + + + + + + + + + + + @Repeatable(SqlResultSetMappings.class) + @Target({TYPE}) @Retention(RUNTIME) + public @interface SqlResultSetMapping { + String name(); + EntityResult[] entities() default {}; + ConstructorResult[] classes() default{}; + ColumnResult[] columns() default {}; + } + + + + + + + + + + + + + + + + + type(); + } + + ]]> + + + + + + + + + + + + + + + + @Target({TYPE}) @Retention(RUNTIME) + public @interface Table { + String name() default ""; + String catalog() default ""; + String schema() default ""; + UniqueConstraint[] uniqueConstraints() default {}; + Index[] indexes() default {}; + CheckConstraint[] check() default {}; + String comment() default ""; + String options() default ""; + } + + + + + + + + + + + + + + + + + + + + + + @Repeatable(TableGenerators.class) + @Target({TYPE, METHOD, FIELD, PACKAGE}) @Retention(RUNTIME) + public @interface TableGenerator { + String name() default ""; + String table() default ""; + String catalog() default ""; + String schema() default ""; + String pkColumnName() default ""; + String valueColumnName() default ""; + String pkColumnValue() default ""; + int initialValue() default 0; + int allocationSize() default 50; + UniqueConstraint[] uniqueConstraints() default {}; + Indexes[] indexes() default {}; + String options() default ""; + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + @Target({METHOD, FIELD}) @Retention(RUNTIME) + public @interface Temporal { + TemporalType value(); + } + + + + + + + + + + + + + @Deprecated(since = "3.2") + public enum TemporalType { + DATE, // java.sql.Date + TIME, // java.sql.Time + TIMESTAMP // java.sql.Timestamp + } + + + + + + + + + + + + + + + + + @Target({METHOD, FIELD}) @Retention(RUNTIME) + public @interface Transient {} + + + + + + + + + + + + + @Target({}) @Retention(RUNTIME) + public @interface UniqueConstraint { + String name() default ""; + String[] columnNames(); + String options() default ""; + } + + + + + + + + + + + + + + + + + @Target({METHOD, FIELD}) @Retention(RUNTIME) + public @interface Version {} + + + + + + + + + + + + diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_4_0.mdd b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_4_0.mdd new file mode 100644 index 000000000000..09375b8799c0 --- /dev/null +++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_4_0.mdd @@ -0,0 +1,100 @@ + + + + + persistence + https://jakarta.ee/xml/ns/persistence + Persistence + + PersistenceUnit + + + org.netbeans.modules.j2ee.persistence.dd.common.Persistence + + + + persistence-unit + https://jakarta.ee/xml/ns/persistence + PersistenceUnit + + Description + + + Provider + + + JtaDataSource + + + NonJtaDataSource + + + MappingFile + + + JarFile + + + Class2 + + + ExcludeUnlistedClasses + + + Properties + + + org.netbeans.modules.j2ee.persistence.dd.common.PersistenceUnit + + + + string + http://www.w3.org/2001/XMLSchema + String + java.lang.String + + + boolean + http://www.w3.org/2001/XMLSchema + Boolean + boolean + + + properties + https://jakarta.ee/xml/ns/persistence + Properties + + Property2 + + + org.netbeans.modules.j2ee.persistence.dd.common.Properties + + + + property + https://jakarta.ee/xml/ns/persistence + Property + + org.netbeans.modules.j2ee.persistence.dd.common.Property + + + diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_4_0.xsd b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_4_0.xsd new file mode 100644 index 000000000000..d20ce2f618b1 --- /dev/null +++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/resources/persistence_4_0.xsd @@ -0,0 +1,361 @@ + + + + + + + + ... + + + ]]> + + + + + + + + + + + + + + + + + + + + + + Configuration of a persistence unit. + + + + + + + + + + + + Description of this persistence unit. + + + + + + + + + + + + Provider class that supplies EntityManagers for this + persistence unit. + + + + + + + + + + + + Qualifier annotation class used for dependency injection. + + + + + + + + + + + + Scope annotation class used for dependency injection. + + + + + + + + + + + + The container-specific name of the JTA datasource to use. + + + + + + + + + + + + The container-specific name of a non-JTA datasource to use. + + + + + + + + + + + + File containing mapping information. Loaded as a resource + by the persistence provider. + + + + + + + + + + + + Jar file that is to be scanned for managed classes. + + + + + + + + + + + + Managed class to be included in the persistence unit and + to scan for annotations. It should be annotated + with either @Entity, @Embeddable or @MappedSuperclass. + + + + + + + + + + + + When set to true then only listed classes and jars will + be scanned for persistent classes, otherwise the + enclosing jar or directory will also be scanned. + Not applicable to Java SE persistence units. + + + + + + + + + + + + Defines whether caching is enabled for the + persistence unit if caching is supported by the + persistence provider. When set to ALL, all entities + will be cached. When set to NONE, no entities will + be cached. When set to ENABLE_SELECTIVE, only entities + specified as cacheable will be cached. When set to + DISABLE_SELECTIVE, entities specified as not cacheable + will not be cached. When not specified or when set to + UNSPECIFIED, provider defaults may apply. + + + + + + + + + + + + The validation mode to be used for the persistence unit. + + + + + + + + + + + + + A list of standard and vendor-specific properties + and hints. + + + + + + + + + A name-value pair. + + + + + + + + + + + + + + + An extension point for integration related configuration, e.g. cdi: + + + + + + + + + + + + + Name used in code to reference this persistence unit. + + + + + + + + + + + + Type of transactions used by EntityManagers from this + persistence unit. + + + + + + + + + + + + + + + + + + + public enum PersistenceUnitTransactionType {JTA, RESOURCE_LOCAL}; + + + + + + + + + + + + + + + + public enum SharedCacheMode { ALL, NONE, ENABLE_SELECTIVE, DISABLE_SELECTIVE, UNSPECIFIED}; + + + + + + + + + + + + + + + + + + + public enum ValidationMode { AUTO, CALLBACK, NONE}; + + + + + + + + + + + \ No newline at end of file diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/provider/DataNucleusProvider.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/provider/DataNucleusProvider.java index 1daa427ad875..53499984597e 100644 --- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/provider/DataNucleusProvider.java +++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/provider/DataNucleusProvider.java @@ -27,11 +27,6 @@ import static org.netbeans.modules.j2ee.persistence.dd.common.PersistenceUnit.JAVAX_NAMESPACE; import org.openide.util.NbBundle; -/** - * - * @author pblaha - */ - /** * This class represents DataNucleus provider. * @@ -111,13 +106,13 @@ public String getTableGenerationCreateValue() { } @Override - public Map getUnresolvedVendorSpecificProperties() { + public Map getUnresolvedVendorSpecificProperties() { return Collections.emptyMap(); } @Override - public Map getDefaultVendorSpecificProperties() { - Map properties = new HashMap<>(); + public Map getDefaultVendorSpecificProperties() { + Map properties = new HashMap<>(4); properties.put("datanucleus.transaction.nontx.read", "true"); //NOI18N properties.put("datanucleus.transaction.nontx.write", "true"); //NOI18N properties.put("datanucleus.ConnectionURL", "appengine"); //NOI18N diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/provider/Provider.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/provider/Provider.java index d2f18a12aead..831502f2d02a 100644 --- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/provider/Provider.java +++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/provider/Provider.java @@ -81,22 +81,19 @@ public boolean isOnClassPath(ClassPath cp) { String classRelativePath = getProviderClass().replace('.', '/') + ".class"; //NOI18N boolean ret = cp.findResource(classRelativePath) != null; - if(ret && version != null) - { - if(Persistence.VERSION_3_2.equals(version)) { - ret &= cp.findResource("jakarta/persistence/criteria/CriteriaSelect.class") != null; - } else if(Persistence.VERSION_3_1.equals(version)){ - ret &= cp.findResource("jakarta/persistence/spi/TransformerException.class") != null; - } else if(Persistence.VERSION_3_0.equals(version)){ - ret &= cp.findResource("jakarta/persistence/Entity.class") != null; - } else if (Persistence.VERSION_2_2.equals(version)) { - ret &= cp.findResource("javax/persistence/TableGenerators.class") != null; - } else if (Persistence.VERSION_2_1.equals(version)) { - ret &= cp.findResource("javax/persistence/criteria/CriteriaUpdate.class") != null; - } else if (Persistence.VERSION_2_0.equals(version)) { - ret &= cp.findResource("javax/persistence/criteria/JoinType.class") != null; - } else if (Persistence.VERSION_1_0.equals(version)) { - ret &= cp.findResource("javax/persistence/Entity.class") != null && cp.findResource("javax/persistence/criteria/JoinType.class") == null; + if(ret && version != null) { + if(null != version) switch (version) { + case Persistence.VERSION_4_0 -> ret &= cp.findResource("jakarta/persistence/PostDelete.class") != null; + case Persistence.VERSION_3_2 -> ret &= cp.findResource("jakarta/persistence/criteria/CriteriaSelect.class") != null; + case Persistence.VERSION_3_1 -> ret &= cp.findResource("jakarta/persistence/spi/TransformerException.class") != null; + case Persistence.VERSION_3_0 -> ret &= cp.findResource("jakarta/persistence/Entity.class") != null; + case Persistence.VERSION_2_2 -> ret &= cp.findResource("javax/persistence/TableGenerators.class") != null; + case Persistence.VERSION_2_1 -> ret &= cp.findResource("javax/persistence/criteria/CriteriaUpdate.class") != null; + case Persistence.VERSION_2_0 -> ret &= cp.findResource("javax/persistence/criteria/JoinType.class") != null; + case Persistence.VERSION_1_0 -> ret &= cp.findResource("javax/persistence/Entity.class") != null + && cp.findResource("javax/persistence/criteria/JoinType.class") == null; + default -> { + } } } return ret; @@ -111,15 +108,15 @@ protected boolean isJakartaNamespace() { return getVersion()!=null && Float.parseFloat(Persistence.VERSION_2_2) < Float.parseFloat(getVersion()); } - private Set initPropertyNames(){ + private Set initPropertyNames(){ Set result = new HashSet<>(); result.add(getJdbcDriver()); result.add(getJdbcUsername()); result.add(getJdbcUrl()); result.add(getJdbcPassword()); result.add(getTableGenerationPropertyName()); - for (Iterator it = getUnresolvedVendorSpecificProperties().keySet().iterator(); it.hasNext();) { - String propertyName = (String) it.next(); + for (Iterator it = getUnresolvedVendorSpecificProperties().keySet().iterator(); it.hasNext();) { + String propertyName = it.next(); result.add(propertyName); } return result; @@ -127,9 +124,9 @@ private Set initPropertyNames(){ /** * Gets the names of all provider specific properties. - * @return Set of Strings representing names of provider specific properties. + * @return Set{@code } representing names of provider specific properties. */ - public Set getPropertyNames(){ + public Set getPropertyNames(){ return this.vendorSpecificProperties; } @@ -142,21 +139,18 @@ public final Property getTableGenerationProperty(String strategy, String version return null; } Property result; - if (Persistence.VERSION_3_2.equals(version)) { - result = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.Property(); - } else if (Persistence.VERSION_3_1.equals(version)) { - result = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.Property(); - } else if (Persistence.VERSION_3_0.equals(version)) { - result = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.Property(); - } else if (Persistence.VERSION_2_2.equals(version)) { - result = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.Property(); - } else if (Persistence.VERSION_2_1.equals(version)) { - result = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.Property(); - } else if (Persistence.VERSION_2_0.equals(version)) { - result = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.Property(); - } else { + if (null == version) { result = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.Property(); - } + } else result = switch (version) { + case Persistence.VERSION_4_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.Property(); + case Persistence.VERSION_3_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.Property(); + case Persistence.VERSION_3_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.Property(); + case Persistence.VERSION_3_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.Property(); + case Persistence.VERSION_2_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.Property(); + case Persistence.VERSION_2_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.Property(); + case Persistence.VERSION_2_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.Property(); + default -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.Property(); + }; result.setName(getTableGenerationPropertyName()); if (TABLE_GENERATION_CREATE.equals(strategy)){ result.setValue(getTableGenerationCreateValue()); @@ -260,13 +254,13 @@ public String getTableGenerationDropCreateValue(){ /** * @return Map{@code } containing vendor specific properties. */ - public abstract Map getUnresolvedVendorSpecificProperties(); + public abstract Map getUnresolvedVendorSpecificProperties(); /** * @return Map{@code } containing vendor specific properties * which should be set on a new unit by default. */ - public abstract Map getDefaultVendorSpecificProperties(); + public abstract Map getDefaultVendorSpecificProperties(); /** * Gets a map containing provider specific name / values pairs of given diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/provider/ProviderUtil.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/provider/ProviderUtil.java index eca1564d3782..7a8080e29586 100644 --- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/provider/ProviderUtil.java +++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/provider/ProviderUtil.java @@ -69,6 +69,7 @@ public class ProviderUtil { public static final Provider HIBERNATE_PROVIDER3_0 = new HibernateProvider(Persistence.VERSION_3_0); public static final Provider HIBERNATE_PROVIDER3_1 = new HibernateProvider(Persistence.VERSION_3_1); public static final Provider HIBERNATE_PROVIDER3_2 = new HibernateProvider(Persistence.VERSION_3_2); + public static final Provider HIBERNATE_PROVIDER4_0 = new HibernateProvider(Persistence.VERSION_4_0); public static final Provider TOPLINK_PROVIDER1_0 = ToplinkProvider.create(Persistence.VERSION_1_0); public static final Provider ECLIPSELINK_PROVIDER1_0 = new EclipseLinkProvider(Persistence.VERSION_1_0); public static final Provider ECLIPSELINK_PROVIDER2_0 = new EclipseLinkProvider(Persistence.VERSION_2_0); @@ -77,6 +78,7 @@ public class ProviderUtil { public static final Provider ECLIPSELINK_PROVIDER3_0 = new EclipseLinkProvider(Persistence.VERSION_3_0); public static final Provider ECLIPSELINK_PROVIDER3_1 = new EclipseLinkProvider(Persistence.VERSION_3_1); public static final Provider ECLIPSELINK_PROVIDER3_2 = new EclipseLinkProvider(Persistence.VERSION_3_2); + public static final Provider ECLIPSELINK_PROVIDER4_0 = new EclipseLinkProvider(Persistence.VERSION_4_0); public static final Provider KODO_PROVIDER = new KodoProvider(); public static final Provider DATANUCLEUS_PROVIDER1_0 = new DataNucleusProvider(Persistence.VERSION_1_0); public static final Provider DATANUCLEUS_PROVIDER2_0 = new DataNucleusProvider(Persistence.VERSION_2_0); @@ -85,10 +87,13 @@ public class ProviderUtil { public static final Provider DATANUCLEUS_PROVIDER3_0 = new DataNucleusProvider(Persistence.VERSION_3_0); public static final Provider DATANUCLEUS_PROVIDER3_1 = new DataNucleusProvider(Persistence.VERSION_3_1); public static final Provider DATANUCLEUS_PROVIDER3_2 = new DataNucleusProvider(Persistence.VERSION_3_2); + public static final Provider DATANUCLEUS_PROVIDER4_0 = new DataNucleusProvider(Persistence.VERSION_4_0); public static final Provider OPENJPA_PROVIDER1_0 = new OpenJPAProvider(Persistence.VERSION_1_0); public static final Provider OPENJPA_PROVIDER2_0 = new OpenJPAProvider(Persistence.VERSION_2_0); public static final Provider OPENJPA_PROVIDER2_1 = new OpenJPAProvider(Persistence.VERSION_2_1); public static final Provider OPENJPA_PROVIDER2_2 = new OpenJPAProvider(Persistence.VERSION_2_2); + public static final Provider OPENJPA_PROVIDER3_0 = new OpenJPAProvider(Persistence.VERSION_3_0); + public static final Provider OPENJPA_PROVIDER3_1 = new OpenJPAProvider(Persistence.VERSION_3_1); public static final Provider DEFAULT_PROVIDER = new DefaultProvider(); public static final Provider DEFAULT_PROVIDER2_0 = new DefaultProvider(Persistence.VERSION_2_0); public static final Provider DEFAULT_PROVIDER2_1 = new DefaultProvider(Persistence.VERSION_2_1); @@ -96,6 +101,7 @@ public class ProviderUtil { public static final Provider DEFAULT_PROVIDER3_0 = new DefaultProvider(Persistence.VERSION_3_0); public static final Provider DEFAULT_PROVIDER3_1 = new DefaultProvider(Persistence.VERSION_3_1); public static final Provider DEFAULT_PROVIDER3_2 = new DefaultProvider(Persistence.VERSION_3_2); + public static final Provider DEFAULT_PROVIDER4_0 = new DefaultProvider(Persistence.VERSION_4_0); /** * TopLink provider using the provider class that was used in NetBeans 5.5. Needed * for maintaining backwards compatibility with persistence units created in 5.5. @@ -129,27 +135,15 @@ public static Provider getProvider(String providerClass, Project project) { Provider ret = null; switch(ver) { - case Persistence.VERSION_1_0: - ret = DEFAULT_PROVIDER; - break; - case Persistence.VERSION_2_0: - ret = DEFAULT_PROVIDER2_0; - break; - case Persistence.VERSION_2_1: - ret = DEFAULT_PROVIDER2_1; - break; - case Persistence.VERSION_2_2: - ret = DEFAULT_PROVIDER2_2; - break; - case Persistence.VERSION_3_0: - ret = DEFAULT_PROVIDER3_0; - break; - case Persistence.VERSION_3_1: - ret = DEFAULT_PROVIDER3_1; - break; - case Persistence.VERSION_3_2: - ret = DEFAULT_PROVIDER3_2; - }// some unknown provider + case Persistence.VERSION_1_0 -> ret = DEFAULT_PROVIDER; + case Persistence.VERSION_2_0 -> ret = DEFAULT_PROVIDER2_0; + case Persistence.VERSION_2_1 -> ret = DEFAULT_PROVIDER2_1; + case Persistence.VERSION_2_2 -> ret = DEFAULT_PROVIDER2_2; + case Persistence.VERSION_3_0 -> ret = DEFAULT_PROVIDER3_0; + case Persistence.VERSION_3_1 -> ret = DEFAULT_PROVIDER3_1; + case Persistence.VERSION_3_2 -> ret = DEFAULT_PROVIDER3_2; + case Persistence.VERSION_4_0 -> ret = DEFAULT_PROVIDER4_0; + } // some unknown provider for (Provider each : getAllProviders()) { if (each.getProviderClass().equals(providerClass.trim())) { @@ -303,7 +297,9 @@ public static void setTableGeneration(PersistenceUnit persistenceUnit, String ta return; } String version = Persistence.VERSION_1_0; - if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) { + if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit) { + version = Persistence.VERSION_4_0; + } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) { version = Persistence.VERSION_3_2; } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) { version = Persistence.VERSION_3_1; @@ -403,39 +399,37 @@ public static PersistenceUnit buildPersistenceUnit(String name, Provider provide Parameters.notNull("provider", provider); Parameters.notNull("connection", connection); PersistenceUnit persistenceUnit = null; - if (Persistence.VERSION_3_2.equals(version)) { - persistenceUnit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit(); - } else if (Persistence.VERSION_3_1.equals(version)) { - persistenceUnit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit(); - } else if (Persistence.VERSION_3_0.equals(version)) { - persistenceUnit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit(); - } else if (Persistence.VERSION_2_2.equals(version)) { + if (null == version) {//currently default 2.2 persistenceUnit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit(); - } else if (Persistence.VERSION_2_1.equals(version)) { - persistenceUnit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit(); - } else if (Persistence.VERSION_2_0.equals(version)) { - persistenceUnit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit(); - } else {//currently default 1.0 - persistenceUnit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit(); - } + } else persistenceUnit = switch (version) { + case Persistence.VERSION_4_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit(); + case Persistence.VERSION_3_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit(); + case Persistence.VERSION_3_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit(); + case Persistence.VERSION_3_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit(); + case Persistence.VERSION_2_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit(); + case Persistence.VERSION_2_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit(); + case Persistence.VERSION_2_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit(); + default -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit(); + }; //currently default 1.0 + persistenceUnit.setName(name); persistenceUnit.setProvider(provider.getProviderClass()); Properties properties = persistenceUnit.newProperties(); - Map connectionProperties = provider.getConnectionPropertiesMap(connection, version); - for (Iterator it = connectionProperties.keySet().iterator(); it.hasNext();) { - String propertyName = (String) it.next(); + Map connectionProperties = provider.getConnectionPropertiesMap(connection, version); + for (Iterator it = connectionProperties.keySet().iterator(); it.hasNext();) { + String propertyName = it.next(); Property property = properties.newProperty(); property.setName(propertyName); - property.setValue((String) connectionProperties.get(propertyName)); + property.setValue(connectionProperties.get(propertyName)); properties.addProperty2(property); } - Map defaultProperties = provider.getDefaultVendorSpecificProperties(); - for (Iterator it = defaultProperties.keySet().iterator(); it.hasNext();) { - String propertyName = (String) it.next(); + Map defaultProperties = provider.getDefaultVendorSpecificProperties(); + for (Iterator it = defaultProperties.keySet().iterator(); it.hasNext();) { + String propertyName = it.next(); Property property = properties.newProperty(); property.setName(propertyName); - property.setValue((String) defaultProperties.get(propertyName)); + property.setValue(defaultProperties.get(propertyName)); properties.addProperty2(property); } @@ -478,19 +472,24 @@ public static void setDatabaseConnection(PersistenceUnit persistenceUnit, Provid } Property[] properties = getProperties(persistenceUnit); - String version = Persistence.VERSION_1_0; - if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) {// we have persistence unit with specific version, should use it + String version = Persistence.VERSION_2_2; + // we have persistence unit with specific version, should use it + if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit) { + version = Persistence.VERSION_4_0; + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) { version = Persistence.VERSION_3_2; - } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) {// we have persistence unit with specific version, should use it + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) { version = Persistence.VERSION_3_1; - } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit) {// we have persistence unit with specific version, should use it + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit) { version = Persistence.VERSION_3_0; - } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit) {// we have persistence unit with specific version, should use it + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit) { version = Persistence.VERSION_2_2; - } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit) {// we have persistence unit with specific version, should use it + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit) { version = Persistence.VERSION_2_1; - } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit) {// we have persistence unit with specific version, should use it + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit) { version = Persistence.VERSION_2_0; + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit) { + version = Persistence.VERSION_1_0; } Map propertiesMap = provider.getConnectionPropertiesMap(connection, version); @@ -591,19 +590,24 @@ public static Provider getProvider(PersistenceUnit persistenceUnit) { */ public static Provider getProvider(PersistenceUnit persistenceUnit, Provider[] providers) { Parameters.notNull("persistenceUnit", persistenceUnit); //NOI18N - String version = Persistence.VERSION_1_0; - if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) {// we have persistence unit with specific version, should use it + String version = Persistence.VERSION_2_2; + // we have persistence unit with specific version, should use it + if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit) { + version = Persistence.VERSION_4_0; + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) { version = Persistence.VERSION_3_2; - } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) {// we have persistence unit with specific version, should use it + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) { version = Persistence.VERSION_3_1; - } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit) {// we have persistence unit with specific version, should use it + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit) { version = Persistence.VERSION_3_0; - } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit) {// we have persistence unit with specific version, should use it + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit) { version = Persistence.VERSION_2_2; - } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit) {// we have persistence unit with specific version, should use it + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit) { version = Persistence.VERSION_2_1; - } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit) {// we have persistence unit with specific version, should use it + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit) { version = Persistence.VERSION_2_0; + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit) { + version = Persistence.VERSION_1_0; } long top_version = Math.round(Double.parseDouble(version) * 100); long longVersion = top_version; @@ -643,22 +647,16 @@ public static Provider getProvider(PersistenceUnit persistenceUnit, Provider[] p } } if(top_provider == null) { - switch (version) { - case Persistence.VERSION_1_0: - return DEFAULT_PROVIDER; - case Persistence.VERSION_2_0: - return DEFAULT_PROVIDER2_0; - case Persistence.VERSION_2_1: - return DEFAULT_PROVIDER2_1; - case Persistence.VERSION_2_2: - return DEFAULT_PROVIDER2_2; - case Persistence.VERSION_3_0: - return DEFAULT_PROVIDER3_0; - case Persistence.VERSION_3_2: - return DEFAULT_PROVIDER3_2; - default: - return DEFAULT_PROVIDER3_1; - }// some unknown provider + return switch (version) { + case Persistence.VERSION_1_0 -> DEFAULT_PROVIDER; + case Persistence.VERSION_2_0 -> DEFAULT_PROVIDER2_0; + case Persistence.VERSION_2_1 -> DEFAULT_PROVIDER2_1; + case Persistence.VERSION_2_2 -> DEFAULT_PROVIDER2_2; + case Persistence.VERSION_3_0 -> DEFAULT_PROVIDER3_0; + case Persistence.VERSION_3_2 -> DEFAULT_PROVIDER3_2; + case Persistence.VERSION_4_0 -> DEFAULT_PROVIDER4_0; + default -> DEFAULT_PROVIDER3_1; + }; // some unknown provider } return top_provider; } @@ -668,9 +666,9 @@ private static Set filterProvidersByProperties(Set providers Set ret = null; if(providers == null){} else if(providers.size()<= 1 || properties==null || properties.length==0) { - ret = new HashSet(providers); + ret = new HashSet<>(providers); } else { - ret = new HashSet(providers); + ret = new HashSet<>(providers); HashMap > rates = new HashMap<>(); int lowrate = Integer.MAX_VALUE; for(Provider each : providers){ @@ -818,18 +816,21 @@ public static void addPersistenceUnit(PersistenceUnit persistenceUnit, Project p * */ public static void addPersistenceUnit(PersistenceUnit persistenceUnit, Project project, FileObject root) throws InvalidPersistenceXmlException { - String version = Persistence.VERSION_1_0; - if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) {// we have persistence unit with specific version, should use it + String version = Persistence.VERSION_2_2; + // we have persistence unit with specific version, should use it + if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit) { + version = Persistence.VERSION_4_0; + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) { version = Persistence.VERSION_3_2; - } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) {// we have persistence unit with specific version, should use it + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) { version = Persistence.VERSION_3_1; - } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit) {// we have persistence unit with specific version, should use it + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit) { version = Persistence.VERSION_3_0; - } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit) {// we have persistence unit with specific version, should use it + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit) { version = Persistence.VERSION_2_2; - } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit) {// we have persistence unit with specific version, should use it + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit) { version = Persistence.VERSION_2_1; - } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit) {// we have persistence unit with specific version, should use it + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit) { version = Persistence.VERSION_2_0; } PUDataObject pud = getPUDataObject(project, root, version); @@ -1036,15 +1037,20 @@ public static String getDatasourceName(PersistenceUnit pu) { */ public static Provider[] getAllProviders() { return new Provider[] { + DATANUCLEUS_PROVIDER4_0, + ECLIPSELINK_PROVIDER4_0, + HIBERNATE_PROVIDER4_0, DATANUCLEUS_PROVIDER3_2, ECLIPSELINK_PROVIDER3_2, HIBERNATE_PROVIDER3_2, DATANUCLEUS_PROVIDER3_1, ECLIPSELINK_PROVIDER3_1, HIBERNATE_PROVIDER3_1, + OPENJPA_PROVIDER3_1, DATANUCLEUS_PROVIDER3_0, ECLIPSELINK_PROVIDER3_0, HIBERNATE_PROVIDER3_0, + OPENJPA_PROVIDER3_0, DATANUCLEUS_PROVIDER2_2, ECLIPSELINK_PROVIDER2_2, HIBERNATE_PROVIDER2_2, diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/spi/entitymanagergenerator/EntityManagerGenerationStrategySupport.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/spi/entitymanagergenerator/EntityManagerGenerationStrategySupport.java index 847f1434aea5..f9a0c842ced6 100644 --- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/spi/entitymanagergenerator/EntityManagerGenerationStrategySupport.java +++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/spi/entitymanagergenerator/EntityManagerGenerationStrategySupport.java @@ -459,17 +459,20 @@ private String getPersistenceVersion() { } else { version = Persistence.VERSION_1_0; } - if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) {// we have persistence unit with specific version, should use it + // we have persistence unit with specific version, should use it + if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit) { + version = Persistence.VERSION_4_0; + } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) { version = Persistence.VERSION_3_2; - } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) {// we have persistence unit with specific version, should use it + } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) { version = Persistence.VERSION_3_1; - } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit) {// we have persistence unit with specific version, should use it + } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit) { version = Persistence.VERSION_3_0; - } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit) {// we have persistence unit with specific version, should use it + } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit) { version = Persistence.VERSION_2_2; - } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit) {// we have persistence unit with specific version, should use it + } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit) { version = Persistence.VERSION_2_1; - } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit) {// we have persistence unit with specific version, should use it + } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit) { version = Persistence.VERSION_2_0; } return version; @@ -478,13 +481,13 @@ private String getPersistenceVersion() { protected String getEntityManagerFqn() { String version = getPersistenceVersion(); switch(version) { - case Persistence.VERSION_1_0: - case Persistence.VERSION_2_0: - case Persistence.VERSION_2_1: - case Persistence.VERSION_2_2: - return ENTITY_MANAGER_FQN; - default: - return ENTITY_MANAGER_JAKARTA_FQN; + case Persistence.VERSION_1_0: + case Persistence.VERSION_2_0: + case Persistence.VERSION_2_1: + case Persistence.VERSION_2_2: + return ENTITY_MANAGER_FQN; + default: + return ENTITY_MANAGER_JAKARTA_FQN; } } diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/ui/resources/layer.xml b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/ui/resources/layer.xml index d0200cc1dc9f..ef6a92a33b3c 100644 --- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/ui/resources/layer.xml +++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/ui/resources/layer.xml @@ -223,6 +223,7 @@ + diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/ui/resources/persistence-4.0.xml b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/ui/resources/persistence-4.0.xml new file mode 100644 index 000000000000..758be7dc4e44 --- /dev/null +++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/ui/resources/persistence-4.0.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PUDataObject.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PUDataObject.java index 7a2fdfca63f2..f37df671c812 100644 --- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PUDataObject.java +++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PUDataObject.java @@ -184,27 +184,42 @@ public boolean parseDocument() { Persistence newPersistence; Persistence cleanPersistence; try (InputStream is = getEditorSupport().getInputStream()) { - if(Persistence.VERSION_3_2.equals(version)) { - newPersistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.Persistence.createGraph(is); - cleanPersistence = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.Persistence(); - } else if(Persistence.VERSION_3_1.equals(version)) { - newPersistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.Persistence.createGraph(is); - cleanPersistence = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.Persistence(); - } else if(Persistence.VERSION_3_0.equals(version)) { - newPersistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.Persistence.createGraph(is); - cleanPersistence = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.Persistence(); - } else if(Persistence.VERSION_2_2.equals(version)) { - newPersistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.Persistence.createGraph(is); - cleanPersistence = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.Persistence(); - } else if(Persistence.VERSION_2_1.equals(version)) { - newPersistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.Persistence.createGraph(is); - cleanPersistence = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.Persistence(); - } else if(Persistence.VERSION_2_0.equals(version)) { - newPersistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.Persistence.createGraph(is); - cleanPersistence = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.Persistence(); - } else {//1.0 - default + if(null == version) { newPersistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.Persistence.createGraph(is); cleanPersistence = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.Persistence(); + } else switch (version) { + case Persistence.VERSION_4_0 -> { + newPersistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.Persistence.createGraph(is); + cleanPersistence = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.Persistence(); + } + case Persistence.VERSION_3_2 -> { + newPersistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.Persistence.createGraph(is); + cleanPersistence = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.Persistence(); + } + case Persistence.VERSION_3_1 -> { + newPersistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.Persistence.createGraph(is); + cleanPersistence = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.Persistence(); + } + case Persistence.VERSION_3_0 -> { + newPersistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.Persistence.createGraph(is); + cleanPersistence = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.Persistence(); + } + case Persistence.VERSION_2_2 -> { + newPersistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.Persistence.createGraph(is); + cleanPersistence = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.Persistence(); + } + case Persistence.VERSION_2_1 -> { + newPersistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.Persistence.createGraph(is); + cleanPersistence = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.Persistence(); + } + case Persistence.VERSION_2_0 -> { + newPersistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.Persistence.createGraph(is); + cleanPersistence = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.Persistence(); + } + default -> { + newPersistence = org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.Persistence.createGraph(is); + cleanPersistence = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.Persistence(); + } } } catch (RuntimeException ex) { // must catch RTE (thrown by schema2beans when document is not valid) LOG.log(Level.INFO, null, ex); @@ -458,15 +473,11 @@ protected void updateDataFromModel(Object model, FileLock lock, boolean modify) if (model == null) { return; } - try (Writer out = new StringWriter()) { + try (lock; Writer out = new StringWriter()) { ((BaseBean) model).write(out); getDataCache().setData(lock, out.toString(), modify); } catch (IOException | Schema2BeansException e) { LOG.log(Level.INFO, null, e); - } finally { - if (lock != null){ - lock.releaseLock(); - } } } diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceCatalog.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceCatalog.java index 273dd90ece32..87950f873e51 100644 --- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceCatalog.java +++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceCatalog.java @@ -61,6 +61,7 @@ private void initialize(){ schemas.add(new SchemaInfo("persistence_2_2.xsd", RESOURCE_PATH, PERSISTENCE_NS)); schemas.add(new SchemaInfo("persistence_3_0.xsd", RESOURCE_PATH, PERSISTENCE_JAKARTA_NS)); schemas.add(new SchemaInfo("persistence_3_2.xsd", RESOURCE_PATH, PERSISTENCE_JAKARTA_NS)); + schemas.add(new SchemaInfo("persistence_4_0.xsd", RESOURCE_PATH, PERSISTENCE_JAKARTA_NS)); // orm schemas.add(new SchemaInfo("orm_1_0.xsd", RESOURCE_PATH, ORM_OLD_NS)); schemas.add(new SchemaInfo("orm_2_0.xsd", RESOURCE_PATH, ORM_OLD_NS)); @@ -69,6 +70,7 @@ private void initialize(){ schemas.add(new SchemaInfo("orm_3_0.xsd", RESOURCE_PATH, ORM_JAKARTA_NS)); schemas.add(new SchemaInfo("orm_3_1.xsd", RESOURCE_PATH, ORM_JAKARTA_NS)); schemas.add(new SchemaInfo("orm_3_2.xsd", RESOURCE_PATH, ORM_JAKARTA_NS)); + schemas.add(new SchemaInfo("orm_4_0.xsd", RESOURCE_PATH, ORM_JAKARTA_NS)); } @Override @@ -85,7 +87,7 @@ public InputSource resolveEntity(String publicId, String systemId) throws SAXExc } @Override - public Iterator getPublicIDs() { + public Iterator getPublicIDs() { List result = new ArrayList<>(); for (SchemaInfo each : schemas){ result.add(each.getPublicId()); diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceCfgProperties.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceCfgProperties.java index 0fa119bd5420..40a64942ac84 100644 --- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceCfgProperties.java +++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceCfgProperties.java @@ -190,11 +190,13 @@ public class PersistenceCfgProperties { possiblePropertyValues.get(ProviderUtil.ECLIPSELINK_PROVIDER2_2).put(PersistenceUnitProperties.SHARED_CACHE_MODE, SHARED_CACHE_MODE); possiblePropertyValues.get(ProviderUtil.ECLIPSELINK_PROVIDER2_2).put(PersistenceUnitProperties.WEAVING_MAPPEDSUPERCLASS, TRUE_FALSE); possiblePropertyValues.get(ProviderUtil.ECLIPSELINK_PROVIDER2_2).put(ProviderUtil.ECLIPSELINK_PROVIDER2_2.getTableGenerationPropertyName(),possiblePropertyValues.get(ProviderUtil.ECLIPSELINK_PROVIDER2_0).get(ProviderUtil.ECLIPSELINK_PROVIDER2_0.getTableGenerationPropertyName())); + //EclipseLink JPA 3.0 (initially just copy of 2.2 and then replace javax to jakarta) possiblePropertyValues.put(ProviderUtil.ECLIPSELINK_PROVIDER3_0, new HashMap<>()); for (Map.Entry entry : possiblePropertyValues.get(ProviderUtil.ECLIPSELINK_PROVIDER2_2).entrySet()) { possiblePropertyValues.get(ProviderUtil.ECLIPSELINK_PROVIDER3_0).put(entry.getKey().replace(JAVAX_NAMESPACE, JAKARTA_NAMESPACE), entry.getValue()); } + //EclipseLink JPA 3.1 (initially just copy of 3.0) possiblePropertyValues.put(ProviderUtil.ECLIPSELINK_PROVIDER3_1, new HashMap<>()); possiblePropertyValues.get(ProviderUtil.ECLIPSELINK_PROVIDER3_1).putAll(possiblePropertyValues.get(ProviderUtil.ECLIPSELINK_PROVIDER3_0)); @@ -202,6 +204,10 @@ public class PersistenceCfgProperties { //EclipseLink JPA 3.2 (initially just copy of 3.0) possiblePropertyValues.put(ProviderUtil.ECLIPSELINK_PROVIDER3_2, new HashMap<>()); possiblePropertyValues.get(ProviderUtil.ECLIPSELINK_PROVIDER3_2).putAll(possiblePropertyValues.get(ProviderUtil.ECLIPSELINK_PROVIDER3_0)); + + //EclipseLink JPA 4.0 (initially just copy of 3.0) + possiblePropertyValues.put(ProviderUtil.ECLIPSELINK_PROVIDER4_0, new HashMap<>()); + possiblePropertyValues.get(ProviderUtil.ECLIPSELINK_PROVIDER4_0).putAll(possiblePropertyValues.get(ProviderUtil.ECLIPSELINK_PROVIDER3_0)); //Hibernate JPA 1.0 possiblePropertyValues.put(ProviderUtil.HIBERNATE_PROVIDER1_0, new HashMap()); @@ -239,11 +245,13 @@ public class PersistenceCfgProperties { //Hibernate JPA 2.2 (initially just copy of 2.0) possiblePropertyValues.put(ProviderUtil.HIBERNATE_PROVIDER2_2, new HashMap()); possiblePropertyValues.get(ProviderUtil.HIBERNATE_PROVIDER2_2).putAll(possiblePropertyValues.get(ProviderUtil.HIBERNATE_PROVIDER2_0)); + //Hibernate JPA 3.0 (initially just copy of 2.2 and then replace javax to jakarta) possiblePropertyValues.put(ProviderUtil.HIBERNATE_PROVIDER3_0, new HashMap()); for (Map.Entry entry : possiblePropertyValues.get(ProviderUtil.HIBERNATE_PROVIDER2_2).entrySet()) { possiblePropertyValues.get(ProviderUtil.HIBERNATE_PROVIDER3_0).put(entry.getKey().replace(JAVAX_NAMESPACE, JAKARTA_NAMESPACE), entry.getValue()); } + //Hibernate JPA 3.1 (initially just copy of 3.0) possiblePropertyValues.put(ProviderUtil.HIBERNATE_PROVIDER3_1, new HashMap()); possiblePropertyValues.get(ProviderUtil.HIBERNATE_PROVIDER3_1).putAll(possiblePropertyValues.get(ProviderUtil.HIBERNATE_PROVIDER3_0)); @@ -252,6 +260,10 @@ public class PersistenceCfgProperties { possiblePropertyValues.put(ProviderUtil.HIBERNATE_PROVIDER3_2, new HashMap()); possiblePropertyValues.get(ProviderUtil.HIBERNATE_PROVIDER3_2).putAll(possiblePropertyValues.get(ProviderUtil.HIBERNATE_PROVIDER3_0)); + //Hibernate JPA 4.0 (initially just copy of 3.0) + possiblePropertyValues.put(ProviderUtil.HIBERNATE_PROVIDER4_0, new HashMap()); + possiblePropertyValues.get(ProviderUtil.HIBERNATE_PROVIDER4_0).putAll(possiblePropertyValues.get(ProviderUtil.HIBERNATE_PROVIDER3_0)); + //OpenJPA JPA 1.0 possiblePropertyValues.put(ProviderUtil.OPENJPA_PROVIDER1_0, new HashMap()); possiblePropertyValues.get(ProviderUtil.OPENJPA_PROVIDER1_0).put(ProviderUtil.OPENJPA_PROVIDER1_0.getJdbcUrl(), null); @@ -373,6 +385,16 @@ public class PersistenceCfgProperties { possiblePropertyValues.put(ProviderUtil.OPENJPA_PROVIDER2_2, new HashMap()); possiblePropertyValues.get(ProviderUtil.OPENJPA_PROVIDER2_2).putAll(possiblePropertyValues.get(ProviderUtil.OPENJPA_PROVIDER2_1)); + //OpenJPA JPA 3.0 (initially just copy of 2.2 and then replace javax to jakarta) + possiblePropertyValues.put(ProviderUtil.OPENJPA_PROVIDER3_0, new HashMap<>()); + for (Map.Entry entry : possiblePropertyValues.get(ProviderUtil.OPENJPA_PROVIDER2_2).entrySet()) { + possiblePropertyValues.get(ProviderUtil.OPENJPA_PROVIDER3_0).put(entry.getKey().replace(JAVAX_NAMESPACE, JAKARTA_NAMESPACE), entry.getValue()); + } + + //OpenJPA JPA 3.1 (initially just copy of 3.0) + possiblePropertyValues.put(ProviderUtil.OPENJPA_PROVIDER3_1, new HashMap()); + possiblePropertyValues.get(ProviderUtil.OPENJPA_PROVIDER3_1).putAll(possiblePropertyValues.get(ProviderUtil.OPENJPA_PROVIDER3_0)); + //DataNucleus JPA 1.0 possiblePropertyValues.put(ProviderUtil.DATANUCLEUS_PROVIDER1_0, new HashMap()); possiblePropertyValues.get(ProviderUtil.DATANUCLEUS_PROVIDER1_0).put(ProviderUtil.DATANUCLEUS_PROVIDER1_0.getJdbcUrl(), null); @@ -613,6 +635,10 @@ public class PersistenceCfgProperties { possiblePropertyValues.put(ProviderUtil.DATANUCLEUS_PROVIDER3_2, new HashMap()); possiblePropertyValues.get(ProviderUtil.DATANUCLEUS_PROVIDER3_2).putAll(possiblePropertyValues.get(ProviderUtil.DATANUCLEUS_PROVIDER3_0)); + //DataNucleus JPA 4.0 (initially just copy of 3.0) + possiblePropertyValues.put(ProviderUtil.DATANUCLEUS_PROVIDER4_0, new HashMap()); + possiblePropertyValues.get(ProviderUtil.DATANUCLEUS_PROVIDER4_0).putAll(possiblePropertyValues.get(ProviderUtil.DATANUCLEUS_PROVIDER3_0)); + //toplink 1.0 possiblePropertyValues.put(ProviderUtil.TOPLINK_PROVIDER1_0, new HashMap()); possiblePropertyValues.get(ProviderUtil.TOPLINK_PROVIDER1_0).put(ProviderUtil.TOPLINK_PROVIDER1_0.getJdbcUrl(), null); @@ -669,7 +695,7 @@ public static Map> getAllKeyAndValues(){ * @return */ public static List getProviders(){ - ArrayList ret = new ArrayList<>(); + List ret = new ArrayList<>(8); ret.add(ProviderUtil.ECLIPSELINK_PROVIDER3_1); ret.add(ProviderUtil.HIBERNATE_PROVIDER2_2); ret.add(ProviderUtil.DATANUCLEUS_PROVIDER2_2); diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceToolBarMVElement.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceToolBarMVElement.java index 6dd8c8368a3d..8b024096e103 100644 --- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceToolBarMVElement.java +++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceToolBarMVElement.java @@ -404,7 +404,10 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { PersistenceUnit punit; boolean useModelgen = false; String modelGenLib = null; - if(Persistence.VERSION_3_2.equals(version)) { + if(Persistence.VERSION_4_0.equals(version)) { + useModelgen = true; + punit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit(); + } else if(Persistence.VERSION_3_2.equals(version)) { useModelgen = true; punit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit(); } else if(Persistence.VERSION_3_1.equals(version)) { diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceUnitPanel.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceUnitPanel.java index cc99d5a50156..3bde8181f197 100644 --- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceUnitPanel.java +++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceUnitPanel.java @@ -211,18 +211,20 @@ private void setVisiblePanel(){ } private void initCache(){ String caching = ""; - if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) { - caching = ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) persistenceUnit).getSharedCacheMode(); - } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) { - caching = ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) persistenceUnit).getSharedCacheMode(); - } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit) { - caching = ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit) persistenceUnit).getSharedCacheMode(); - } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit) { - caching = ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit) persistenceUnit).getSharedCacheMode(); - } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit) { - caching = ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit) persistenceUnit).getSharedCacheMode(); - } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit) { - caching = ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit) persistenceUnit).getSharedCacheMode(); + if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit pu40) { + caching = pu40.getSharedCacheMode(); + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit pu32) { + caching = pu32.getSharedCacheMode(); + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit pu31) { + caching = pu31.getSharedCacheMode(); + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit pu30) { + caching = pu30.getSharedCacheMode(); + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit pu22) { + caching = pu22.getSharedCacheMode(); + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit pu21) { + caching = pu21.getSharedCacheMode(); + } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit pu20) { + caching = pu20.getSharedCacheMode(); } if(cachingTypes[0].equals(caching)) @@ -251,18 +253,20 @@ else if(cachingTypes[3].equals(caching)) private void initValidation(){ String validation = ""; - if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) { - validation = ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) persistenceUnit).getValidationMode(); - } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) { - validation = ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) persistenceUnit).getValidationMode(); - } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit) { - validation = ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit) persistenceUnit).getValidationMode(); - } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit) { - validation = ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit) persistenceUnit).getValidationMode(); - } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit) { - validation = ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit) persistenceUnit).getValidationMode(); - } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit) { - validation = ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit) persistenceUnit).getValidationMode(); + if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit pu40) { + validation = pu40.getValidationMode(); + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit pu32) { + validation = pu32.getValidationMode(); + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit pu31) { + validation = pu31.getValidationMode(); + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit pu30) { + validation = pu30.getValidationMode(); + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit pu22) { + validation = pu22.getValidationMode(); + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit pu21) { + validation = pu21.getValidationMode(); + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit pu20) { + validation = pu20.getValidationMode(); } if(validationModes[1].equals(validation)) @@ -536,32 +540,36 @@ else if(source==ddNoValidation) vMode = validationModes[2]; } if(!"".equals(cType)) { - if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) { - ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) persistenceUnit).setSharedCacheMode(cType); - } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) { - ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) persistenceUnit).setSharedCacheMode(cType); - } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit) { - ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit) persistenceUnit).setSharedCacheMode(cType); - } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit) { - ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit) persistenceUnit).setSharedCacheMode(cType); - } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit) { - ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit) persistenceUnit).setSharedCacheMode(cType); - } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit) { - ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit) persistenceUnit).setSharedCacheMode(cType); + if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit pu40) { + pu40.setSharedCacheMode(cType); + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit pu32) { + pu32.setSharedCacheMode(cType); + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit pu31) { + pu31.setSharedCacheMode(cType); + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit pu30) { + pu30.setSharedCacheMode(cType); + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit pu22) { + pu22.setSharedCacheMode(cType); + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit pu21) { + pu21.setSharedCacheMode(cType); + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit pu20) { + pu20.setSharedCacheMode(cType); } } else if(!"".equals(vMode)) { - if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) { - ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) persistenceUnit).setValidationMode(vMode); - } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) { - ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) persistenceUnit).setValidationMode(vMode); - } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit) { - ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit) persistenceUnit).setValidationMode(vMode); - } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit) { - ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit) persistenceUnit).setValidationMode(vMode); - } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit) { - ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit) persistenceUnit).setValidationMode(vMode); - } else if (persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit) { - ((org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit) persistenceUnit).setValidationMode(vMode); + if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit pu40) { + pu40.setValidationMode(vMode); + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit pu32) { + pu32.setValidationMode(vMode); + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit pu31) { + pu31.setValidationMode(vMode); + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit pu30) { + pu30.setValidationMode(vMode); + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit pu22) { + pu22.setValidationMode(vMode); + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit pu21) { + pu21.setValidationMode(vMode); + } else if(persistenceUnit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit pu20) { + pu20.setValidationMode(vMode); } } ProviderUtil.normalizeIfPossible(project, persistenceUnit); diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/Util.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/Util.java index 01f71945a303..08c6354f47a8 100644 --- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/Util.java +++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/Util.java @@ -80,7 +80,8 @@ public static ArrayList getAvailPropNames(Persistence persistence, Provi } } } - if(Persistence.VERSION_3_2.equals(persistence.getVersion()) + if(Persistence.VERSION_4_0.equals(persistence.getVersion()) + || Persistence.VERSION_3_2.equals(persistence.getVersion()) || Persistence.VERSION_3_1.equals(persistence.getVersion()) || Persistence.VERSION_3_0.equals(persistence.getVersion())) { availProps.replaceAll(s -> s.replace(PersistenceUnit.JAVAX_NAMESPACE, PersistenceUnit.JAKARTA_NAMESPACE)); diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/util/PersistenceProviderComboboxHelper.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/util/PersistenceProviderComboboxHelper.java index 5b7f1d219fda..577ab08a805e 100644 --- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/util/PersistenceProviderComboboxHelper.java +++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/util/PersistenceProviderComboboxHelper.java @@ -181,7 +181,8 @@ private void initCombo(JComboBox providerCombo) { || Util.isJPAVersionSupported(project, Persistence.VERSION_2_2) || Util.isJPAVersionSupported(project, Persistence.VERSION_3_0) || Util.isJPAVersionSupported(project, Persistence.VERSION_3_1) - || Util.isJPAVersionSupported(project, Persistence.VERSION_3_2)) + || Util.isJPAVersionSupported(project, Persistence.VERSION_3_2) + || Util.isJPAVersionSupported(project, Persistence.VERSION_4_0)) && (defProviderVersion == null || defProviderVersion.equals(Persistence.VERSION_1_0));//jpa 3.1 is supported by default (or first) is jpa1.0 or udefined version provider if(specialCase){ for (int i = 1; i new org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit(); + case Persistence.VERSION_3_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit(); + case Persistence.VERSION_3_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit(); + case Persistence.VERSION_3_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit(); + case Persistence.VERSION_2_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit(); + case Persistence.VERSION_2_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit(); + case Persistence.VERSION_2_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit(); + default -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit(); + }; if (isContainerManaged) { PersistenceUnitWizardPanelDS puPanel = (PersistenceUnitWizardPanelDS) panel; if (puPanel.getDatasource() != null && !"".equals(puPanel.getDatasource().trim())) { @@ -482,21 +482,19 @@ public static PersistenceUnit buildPersistenceUnitUsingData(Project project, Str } } PersistenceUnit punit = null; - if (Persistence.VERSION_3_2.equals(version)) { - punit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit(); - } else if (Persistence.VERSION_3_1.equals(version)) { - punit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit(); - } else if (Persistence.VERSION_3_0.equals(version)) { - punit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit(); - } else if (Persistence.VERSION_2_2.equals(version)) { - punit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit(); - } else if (Persistence.VERSION_2_1.equals(version)) { - punit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit(); - } else if (Persistence.VERSION_2_0.equals(version)) { - punit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit(); - } else {//currently default 1.0 + if (null == version) { + //currently default 1.0 punit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit(); - } + } else punit = switch (version) { + case Persistence.VERSION_4_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit(); + case Persistence.VERSION_3_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit(); + case Persistence.VERSION_3_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit(); + case Persistence.VERSION_3_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit(); + case Persistence.VERSION_2_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit(); + case Persistence.VERSION_2_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit(); + case Persistence.VERSION_2_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit(); + default -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit(); + }; if (isContainerManaged) { if (preselectedDB == null || preselectedDB.trim().isEmpty()) { //find first with default/sample part in name @@ -601,7 +599,9 @@ public static boolean createPersistenceUnitUsingWizard(Project project, return false; } String version = Persistence.VERSION_1_0; - if(punit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) { + if(punit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit) { + version = Persistence.VERSION_4_0; + } else if(punit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit) { version = Persistence.VERSION_3_2; } else if(punit instanceof org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit) { version = Persistence.VERSION_3_1; @@ -744,7 +744,8 @@ public static void addLibraryToProject(Project project, Library library, String public static void addPersistenceUnitToProject(Project project) { if(PersistenceUtils.getJPAVersion(project) == null){ Library lib; - if(isJPAVersionSupported(project, Persistence.VERSION_3_2) + if(isJPAVersionSupported(project, Persistence.VERSION_4_0) + || isJPAVersionSupported(project, Persistence.VERSION_3_2) || isJPAVersionSupported(project, Persistence.VERSION_3_1) || isJPAVersionSupported(project, Persistence.VERSION_3_0) || isJPAVersionSupported(project, Persistence.VERSION_2_2) diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/wizard/unit/PersistenceUnitWizard.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/wizard/unit/PersistenceUnitWizard.java index da9832e229f3..e9d17ba820fe 100644 --- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/wizard/unit/PersistenceUnitWizard.java +++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/wizard/unit/PersistenceUnitWizard.java @@ -129,11 +129,9 @@ public Set instantiate() throws java.io.IOException { @Override public Set instantiate(ProgressHandle handle) throws IOException { - try { + try (handle) { handle.start(); return instantiateWProgress(handle); - } finally { - handle.finish(); } } @@ -212,21 +210,19 @@ private Set instantiateWProgress(ProgressHandle handle) throws IOException { // if (descriptor.isContainerManaged()) { LOG.fine("Creating a container managed PU"); - if(Persistence.VERSION_3_2.equals(version)) { - punit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit(); - } else if(Persistence.VERSION_3_1.equals(version)) { - punit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit(); - } else if(Persistence.VERSION_3_0.equals(version)) { - punit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit(); - } else if(Persistence.VERSION_2_2.equals(version)) { - punit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit(); - } else if(Persistence.VERSION_2_1.equals(version)) { - punit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit(); - } else if(Persistence.VERSION_2_0.equals(version)) { - punit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit(); - } else {//currently default 1.0 + if(null == version) { + //currently default 1.0 punit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit(); - } + } else punit = switch (version) { + case Persistence.VERSION_4_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit(); + case Persistence.VERSION_3_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit(); + case Persistence.VERSION_3_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit(); + case Persistence.VERSION_3_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit(); + case Persistence.VERSION_2_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit(); + case Persistence.VERSION_2_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit(); + case Persistence.VERSION_2_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit(); + default -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit(); + }; if (descriptor.getDatasource() != null && !"".equals(descriptor.getDatasource())){ if (descriptor.isJTA()) { punit.setJtaDataSource(descriptor.getDatasource()); diff --git a/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/provider/ProviderUtilTest.java b/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/provider/ProviderUtilTest.java index 6dba6d6419da..6029b3d0d5cd 100644 --- a/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/provider/ProviderUtilTest.java +++ b/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/provider/ProviderUtilTest.java @@ -44,6 +44,7 @@ public class ProviderUtilTest extends NbTestCase { private PersistenceUnit persistenceUnit5; private PersistenceUnit persistenceUnit6; private PersistenceUnit persistenceUnit7; + private PersistenceUnit persistenceUnit8; public ProviderUtilTest(String testName) { super(testName); @@ -58,6 +59,7 @@ protected void setUp() throws Exception { this.persistenceUnit5 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit(); this.persistenceUnit6 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit(); this.persistenceUnit7 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit(); + this.persistenceUnit8 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit(); } @Override @@ -285,6 +287,20 @@ public void testSetProvider7(){ assertPropertyExists(persistenceUnit7, provider.getJdbcUrl()); assertPropertyExists(persistenceUnit7, provider.getJdbcUsername()); } + + public void testGetProvider8() { + persistenceUnit8.setProvider(ProviderUtil.ECLIPSELINK_PROVIDER4_0.getProviderClass()); + assertEquals(ProviderUtil.ECLIPSELINK_PROVIDER4_0, ProviderUtil.getProvider(persistenceUnit8)); + } + + public void testSetProvider8(){ + Provider provider = ProviderUtil.ECLIPSELINK_PROVIDER4_0; + ProviderUtil.setProvider(persistenceUnit8, provider, getConnection(), Provider.TABLE_GENERATTION_UNKOWN); + assertEquals(provider.getProviderClass(), persistenceUnit8.getProvider()); + assertPropertyExists(persistenceUnit8, provider.getJdbcDriver()); + assertPropertyExists(persistenceUnit8, provider.getJdbcUrl()); + assertPropertyExists(persistenceUnit8, provider.getJdbcUsername()); + } /** * Tests that changing of provider preserves existing diff --git a/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceUnitDataObjectTest.java b/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceUnitDataObjectTest.java index b4523e30af64..70e0f48460ca 100644 --- a/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceUnitDataObjectTest.java +++ b/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceUnitDataObjectTest.java @@ -42,23 +42,19 @@ public void testAddPersistenceUnit() throws Exception{ String version=dataObject.getPersistence().getVersion(); PersistenceUnit persistenceUnit = null; - if(Persistence.VERSION_3_2.equals(version)) { - persistenceUnit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit(); - } else if(Persistence.VERSION_3_1.equals(version)) { + if(null == version) { persistenceUnit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit(); - } else if(Persistence.VERSION_3_0.equals(version)) { - persistenceUnit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit(); - } else if(Persistence.VERSION_2_2.equals(version)) { - persistenceUnit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit(); - } else if(Persistence.VERSION_2_1.equals(version)) { - persistenceUnit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit(); - } else if(Persistence.VERSION_2_0.equals(version)) { - persistenceUnit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit(); - } else if(Persistence.VERSION_1_0.equals(version)) { - persistenceUnit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit(); - } else { - persistenceUnit = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit(); - } + } else persistenceUnit = switch (version) { + case Persistence.VERSION_4_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit(); + case Persistence.VERSION_3_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit(); + case Persistence.VERSION_3_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit(); + case Persistence.VERSION_3_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit(); + case Persistence.VERSION_2_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit(); + case Persistence.VERSION_2_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit(); + case Persistence.VERSION_2_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit(); + case Persistence.VERSION_1_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit(); + default -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit(); + }; persistenceUnit.setName("em3"); persistenceUnit.setJtaDataSource("jdbc/__default"); diff --git a/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceValidatorTest.java b/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceValidatorTest.java index 820a81a227f1..820bc290f10e 100644 --- a/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceValidatorTest.java +++ b/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/unit/PersistenceValidatorTest.java @@ -45,43 +45,35 @@ protected void setUp() throws Exception { public void testValidateNameIsUnique() { String version=dataObject.getPersistence().getVersion(); PersistenceUnit unit1 = null; - if(Persistence.VERSION_3_2.equals(version)) { - unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit(); - } else if(Persistence.VERSION_3_1.equals(version)) { + if(null == version) { unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit(); - } else if(Persistence.VERSION_3_0.equals(version)) { - unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit(); - } else if(Persistence.VERSION_2_2.equals(version)) { - unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit(); - } else if(Persistence.VERSION_2_1.equals(version)) { - unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit(); - } else if(Persistence.VERSION_2_0.equals(version)) { - unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit(); - } else if(Persistence.VERSION_1_0.equals(version)) { - unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit(); - } else { - unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit(); - } + } else unit1 = switch (version) { + case Persistence.VERSION_4_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit(); + case Persistence.VERSION_3_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit(); + case Persistence.VERSION_3_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit(); + case Persistence.VERSION_3_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit(); + case Persistence.VERSION_2_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit(); + case Persistence.VERSION_2_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit(); + case Persistence.VERSION_2_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit(); + case Persistence.VERSION_1_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit(); + default -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit(); + }; unit1.setName("name1"); dataObject.addPersistenceUnit(unit1); PersistenceUnit unit2 = null; - if(Persistence.VERSION_3_2.equals(version)) { - unit2 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit(); - } else if(Persistence.VERSION_3_1.equals(version)) { + if(null == version) { unit2 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit(); - } else if(Persistence.VERSION_3_0.equals(version)) { - unit2 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit(); - } else if(Persistence.VERSION_2_2.equals(version)) { - unit2 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit(); - } else if(Persistence.VERSION_2_1.equals(version)) { - unit2 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit(); - } else if(Persistence.VERSION_2_0.equals(version)) { - unit2 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit(); - } else if(Persistence.VERSION_1_0.equals(version)) { - unit2 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit(); - } else { - unit2 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit(); - } + } else unit2 = switch (version) { + case Persistence.VERSION_4_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit(); + case Persistence.VERSION_3_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit(); + case Persistence.VERSION_3_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit(); + case Persistence.VERSION_3_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit(); + case Persistence.VERSION_2_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit(); + case Persistence.VERSION_2_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit(); + case Persistence.VERSION_2_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit(); + case Persistence.VERSION_1_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit(); + default -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit(); + }; unit2.setName("name1"); dataObject.addPersistenceUnit(unit2); PersistenceValidator validator = new PersistenceValidatorImpl(dataObject, false); @@ -101,23 +93,19 @@ public void testValidateExcludeUnlistedClasses(){ PersistenceValidator javaSEvalidator = new PersistenceValidatorImpl(dataObject, true); String version=dataObject.getPersistence().getVersion(); PersistenceUnit unit1 = null; - if(Persistence.VERSION_3_2.equals(version)) { - unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit(); - } else if(Persistence.VERSION_3_1.equals(version)) { + if(null == version) { unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit(); - } else if(Persistence.VERSION_3_0.equals(version)) { - unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit(); - } else if(Persistence.VERSION_2_2.equals(version)) { - unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit(); - } else if(Persistence.VERSION_2_1.equals(version)) { - unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit(); - } else if(Persistence.VERSION_2_0.equals(version)) { - unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit(); - } else if(Persistence.VERSION_1_0.equals(version)) { - unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit(); - } else { - unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit(); - } + } else unit1 = switch (version) { + case Persistence.VERSION_4_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit(); + case Persistence.VERSION_3_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit(); + case Persistence.VERSION_3_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit(); + case Persistence.VERSION_3_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit(); + case Persistence.VERSION_2_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit(); + case Persistence.VERSION_2_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit(); + case Persistence.VERSION_2_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit(); + case Persistence.VERSION_1_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit(); + default -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit(); + }; unit1.setName("unit1"); unit1.setExcludeUnlistedClasses(true); dataObject.addPersistenceUnit(unit1); @@ -139,23 +127,19 @@ public void testValidateJarFiles(){ PersistenceValidator javaSEvalidator = new PersistenceValidatorImpl(dataObject, true); String version=dataObject.getPersistence().getVersion(); PersistenceUnit unit1 = null; - if(Persistence.VERSION_3_2.equals(version)) { - unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit(); - } else if(Persistence.VERSION_3_1.equals(version)) { + if(null == version) { unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit(); - } else if(Persistence.VERSION_3_0.equals(version)) { - unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit(); - } else if(Persistence.VERSION_2_2.equals(version)) { - unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit(); - } else if(Persistence.VERSION_2_1.equals(version)) { - unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit(); - } else if(Persistence.VERSION_2_0.equals(version)) { - unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit(); - } else if(Persistence.VERSION_1_0.equals(version)) { - unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit(); - } else { - unit1 = new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit(); - } + } else unit1 = switch (version) { + case Persistence.VERSION_4_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_4_0.PersistenceUnit(); + case Persistence.VERSION_3_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_2.PersistenceUnit(); + case Persistence.VERSION_3_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit(); + case Persistence.VERSION_3_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_0.PersistenceUnit(); + case Persistence.VERSION_2_2 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_2.PersistenceUnit(); + case Persistence.VERSION_2_1 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_1.PersistenceUnit(); + case Persistence.VERSION_2_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_2_0.PersistenceUnit(); + case Persistence.VERSION_1_0 -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_1_0.PersistenceUnit(); + default -> new org.netbeans.modules.j2ee.persistence.dd.persistence.model_3_1.PersistenceUnit(); + }; unit1.setName("unit1"); unit1.addJarFile("my-jar.jar"); dataObject.addPersistenceUnit(unit1); diff --git a/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ignored-overlaps b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ignored-overlaps index 12e962c4c826..ebf8b9d31e0d 100644 --- a/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ignored-overlaps +++ b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ignored-overlaps @@ -102,6 +102,7 @@ ide/db.metadata.model/external/mysql-connector-j-8.0.31.jar ide/db.mysql/externa # Jakarta EE API doc is repackaged to align with old NetBeans format, embedded indexes are thus identically and can be ignored. enterprise/jakartaee10.platform/external/generated-jakarta.jakartaee-api-10.0.0-javadoc.jar enterprise/jakartaee10.platform/external/jakarta.jakartaee-api-10.0.0-javadoc.jar enterprise/jakartaee11.platform/external/generated-jakarta.jakartaee-api-11.0.0-javadoc.jar enterprise/jakartaee11.platform/external/jakarta.jakartaee-api-11.0.0-javadoc.jar +enterprise/jakartaee12.platform/external/generated-jakarta.jakartaee-api-12.0.0-javadoc.jar enterprise/jakartaee12.platform/external/jakarta.jakartaee-api-12.0.0-javadoc.jar # Jakarta Servlet API is used by both servletjspapi and websvc.restlib enterprise/servletjspapi/external/jakarta.servlet-api-4.0.4.jar enterprise/websvc.restlib/external/jakarta.servlet-api-4.0.4.jar diff --git a/nbbuild/cluster.properties b/nbbuild/cluster.properties index bbd52bc8c877..96255e931011 100644 --- a/nbbuild/cluster.properties +++ b/nbbuild/cluster.properties @@ -758,6 +758,8 @@ nb.cluster.enterprise=\ jakartaee10.platform,\ jakartaee11.api,\ jakartaee11.platform,\ + jakartaee12.api,\ + jakartaee12.platform,\ jakartaee8.api,\ jakartaee8.platform,\ jakartaee9.api,\ diff --git a/nbbuild/rat-exclusions.txt b/nbbuild/rat-exclusions.txt index 113d0a947505..909e5bd7e2e9 100644 --- a/nbbuild/rat-exclusions.txt +++ b/nbbuild/rat-exclusions.txt @@ -35,6 +35,7 @@ enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/application/model_8/* enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/application/model_9/* enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/application/model_10/* enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/application/model_11/* +enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/application/model_12/* enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/client/model_1_4/* enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/client/model_5_0/* enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/client/model_6_0/* @@ -43,11 +44,13 @@ enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/client/model_8_0/* enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/client/model_9_0/* enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/client/model_10_0/* enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/client/model_11_0/* +enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/client/model_12_0/* enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/ejb/model_2_1/* enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/ejb/model_3_0/* enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/ejb/model_3_1/* enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/ejb/model_3_2/* enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/ejb/model_4_0/* +enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/ejb/model_4_1/* enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/model_2_4/* enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/model_2_5/* enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/model_3_0/* @@ -56,12 +59,14 @@ enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/model_4_0/* enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/model_5_0/* enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/model_6_0/* enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/model_6_1/* +enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/model_6_2/* enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/model_3_0_frag/* enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/model_3_1_frag/* enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/model_4_0_frag/* enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/model_5_0_frag/* enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/model_6_0_frag/* enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/model_6_1_frag/* +enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/model_6_2_frag/* extide/gradle/netbeans-gradle-tooling/.gradle/** profiler/lib.profiler/release/BUILDINFO.txt webcommon/javascript2.jquery/external/jquery-api.xml