Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoredpeters2010-04-14 21:03:58 +0000
committeredpeters2010-04-14 21:03:58 +0000
commite6831448b45ce14064133b35321a5447b78b818c (patch)
treec3c150018d190ec62fd8034b865c886ede9c4869 /bundles/org.eclipse.jst.ws.jaxrs.core/src/org
parent228c441307b3edb00e6ad56ad54f002e4b199192 (diff)
downloadwebtools.webservices-e6831448b45ce14064133b35321a5447b78b818c.tar.gz
webtools.webservices-e6831448b45ce14064133b35321a5447b78b818c.tar.xz
webtools.webservices-e6831448b45ce14064133b35321a5447b78b818c.zip
[307552] JAX-RS and Java EE 6 setup is incorrect
Diffstat (limited to 'bundles/org.eclipse.jst.ws.jaxrs.core/src/org')
-rw-r--r--bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/Messages.java18
-rw-r--r--bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/jaxrslibraryproviderconfig/JAXRSLibraryProvider.java26
-rw-r--r--bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/jaxrslibraryproviderconfig/JAXRSLibraryProviderCreationHelper.java89
-rw-r--r--bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/jaxrslibraryproviderconfig/JAXRSLibraryProviderImpl.java53
-rw-r--r--bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/jaxrslibraryproviderconfig/JAXRSLibraryProviderUtil.java159
-rw-r--r--bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/messages.properties5
-rw-r--r--bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/project/facet/IJAXRSFacetInstallDataModelProperties.java3
-rw-r--r--bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/project/facet/JAXRSFacetInstallDataModelProvider.java4
-rw-r--r--bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/project/facet/JAXRSFacetInstallDelegate.java7
-rw-r--r--bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/project/facet/JAXRSUtils.java2
10 files changed, 357 insertions, 9 deletions
diff --git a/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/Messages.java b/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/Messages.java
index 4de505682..8641e5aed 100644
--- a/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/Messages.java
+++ b/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/Messages.java
@@ -1,5 +1,7 @@
+package org.eclipse.jst.ws.jaxrs.core.internal;
+
/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation and others.
+ * Copyright (c) 2009, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,8 +12,8 @@
* yyyymmdd bug Email and other contact information
* -------- -------- -----------------------------------------------------------
* 20091021 291954 ericdp@ca.ibm.com - Eric D. Peters, JAX-RS: Implement JAX-RS Facet
- *******************************************************************************/package org.eclipse.jst.ws.jaxrs.core.internal;
-
+ * 20100413 307552 ericdp@ca.ibm.com - Eric D. Peters, JAX-RS and Java EE 6 setup is incorrect
+ *******************************************************************************/
import org.eclipse.osgi.util.NLS;
/**
@@ -75,7 +77,10 @@ public class Messages extends NLS {
* see messages.properties
*/
public static String JAXRSSharedLibraryConfigurator_ErrorLoadingFromExtPt;
-
+ /**
+ * see messages.properties
+ */
+ public static String JAXRSLibraryProvider_ErrorLoadingFromExtPt;
/**
* see messages.properties
*/
@@ -110,6 +115,11 @@ public class Messages extends NLS {
/**
* see messages.properties
*/
+ public static String JAXRSLibraryProviderCreationHelper_ErrorCreating;
+
+ /**
+ * see messages.properties
+ */
public static String PluginProvidedJAXRSLibraryCreationHelper_ErrorMultipleDefinition;
/**
diff --git a/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/jaxrslibraryproviderconfig/JAXRSLibraryProvider.java b/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/jaxrslibraryproviderconfig/JAXRSLibraryProvider.java
new file mode 100644
index 000000000..8d52f023d
--- /dev/null
+++ b/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/jaxrslibraryproviderconfig/JAXRSLibraryProvider.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * yyyymmdd bug Email and other contact information
+ * -------- -------- -----------------------------------------------------------
+ * 20100413 307552 ericdp@ca.ibm.com - Eric D. Peters, JAX-RS and Java EE 6 setup is incorrect
+ *******************************************************************************/
+package org.eclipse.jst.ws.jaxrs.core.internal.jaxrslibraryproviderconfig;
+
+
+public interface JAXRSLibraryProvider {
+ String getLibraryProviderID();
+ void setLibraryProviderID(String value);
+ boolean getShowUpdateDDCheckBox();
+ void setShowUpdateDDCheckBox(boolean show);
+ boolean getUpdateDDCheckBoxSelected();
+ void setUpdateDDCheckBoxSelected(boolean show);
+ String getServletClassName();
+ void setServletClassName(String sevletClassName);
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/jaxrslibraryproviderconfig/JAXRSLibraryProviderCreationHelper.java b/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/jaxrslibraryproviderconfig/JAXRSLibraryProviderCreationHelper.java
new file mode 100644
index 000000000..fb8838b1b
--- /dev/null
+++ b/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/jaxrslibraryproviderconfig/JAXRSLibraryProviderCreationHelper.java
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * yyyymmdd bug Email and other contact information
+ * -------- -------- -----------------------------------------------------------
+ * 20100413 307552 ericdp@ca.ibm.com - Eric D. Peters, JAX-RS and Java EE 6 setup is incorrect
+ *******************************************************************************/
+package org.eclipse.jst.ws.jaxrs.core.internal.jaxrslibraryproviderconfig;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.jst.ws.jaxrs.core.internal.JAXRSCorePlugin;
+import org.eclipse.jst.ws.jaxrs.core.internal.Messages;
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Helper class used to create JAXRS Library Providers from the
+ * <code>org.eclipse.jst.ws.jaxrs.core.jaxrsLibraryProvider</code>
+ * extension-point.
+ *
+ */
+public final class JAXRSLibraryProviderCreationHelper {
+ private JAXRSLibraryProviderImpl newLibraryProvider;
+ private IConfigurationElement config_element;
+ /**
+ * Key of the 'libraryProviderID' attribute of the extension point.
+ */
+ public final static String LibraryProviderID = "libraryProviderID"; //$NON-NLS-1$
+
+
+ /**
+ * Key of the 'showUpdateDD' attribute of the extension point.
+ */
+ public final static String ShowUpdateDD = "showUpdateDD"; //$NON-NLS-1$
+ /**
+ * Key of the 'updateDDSelected' attribute of the extension point.
+ */
+ public final static String UpdateDDSelected = "updateDDSelected"; //$NON-NLS-1$
+ /**
+ * Key of the 'isSelected' attribute of the extension point.
+ */
+ public final static String SevletClassName = "sevletClassName"; //$NON-NLS-1$
+
+ /**
+ * Creates an instance with the specified IConfigurationElement instance.
+ *
+ * @param JAXRSLibraryProvider
+ * IConfigurationElement instance
+ */
+ public JAXRSLibraryProviderCreationHelper(
+ IConfigurationElement JAXRSLibraryProvider) {
+ this.config_element = JAXRSLibraryProvider;
+ }
+
+
+ /**
+ * Creates a new LibraryProvider from the <code>org.eclipse.jst.ws.jaxrs.core.jaxrsLibraryProvider</code>
+ * extension-point.
+ *
+ * @return JAXRSLibraryProvider instance.
+ */
+ public JAXRSLibraryProvider create() {
+ try {
+ newLibraryProvider = new JAXRSLibraryProviderImpl();
+ newLibraryProvider.setLibraryProviderID(config_element.getAttribute(LibraryProviderID));
+ newLibraryProvider.setServletClassName(config_element.getAttribute(SevletClassName));
+ newLibraryProvider.setShowUpdateDDCheckBox(Boolean.parseBoolean(config_element
+ .getAttribute(ShowUpdateDD)));
+ newLibraryProvider.setUpdateDDCheckBoxSelected(Boolean.parseBoolean(config_element
+ .getAttribute(UpdateDDSelected)));
+ return newLibraryProvider;
+ } catch (Exception e) {
+ JAXRSCorePlugin
+ .log(
+ e,
+ NLS
+ .bind(
+ Messages.JAXRSLibraryProviderCreationHelper_ErrorCreating,
+ newLibraryProvider.getLibraryProviderID()));
+ }
+ return null;
+ }
+
+}
diff --git a/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/jaxrslibraryproviderconfig/JAXRSLibraryProviderImpl.java b/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/jaxrslibraryproviderconfig/JAXRSLibraryProviderImpl.java
new file mode 100644
index 000000000..86ef07bb8
--- /dev/null
+++ b/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/jaxrslibraryproviderconfig/JAXRSLibraryProviderImpl.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * yyyymmdd bug Email and other contact information
+ * -------- -------- -----------------------------------------------------------
+ * 20100413 307552 ericdp@ca.ibm.com - Eric D. Peters, JAX-RS and Java EE 6 setup is incorrect
+ *******************************************************************************/
+package org.eclipse.jst.ws.jaxrs.core.internal.jaxrslibraryproviderconfig;
+
+
+public class JAXRSLibraryProviderImpl implements JAXRSLibraryProvider {
+ boolean showUpdateDD = false;
+ boolean updateDDSelected = false;
+ String libraryProviderID;
+ String servletClassName;
+ public JAXRSLibraryProviderImpl() {
+ }
+ public String getLibraryProviderID() {
+ return libraryProviderID;
+ }
+
+ public void setLibraryProviderID(String id) {
+ this.libraryProviderID = id;
+
+ }
+ public boolean getShowUpdateDDCheckBox() {
+ return showUpdateDD;
+ }
+ public void setShowUpdateDDCheckBox(boolean show) {
+ this.showUpdateDD = show;
+ }
+ public boolean getUpdateDDCheckBoxSelected() {
+ return this.updateDDSelected;
+ }
+ public void setUpdateDDCheckBoxSelected(boolean selected) {
+ this.updateDDSelected = selected;
+ }
+ public String getServletClassName() {
+ return this.servletClassName;
+ }
+ public void setServletClassName(String name) {
+ this.servletClassName = name;
+
+ }
+
+
+}
diff --git a/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/jaxrslibraryproviderconfig/JAXRSLibraryProviderUtil.java b/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/jaxrslibraryproviderconfig/JAXRSLibraryProviderUtil.java
new file mode 100644
index 000000000..66e94cd0b
--- /dev/null
+++ b/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/jaxrslibraryproviderconfig/JAXRSLibraryProviderUtil.java
@@ -0,0 +1,159 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * yyyymmdd bug Email and other contact information
+ * -------- -------- -----------------------------------------------------------
+ * 20100413 307552 ericdp@ca.ibm.com - Eric D. Peters, JAX-RS and Java EE 6 setup is incorrect
+ *******************************************************************************/
+package org.eclipse.jst.ws.jaxrs.core.internal.jaxrslibraryproviderconfig;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Vector;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.InvalidRegistryObjectException;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jst.ws.jaxrs.core.internal.JAXRSCorePlugin;
+import org.eclipse.jst.ws.jaxrs.core.internal.Messages;
+import org.eclipse.jst.ws.jaxrs.core.internal.project.facet.IJAXRSFacetInstallDataModelProperties;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+
+/**
+ * A singleton maintains lists of Library Providers
+ *
+ */
+public class JAXRSLibraryProviderUtil {
+ private static JAXRSLibraryProviderUtil instance = null;
+
+ private static List<JAXRSLibraryProvider> libraryProviders = new Vector<JAXRSLibraryProvider>();
+
+ private static final String JAXRS_LIBRARY_PROVIDER_EXT_PT = "jaxrsLibraryProvider";
+
+
+ /**
+ * Private constructor
+ */
+ private JAXRSLibraryProviderUtil() {
+ // nothing to do
+ }
+
+ public static boolean isUpdateDDCheckBoxSelectedByDefault(String libraryID) {
+ if (libraryID == null)
+ return false;
+
+ JAXRSLibraryProviderUtil.getInstance();
+ java.util.List<JAXRSLibraryProvider> libraryProviders = getLibraryProviders();
+
+ Iterator<JAXRSLibraryProvider> libraryProvidersIterator = libraryProviders
+ .iterator();
+ while (libraryProvidersIterator.hasNext()) {
+ JAXRSLibraryProvider thisLibraryProvider = libraryProvidersIterator
+ .next();
+ if (libraryID.equals(thisLibraryProvider.getLibraryProviderID())) {
+ return thisLibraryProvider.getUpdateDDCheckBoxSelected();
+ }
+
+ }
+
+ return false;
+ }
+
+ public static boolean isUpdateDDCheckBoxSupportAvailable(String libraryID) {
+ if (libraryID == null || libraryID.length() == 0)
+ return false;
+
+ JAXRSLibraryProviderUtil.getInstance();
+ java.util.List<JAXRSLibraryProvider> libraryProviders = getLibraryProviders();
+
+ Iterator<JAXRSLibraryProvider> libraryProvidersIterator = libraryProviders
+ .iterator();
+ while (libraryProvidersIterator.hasNext()) {
+ JAXRSLibraryProvider thisLibraryProvider = libraryProvidersIterator
+ .next();
+ if (libraryID.equals(thisLibraryProvider.getLibraryProviderID())) {
+ if (thisLibraryProvider.getShowUpdateDDCheckBox()) {
+ return true;
+ }
+ }
+
+ }
+
+ return false;
+ }
+
+ public static String getServletClassName(String libraryID) {
+ String toReturn = "";
+ if (libraryID == null || libraryID.length() == 0)
+ return toReturn;
+
+ JAXRSLibraryProviderUtil.getInstance();
+ java.util.List<JAXRSLibraryProvider> libraryProviders = getLibraryProviders();
+
+ Iterator<JAXRSLibraryProvider> libraryProvidersIterator = libraryProviders
+ .iterator();
+ while (libraryProvidersIterator.hasNext()) {
+ JAXRSLibraryProvider thisLibraryProvider = libraryProvidersIterator
+ .next();
+ if (libraryID.equals(thisLibraryProvider.getLibraryProviderID())) {
+ return thisLibraryProvider.getServletClassName() != null ? thisLibraryProvider.getServletClassName() : toReturn;
+ }
+
+ }
+
+ return toReturn;
+ }
+
+ /**
+ * Return the singleton instance of JAXRSLibraryProviderUtil.
+ *
+ * @return JAXRSLibraryProviderUtil
+ */
+ public synchronized static JAXRSLibraryProviderUtil getInstance() {
+ if (instance == null) {
+ instance = new JAXRSLibraryProviderUtil();
+ instance.loadLibraryProvidersExtensions();
+ }
+ return instance;
+ }
+
+ /**
+ * Creates jax-rs library provider items from extension points.
+ */
+ private void loadLibraryProvidersExtensions() {
+ try {
+ IExtensionPoint point = Platform.getExtensionRegistry()
+ .getExtensionPoint(JAXRSCorePlugin.PLUGIN_ID, JAXRS_LIBRARY_PROVIDER_EXT_PT);
+ IExtension[] extensions = point.getExtensions();
+ for (int i = 0; i < extensions.length; i++) {
+ IExtension ext = extensions[i];
+ for (int j = 0; j < ext.getConfigurationElements().length; j++) {
+ JAXRSLibraryProviderCreationHelper newLibCreator = new JAXRSLibraryProviderCreationHelper(
+ ext.getConfigurationElements()[j]);
+ JAXRSLibraryProvider newLibraryProvider = newLibCreator.create();
+
+ if (newLibraryProvider != null)
+ libraryProviders.add(newLibraryProvider);
+ }
+ }
+ } catch (InvalidRegistryObjectException e) {
+ JAXRSCorePlugin.log(IStatus.ERROR,
+ Messages.JAXRSLibraryProvider_ErrorLoadingFromExtPt, e);
+ }
+ }
+
+ public static List<JAXRSLibraryProvider> getLibraryProviders() {
+ return libraryProviders;
+ }
+
+}
diff --git a/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/messages.properties b/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/messages.properties
index 00d6ef44c..428813450 100644
--- a/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/messages.properties
+++ b/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/messages.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2009 IBM Corporation and others.
+# Copyright (c) 2009, 2010 IBM Corporation and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
@@ -10,6 +10,7 @@
# yyyymmdd bug Email and other contact information
# -------- -------- -----------------------------------------------------------
# 20091021 291954 ericdp@ca.ibm.com - Eric D. Peters, JAX-RS: Implement JAX-RS Facet
+# 20100413 307552 ericdp@ca.ibm.com - Eric D. Peters, JAX-RS and Java EE 6 setup is incorrect
###############################################################################
JAXRSLibraryRegistry_ErrorCreatingURL=Error creating URL for JAX-RS Library Registry
JAXRSLibraryRegistry_ErrorSaving=Error saving JAX-RS Library Registry
@@ -17,6 +18,7 @@ JAXRSLibraryRegistry_DEFAULT_IMPL_LABEL=<Default>
JAXRSLibraryConfigModel_Null_Data_Source=Data Source is not provided.
JAXRSLibraryRegistry_ErrorLoadingFromExtPt=Error while loading JAX-RS Libraries from extension points
JAXRSSharedLibraryConfigurator_ErrorLoadingFromExtPt=Error while loading JAX-RS Shared Library Configurators from extension points
+JAXRSLibraryProvider_ErrorLoadingFromExtPt=Error while loading JAX-RS Library Providers from extension points
JAXRSLibraryClasspathContainer_IMPL_LIBRARY=[JAX-RS Library]
JAXRSFacetInstallDataModelProvider_ValidateServletName=Specify a servlet name to use
@@ -39,4 +41,5 @@ ArchiveFileImpl_CannotLocatePluginRelativeFile=Cannot locate plugin-relative fil
PluginProvidedJAXRSLibraryCreationHelper_ErrorCreating=Unable to create JAX-RS Library: {0}
PluginProvidedSharedLibraryConfiguratorCreationHelper_ErrorCreating=Unable to create JAX-RS Shared Library Configurator: {0}
+JAXRSLibraryProviderCreationHelper_ErrorCreating=Unable to create JAX-RS Library Provider: {0}
PluginProvidedJAXRSLibraryCreationHelper_ErrorMultipleDefinition={0} defined multiple times in {1}
diff --git a/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/project/facet/IJAXRSFacetInstallDataModelProperties.java b/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/project/facet/IJAXRSFacetInstallDataModelProperties.java
index a46cfb888..ac572ceab 100644
--- a/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/project/facet/IJAXRSFacetInstallDataModelProperties.java
+++ b/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/project/facet/IJAXRSFacetInstallDataModelProperties.java
@@ -12,6 +12,7 @@
* 20091021 291954 ericdp@ca.ibm.com - Eric D. Peters, JAX-RS: Implement JAX-RS Facet
* 20091106 291954 ericdp@ca.ibm.com - Eric D. Peters, JAX-RS: Implement JAX-RS Facet
* 20100303 291954 kchong@ca.ibm.com - Keith Chong, JAX-RS: Implement JAX-RS Facet
+ * 20100413 307552 ericdp@ca.ibm.com - Eric D. Peters, JAX-RS and Java EE 6 setup is incorrect
*******************************************************************************/
package org.eclipse.jst.ws.jaxrs.core.internal.project.facet;
@@ -53,4 +54,6 @@ public interface IJAXRSFacetInstallDataModelProperties extends
// Support post-project creation scenario. If WAR is parked in multiple EARs, then we should update all the EARs
public static final String EARPROJECTS = "IJAXRSFacetInstallDataModelProperties.EARPROJECTS"; //$NON-NLS-1$
+ public static final String UPDATEDD = "IJAXRSFacetInstallDataModelProperties.UPDATEDD"; //$NON-NLS-1$
+
}
diff --git a/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/project/facet/JAXRSFacetInstallDataModelProvider.java b/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/project/facet/JAXRSFacetInstallDataModelProvider.java
index 7902c649b..265dcd567 100644
--- a/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/project/facet/JAXRSFacetInstallDataModelProvider.java
+++ b/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/project/facet/JAXRSFacetInstallDataModelProvider.java
@@ -13,6 +13,7 @@
* 20091106 291954 ericdp@ca.ibm.com - Eric D. Peters, JAX-RS: Implement JAX-RS Facet
* 20100303 291954 kchong@ca.ibm.com - Keith Chong, JAX-RS: Implement JAX-RS Facet
* 20100407 308401 ericdp@ca.ibm.com - Eric D. Peters, JAX-RS facet wizard page - Shared-library option should be disabled
+ * 20100413 307552 ericdp@ca.ibm.com - Eric D. Peters, JAX-RS and Java EE 6 setup is incorrect
*******************************************************************************/
package org.eclipse.jst.ws.jaxrs.core.internal.project.facet;
@@ -67,6 +68,7 @@ public class JAXRSFacetInstallDataModelProvider extends
names.add(CONFIGURATION_PRESET);
names.add(SERVER_IRUNTIME);
names.add(EARPROJECTS);
+ names.add(UPDATEDD);
return names;
}
@@ -105,6 +107,8 @@ public class JAXRSFacetInstallDataModelProvider extends
return false;
} else if (propertyName.equals(DEPLOY_IMPLEMENTATION)) {
return true;
+ } else if (propertyName.equals(UPDATEDD)) {
+ return true;
}
return super.getDefaultProperty(propertyName);
}
diff --git a/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/project/facet/JAXRSFacetInstallDelegate.java b/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/project/facet/JAXRSFacetInstallDelegate.java
index 0c9e358b1..18f7e699c 100644
--- a/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/project/facet/JAXRSFacetInstallDelegate.java
+++ b/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/project/facet/JAXRSFacetInstallDelegate.java
@@ -14,6 +14,7 @@
* 20100303 291954 kchong@ca.ibm.com - Keith Chong, JAX-RS: Implement JAX-RS Facet
* 20100310 304405 ericdp@ca.ibm.com - Eric D. Peters, JAX-RS Facet : support JAX-RS 1.1
* 20100319 306595 ericdp@ca.ibm.com - Eric D. Peters, several install scenarios fail for both user library & non-user library
+ * 20100413 307552 ericdp@ca.ibm.com - Eric D. Peters, JAX-RS and Java EE 6 setup is incorrect
*******************************************************************************/
package org.eclipse.jst.ws.jaxrs.core.internal.project.facet;
@@ -143,9 +144,9 @@ public final class JAXRSFacetInstallDelegate implements IDelegate {
createSharedLibraries(project, fv, monitor, config);
}
- // Update web model
- createServletAndModifyWebXML(project, config, monitor);
-
+ // Update web model if necessary
+ if (config.getBooleanProperty(IJAXRSFacetInstallDataModelProperties.UPDATEDD))
+ createServletAndModifyWebXML(project, config, monitor);
if (monitor != null) {
monitor.worked(1);
}
diff --git a/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/project/facet/JAXRSUtils.java b/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/project/facet/JAXRSUtils.java
index 01506f9c9..d7bf16a1f 100644
--- a/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/project/facet/JAXRSUtils.java
+++ b/bundles/org.eclipse.jst.ws.jaxrs.core/src/org/eclipse/jst/ws/jaxrs/core/internal/project/facet/JAXRSUtils.java
@@ -33,7 +33,7 @@ public abstract class JAXRSUtils {
/**
* The default name of the JAX-RS servlet class
*/
- public static final String JAXRS_SERVLET_CLASS = "com.mycompany.web.rest.RestServlet"; //$NON-NLS-1$
+ public static final String JAXRS_SERVLET_CLASS = ""; //$NON-NLS-1$
/**
* Default URL mapping to jaxrs servlet

Back to the top