This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 223442
Collapse All | Expand All

(-)a/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/api/AppClientProjectGenerator.java (-4 / +2 lines)
Lines 434-441 Link Here
434
            }
434
            }
435
        }
435
        }
436
        Profile j2eeProfile = createData.getJavaEEProfile();
436
        Profile j2eeProfile = createData.getJavaEEProfile();
437
        if (j2eeProfile.equals(Profile.JAVA_EE_6_FULL) || j2eeProfile.equals(Profile.JAVA_EE_6_WEB) ||
437
        if (Util.isAtLeastJavaEE6Web(j2eeProfile)) {
438
                j2eeProfile.equals(Profile.JAVA_EE_7_FULL) || j2eeProfile.equals(Profile.JAVA_EE_7_WEB)) {
439
            if (rh.getProjectLibraryManager().getLibrary(Util.ENDORSED_LIBRARY_NAME) == null) { // NOI18N
438
            if (rh.getProjectLibraryManager().getLibrary(Util.ENDORSED_LIBRARY_NAME) == null) { // NOI18N
440
                rh.copyLibrary(LibraryManager.getDefault().getLibrary(Util.ENDORSED_LIBRARY_NAME)); // NOI18N
439
                rh.copyLibrary(LibraryManager.getDefault().getLibrary(Util.ENDORSED_LIBRARY_NAME)); // NOI18N
441
            }
440
            }
Lines 672-679 Link Here
672
            ep.put(AppClientProjectProperties.CLIENT_NAME, mainClassArgs);
671
            ep.put(AppClientProjectProperties.CLIENT_NAME, mainClassArgs);
673
        }
672
        }
674
673
675
        if (j2eeProfile.equals(Profile.JAVA_EE_6_FULL) || j2eeProfile.equals(Profile.JAVA_EE_6_WEB) ||
674
        if (Util.isAtLeastJavaEE6Web(j2eeProfile)) {
676
                j2eeProfile.equals(Profile.JAVA_EE_7_FULL) || j2eeProfile.equals(Profile.JAVA_EE_7_WEB)) {
677
            ep.setProperty(ProjectProperties.ENDORSED_CLASSPATH, new String[]{Util.ENDORSED_LIBRARY_CLASSPATH});
675
            ep.setProperty(ProjectProperties.ENDORSED_CLASSPATH, new String[]{Util.ENDORSED_LIBRARY_CLASSPATH});
678
        }
676
        }
679
677
(-)a/j2ee.common/manifest.mf (-1 / +1 lines)
Lines 2-6 Link Here
2
OpenIDE-Module: org.netbeans.modules.j2ee.common/1
2
OpenIDE-Module: org.netbeans.modules.j2ee.common/1
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/j2ee/common/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/j2ee/common/Bundle.properties
4
OpenIDE-Module-Needs: javax.script.ScriptEngine.freemarker
4
OpenIDE-Module-Needs: javax.script.ScriptEngine.freemarker
5
OpenIDE-Module-Specification-Version: 1.74
5
OpenIDE-Module-Specification-Version: 1.75
6
AutoUpdate-Show-In-Client: false
6
AutoUpdate-Show-In-Client: false
(-)a/j2ee.common/src/org/netbeans/modules/j2ee/common/Util.java (+112 lines)
Lines 228-233 Link Here
228
    }
228
    }
229
    
229
    
230
    /**
230
    /**
231
     * Find out if the version of the given profile is at least Java EE 5 or higher.
232
     *
233
     * @param profile profile that we want to compare
234
     * @return true if the version of the given profile is Java EE 5 or higher,
235
     *         false otherwise
236
     * @since 1.75
237
     */
238
    public static boolean isAtLeastJavaEE5(@NonNull Profile profile) {
239
        return isVersionEqualOrHigher(profile, Profile.JAVA_EE_5);
240
    }
241
242
    /**
243
     * Find out if the version of the given profile is at least Java EE 6 Web or
244
     * higher.
245
     *
246
     * @param profile profile that we want to compare
247
     * @return true if the version of the given profile is Java EE 6 Web or
248
     *         higher, false otherwise
249
     * @since 1.75
250
     */
251
    public static boolean isAtLeastJavaEE6Web(@NonNull Profile profile) {
252
        return isVersionEqualOrHigher(profile, Profile.JAVA_EE_6_WEB);
253
    }
254
255
    /**
256
     * Compares if the first given profile has equal or higher Java EE version
257
     * in comparison to the second profile.
258
     *
259
     * Please be aware of the following rules:
260
     * <br/><br/>
261
     *
262
     * 1) Each Java EE X version is considered as lower than Java EE X+1 version
263
     * (this applies regardless on Web/Full specification and in reality it means
264
     * that even Java EE 6 Full version is considered as lower than Java EE 7 Web)
265
     * <br/><br/>
266
     *
267
     * 2) Each Java EE X Web version is considered as lower than Java EE X Full
268
     * <br/>
269
     *
270
     * @param profileToCompare profile that we want to compare
271
     * @param comparingVersion version which we are comparing with
272
     * @return <code>true</code> if the profile version is equal or higher in
273
     *         comparison with the second one, <code>false</code> otherwise
274
     * @since 1.75
275
     */
276
    private static boolean isVersionEqualOrHigher(
277
            @NonNull Profile profileToCompare,
278
            @NonNull Profile comparingVersion) {
279
280
        int comparisonResult = Profile.UI_COMPARATOR.compare(profileToCompare, comparingVersion);
281
        if (comparisonResult == 0) {
282
            // The same version for both
283
            return true;
284
285
        } else {
286
            String profileToCompareVersion = getProfileVersion(profileToCompare);
287
            String comparingProfileVersion = getProfileVersion(comparingVersion);
288
289
            // If the canonicalName is the same value we have to differ between Web and Full profile
290
            if (profileToCompareVersion.equals(comparingProfileVersion)) {
291
                return compareWebAndFull(profileToCompare, comparingVersion);
292
            } else {
293
                if (comparisonResult > 0) {
294
                    // profileToCompare has lower version than comparingVersion
295
                    return false;
296
                } else {
297
                    return true;
298
                }
299
            }
300
        }
301
    }
302
303
    private static boolean compareWebAndFull(
304
            @NonNull Profile profileToCompare,
305
            @NonNull Profile comparingVersion) {
306
307
        boolean isThisFullProfile = isFullProfile(profileToCompare);
308
        boolean isParamFullProfile = isFullProfile(comparingVersion);
309
310
        if (isThisFullProfile && isParamFullProfile) {
311
            // Both profiles are Java EE Full
312
            return true;
313
        }
314
        if (!isThisFullProfile && !isParamFullProfile) {
315
            // Both profiles are Java EE Web
316
            return true;
317
        }
318
        if (isThisFullProfile && !isParamFullProfile) {
319
            // profileToCompare is Java EE Full profile and comparingVersion is only Java EEWeb profile
320
            return true;
321
        }
322
        return false;
323
    }
324
325
    private static String getProfileVersion(@NonNull Profile profile) {
326
        String profileDetails = profile.toPropertiesString();
327
        int indexOfDash = profileDetails.indexOf("-");
328
        if (indexOfDash != -1) {
329
            return profileDetails.substring(0, indexOfDash);
330
        }
331
        return profileDetails;
332
    }
333
334
    private static boolean isFullProfile(@NonNull Profile profile) {
335
        final String profileDetails = profile.toPropertiesString();
336
        if (profileDetails.indexOf("-") == -1) {
337
            return true;
338
        }
339
        return false;
340
    }
341
    
342
    /**
231
     * Returns source level of a given project
343
     * Returns source level of a given project
232
     *
344
     *
233
     * @param project Project
345
     * @param project Project
(-)a/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/DDHelper.java (-10 / +6 lines)
Lines 49-54 Link Here
49
import java.io.InputStreamReader;
49
import java.io.InputStreamReader;
50
import java.io.OutputStreamWriter;
50
import java.io.OutputStreamWriter;
51
import org.netbeans.api.j2ee.core.Profile;
51
import org.netbeans.api.j2ee.core.Profile;
52
import org.netbeans.modules.j2ee.common.Util;
52
import org.openide.filesystems.FileLock;
53
import org.openide.filesystems.FileLock;
53
import org.openide.filesystems.FileObject;
54
import org.openide.filesystems.FileObject;
54
import org.openide.filesystems.FileUtil;
55
import org.openide.filesystems.FileUtil;
Lines 85-92 Link Here
85
     */
86
     */
86
    public static FileObject createWebXml(Profile j2eeProfile, boolean webXmlRequired, FileObject dir) throws IOException {
87
    public static FileObject createWebXml(Profile j2eeProfile, boolean webXmlRequired, FileObject dir) throws IOException {
87
        String template = null;
88
        String template = null;
88
        if ((Profile.JAVA_EE_6_FULL == j2eeProfile || Profile.JAVA_EE_6_WEB == j2eeProfile ||
89
        if (Util.isAtLeastJavaEE6Web(j2eeProfile) && webXmlRequired) {
89
                Profile.JAVA_EE_7_FULL == j2eeProfile || Profile.JAVA_EE_7_WEB == j2eeProfile) && webXmlRequired) {
90
            template = "web-3.0.xml"; //NOI18N
90
            template = "web-3.0.xml"; //NOI18N
91
        } else if (Profile.JAVA_EE_5 == j2eeProfile) {
91
        } else if (Profile.JAVA_EE_5 == j2eeProfile) {
92
            template = "web-2.5.xml"; //NOI18N
92
            template = "web-2.5.xml"; //NOI18N
Lines 116-123 Link Here
116
     */
116
     */
117
    public static FileObject createWebFragmentXml(Profile j2eeProfile, FileObject dir) throws IOException {
117
    public static FileObject createWebFragmentXml(Profile j2eeProfile, FileObject dir) throws IOException {
118
        String template = null;
118
        String template = null;
119
        if (Profile.JAVA_EE_6_FULL == j2eeProfile || Profile.JAVA_EE_6_WEB == j2eeProfile ||
119
        if (Util.isAtLeastJavaEE6Web(j2eeProfile)) {
120
                Profile.JAVA_EE_7_FULL == j2eeProfile || Profile.JAVA_EE_7_WEB == j2eeProfile) {
121
            template = "web-fragment-3.0.xml"; //NOI18N
120
            template = "web-fragment-3.0.xml"; //NOI18N
122
        }
121
        }
123
122
Lines 155-162 Link Here
155
     */
154
     */
156
    public static FileObject createBeansXml(Profile j2eeProfile, FileObject dir, String name) throws IOException {
155
    public static FileObject createBeansXml(Profile j2eeProfile, FileObject dir, String name) throws IOException {
157
        String template = null;
156
        String template = null;
158
        if (Profile.JAVA_EE_6_FULL == j2eeProfile || Profile.JAVA_EE_6_WEB == j2eeProfile ||
157
        if (Util.isAtLeastJavaEE6Web(j2eeProfile)) {
159
                Profile.JAVA_EE_7_FULL == j2eeProfile || Profile.JAVA_EE_7_WEB == j2eeProfile) {
160
            template = "beans-1.0.xml"; //NOI18N
158
            template = "beans-1.0.xml"; //NOI18N
161
        }
159
        }
162
160
Lines 194-201 Link Here
194
     */
192
     */
195
    public static FileObject createValidationXml(Profile j2eeProfile, FileObject dir, String name) throws IOException {
193
    public static FileObject createValidationXml(Profile j2eeProfile, FileObject dir, String name) throws IOException {
196
        String template = null;
194
        String template = null;
197
        if (Profile.JAVA_EE_6_FULL == j2eeProfile || Profile.JAVA_EE_6_WEB == j2eeProfile ||
195
        if (Util.isAtLeastJavaEE6Web(j2eeProfile)) {
198
                Profile.JAVA_EE_7_FULL == j2eeProfile || Profile.JAVA_EE_7_WEB == j2eeProfile) {
199
            template = "validation.xml"; //NOI18N
196
            template = "validation.xml"; //NOI18N
200
        }
197
        }
201
198
Lines 233-240 Link Here
233
     */
230
     */
234
    public static FileObject createConstraintXml(Profile j2eeProfile, FileObject dir, String name) throws IOException {
231
    public static FileObject createConstraintXml(Profile j2eeProfile, FileObject dir, String name) throws IOException {
235
        String template = null;
232
        String template = null;
236
        if (Profile.JAVA_EE_6_FULL == j2eeProfile || Profile.JAVA_EE_6_WEB == j2eeProfile ||
233
        if (Util.isAtLeastJavaEE6Web(Profile.JAVA_EE_6_FULL)) {
237
                Profile.JAVA_EE_7_FULL == j2eeProfile || Profile.JAVA_EE_7_WEB == j2eeProfile) {
238
            template = "constraint.xml"; //NOI18N
234
            template = "constraint.xml"; //NOI18N
239
        }
235
        }
240
236
(-)a/j2ee.common/src/org/netbeans/modules/j2ee/common/project/ui/ProjectServerPanel.java (-2 / +2 lines)
Lines 73-78 Link Here
73
import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeApplicationProvider;
73
import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeApplicationProvider;
74
import org.netbeans.api.j2ee.core.Profile;
74
import org.netbeans.api.j2ee.core.Profile;
75
import org.netbeans.api.project.ant.AntArtifactQuery;
75
import org.netbeans.api.project.ant.AntArtifactQuery;
76
import org.netbeans.modules.j2ee.common.Util;
76
import org.netbeans.modules.j2ee.deployment.devmodules.api.ServerInstance;
77
import org.netbeans.modules.j2ee.deployment.devmodules.api.ServerInstance;
77
import org.netbeans.spi.project.support.ant.PropertyUtils;
78
import org.netbeans.spi.project.support.ant.PropertyUtils;
78
import org.openide.WizardDescriptor;
79
import org.openide.WizardDescriptor;
Lines 838-845 Link Here
838
            cdiCheckbox.setVisible(false);
839
            cdiCheckbox.setVisible(false);
839
            return;
840
            return;
840
        }
841
        }
841
        cdiCheckbox.setVisible(!importScenario && (j2ee.equals(Profile.JAVA_EE_6_FULL) || j2ee.equals(Profile.JAVA_EE_6_WEB) ||
842
        cdiCheckbox.setVisible(!importScenario && Util.isAtLeastJavaEE6Web(j2ee));
842
                j2ee.equals(Profile.JAVA_EE_7_FULL) || j2ee.equals(Profile.JAVA_EE_7_WEB)));
843
        String warningType = J2eeVersionWarningPanel.findWarningType(j2ee);
843
        String warningType = J2eeVersionWarningPanel.findWarningType(j2ee);
844
        if (warningType == null && warningPanel == null) {
844
        if (warningType == null && warningPanel == null) {
845
            warningPlaceHolderPanel.setVisible(false);
845
            warningPlaceHolderPanel.setVisible(false);
(-)a/j2ee.common/test/unit/src/org/netbeans/modules/j2ee/common/UtilTest.java (-2 / +22 lines)
Lines 51-59 Link Here
51
import java.util.Arrays;
51
import java.util.Arrays;
52
import java.util.LinkedList;
52
import java.util.LinkedList;
53
import java.util.List;
53
import java.util.List;
54
import org.netbeans.junit.Manager;
54
import org.netbeans.api.j2ee.core.Profile;
55
import org.netbeans.junit.NbTestCase;
55
import org.netbeans.junit.NbTestCase;
56
import org.netbeans.modules.j2ee.common.Util;
57
import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule;
56
import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule;
58
import org.openide.filesystems.FileUtil;
57
import org.openide.filesystems.FileUtil;
59
58
Lines 68-73 Link Here
68
        super(testName);
67
        super(testName);
69
    }
68
    }
70
    
69
    
70
    public void testIsHigherJavaEEVersionJavaEE5() {
71
        assertFalse(Util.isAtLeastJavaEE5(Profile.J2EE_13));
72
        assertFalse(Util.isAtLeastJavaEE5(Profile.J2EE_14));
73
74
        assertTrue(Util.isAtLeastJavaEE5(Profile.JAVA_EE_5));
75
        assertTrue(Util.isAtLeastJavaEE5(Profile.JAVA_EE_6_FULL));
76
        assertTrue(Util.isAtLeastJavaEE5(Profile.JAVA_EE_6_WEB));
77
        assertTrue(Util.isAtLeastJavaEE5(Profile.JAVA_EE_7_FULL));
78
        assertTrue(Util.isAtLeastJavaEE5(Profile.JAVA_EE_7_WEB));
79
    }
80
81
    public void testIsHigherJavaEEVersionJavaEE6full() {
82
        assertFalse(Util.isAtLeastJavaEE6Web(Profile.J2EE_13));
83
        assertFalse(Util.isAtLeastJavaEE6Web(Profile.J2EE_14));
84
        assertFalse(Util.isAtLeastJavaEE6Web(Profile.JAVA_EE_5));
85
86
        assertTrue(Util.isAtLeastJavaEE6Web(Profile.JAVA_EE_6_WEB));
87
        assertTrue(Util.isAtLeastJavaEE6Web(Profile.JAVA_EE_6_FULL));
88
        assertTrue(Util.isAtLeastJavaEE6Web(Profile.JAVA_EE_7_WEB));
89
        assertTrue(Util.isAtLeastJavaEE6Web(Profile.JAVA_EE_7_FULL));
90
    }
71
    
91
    
72
    public void testContainsClass() throws IOException {
92
    public void testContainsClass() throws IOException {
73
        File dataDir = getDataDir();
93
        File dataDir = getDataDir();
(-)a/j2ee.earproject/src/org/netbeans/modules/j2ee/earproject/EarProjectGenerator.java (-6 / +3 lines)
Lines 233-240 Link Here
233
            SharabilityUtility.createLibrary(
233
            SharabilityUtility.createLibrary(
234
                h.resolveFile(h.getLibrariesLocation()), serverlibraryName, serverInstanceId);
234
                h.resolveFile(h.getLibrariesLocation()), serverlibraryName, serverInstanceId);
235
        }
235
        }
236
        if (j2eeProfile.equals(Profile.JAVA_EE_6_FULL) || j2eeProfile.equals(Profile.JAVA_EE_6_WEB) ||
236
        if (Util.isAtLeastJavaEE6Web(j2eeProfile)) {
237
                j2eeProfile.equals(Profile.JAVA_EE_7_FULL) || j2eeProfile.equals(Profile.JAVA_EE_7_WEB)) {
238
            if (rh.getProjectLibraryManager().getLibrary(Util.ENDORSED_LIBRARY_NAME) == null) { // NOI18N
237
            if (rh.getProjectLibraryManager().getLibrary(Util.ENDORSED_LIBRARY_NAME) == null) { // NOI18N
239
                rh.copyLibrary(LibraryManager.getDefault().getLibrary(Util.ENDORSED_LIBRARY_NAME)); // NOI18N
238
                rh.copyLibrary(LibraryManager.getDefault().getLibrary(Util.ENDORSED_LIBRARY_NAME)); // NOI18N
240
            }
239
            }
Lines 526-533 Link Here
526
            } else if (Profile.JAVA_EE_5.equals(j2eeProfile)) {
525
            } else if (Profile.JAVA_EE_5.equals(j2eeProfile)) {
527
                template = FileUtil.getConfigFile(
526
                template = FileUtil.getConfigFile(
528
                        "org-netbeans-modules-j2ee-earproject/ear-5.xml"); // NOI18N
527
                        "org-netbeans-modules-j2ee-earproject/ear-5.xml"); // NOI18N
529
            } else if (Profile.JAVA_EE_6_FULL.equals(j2eeProfile) || Profile.JAVA_EE_6_WEB.equals(j2eeProfile) ||
528
            } else if (Util.isAtLeastJavaEE6Web(j2eeProfile)) {
530
                    Profile.JAVA_EE_7_FULL.equals(j2eeProfile) || Profile.JAVA_EE_7_WEB.equals(j2eeProfile)) {
531
                template = FileUtil.getConfigFile(
529
                template = FileUtil.getConfigFile(
532
                        "org-netbeans-modules-j2ee-earproject/ear-6.xml"); // NOI18N
530
                        "org-netbeans-modules-j2ee-earproject/ear-6.xml"); // NOI18N
533
            } else {
531
            } else {
Lines 646-653 Link Here
646
                EarProjectProperties.JAR_CONTENT_ADDITIONAL+"}:${"+ // NOI18N
644
                EarProjectProperties.JAR_CONTENT_ADDITIONAL+"}:${"+ // NOI18N
647
                EarProjectProperties.RUN_CLASSPATH+"}"); // NOI18N
645
                EarProjectProperties.RUN_CLASSPATH+"}"); // NOI18N
648
646
649
        if (j2eeProfile.equals(Profile.JAVA_EE_6_FULL) || j2eeProfile.equals(Profile.JAVA_EE_6_WEB) ||
647
        if (Util.isAtLeastJavaEE6Web(j2eeProfile)) {
650
                j2eeProfile.equals(Profile.JAVA_EE_7_FULL) || j2eeProfile.equals(Profile.JAVA_EE_7_WEB)) {
651
            ep.setProperty(ProjectProperties.ENDORSED_CLASSPATH, new String[]{Util.ENDORSED_LIBRARY_CLASSPATH});
648
            ep.setProperty(ProjectProperties.ENDORSED_CLASSPATH, new String[]{Util.ENDORSED_LIBRARY_CLASSPATH});
652
        }
649
        }
653
        
650
        
(-)a/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/Utils.java (-2 / +2 lines)
Lines 76-81 Link Here
76
import org.netbeans.api.project.FileOwnerQuery;
76
import org.netbeans.api.project.FileOwnerQuery;
77
import org.netbeans.api.project.Project;
77
import org.netbeans.api.project.Project;
78
import org.netbeans.modules.j2ee.common.J2eeProjectCapabilities;
78
import org.netbeans.modules.j2ee.common.J2eeProjectCapabilities;
79
import org.netbeans.modules.j2ee.common.Util;
79
import org.netbeans.modules.j2ee.dd.api.ejb.EjbJarMetadata;
80
import org.netbeans.modules.j2ee.dd.api.ejb.EjbJarMetadata;
80
import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeApplicationProvider;
81
import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeApplicationProvider;
81
import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleProvider;
82
import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleProvider;
Lines 270-277 Link Here
270
                    Profile profile = ejbJars.length > 0 ? ejbJars[0].getJ2eeProfile() : null;
271
                    Profile profile = ejbJars.length > 0 ? ejbJars[0].getJ2eeProfile() : null;
271
272
272
                    if (J2eeModule.Type.EJB.equals(type) || (J2eeModule.Type.WAR.equals(type) &&
273
                    if (J2eeModule.Type.EJB.equals(type) || (J2eeModule.Type.WAR.equals(type) &&
273
                                (Profile.JAVA_EE_6_WEB.equals(profile) || Profile.JAVA_EE_6_FULL.equals(profile) ||
274
                                Util.isAtLeastJavaEE6Web(profile))){
274
                                Profile.JAVA_EE_7_WEB.equals(profile) || Profile.JAVA_EE_7_FULL.equals(profile)))){
275
                        isEJBModule = true;
275
                        isEJBModule = true;
276
                    }
276
                    }
277
            }
277
            }
(-)a/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/jpa/dao/AppServerValidationPanel.java (-2 / +1 lines)
Lines 78-85 Link Here
78
        }
78
        }
79
79
80
        WebModule wm = WebModule.getWebModule(project.getProjectDirectory());
80
        WebModule wm = WebModule.getWebModule(project.getProjectDirectory());
81
        if (wm != null && (wm.getJ2eeProfile() == Profile.JAVA_EE_6_FULL || wm.getJ2eeProfile() == Profile.JAVA_EE_6_WEB ||
81
        if (wm != null && Util.isAtLeastJavaEE6Web(wm.getJ2eeProfile())) {
82
                wm.getJ2eeProfile() == Profile.JAVA_EE_7_FULL || wm.getJ2eeProfile() == Profile.JAVA_EE_7_WEB)) {
83
            // check that server is EJB lite sufficient
82
            // check that server is EJB lite sufficient
84
            EjbSupport ejbSupport = EjbSupport.getInstance(j2eePlatform);
83
            EjbSupport ejbSupport = EjbSupport.getInstance(j2eePlatform);
85
            if (!ejbSupport.isEjb31LiteSupported(j2eePlatform)) {
84
            if (!ejbSupport.isEjb31LiteSupported(j2eePlatform)) {
(-)a/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/jpa/dao/EjbFacadeVisualPanel2.java (-8 / +2 lines)
Lines 42-49 Link Here
42
package org.netbeans.modules.j2ee.ejbcore.ejb.wizard.jpa.dao;
42
package org.netbeans.modules.j2ee.ejbcore.ejb.wizard.jpa.dao;
43
43
44
import java.awt.Component;
44
import java.awt.Component;
45
import java.awt.event.ActionEvent;
46
import java.awt.event.ActionListener;
47
import java.io.IOException;
45
import java.io.IOException;
48
import java.util.List;
46
import java.util.List;
49
import java.util.logging.Level;
47
import java.util.logging.Level;
Lines 58-69 Link Here
58
import javax.swing.event.DocumentListener;
56
import javax.swing.event.DocumentListener;
59
import javax.swing.text.Document;
57
import javax.swing.text.Document;
60
import javax.swing.text.JTextComponent;
58
import javax.swing.text.JTextComponent;
61
import org.netbeans.api.j2ee.core.Profile;
62
import org.netbeans.api.project.Project;
59
import org.netbeans.api.project.Project;
63
import org.netbeans.api.project.ProjectUtils;
60
import org.netbeans.api.project.ProjectUtils;
64
import org.netbeans.api.project.SourceGroup;
61
import org.netbeans.api.project.SourceGroup;
65
import org.netbeans.modules.j2ee.common.J2eeProjectCapabilities;
62
import org.netbeans.modules.j2ee.common.J2eeProjectCapabilities;
66
import org.netbeans.modules.j2ee.common.Util;
67
import org.netbeans.modules.j2ee.core.api.support.SourceGroups;
63
import org.netbeans.modules.j2ee.core.api.support.SourceGroups;
68
import org.netbeans.modules.j2ee.ejbcore.ejb.wizard.session.SessionEJBWizardPanel;
64
import org.netbeans.modules.j2ee.ejbcore.ejb.wizard.session.SessionEJBWizardPanel;
69
import org.netbeans.modules.j2ee.persistence.wizard.fromdb.SourceGroupUISupport;
65
import org.netbeans.modules.j2ee.persistence.wizard.fromdb.SourceGroupUISupport;
Lines 96-105 Link Here
96
        handleCheckboxes();
92
        handleCheckboxes();
97
        
93
        
98
        J2eeProjectCapabilities projectCap = J2eeProjectCapabilities.forProject(project);
94
        J2eeProjectCapabilities projectCap = J2eeProjectCapabilities.forProject(project);
99
        if (projectCap.isEjb31LiteSupported()){
95
        if (projectCap != null && projectCap.isEjb31LiteSupported()){
100
            boolean serverSupportsEJB31 = Util.getSupportedProfiles(project).contains(Profile.JAVA_EE_6_FULL) ||
96
            if (!projectCap.isEjb31Supported()){
101
                    Util.getSupportedProfiles(project).contains(Profile.JAVA_EE_7_FULL);
102
            if (!projectCap.isEjb31Supported() && !serverSupportsEJB31){
103
                remoteCheckBox.setVisible(false);
97
                remoteCheckBox.setVisible(false);
104
                remoteCheckBox.setEnabled(false);
98
                remoteCheckBox.setEnabled(false);
105
            }
99
            }
(-)a/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/mdb/MessageEJBWizard.java (-5 / +2 lines)
Lines 54-59 Link Here
54
import org.netbeans.api.project.Project;
54
import org.netbeans.api.project.Project;
55
import org.netbeans.api.project.SourceGroup;
55
import org.netbeans.api.project.SourceGroup;
56
import org.netbeans.modules.j2ee.api.ejbjar.EjbJar;
56
import org.netbeans.modules.j2ee.api.ejbjar.EjbJar;
57
import org.netbeans.modules.j2ee.common.Util;
57
import org.netbeans.spi.project.ui.templates.support.Templates;
58
import org.netbeans.spi.project.ui.templates.support.Templates;
58
import org.openide.filesystems.FileObject;
59
import org.openide.filesystems.FileObject;
59
import org.netbeans.modules.j2ee.core.api.support.SourceGroups;
60
import org.netbeans.modules.j2ee.core.api.support.SourceGroups;
Lines 103-113 Link Here
103
        
104
        
104
        // TODO: UI - add checkbox for Java EE 5 to create also EJB 2.1 style EJBs
105
        // TODO: UI - add checkbox for Java EE 5 to create also EJB 2.1 style EJBs
105
        Profile profile = ejbModule.getJ2eeProfile();
106
        Profile profile = ejbModule.getJ2eeProfile();
106
        boolean isSimplified = Profile.JAVA_EE_5.equals(profile) ||
107
        boolean isSimplified = Util.isAtLeastJavaEE5(profile);
107
                               Profile.JAVA_EE_6_FULL.equals(profile) ||
108
                               Profile.JAVA_EE_6_WEB.equals(profile) ||
109
                               Profile.JAVA_EE_7_FULL.equals(profile) ||
110
                               Profile.JAVA_EE_7_WEB.equals(profile);
111
        MessageGenerator generator = MessageGenerator.create(
108
        MessageGenerator generator = MessageGenerator.create(
112
                Templates.getTargetName(wiz),
109
                Templates.getTargetName(wiz),
113
                pkg,
110
                pkg,
(-)a/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/SessionEJBWizard.java (-2 / +2 lines)
Lines 54-59 Link Here
54
import org.netbeans.api.project.Project;
54
import org.netbeans.api.project.Project;
55
import org.netbeans.api.project.SourceGroup;
55
import org.netbeans.api.project.SourceGroup;
56
import org.netbeans.modules.j2ee.api.ejbjar.EjbJar;
56
import org.netbeans.modules.j2ee.api.ejbjar.EjbJar;
57
import org.netbeans.modules.j2ee.common.Util;
57
import org.netbeans.spi.project.ui.templates.support.Templates;
58
import org.netbeans.spi.project.ui.templates.support.Templates;
58
import org.openide.filesystems.FileObject;
59
import org.openide.filesystems.FileObject;
59
import org.netbeans.modules.j2ee.core.api.support.SourceGroups;
60
import org.netbeans.modules.j2ee.core.api.support.SourceGroups;
Lines 113-120 Link Here
113
        EjbJar ejbModule = EjbJar.getEjbJar(pkg);
114
        EjbJar ejbModule = EjbJar.getEjbJar(pkg);
114
        // TODO: UI - add checkbox for Java EE 5 to create also EJB 2.1 style EJBs
115
        // TODO: UI - add checkbox for Java EE 5 to create also EJB 2.1 style EJBs
115
        Profile profile = ejbModule.getJ2eeProfile();
116
        Profile profile = ejbModule.getJ2eeProfile();
116
        boolean isSimplified = Profile.JAVA_EE_5.equals(profile) || Profile.JAVA_EE_6_FULL.equals(profile) || Profile.JAVA_EE_6_WEB.equals(profile) ||
117
        boolean isSimplified = Util.isAtLeastJavaEE5(profile);
117
                 Profile.JAVA_EE_7_FULL.equals(profile) || Profile.JAVA_EE_7_WEB.equals(profile);
118
        SessionGenerator sessionGenerator = SessionGenerator.create(
118
        SessionGenerator sessionGenerator = SessionGenerator.create(
119
                Templates.getTargetName(wiz), 
119
                Templates.getTargetName(wiz), 
120
                pkg, 
120
                pkg, 
(-)a/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/SessionEJBWizardPanel.java (-6 / +2 lines)
Lines 61-67 Link Here
61
import javax.swing.event.ChangeListener;
61
import javax.swing.event.ChangeListener;
62
import javax.swing.event.DocumentEvent;
62
import javax.swing.event.DocumentEvent;
63
import javax.swing.event.DocumentListener;
63
import javax.swing.event.DocumentListener;
64
import org.netbeans.api.j2ee.core.Profile;
65
import org.netbeans.api.java.classpath.ClassPath;
64
import org.netbeans.api.java.classpath.ClassPath;
66
import org.netbeans.api.java.project.JavaProjectConstants;
65
import org.netbeans.api.java.project.JavaProjectConstants;
67
import org.netbeans.api.java.queries.SourceForBinaryQuery;
66
import org.netbeans.api.java.queries.SourceForBinaryQuery;
Lines 72-78 Link Here
72
import org.netbeans.api.project.ant.AntArtifactQuery;
71
import org.netbeans.api.project.ant.AntArtifactQuery;
73
import org.netbeans.api.project.ui.OpenProjects;
72
import org.netbeans.api.project.ui.OpenProjects;
74
import org.netbeans.modules.j2ee.common.J2eeProjectCapabilities;
73
import org.netbeans.modules.j2ee.common.J2eeProjectCapabilities;
75
import org.netbeans.modules.j2ee.common.Util;
76
import org.netbeans.modules.j2ee.dd.api.ejb.Session;
74
import org.netbeans.modules.j2ee.dd.api.ejb.Session;
77
import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleProvider;
75
import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleProvider;
78
import org.netbeans.spi.project.ant.AntArtifactProvider;
76
import org.netbeans.spi.project.ant.AntArtifactProvider;
Lines 99-108 Link Here
99
        initComponents();
97
        initComponents();
100
98
101
        J2eeProjectCapabilities projectCap = J2eeProjectCapabilities.forProject(project);
99
        J2eeProjectCapabilities projectCap = J2eeProjectCapabilities.forProject(project);
102
        if (projectCap.isEjb31LiteSupported()){
100
        if (projectCap != null && projectCap.isEjb31LiteSupported()){
103
            boolean serverSupportsEJB31 = Util.getSupportedProfiles(project).contains(Profile.JAVA_EE_6_FULL) ||
101
            if (!projectCap.isEjb31Supported()){
104
                    Util.getSupportedProfiles(project).contains(Profile.JAVA_EE_7_FULL);
105
            if (!projectCap.isEjb31Supported() && !serverSupportsEJB31){
106
                remoteCheckBox.setVisible(false);
102
                remoteCheckBox.setVisible(false);
107
                remoteCheckBox.setEnabled(false);
103
                remoteCheckBox.setEnabled(false);
108
            }
104
            }
(-)a/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ui/logicalview/ejb/shared/EjbViewController.java (-7 / +2 lines)
Lines 55-61 Link Here
55
import org.netbeans.api.java.source.ElementHandle;
55
import org.netbeans.api.java.source.ElementHandle;
56
import org.netbeans.api.java.source.SourceUtils;
56
import org.netbeans.api.java.source.SourceUtils;
57
import org.netbeans.modules.j2ee.api.ejbjar.EjbReference;
57
import org.netbeans.modules.j2ee.api.ejbjar.EjbReference;
58
import org.netbeans.modules.j2ee.dd.api.common.EjbRef;
58
import org.netbeans.modules.j2ee.common.Util;
59
import org.netbeans.modules.j2ee.dd.api.ejb.AssemblyDescriptor;
59
import org.netbeans.modules.j2ee.dd.api.ejb.AssemblyDescriptor;
60
import org.netbeans.modules.j2ee.dd.api.ejb.ContainerTransaction;
60
import org.netbeans.modules.j2ee.dd.api.ejb.ContainerTransaction;
61
import org.netbeans.modules.j2ee.dd.api.ejb.DDProvider;
61
import org.netbeans.modules.j2ee.dd.api.ejb.DDProvider;
Lines 65-71 Link Here
65
import org.netbeans.modules.j2ee.dd.api.ejb.EjbRelation;
65
import org.netbeans.modules.j2ee.dd.api.ejb.EjbRelation;
66
import org.netbeans.modules.j2ee.dd.api.ejb.EjbRelationshipRole;
66
import org.netbeans.modules.j2ee.dd.api.ejb.EjbRelationshipRole;
67
import org.netbeans.modules.j2ee.dd.api.ejb.EnterpriseBeans;
67
import org.netbeans.modules.j2ee.dd.api.ejb.EnterpriseBeans;
68
import org.netbeans.modules.j2ee.dd.api.ejb.Entity;
69
import org.netbeans.modules.j2ee.dd.api.ejb.EntityAndSession;
68
import org.netbeans.modules.j2ee.dd.api.ejb.EntityAndSession;
70
import org.netbeans.modules.j2ee.dd.api.ejb.Method;
69
import org.netbeans.modules.j2ee.dd.api.ejb.Method;
71
import org.netbeans.modules.j2ee.dd.api.ejb.MethodPermission;
70
import org.netbeans.modules.j2ee.dd.api.ejb.MethodPermission;
Lines 129-139 Link Here
129
    public void delete(boolean deleteClasses) throws IOException {
128
    public void delete(boolean deleteClasses) throws IOException {
130
129
131
        Profile profile = ejbModule.getJ2eeProfile();
130
        Profile profile = ejbModule.getJ2eeProfile();
132
        boolean isEE5orEE6or7 = Profile.JAVA_EE_5.equals(profile) ||
131
        boolean isEE5orEE6or7 = Util.isAtLeastJavaEE5(profile);
133
                             Profile.JAVA_EE_6_FULL.equals(profile) ||
134
                             Profile.JAVA_EE_6_WEB.equals(profile) ||
135
                             Profile.JAVA_EE_7_FULL.equals(profile) ||
136
                             Profile.JAVA_EE_7_WEB.equals(profile);
137
132
138
        if (!isEE5orEE6or7) {
133
        if (!isEE5orEE6or7) {
139
            ejbModule.getMetadataModel().runReadAction(new MetadataModelAction<EjbJarMetadata, Void>() {
134
            ejbModule.getMetadataModel().runReadAction(new MetadataModelAction<EjbJarMetadata, Void>() {
(-)a/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/EjbJarProvider.java (-2 / +2 lines)
Lines 56-61 Link Here
56
import org.netbeans.api.project.SourceGroup;
56
import org.netbeans.api.project.SourceGroup;
57
import org.netbeans.api.project.Sources;
57
import org.netbeans.api.project.Sources;
58
import org.netbeans.api.project.ui.OpenProjects;
58
import org.netbeans.api.project.ui.OpenProjects;
59
import org.netbeans.modules.j2ee.common.Util;
59
import org.netbeans.modules.java.api.common.classpath.ClassPathProviderImpl;
60
import org.netbeans.modules.java.api.common.classpath.ClassPathProviderImpl;
60
import org.netbeans.modules.j2ee.dd.api.ejb.EjbJarMetadata;
61
import org.netbeans.modules.j2ee.dd.api.ejb.EjbJarMetadata;
61
import org.netbeans.modules.j2ee.dd.api.webservices.WebservicesMetadata;
62
import org.netbeans.modules.j2ee.dd.api.webservices.WebservicesMetadata;
Lines 313-320 Link Here
313
        if (platformVersion == null) {
314
        if (platformVersion == null) {
314
            platformVersion = Profile.JAVA_EE_6_FULL;
315
            platformVersion = Profile.JAVA_EE_6_FULL;
315
        }
316
        }
316
        if (Profile.JAVA_EE_6_FULL.equals(platformVersion) || Profile.JAVA_EE_6_WEB.equals(platformVersion) ||
317
        if (Util.isAtLeastJavaEE6Web(platformVersion)) {
317
                Profile.JAVA_EE_7_FULL.equals(platformVersion) || Profile.JAVA_EE_7_WEB.equals(platformVersion)) {
318
            return EjbJar.VERSION_3_1;
318
            return EjbJar.VERSION_3_1;
319
        } else if (Profile.JAVA_EE_5.equals(platformVersion)) {
319
        } else if (Profile.JAVA_EE_5.equals(platformVersion)) {
320
            return EjbJar.VERSION_3_0;
320
            return EjbJar.VERSION_3_0;
(-)a/j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/api/EjbJarProjectGenerator.java (-6 / +3 lines)
Lines 205-212 Link Here
205
        
205
        
206
        // create ejb-jar.xml
206
        // create ejb-jar.xml
207
        Profile profile = createData.getJavaEEProfile();
207
        Profile profile = createData.getJavaEEProfile();
208
        if (!Profile.JAVA_EE_5.equals(profile) && !Profile.JAVA_EE_6_FULL.equals(profile) && !Profile.JAVA_EE_6_WEB.equals(profile) &&
208
        if (!Util.isAtLeastJavaEE5(profile)) {
209
                !Profile.JAVA_EE_7_FULL.equals(profile) && !Profile.JAVA_EE_7_WEB.equals(profile)) {
210
            String resource = "org-netbeans-modules-j2ee-ejbjarproject/ejb-jar-2.1.xml";
209
            String resource = "org-netbeans-modules-j2ee-ejbjarproject/ejb-jar-2.1.xml";
211
            FileObject ddFile = FileUtil.copyFile(FileUtil.getConfigFile(resource), confRoot, "ejb-jar"); //NOI18N
210
            FileObject ddFile = FileUtil.copyFile(FileUtil.getConfigFile(resource), confRoot, "ejb-jar"); //NOI18N
212
            EjbJar ejbJar = DDProvider.getDefault().getDDRoot(ddFile);
211
            EjbJar ejbJar = DDProvider.getDefault().getDDRoot(ddFile);
Lines 435-442 Link Here
435
            }
434
            }
436
        }
435
        }
437
        Profile j2eeProfile = data.getJavaEEProfile();
436
        Profile j2eeProfile = data.getJavaEEProfile();
438
        if (j2eeProfile.equals(Profile.JAVA_EE_6_FULL) || j2eeProfile.equals(Profile.JAVA_EE_6_WEB) ||
437
        if (Util.isAtLeastJavaEE6Web(j2eeProfile)) {
439
                j2eeProfile.equals(Profile.JAVA_EE_7_FULL) || j2eeProfile.equals(Profile.JAVA_EE_7_WEB)) {
440
            if (rh.getProjectLibraryManager().getLibrary(Util.ENDORSED_LIBRARY_NAME) == null) { // NOI18N
438
            if (rh.getProjectLibraryManager().getLibrary(Util.ENDORSED_LIBRARY_NAME) == null) { // NOI18N
441
                rh.copyLibrary(LibraryManager.getDefault().getLibrary(Util.ENDORSED_LIBRARY_NAME)); // NOI18N
439
                rh.copyLibrary(LibraryManager.getDefault().getLibrary(Util.ENDORSED_LIBRARY_NAME)); // NOI18N
442
            }
440
            }
Lines 618-625 Link Here
618
        Charset enc = FileEncodingQuery.getDefaultEncoding();
616
        Charset enc = FileEncodingQuery.getDefaultEncoding();
619
        ep.setProperty(EjbJarProjectProperties.SOURCE_ENCODING, enc.name());
617
        ep.setProperty(EjbJarProjectProperties.SOURCE_ENCODING, enc.name());
620
        
618
        
621
        if (j2eeProfile.equals(Profile.JAVA_EE_6_FULL) || j2eeProfile.equals(Profile.JAVA_EE_6_WEB) ||
619
        if (Util.isAtLeastJavaEE6Web(j2eeProfile)) {
622
                j2eeProfile.equals(Profile.JAVA_EE_7_FULL) || j2eeProfile.equals(Profile.JAVA_EE_7_WEB)) {
623
            ep.setProperty(ProjectProperties.ENDORSED_CLASSPATH, new String[]{Util.ENDORSED_LIBRARY_CLASSPATH});
620
            ep.setProperty(ProjectProperties.ENDORSED_CLASSPATH, new String[]{Util.ENDORSED_LIBRARY_CLASSPATH});
624
        }
621
        }
625
        
622
        
(-)a/web.project/src/org/netbeans/modules/web/project/ProjectWebModule.java (-2 / +2 lines)
Lines 58-63 Link Here
58
import org.netbeans.api.project.SourceGroup;
58
import org.netbeans.api.project.SourceGroup;
59
import org.netbeans.api.project.Sources;
59
import org.netbeans.api.project.Sources;
60
import org.netbeans.api.project.ui.OpenProjects;
60
import org.netbeans.api.project.ui.OpenProjects;
61
import org.netbeans.modules.j2ee.common.Util;
61
import org.netbeans.modules.j2ee.dd.api.web.WebApp;
62
import org.netbeans.modules.j2ee.dd.api.web.WebApp;
62
import org.netbeans.modules.j2ee.dd.api.web.WebAppMetadata;
63
import org.netbeans.modules.j2ee.dd.api.web.WebAppMetadata;
63
import org.netbeans.modules.j2ee.dd.api.webservices.WebservicesMetadata;
64
import org.netbeans.modules.j2ee.dd.api.webservices.WebservicesMetadata;
Lines 592-599 Link Here
592
    public String getModuleVersion () {
593
    public String getModuleVersion () {
593
        // return a version based on the Java EE version
594
        // return a version based on the Java EE version
594
        Profile platformVersion = getJ2eeProfile();
595
        Profile platformVersion = getJ2eeProfile();
595
        if (Profile.JAVA_EE_6_FULL.equals(platformVersion) || Profile.JAVA_EE_6_WEB.equals(platformVersion) ||
596
        if (Util.isAtLeastJavaEE6Web(platformVersion)) {
596
                Profile.JAVA_EE_7_FULL.equals(platformVersion) || Profile.JAVA_EE_7_WEB.equals(platformVersion)) {
597
            return WebApp.VERSION_3_0;
597
            return WebApp.VERSION_3_0;
598
        } else if (Profile.JAVA_EE_5.equals(platformVersion)) {
598
        } else if (Profile.JAVA_EE_5.equals(platformVersion)) {
599
            return WebApp.VERSION_2_5;
599
            return WebApp.VERSION_2_5;
(-)a/web.project/src/org/netbeans/modules/web/project/WebProject.java (-7 / +3 lines)
Lines 1421-1427 Link Here
1421
        private boolean checked = false;
1421
        private boolean checked = false;
1422
        private boolean isArchive = false;
1422
        private boolean isArchive = false;
1423
        private boolean isEE5 = false;
1423
        private boolean isEE5 = false;
1424
        private boolean serverSupportsEJB31 = false;
1425
1424
1426
        public String[] getRecommendedTypes() {
1425
        public String[] getRecommendedTypes() {
1427
            checkEnvironment();
1426
            checkEnvironment();
Lines 1429-1435 Link Here
1429
                return TYPES_ARCHIVE;
1428
                return TYPES_ARCHIVE;
1430
            } else if (projectCap.isEjb31LiteSupported()){
1429
            } else if (projectCap.isEjb31LiteSupported()){
1431
                List<String> list = new ArrayList(Arrays.asList(TYPES));
1430
                List<String> list = new ArrayList(Arrays.asList(TYPES));
1432
                if (projectCap.isEjb31Supported() || serverSupportsEJB31){
1431
                if (projectCap.isEjb31Supported()){
1433
                    list.addAll(Arrays.asList(TYPES_EJB));
1432
                    list.addAll(Arrays.asList(TYPES_EJB));
1434
                } else {
1433
                } else {
1435
                    list.addAll(Arrays.asList(TYPES_EJB_LITE));
1434
                    list.addAll(Arrays.asList(TYPES_EJB_LITE));
Lines 1448-1454 Link Here
1448
                List<String> list;
1447
                List<String> list;
1449
                if (projectCap.isEjb31LiteSupported()) {
1448
                if (projectCap.isEjb31LiteSupported()) {
1450
                    list = getPrivilegedTemplatesEE5();
1449
                    list = getPrivilegedTemplatesEE5();
1451
                    if (projectCap.isEjb31Supported() || serverSupportsEJB31){
1450
                    if (projectCap.isEjb31Supported()){
1452
                        list.addAll(13, Arrays.asList(PRIVILEGED_NAMES_EE6_FULL));
1451
                        list.addAll(13, Arrays.asList(PRIVILEGED_NAMES_EE6_FULL));
1453
                    } else {
1452
                    } else {
1454
                        list.addAll(13, Arrays.asList(PRIVILEGED_NAMES_EE6_WEB));
1453
                        list.addAll(13, Arrays.asList(PRIVILEGED_NAMES_EE6_WEB));
Lines 1472-1479 Link Here
1472
                projectCap = J2eeProjectCapabilities.forProject(project);
1471
                projectCap = J2eeProjectCapabilities.forProject(project);
1473
                Profile profile = Profile.fromPropertiesString(eval.getProperty(WebProjectProperties.J2EE_PLATFORM));
1472
                Profile profile = Profile.fromPropertiesString(eval.getProperty(WebProjectProperties.J2EE_PLATFORM));
1474
                isEE5 = profile == Profile.JAVA_EE_5;
1473
                isEE5 = profile == Profile.JAVA_EE_5;
1475
                serverSupportsEJB31 = Util.getSupportedProfiles(project).contains(Profile.JAVA_EE_6_FULL) ||
1476
                        Util.getSupportedProfiles(project).contains(Profile.JAVA_EE_7_FULL);
1477
                checked = true;
1474
                checked = true;
1478
            }
1475
            }
1479
        }
1476
        }
Lines 2235-2242 Link Here
2235
2232
2236
        private void updateLookup(){
2233
        private void updateLookup(){
2237
            Profile profile = Profile.fromPropertiesString(project.evaluator().getProperty(WebProjectProperties.J2EE_PLATFORM));
2234
            Profile profile = Profile.fromPropertiesString(project.evaluator().getProperty(WebProjectProperties.J2EE_PLATFORM));
2238
            if (Profile.JAVA_EE_6_FULL.equals(profile) || Profile.JAVA_EE_6_WEB.equals(profile) ||
2235
            if (Util.isAtLeastJavaEE6Web(profile)) {
2239
                    Profile.JAVA_EE_7_FULL.equals(profile) || Profile.JAVA_EE_7_WEB.equals(profile)){
2240
                setLookups(base, ee6);
2236
                setLookups(base, ee6);
2241
            }else{
2237
            }else{
2242
                setLookups(base);
2238
                setLookups(base);
(-)a/web.project/src/org/netbeans/modules/web/project/api/WebProjectUtilities.java (-4 / +2 lines)
Lines 666-673 Link Here
666
            }
666
            }
667
        }
667
        }
668
        Profile j2eeProfile = data.getJavaEEProfile();
668
        Profile j2eeProfile = data.getJavaEEProfile();
669
        if (j2eeProfile.equals(Profile.JAVA_EE_6_FULL) || j2eeProfile.equals(Profile.JAVA_EE_6_WEB) ||
669
        if (Util.isAtLeastJavaEE6Web(j2eeProfile)) {
670
                j2eeProfile.equals(Profile.JAVA_EE_7_FULL) || j2eeProfile.equals(Profile.JAVA_EE_7_WEB)) {
671
            if (rh.getProjectLibraryManager().getLibrary(Util.ENDORSED_LIBRARY_NAME) == null) { // NOI18N
670
            if (rh.getProjectLibraryManager().getLibrary(Util.ENDORSED_LIBRARY_NAME) == null) { // NOI18N
672
                rh.copyLibrary(LibraryManager.getDefault().getLibrary(Util.ENDORSED_LIBRARY_NAME)); // NOI18N
671
                rh.copyLibrary(LibraryManager.getDefault().getLibrary(Util.ENDORSED_LIBRARY_NAME)); // NOI18N
673
            }
672
            }
Lines 843-850 Link Here
843
        Charset enc = FileEncodingQuery.getDefaultEncoding();
842
        Charset enc = FileEncodingQuery.getDefaultEncoding();
844
        ep.setProperty(WebProjectProperties.SOURCE_ENCODING, enc.name());
843
        ep.setProperty(WebProjectProperties.SOURCE_ENCODING, enc.name());
845
        
844
        
846
        if (j2eeProfile.equals(Profile.JAVA_EE_6_FULL) || j2eeProfile.equals(Profile.JAVA_EE_6_WEB) ||
845
        if (Util.isAtLeastJavaEE6Web(j2eeProfile)) {
847
                j2eeProfile.equals(Profile.JAVA_EE_7_FULL) || j2eeProfile.equals(Profile.JAVA_EE_7_WEB)) {
848
            ep.setProperty(ProjectProperties.ENDORSED_CLASSPATH, new String[]{Util.ENDORSED_LIBRARY_CLASSPATH});
846
            ep.setProperty(ProjectProperties.ENDORSED_CLASSPATH, new String[]{Util.ENDORSED_LIBRARY_CLASSPATH});
849
        }
847
        }
850
848

Return to bug 223442