Skip to content

Commit

Permalink
Merge pull request apache#1539 from apache/master
Browse files Browse the repository at this point in the history
Sync master to release112 branch for beta2
  • Loading branch information
neilcsmith-net authored Oct 2, 2019
2 parents fc82d6f + 101c870 commit 86e1b2e
Show file tree
Hide file tree
Showing 40 changed files with 778 additions and 106 deletions.
30 changes: 30 additions & 0 deletions enterprise/glassfish.eecommon/licenseinfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
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.
-->

<licenseinfo>
<fileset>
<file>src/org/netbeans/modules/glassfish/eecommon/api/ddtemplates/javaee/glassfish-web.xml</file>
<license ref="EPL-v20" />
<comment type="TEMPLATE_MINIMAL_IP" />
</fileset>
</licenseinfo>
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ public static FileObject getSunDDFromProjectsModuleVersion(J2eeModule mod, Strin
// appcli 1.3, 1.4, 5.0, 6.0
// ear 1.3, 1.4, 5, 6
if (modVer.equals("6") || modVer.equals("6.0") || modVer.endsWith("1.6") || modVer.equals("3.1")) {
suffix = "-java_ee_6/";
suffix = "-java_ee/";
} else if (modVer.equals("3.0")) {
if (J2eeModule.Type.WAR.equals(t)) {
suffix = "-java_ee_6/";
suffix = "-java_ee/";
}
} else if (modVer.equals("1.4") || modVer.equals("2.4") || modVer.equals("2.1")) {
suffix = "-j2ee_1_4/";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ private static int[] versionToResourceFilesIndexes(
if (version == null) {
return new int[]{0,1};
}
// glassfish-resources.xml for v5
if (GlassFishVersion.ge(version, GlassFishVersion.GF_5) || GlassFishVersion.ge(version, GlassFishVersion.GF_5_1_0)) {
return new int[]{0};
}
// glassfish-resources.xml for v4
if (GlassFishVersion.ge(version, GlassFishVersion.GF_4)) {
return new int[]{0};
Expand Down Expand Up @@ -333,7 +337,7 @@ protected GlassfishConfiguration(
(J2EEVersion.J2EE_1_4.compareSpecification(j2eeVersion) >= 0) : false;
boolean isPreJavaEE6 = (j2eeVersion != null) ?
(J2EEVersion.JAVAEE_5_0.compareSpecification(j2eeVersion) >= 0) : false;
if (!primarySunDD.exists() && isPreJavaEE6) {
if (!primarySunDD.exists()) {
// If module is J2EE 1.4 (or 1.3), or this is a web app (where we have
// a default property even for JavaEE5), then copy the default template.
if (J2eeModule.Type.WAR.equals(mt) || isPreJavaEE5) {
Expand Down Expand Up @@ -545,7 +549,17 @@ protected ASDDVersion getInstalledAppServerVersion(File asInstallFolder) {

static ASDDVersion getInstalledAppServerVersionFromDirectory(File asInstallFolder) {
File dtdFolder = new File(asInstallFolder, "lib/dtds/"); // NOI18N
if (dtdFolder.exists()) {
File schemaFolder = new File(asInstallFolder, "lib/schemas");

boolean geGF5 = false;
if(schemaFolder.exists()){
if(new File(schemaFolder, "javaee_8.xsd").exists() &&
new File(dtdFolder, "glassfish-web-app_3_0-1.dtd").exists()){
geGF5 = true;
return ASDDVersion.GLASSFISH_5_1;
}
}
if (!geGF5 && dtdFolder.exists()) {
if (new File(dtdFolder, "glassfish-web-app_3_0-1.dtd").exists()) {
return ASDDVersion.SUN_APPSERVER_10_1;
}
Expand All @@ -569,7 +583,7 @@ static ASDDVersion getInstalledAppServerVersionFromDirectory(File asInstallFolde
return null;
}

// ------------------------------------------------------------------------
// ---------------------------------- --------------------------------------
// Access to V2/V3 specific information. Allows for graceful deprecation
// of unsupported features (e.g. CMP, etc.)
// ------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public File getSecondarySunDDFile(J2eeModule module) {
return secondarySunDDName != null ?
module.getDeploymentConfigurationFile(secondarySunDDName) : null;
}

public RootInterface getStandardRootDD(J2eeModule module) {
RootInterface stdRootDD = null;
if (standardDDName != null) {
Expand Down Expand Up @@ -177,7 +177,7 @@ public Webservices getWebServicesRootDD(J2eeModule module) {
public static class WebDDHelper extends J2eeModuleHelper {

private WebDDHelper() {
this(GF_WEB_XML_V1, null);
this(GF_WEB_XML_V2, null);
}

private WebDDHelper(String dd1, String dd2) {
Expand All @@ -200,6 +200,8 @@ protected ASDDVersion getMinASVersion(String j2eeModuleVersion, ASDDVersion defa
result = ASDDVersion.SUN_APPSERVER_9_0;
} else if (ServletVersion.SERVLET_3_0.equals(servletVersion)) {
result = ASDDVersion.SUN_APPSERVER_10_0;
} else if (ServletVersion.SERVLET_4_0.equals(servletVersion)) {
result = ASDDVersion.GLASSFISH_5_1;
}
return result;
}
Expand Down Expand Up @@ -228,6 +230,8 @@ protected ASDDVersion getMinASVersion(String j2eeModuleVersion, ASDDVersion defa
result = ASDDVersion.SUN_APPSERVER_9_0;
} else if (ServletVersion.SERVLET_3_0.equals(servletVersion)) {
result = ASDDVersion.SUN_APPSERVER_10_0;
} else if (ServletVersion.SERVLET_4_0.equals(servletVersion)) {
result = ASDDVersion.GLASSFISH_5_1;
}
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ public final class ServletVersion extends J2EEBaseVersion {
"3.0", 3000, // NOI18N
"6.0", 6000 // NOI18N
);

/** Represents servlet version 4.0
*/
public static final ServletVersion SERVLET_4_0 = new ServletVersion(
"4.0", 3000, // NOI18N
"6.0", 6000 // NOI18N
);

/** -----------------------------------------------------------------------
* Implementation
Expand Down Expand Up @@ -87,6 +94,8 @@ public static ServletVersion getServletVersion(String version) {
result = SERVLET_2_5;
} else if(SERVLET_3_0.toString().equals(version)) {
result = SERVLET_3_0;
} else if(SERVLET_4_0.toString().equals(version)) {
result = SERVLET_4_0;
}

return result;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 1997, 2018 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
-->
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app error-url="">
<class-loader delegate="true"/>
<jsp-config>
<property name="keepgenerated" value="true">
<description>Keep a copy of the generated servlet class' java code.</description>
</property>
</jsp-config>
</glassfish-web-app>
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<attr name="displayName" bundlevalue="org.netbeans.modules.glassfish.eecommon.Bundle#SunResourcesFolder"/>
</folder>
</folder>
<!-- <folder name="org-netbeans-modules-glassfish-eecommon-ddtemplates-j2ee_1_3">
<!-- <folder name="org-netbeans-modules-glassfish-eecommon-ddtemplates-j2ee_1_3">
<file name="sun-web.xml" url="api/ddtemplates/j2ee13/sun-web.xml"/>
<file name="sun-ejb-jar.xml" url="api/ddtemplates/j2ee13/sun-ejb-jar.xml"/>
<file name="sun-cmp-mappings.xml" url="api/ddtemplates/j2ee13/sun-cmp-mappings.xml"/>
Expand Down Expand Up @@ -71,20 +71,8 @@
<file name="weblogic-application-client.xml" url="api/ddtemplates/javaee5/weblogic-application-client.xml"/>
<file name="weblogic-application.xml" url="api/ddtemplates/javaee5/weblogic-application.xml"/>
<file name="weblogic-ejb-jar.xml" url="api/ddtemplates/javaee5/weblogic-ejb-jar.xml"/>
</folder-->
<folder name="org-netbeans-modules-glassfish-eecommon-ddtemplates-java_ee">
<file name="glassfish-web.xml" url="api/ddtemplates/javaee/glassfish-web.xml"/>
</folder>
<folder name="org-netbeans-modules-glassfish-eecommon-ddtemplates-java_ee_6">
<file name="sun-web.xml" url="api/ddtemplates/javaee6/sun-web.xml"/>
<file name="sun-ejb-jar.xml" url="api/ddtemplates/javaee6/sun-ejb-jar.xml"/>
<file name="sun-cmp-mappings.xml" url="api/ddtemplates/javaee6/sun-cmp-mappings.xml"/>
<file name="sun-application.xml" url="api/ddtemplates/javaee6/sun-application.xml"/>
<file name="sun-application-client.xml" url="api/ddtemplates/javaee6/sun-application-client.xml"/>
<file name="glassfish-web.xml" url="api/ddtemplates/javaee6/glassfish-web.xml"/>
<file name="glassfish-ejb-jar.xml" url="api/ddtemplates/javaee6/glassfish-ejb-jar.xml"/>
<file name="glassfish-application.xml" url="api/ddtemplates/javaee6/glassfish-application.xml"/>
<file name="glassfish-application-client.xml" url="api/ddtemplates/javaee6/glassfish-application-client.xml"/>
<file name="weblogic.xml" url="api/ddtemplates/javaee6/weblogic.xml"/>
<file name="weblogic-application-client.xml" url="api/ddtemplates/javaee6/weblogic-application-client.xml"/>
<file name="weblogic-application.xml" url="api/ddtemplates/javaee6/weblogic-application.xml"/>
<file name="weblogic-ejb-jar.xml" url="api/ddtemplates/javaee6/weblogic-ejb-jar.xml"/>
</folder>-->
</filesystem>
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,59 @@ public final class ASDDVersion {
601,
"GlassFish Server 3.1" // NOI18N
);

/** Represents GF Server 5.1
*/
public static final ASDDVersion GLASSFISH_5_0 = new ASDDVersion(
"5.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 5.0" // NOI18N
);
/** Represents GF Server 5.1
*/
public static final ASDDVersion GLASSFISH_5_1 = new ASDDVersion(
"5.1", 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 5.1" // NOI18N
);
/** Represents Sun Java System Web Server 7.0
*/
public static final ASDDVersion SUN_WEBSERVER_7_0 = new ASDDVersion(
Expand Down
Loading

0 comments on commit 86e1b2e

Please sign in to comment.