Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsrinivasan2011-03-05 23:47:03 +0000
committerrsrinivasan2011-03-05 23:47:03 +0000
commit74964cdd912ced15bbe697ccc4c7fe86212eca74 (patch)
treeba87142c6bbb2b7730226166c431cc2c1e3b5762 /jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml
parent6b4082ad6b8235e15d6766dfedc75d3ef1e5317c (diff)
downloadwebtools.jsf-74964cdd912ced15bbe697ccc4c7fe86212eca74.tar.gz
webtools.jsf-74964cdd912ced15bbe697ccc4c7fe86212eca74.tar.xz
webtools.jsf-74964cdd912ced15bbe697ccc4c7fe86212eca74.zip
This commit was manufactured by cvs2svn to create tag 'v201103051547'.v201103051547
Diffstat (limited to 'jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml')
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/WebXmlUpdater.java251
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/WebXmlUtils.java31
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/WebXmlUtilsForJ2EE.java615
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/WebXmlUtilsForJavaEE.java610
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/AbstractWebXmlUpdater.java174
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/WebXmlUpdaterForJ2EE.java161
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/WebXmlUpdaterForJavaEE.java163
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ContextParamAdderForJ2EE.java59
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ContextParamAdderForJavaEE.java59
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/FilterAdderForJ2EE.java55
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/FilterAdderForJavaEE.java55
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/FilterMapperAdderForJ2EE.java60
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/FilterMapperAdderForJavaEE.java55
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/FilterRemoverForJavaEE.java58
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ListenerAdderForJ2EE.java51
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ListenerAdderForJavaEE.java51
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ServletAdderForJ2EE.java59
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ServletAdderForJavaEE.java59
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ServletMappingAdderForJ2EE.java59
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ServletMappingAdderForJavaEE.java59
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ServletRemoverForJ2EE.java57
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ServletRemoverForJavaEE.java54
22 files changed, 0 insertions, 2855 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/WebXmlUpdater.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/WebXmlUpdater.java
deleted file mode 100644
index e3261ead1..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/WebXmlUpdater.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.jst.jsf.common.webxml;
-
-
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jst.j2ee.model.IModelProvider;
-import org.eclipse.jst.j2ee.model.ModelProviderManager;
-import org.eclipse.jst.javaee.web.WebApp;
-import org.eclipse.jst.jsf.common.webxml.internal.AbstractWebXmlUpdater;
-import org.eclipse.jst.jsf.common.webxml.internal.WebXmlUpdaterForJ2EE;
-import org.eclipse.jst.jsf.common.webxml.internal.WebXmlUpdaterForJavaEE;
-
-
-/**
- * Facade for web.xml updater classes WebXmlUpdaterForJavaEE,
- * WebXmlUpdaterForJ2EE, and AbstractWebXmlUpdater. Utility class to make
- * editing web.xml easy.
- *
- * @author Debajit Adhikary
- *
- */
-public class WebXmlUpdater
-{
- private final IProject project;
- private final IProgressMonitor monitor;
- private final AbstractWebXmlUpdater updater;
- private final IModelProvider provider;
-
- /**
- * @param project
- * @param monitor
- */
- public WebXmlUpdater (final IProject project,
- final IProgressMonitor monitor)
- {
- this.project = project;
- this.monitor = monitor;
- this.provider = ModelProviderManager.getModelProvider(project);
- this.updater = initUpdater();
- }
-
-
- /**
- * @return WebApp object associated with this WebXmlUpdater object
- */
- public WebApp getWebAppForJavaEE ()
- {
- return (WebApp) updater.getWebApp();
- }
-
-
- /**
- * @return WebApp object associated with this WebXmlUpdater object
- */
- public org.eclipse.jst.j2ee.webapplication.WebApp getWebAppForJ2EE ()
- {
- return (org.eclipse.jst.j2ee.webapplication.WebApp) updater.getWebApp();
- }
-
-
- /**
- * @return Provider object for the webapp this WebXmlUpdater is associated
- * with. This may be used by clients to perform additional complex
- * updates to web.xml using getProvider.modify(new Runnable(), ...)
- */
- public IModelProvider getProvider()
- {
- return provider;
- }
-
-
- /**
- * @return True if this webapp is a Java EE app.
- */
- public boolean isJavaEEWebapp ()
- {
- return updater instanceof WebXmlUpdaterForJavaEE;
- }
-
-
- /**
- * @return True if this webapp is a J2EE app
- */
- public boolean isJ2EEWebapp ()
- {
- return updater instanceof WebXmlUpdaterForJ2EE;
- }
-
-
- /**
- * @param servletName
- * @param servletClass
- * @param loadOnStartup
- */
- public void addServlet (final String servletName,
- final String servletClass,
- final String loadOnStartup)
- {
- updater.addServlet(servletName, servletClass, loadOnStartup);
- }
-
-
- /**
- * @param servletClassName
- */
- public void removeServlet (final String servletClassName)
- {
- updater.removeServlet(servletClassName);
- }
-
-
- /**
- * @param servletName
- * @param servletClass
- * @param urlPattern
- */
- public void addServletMapping (final String servletName,
- final String servletClass,
- final String urlPattern)
- {
- updater.addServletMapping(servletName, servletClass, urlPattern);
- }
-
-
- /**
- * @param filterName
- * @param filterClass
- */
- public void addFilter (final String filterName,
- final String filterClass)
- {
- updater.addFilter(filterName, filterClass);
- }
-
-
- /**
- * @param filterName
- */
- public void removeFilter (final String filterName)
- {
- updater.removeFilter(filterName);
- }
-
-
- /**
- * @param filterName
- * @param filterClass
- * @param servletName
- */
- public void addFilterMapping (final String filterName,
- final String filterClass,
- final String servletName)
- {
- updater.addFilterMapping(filterName, filterClass, servletName);
- }
-
-
- /**
- * @param paramName
- * Name of context param
- * @return Value of given context param.
- */
- public String getContextParamValue (final String paramName)
- {
- return updater.getContextParamValue(paramName);
- }
-
-
- /**
- * @param paramName
- * Name of context param
- * @param valuesDelimiterRegex
- * Delimiter string for values
- * @return Values of given context param as a list. This is useful when the
- * multiple values are demarcated by a delimiter string.
- *
- */
- public List<String> getContextParamValuesAsList (final String paramName,
- final String valuesDelimiterRegex)
- {
- return updater.getContextParamValuesAsList(paramName, valuesDelimiterRegex);
- }
-
-
- /**
- * Sets the value of the given context param name to the given value. If
- * paramName is not found, a new context-param is created with the given
- * paramName and paramValue.
- *
- * @param paramName
- * @param paramValue
- */
- public void setContextParamValue (final String paramName,
- final String paramValue)
- {
- updater.setContextParamValue(paramName, paramValue);
- }
-
-
- /**
- * @param paramName
- * @param paramValue
- * @param description
- */
- public void addContextParam (final String paramName,
- final String paramValue,
- final String description)
- {
- updater.addContextParam(paramName, paramValue, description);
- }
-
-
- /**
- * @param listenerClass
- */
- public void addListener (final String listenerClass)
- {
- updater.addListener(listenerClass);
- }
-
-
- private AbstractWebXmlUpdater initUpdater()
- {
- final Object webAppObj = ModelProviderManager.getModelProvider(project).getModelObject();
-
- if (webAppObj != null)
- {
- if (webAppObj instanceof WebApp) // Java EE
- return new WebXmlUpdaterForJavaEE(webAppObj, project, getProvider(), monitor);
- else if (webAppObj instanceof org.eclipse.jst.j2ee.webapplication.WebApp) // J2EE
- return new WebXmlUpdaterForJ2EE(webAppObj, project, getProvider(), monitor);
- }
-
- // Control should never come here
- throw new IllegalArgumentException("Unable to resolve WebApp object for updating web.xml"); //$NON-NLS-1$
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/WebXmlUtils.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/WebXmlUtils.java
deleted file mode 100644
index 48d22505e..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/WebXmlUtils.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.jst.jsf.common.webxml;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-
-
-/**
- * Web.xml utilities.
- *
- * @author Debajit Adhikary
- *
- */
-public class WebXmlUtils
-{
- /**
- * Path to deployment descriptor of webapp
- */
- public static final IPath WEB_XML_PATH = new Path("WEB-INF").append("web.xml"); //$NON-NLS-1$ //$NON-NLS-2$
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/WebXmlUtilsForJ2EE.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/WebXmlUtilsForJ2EE.java
deleted file mode 100644
index 6354dc8e3..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/WebXmlUtilsForJ2EE.java
+++ /dev/null
@@ -1,615 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle 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: Oracle Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.jst.jsf.common.webxml;
-
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.jst.j2ee.common.CommonFactory;
-import org.eclipse.jst.j2ee.common.Description;
-import org.eclipse.jst.j2ee.common.Listener;
-import org.eclipse.jst.j2ee.common.ParamValue;
-import org.eclipse.jst.j2ee.webapplication.Filter;
-import org.eclipse.jst.j2ee.webapplication.FilterMapping;
-import org.eclipse.jst.j2ee.webapplication.Servlet;
-import org.eclipse.jst.j2ee.webapplication.ServletMapping;
-import org.eclipse.jst.j2ee.webapplication.ServletType;
-import org.eclipse.jst.j2ee.webapplication.WebApp;
-import org.eclipse.jst.j2ee.webapplication.WebapplicationFactory;
-import org.eclipse.jst.j2ee.webapplication.internal.impl.ServletTypeImpl;
-
-
-/**
- * Web.xml editing utilities for J2EE (Servlet 2.4 and lower versions).
- *
- * @author Debajit Adhikary
- *
- */
-public class WebXmlUtilsForJ2EE
-{
- /**
- * @param webapp
- * @param servletName
- * @param servletClass
- * @param loadOnStartup
- */
- public static void addServlet (final WebApp webapp,
- final String servletName,
- final String servletClass,
- final String loadOnStartup)
- {
- if (existsServlet(webapp, servletName, servletClass))
- return;
-
- // Create new servlet
-
- final Servlet servlet = WebapplicationFactory.eINSTANCE.createServlet();
- servlet.setServletName(servletName);
- servlet.setLoadOnStartup(new Integer(loadOnStartup));
-
- final ServletType servletType = WebapplicationFactory.eINSTANCE.createServletType();
- servletType.setClassName(servletClass);
- servlet.setWebType(servletType);
-
- webapp.getServlets().add(servlet);
- }
-
-
- /**
- * @param webapp
- * @param servletName
- * @param servletClass
- * @return true if the specified servlet is declared for use in webapp
- */
- public static boolean existsServlet (final WebApp webapp,
- final String servletName,
- final String servletClass)
- {
- return findServlet(webapp, servletName, servletClass) != null;
- }
-
-
- /**
- * @param webapp
- * Webapp in which to look for
- * @param servletName
- * Servlet name
- * @param servletClass
- * Servlet class
- *
- * @return The servlet containing the specified servlet-name and
- * servlet-class in web.xml
- */
- public static Servlet findServlet (final WebApp webapp,
- final String servletName,
- final String servletClass)
- {
- for (final Object s : webapp.getServlets())
- {
- final Servlet servlet = (Servlet) s;
- if (servlet.getServletName().equals(servletName)
- && ((ServletType) servlet.getWebType()).getClassName().equals(servletClass))
- {
- return servlet;
- }
- }
-
- return null;
- }
-
-
- /**
- * @param webApp
- * @param servletClassName
- * @return the servlet or null if not found
- */
- public static Servlet findServlet (final WebApp webApp,
- final String servletClassName)
- {
- for (final Object servlet : webApp.getServlets())
- {
- final org.eclipse.jst.j2ee.webapplication.Servlet j2eeServlet = (org.eclipse.jst.j2ee.webapplication.Servlet) servlet;
- final String servletClass = ((ServletTypeImpl) j2eeServlet.getWebType()).getClassName();
- if (servletClass.equals(servletClassName))
- return j2eeServlet;
- }
- return null;
- }
-
-
- /**
- * @param webapp
- * @param servletName
- * @return the servlet or null if not found
- */
- public static Servlet findServletByName (final WebApp webapp,
- final String servletName)
- {
- for (final Object s : webapp.getServlets())
- {
- final Servlet servlet = (Servlet) s;
- if (servlet.getServletName().trim().equals(servletName))
- return servlet;
- }
-
- return null;
- }
-
-
- /**
- * @param webApp
- * @param servlet
- */
- public static void removeServlet (final WebApp webApp,
- final Servlet servlet)
- {
- webApp.getServlets().remove(servlet);
- }
-
-
- /**
- * @param webapp
- * @param servletName
- * @param servletClass
- * @param urlPattern
- */
- public static void addServletMapping (final WebApp webapp,
- final String servletName,
- final String servletClass,
- final String urlPattern)
- {
- if (existsServletMapping(webapp, servletName, urlPattern))
- return;
-
- final Servlet servlet = findServlet(webapp, servletName, servletClass);
- if (servlet == null)
- throw new IllegalArgumentException("Cannot create servlet mapping with servlet name \"" //$NON-NLS-1$
- + servletName + "\" and URL pattern \"" //$NON-NLS-1$
- + urlPattern + "\". No corresponding servlet is defined."); //$NON-NLS-1$
-
- final ServletMapping servletMapping = WebapplicationFactory.eINSTANCE.createServletMapping();
- servletMapping.setServlet(servlet);
- servletMapping.setName(servletName);
- servletMapping.setUrlPattern(urlPattern);
-
- webapp.getServletMappings().add(servletMapping);
- }
-
-
- /**
- * @param webapp
- * @param servletName
- * @param urlPattern
- * @return true if the servlet mapping exists
- */
- public static boolean existsServletMapping (final WebApp webapp,
- final String servletName,
- final String urlPattern)
- {
- return findServletMapping(webapp, servletName, urlPattern) != null;
- }
-
-
- /**
- * @param webapp
- * @param servletName
- * @param urlPattern
- * @return the servlet mapping
- */
- public static ServletMapping findServletMapping (final WebApp webapp,
- final String servletName,
- final String urlPattern)
- {
- for (final Object mapping : webapp.getServletMappings())
- {
- final ServletMapping servletMapping = (ServletMapping) mapping;
- if (servletMapping.getName().equals(servletName)
- && servletMapping.getUrlPattern().equals(urlPattern))
- {
- return servletMapping;
- }
- }
-
- return null;
- }
-
-
- /**
- * @param webApp
- * @param servlet
- */
- public static void removeServletMappings (final WebApp webApp,
- final Servlet servlet)
- {
- final List mappings = webApp.getServletMappings();
- String servletName = servlet.getServletName();
-
- if (servletName != null)
- {
- servletName = servletName.trim();
- for (int i = mappings.size() - 1; i >= 0; --i)
- {
- final ServletMapping mapping = (ServletMapping) mappings.get(i);
- if (mapping != null && mapping.getServlet().getServletName() != null
- && mapping.getServlet().getServletName().trim().equals(servletName))
- {
- mappings.remove(mapping);
- }
- }
- }
- }
-
-
- /**
- * @param webapp
- * @param filterName
- * @param filterClass
- */
- public static void addFilter (final WebApp webapp,
- final String filterName,
- final String filterClass)
- {
- if (existsFilter(webapp, filterName, filterClass))
- return;
-
- webapp.getFilters().add(createFilter(filterName, filterClass));
- }
-
-
- /**
- * @param filterName
- * @param filterClass
- * @return the filter or null if not found.
- */
- public static Filter createFilter (final String filterName,
- final String filterClass)
- {
- final Filter filter = WebapplicationFactory.eINSTANCE.createFilter();
- filter.setName(filterName);
- filter.setFilterClassName(filterClass);
- return filter;
- }
-
-
- /**
- * @param webapp
- * @param filterName
- * @param filterClass
- * @return true if the filter exists.
- */
- public static boolean existsFilter (final WebApp webapp,
- final String filterName,
- final String filterClass)
- {
- return findFilter(webapp, filterName, filterClass) != null;
- }
-
-
- /**
- * @param webapp
- * @param filterName
- * @param filterClass
- * @return the filter or null if not found.
- */
- public static Filter findFilter (final WebApp webapp,
- final String filterName,
- final String filterClass)
- {
- for (final Object f : webapp.getFilters())
- {
- final Filter filter = (Filter) f;
- if (filter.getName().trim().equals(filterName)
- && filter.getFilterClassName().trim().equals(filterClass))
- {
- return filter;
- }
- }
-
- return null;
- }
-
-
- /**
- * @param webApp
- * @param filterClassName
- * @return the filter or null if not found.
- */
- public static Filter findFilter (final WebApp webApp,
- final String filterClassName)
- {
- for (final Object filter : webApp.getFilters())
- {
- if (((Filter) filter).getFilterClassName().trim().equals(filterClassName))
- return (Filter) filter;
- }
-
- return null;
- }
-
-
- /**
- * @param webapp
- * @param filterName
- * @param filterClass
- * @param servletName
- */
- public static void addFilterMapping (final WebApp webapp,
- final String filterName,
- final String filterClass,
- final String servletName)
- {
- if (existsFilterMapping(webapp, filterName, servletName))
- return;
-
-
- // Find corresponding filter
- final Filter filter = findFilter(webapp, filterName, filterClass);
- if (filter == null)
- throw new IllegalArgumentException("Cannot create filter mapping with filter name \"" //$NON-NLS-1$
- + filterName + "\" and servlet name \"" //$NON-NLS-1$
- + servletName + "\". No corresponding filter is defined."); //$NON-NLS-1$
-
-
- // Find corresponding servlet
- final Servlet servlet = findServletByName(webapp, servletName);
- if (servlet == null)
- throw new IllegalArgumentException("Cannot create filter mapping with filter name \"" //$NON-NLS-1$
- + filterName + "\" and servlet name \"" //$NON-NLS-1$
- + servletName + "\". No corresponding servlet is defined."); //$NON-NLS-1$
-
-
- // Create new filter mapping
- final FilterMapping filterMapping = WebapplicationFactory.eINSTANCE.createFilterMapping();
- filterMapping.setFilter(filter);
- filterMapping.setServlet(servlet);
- filterMapping.setServletName(servletName);
-
- webapp.getFilterMappings().add(filterMapping);
- }
-
-
- /**
- * @param webapp
- * @param filterName
- * @param servletName
- * @return true if the filter mapping exists
- */
- public static boolean existsFilterMapping (final WebApp webapp,
- final String filterName,
- final String servletName)
- {
- return findFilterMapping(webapp, filterName, servletName) != null;
- }
-
-
- /**
- * @param webapp
- * @param filterName
- * @param servletName
- * @return the filter mapping or null if it doesn't exist.
- */
- public static FilterMapping findFilterMapping (final WebApp webapp,
- final String filterName,
- final String servletName)
- {
- for (final Object fm : webapp.getFilterMappings())
- {
- final FilterMapping filterMapping = (FilterMapping) fm;
-
- if (filterMapping.getFilter().getName().trim().equals(filterName)
- && filterMapping.getServletName().equals(servletName))
- {
- return filterMapping;
- }
- }
-
- return null;
- }
-
-
- /**
- * @param webApp
- * @param paramName
- * @param paramValue
- * @param description
- */
- public static void addContextParam (final WebApp webApp,
- final String paramName,
- final String paramValue,
- final String description)
- {
- if (existsContextParam(webApp, paramName, paramValue))
- return;
-
- webApp.getContextParams().add(createContextParam(paramName, paramValue, description));
- }
-
-
- /**
- * @param paramName
- * @param paramValue
- * @param descriptionString
- * @return the param value or null if doesn't exist
- */
- public static ParamValue createContextParam (final String paramName,
- final String paramValue,
- final String descriptionString)
- {
- final ParamValue param = CommonFactory.eINSTANCE.createParamValue();
- param.setName(paramName);
- param.setValue(paramValue);
-
- if (descriptionString != null)
- {
- final Description description = CommonFactory.eINSTANCE.createDescription();
- description.setValue(descriptionString);
- param.getDescriptions().add(description);
- }
-
- return param;
- }
-
-
- /**
- * @param webApp
- * @param paramName
- * @param paramValue
- * @return true if the context param exists.
- */
- public static boolean existsContextParam (final WebApp webApp,
- final String paramName,
- final String paramValue)
- {
- return findContextParam(webApp, paramName, paramValue) != null;
- }
-
-
- /**
- * @param webApp
- * @param paramName
- * @param paramValue
- * @return the param value or null if not found
- */
- public static ParamValue findContextParam (final WebApp webApp,
- final String paramName,
- final String paramValue)
- {
- for (final Object param : webApp.getContextParams())
- {
- final ParamValue contextParam = (ParamValue) param;
- if (contextParam.getName().equals(paramName)
- && contextParam.getValue().equals(paramValue))
- {
- return contextParam;
- }
- }
-
- return null;
- }
-
-
- /**
- * @param webApp
- * @param paramName
- * @return the param value or null if not found
- */
- public static String getContextParamValue (final WebApp webApp,
- final String paramName)
- {
- for (final Object param : webApp.getContextParams())
- {
- final ParamValue contextParam = (ParamValue) param;
- if (contextParam.getName().equals(paramName))
- {
- return contextParam.getValue();
- }
- }
-
- return null;
- }
-
-
- /**
- * @param webApp
- * @param paramName Name of context param
- * @param valuesDelimiterRegex
- * @return Values of the given context param as a list
- */
- public static List<String> getContextParamValuesAsList (final WebApp webApp,
- final String paramName,
- final String valuesDelimiterRegex)
- {
- final String valuesString = getContextParamValue(webApp, paramName);
- return Arrays.asList(valuesString.split(valuesDelimiterRegex));
- }
-
-
- /**
- * Updates the value of a context param if it exists. Otherwise, adds this
- * as a new context param.
- *
- * @param webApp
- * @param paramName
- * @param paramValue
- */
- public static void setContextParamValue (final WebApp webApp,
- final String paramName,
- final String paramValue)
- {
- ParamValue contextParam = null;
-
- for (final Object p : webApp.getContextParams())
- {
- final ParamValue param = (ParamValue) p;
- if (param.getName().equals(paramName))
- {
- contextParam = param;
- break;
- }
- }
-
- if (contextParam == null)
- {
- webApp.getContextParams().add(createContextParam(paramName, paramValue, null));
- }
- else
- {
- contextParam.setValue(paramValue);
- }
- }
-
-
- /**
- * @param webapp
- * @param listenerClass
- */
- public static void addListener (final WebApp webapp,
- final String listenerClass)
- {
- if (existsListener(webapp, listenerClass))
- return;
-
- // Create new listener
- final Listener listener = CommonFactory.eINSTANCE.createListener();
- listener.setListenerClassName(listenerClass);
-
- webapp.getListeners().add(listener);
- }
-
-
- /**
- * @param webapp
- * @param listenerClass
- * @return true if the listener exists
- */
- public static boolean existsListener (final WebApp webapp,
- final String listenerClass)
- {
- return findListener(webapp, listenerClass) != null;
- }
-
-
- /**
- * @param webapp
- * @param listenerClass
- * @return the listener or null if not found
- */
- public static Listener findListener (final WebApp webapp,
- final String listenerClass)
- {
- for (final Object listener : webapp.getListeners())
- if (((Listener) listener).getListenerClassName().equals(listenerClass))
- return (Listener) listener;
-
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/WebXmlUtilsForJavaEE.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/WebXmlUtilsForJavaEE.java
deleted file mode 100644
index 6a3d59779..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/WebXmlUtilsForJavaEE.java
+++ /dev/null
@@ -1,610 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle 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: Oracle Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.jst.jsf.common.webxml;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.jst.javaee.core.Description;
-import org.eclipse.jst.javaee.core.JavaeeFactory;
-import org.eclipse.jst.javaee.core.Listener;
-import org.eclipse.jst.javaee.core.ParamValue;
-import org.eclipse.jst.javaee.core.UrlPatternType;
-import org.eclipse.jst.javaee.web.Filter;
-import org.eclipse.jst.javaee.web.FilterMapping;
-import org.eclipse.jst.javaee.web.Servlet;
-import org.eclipse.jst.javaee.web.ServletMapping;
-import org.eclipse.jst.javaee.web.WebApp;
-import org.eclipse.jst.javaee.web.WebFactory;
-
-
-/**
- * Web.xml editing utilities for Java EE.
- *
- * @author Debajit Adhikary
- *
- */
-public class WebXmlUtilsForJavaEE
-{
- /**
- * @param webapp
- * @param servletName
- * @param servletClass
- * @param loadOnStartup
- */
- public static void addServlet (final WebApp webapp,
- final String servletName,
- final String servletClass,
- final String loadOnStartup)
- {
- if (existsServlet(webapp, servletName, servletClass))
- return;
-
- // Create new servlet
- final Servlet servlet = WebFactory.eINSTANCE.createServlet();
- servlet.setServletName(servletName);
- servlet.setServletClass(servletClass);
- servlet.setLoadOnStartup(loadOnStartup);
-
- webapp.getServlets().add(servlet);
- }
-
-
- /**
- * @param webapp
- * @param servletName
- * @param servletClass
- * @return true if the servlet exists.
- */
- public static boolean existsServlet (final WebApp webapp,
- final String servletName,
- final String servletClass)
- {
- return findServlet(webapp, servletName, servletClass) != null;
- }
-
-
- /**
- * @param webapp
- * @param servletName
- * @param servletClass
- * @return the servlet or null if not found.
- */
- public static Servlet findServlet (final WebApp webapp,
- final String servletName,
- final String servletClass)
- {
- for (final Object s : webapp.getServlets())
- {
- final Servlet servlet = (Servlet) s;
- if (servlet.getServletName().equals(servletName) && servlet.getServletClass().equals(servletClass))
- {
- return servlet;
- }
- }
-
- return null;
- }
-
-
- /**
- * @param servletName
- * @param webApp
- * @return the servlet or null if not found.
- */
- public static Servlet findServlet (final String servletName,
- final WebApp webApp)
- {
- for (final Object servlet : webApp.getServlets())
- {
- if (((Servlet) servlet).getServletClass().trim().equals(servletName))
- return (Servlet) servlet;
- }
-
- return null;
- }
-
-
- /**
- * @param webApp
- * @param servlet
- */
- public static void removeServlet (final WebApp webApp,
- final Servlet servlet)
- {
- webApp.getServlets().remove(servlet);
- }
-
-
- /**
- * @param webApp
- * @param servletName
- * @param servletClass
- * @param urlPatternString
- */
- public static void addServletMapping (final WebApp webApp,
- final String servletName,
- final String servletClass,
- final String urlPatternString)
- {
- if (existsServletMapping(webApp, servletName, urlPatternString))
- return;
-
- // Create new servlet mapping.
- final ServletMapping servletMapping = WebFactory.eINSTANCE.createServletMapping();
- servletMapping.setServletName(servletName);
- servletMapping.getUrlPatterns().add(createUrlPattern(urlPatternString));
-
- webApp.getServletMappings().add(servletMapping);
- }
-
-
- /**
- * @param webApp
- * @param servletName
- * @param urlPatternString
- * @return true if the servlet mapping exists.
- */
- public static boolean existsServletMapping (final WebApp webApp,
- final String servletName,
- final String urlPatternString)
- {
- return findServletMapping(webApp, servletName, urlPatternString) != null;
- }
-
-
- /**
- * @param webApp
- * @param servletName
- * @param urlPatternString
- * @return the servlet mapping or null if doesn't exist.
- */
- public static ServletMapping findServletMapping (final WebApp webApp,
- final String servletName,
- final String urlPatternString)
- {
- for (final Object mapping : webApp.getServletMappings())
- {
- final ServletMapping servletMappingToCheck = (ServletMapping) mapping;
- if (servletMappingToCheck.getServletName().trim().equals(servletName))
- {
- // We found a servlet with the same name. Check for urls
- for (final Object pattern : servletMappingToCheck.getUrlPatterns())
- if (((UrlPatternType) pattern).getValue().equals(urlPatternString))
- return servletMappingToCheck;
- }
- }
-
- return null;
- }
-
- /**
- * @param webApp
- * @param servlet
- */
- public static void removeServletMappings (final WebApp webApp,
- final Servlet servlet)
- {
- final List mappings = webApp.getServletMappings();
- String servletName = servlet.getServletName();
-
- if (servletName != null)
- {
- servletName = servletName.trim();
- for (int i = mappings.size() - 1; i >= 0; --i)
- {
- final ServletMapping mapping = (ServletMapping) mappings.get(i);
- if (mapping != null && mapping.getServletName() != null && mapping.getServletName().trim().equals(servletName))
- {
- mappings.remove(mapping);
- }
- }
- }
- }
-
-
- /**
- * @param webapp
- * @param filterName
- * @param filterClass
- */
- public static void addFilter (final WebApp webapp,
- final String filterName,
- final String filterClass)
- {
- if (existsFilter(webapp, filterName, filterClass))
- return;
-
- webapp.getFilters().add(createFilter(filterName, filterClass));
- }
-
-
- /**
- * @param filterName
- * @param filterClass
- * @return the filter or null if it doesn't exist.
- */
- public static Filter createFilter (final String filterName,
- final String filterClass)
- {
- final Filter filter = WebFactory.eINSTANCE.createFilter();
- filter.setFilterName(filterName);
- filter.setFilterClass(filterClass);
- return filter;
- }
-
-
- /**
- * @param webapp
- * @param filterName
- * @param filterClass
- * @return true if the filter exists.
- */
- public static boolean existsFilter (final WebApp webapp,
- final String filterName,
- final String filterClass)
- {
- return findFilter(webapp, filterName, filterClass) != null;
- }
-
-
- /**
- * @param webapp
- * @param filterName
- * @param filterClass
- * @return the filter or null if not found.
- */
- public static Filter findFilter (final WebApp webapp,
- final String filterName,
- final String filterClass)
- {
- for (final Object f : webapp.getFilters())
- {
- final Filter filter = (Filter) f;
- if (filter.getFilterName().trim().equals(filterName) && filter.getFilterClass().trim().equals(filterClass))
- {
- return filter;
- }
- }
-
- return null;
- }
-
-
- /**
- * @param webApp
- * @param filterClassName
- * @return the filter or null if not found.
- */
- public static Filter findFilter (final WebApp webApp,
- final String filterClassName)
- {
- for (final Object filter : webApp.getFilters())
- {
- if (((Filter) filter).getFilterClass().trim().equals(filterClassName))
- return (Filter) filter;
- }
-
- return null;
- }
-
-
- /**
- * @param webApp
- * @param filter
- */
- public static void removeFilter (final WebApp webApp,
- final Filter filter)
- {
- webApp.getFilters().remove(filter);
- }
-
-
- /**
- * @param webapp
- * @param filterName
- * @param servletName
- */
- public static void addFilterMapping (final WebApp webapp,
- final String filterName,
- final String servletName)
- {
- if (existsFilterMapping(webapp, filterName, servletName))
- return;
-
- webapp.getFilterMappings().add(createFilterMapping(filterName, servletName));
- }
-
-
- /**
- * @param filterName
- * @param servletName
- * @return the filter mapping or null if not found.
- */
- public static FilterMapping createFilterMapping (final String filterName,
- final String servletName)
- {
- final FilterMapping filterMapping = WebFactory.eINSTANCE.createFilterMapping();
- filterMapping.setFilterName(filterName);
- filterMapping.getServletNames().add(servletName);
-
- return filterMapping;
- }
-
-
- /**
- * @param webapp
- * @param filterName
- * @param servletName
- * @return true if the filter mapping exists.
- */
- public static boolean existsFilterMapping (final WebApp webapp,
- final String filterName,
- final String servletName)
- {
- return findFilterMapping(webapp, filterName, servletName) != null;
- }
-
-
- /**
- * @param webapp
- * @param filterName
- * @param servletName
- * @return the filter mapping or null.
- */
- public static FilterMapping findFilterMapping (final WebApp webapp,
- final String filterName,
- final String servletName)
- {
- for (final Object fm : webapp.getFilterMappings())
- {
- final FilterMapping filterMapping = (FilterMapping) fm;
-
- if (filterMapping.getFilterName().trim().equals(filterName) && filterMapping.getServletNames().contains(servletName))
- {
- return filterMapping;
- }
- }
-
- return null;
- }
-
-
- /**
- * @param webApp
- * @param filter
- */
- public static void removeFilterMappings (final WebApp webApp,
- final Filter filter)
- {
- final List mappings = webApp.getFilterMappings();
- String filterName = filter.getFilterName();
-
- if (filterName != null)
- {
- filterName = filterName.trim();
- for (int i = mappings.size() - 1; i >= 0; --i)
- {
- final FilterMapping mapping = (FilterMapping) mappings.get(i);
- if (mapping != null && mapping.getFilterName() != null && mapping.getFilterName().trim().equals(filterName))
- {
- mappings.remove(mapping);
- }
- }
- }
- }
-
-
- /**
- * @param webApp
- * @param paramName
- * @param paramValue
- * @param description
- */
- public static void addContextParam (final WebApp webApp,
- final String paramName,
- final String paramValue,
- final String description)
- {
- if (existsContextParam(webApp, paramName, paramValue))
- return;
-
- webApp.getContextParams().add(createContextParam(paramName, paramValue, description));
- }
-
-
- /**
- * @param paramName
- * @param paramValue
- * @param descriptionString
- * @return the param value or null if not found.
- */
- public static ParamValue createContextParam (final String paramName,
- final String paramValue,
- final String descriptionString)
- {
- final ParamValue param = JavaeeFactory.eINSTANCE.createParamValue();
- param.setParamName(paramName);
- param.setParamValue(paramValue);
-
- if (descriptionString != null)
- {
- final Description description = JavaeeFactory.eINSTANCE.createDescription();
- description.setValue(descriptionString);
- param.getDescriptions().add(description);
- }
-
-
- return param;
- }
-
-
- /**
- * @param webApp
- * @param paramName
- * @param paramValue
- * @return true if the context param exists.
- */
- public static boolean existsContextParam (final WebApp webApp,
- final String paramName,
- final String paramValue)
- {
- return findContextParam(webApp, paramName, paramValue) != null;
- }
-
-
- /**
- * @param webApp
- * @param paramName
- * @param paramValue
- * @return the param value or null if not found.
- */
- public static ParamValue findContextParam (final WebApp webApp,
- final String paramName,
- final String paramValue)
- {
- for (final Object param : webApp.getContextParams())
- {
- final ParamValue contextParam = (ParamValue) param;
- if (contextParam.getParamName().equals(paramName) && contextParam.getParamValue().equals(paramValue))
- return contextParam;
- }
-
- return null;
- }
-
-
- /**
- * @param webApp
- * @param paramName Name of context param
- * @return Value of the given context param
- */
- public static String getContextParamValue (final WebApp webApp,
- final String paramName)
- {
- for (final Object param : webApp.getContextParams())
- {
- final ParamValue contextParam = (ParamValue) param;
- if (contextParam.getParamName().equals(paramName))
- return contextParam.getParamValue();
- }
-
- return null;
- }
-
-
- /**
- * @param webApp
- * @param paramName Name of context param
- * @param valuesDelimiterRegex
- * @return Values of the given context param as a list
- */
- public static List<String> getContextParamValuesAsList (final WebApp webApp,
- final String paramName,
- final String valuesDelimiterRegex)
- {
- final String valueString = getContextParamValue(webApp, paramName);
- return Arrays.asList(valueString.split(valuesDelimiterRegex));
- }
-
-
- /**
- * Updates the value of a context param if it exists. Otherwise, adds this
- * as a new context param.
- *
- * @param webApp
- * @param paramName
- * @param paramValue
- */
- public static void setContextParamValue (final WebApp webApp,
- final String paramName,
- final String paramValue)
- {
- ParamValue contextParam = null;
-
- for (final Object p : webApp.getContextParams())
- {
- final ParamValue param = (ParamValue) p;
- if (param.getParamName().equals(paramName))
- {
- contextParam = param;
- break;
- }
- }
-
- if (contextParam == null)
- {
- webApp.getContextParams().add(createContextParam(paramName, paramValue, null));
- }
- else
- {
- contextParam.setParamValue(paramValue);
- }
- }
-
-
- /**
- * @param webapp
- * @param listenerClass
- */
- public static void addListener (final WebApp webapp,
- final String listenerClass)
- {
- if (existsListener(webapp, listenerClass))
- return;
-
- // Create new listener
- final Listener listener = JavaeeFactory.eINSTANCE.createListener();
- listener.setListenerClass(listenerClass);
-
- webapp.getListeners().add(listener);
- }
-
-
- /**
- * @param webapp
- * @param listenerClass
- * @return true if the listener exists.
- */
- public static boolean existsListener (final WebApp webapp,
- final String listenerClass)
- {
- return findListener(webapp, listenerClass) != null;
- }
-
-
- /**
- * @param webapp
- * @param listenerClass
- * @return the listener or null if not found.
- */
- public static Listener findListener (final WebApp webapp,
- final String listenerClass)
- {
- for (final Object listener : webapp.getListeners())
- if (((Listener) listener).getListenerClass().equals(listenerClass))
- return (Listener) listener;
-
- return null;
- }
-
-
- /**
- * @param urlPatternString
- * @return the UrlPattern or null.
- */
- public static UrlPatternType createUrlPattern (final String urlPatternString)
- {
- final UrlPatternType urlPattern = JavaeeFactory.eINSTANCE.createUrlPatternType();
- urlPattern.setValue(urlPatternString);
- return urlPattern;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/AbstractWebXmlUpdater.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/AbstractWebXmlUpdater.java
deleted file mode 100644
index b298bb7a5..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/AbstractWebXmlUpdater.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.jst.jsf.common.webxml.internal;
-
-
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jst.j2ee.model.IModelProvider;
-
-
-/**
- * Abstract class to define web-xml editing interface. Users may use the
- * WebXmlUpdater facade class for convenient web.xml editing.
- *
- * @author Debajit Adhikary
- *
- */
-public abstract class AbstractWebXmlUpdater
-{
- /**
- * the web app object. JavaEE has own type and J2EE has another. They are not object compatible.
- */
- protected final Object webAppObj;
- /**
- * the project
- */
- protected final IProject project;
- /**
- * the model provider used to modify the model
- */
- protected final IModelProvider provider;
- /**
- * the progress monitor
- */
- protected final IProgressMonitor monitor;
-
-
- /**
- * @param webAppObj
- * @param project
- * @param provider
- * @param monitor
- */
- public AbstractWebXmlUpdater (final Object webAppObj,
- final IProject project,
- final IModelProvider provider,
- final IProgressMonitor monitor)
- {
- this.webAppObj = webAppObj;
- this.project = project;
- this.provider = provider;
- this.monitor = monitor;
- }
-
-
- /**
- * @param servletName
- * @param servletClass
- * @param loadOnStartup
- */
- public abstract void addServlet (final String servletName,
- final String servletClass,
- final String loadOnStartup);
-
-
- /**
- * @param servletName
- * @param servletClass
- * @param urlPattern
- */
- public abstract void addServletMapping (final String servletName,
- final String servletClass,
- final String urlPattern);
-
-
- /**
- * Removes a servlet and its associated mappings from web.xml.
- *
- * @param servletClassName
- * Fully qualified classname of servlet class to remove.
- */
- public abstract void removeServlet (final String servletClassName);
-
-
- /**
- * @param filterName
- * @param filterClass
- */
- public abstract void addFilter (final String filterName,
- final String filterClass);
-
-
- /**
- * Removes a filter and its associated mappings from web.xml.
- *
- * @param filterName
- */
- public abstract void removeFilter (final String filterName);
-
-
- /**
- * @param filterName
- * @param filterClass
- * @param servletName
- */
- public abstract void addFilterMapping (final String filterName,
- final String filterClass,
- final String servletName);
-
- /**
- * @param paramName
- * Name of context param
- * @return Value of given context param.
- */
- public abstract String getContextParamValue (final String paramName);
-
-
- /**
- * @param paramName
- * Name of context param
- * @param valuesDelimiterRegex
- * Delimiter string for values
- * @return Values of given context param as a list. This is useful when the
- * multiple values are demarcated by a delimiter string.
- */
- public abstract List<String> getContextParamValuesAsList (final String paramName,
- final String valuesDelimiterRegex);
-
-
- /**
- * Sets the value of the given context param name to the given value. If
- * paramName is not found, a new context-param is created with the given
- * paramName and paramValue.
- *
- * @param paramName
- * @param paramValue
- */
- public abstract void setContextParamValue (final String paramName,
- final String paramValue);
-
-
- /**
- * @param paramName
- * @param paramValue
- * @param description
- */
- public abstract void addContextParam (final String paramName,
- final String paramValue,
- final String description);
-
-
- /**
- * @param listenerClass
- */
- public abstract void addListener (final String listenerClass);
-
-
- /**
- * @return The WebApp object associated with this updater
- */
- public abstract Object getWebApp ();
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/WebXmlUpdaterForJ2EE.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/WebXmlUpdaterForJ2EE.java
deleted file mode 100644
index 2d4ba290a..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/WebXmlUpdaterForJ2EE.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2009 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.jst.jsf.common.webxml.internal;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jst.j2ee.model.IModelProvider;
-import org.eclipse.jst.j2ee.webapplication.Filter;
-import org.eclipse.jst.j2ee.webapplication.Servlet;
-import org.eclipse.jst.j2ee.webapplication.WebApp;
-import org.eclipse.jst.jsf.common.webxml.WebXmlUtils;
-import org.eclipse.jst.jsf.common.webxml.WebXmlUtilsForJ2EE;
-import org.eclipse.jst.jsf.common.webxml.internal.operations.ContextParamAdderForJ2EE;
-import org.eclipse.jst.jsf.common.webxml.internal.operations.FilterAdderForJ2EE;
-import org.eclipse.jst.jsf.common.webxml.internal.operations.FilterMapperAdderForJ2EE;
-import org.eclipse.jst.jsf.common.webxml.internal.operations.FilterRemoverForJavaEE;
-import org.eclipse.jst.jsf.common.webxml.internal.operations.ListenerAdderForJ2EE;
-import org.eclipse.jst.jsf.common.webxml.internal.operations.ServletAdderForJ2EE;
-import org.eclipse.jst.jsf.common.webxml.internal.operations.ServletMappingAdderForJ2EE;
-import org.eclipse.jst.jsf.common.webxml.internal.operations.ServletRemoverForJavaEE;
-
-
-/**
- * @author Debajit Adhikary
- *
- */
-public class WebXmlUpdaterForJ2EE extends AbstractWebXmlUpdater
-{
- private final WebApp webApp;
-
-
- /**
- * @param webAppObj
- * @param project
- * @param provider
- * @param monitor
- */
- public WebXmlUpdaterForJ2EE (final Object webAppObj,
- final IProject project,
- final IModelProvider provider,
- final IProgressMonitor monitor)
- {
- super(webAppObj, project, provider, monitor);
- this.webApp = (WebApp) webAppObj;
- }
-
-
- @Override
- public void addServlet (final String servletName,
- final String servletClass,
- final String loadOnStartup)
- {
- provider.modify(new ServletAdderForJ2EE(project, servletName, servletClass, loadOnStartup), WebXmlUtils.WEB_XML_PATH);
- }
-
-
- @Override
- public void addServletMapping (final String servletName,
- final String servletClass,
- final String urlPattern)
- {
- provider.modify(new ServletMappingAdderForJ2EE(project, servletName, servletClass, urlPattern), WebXmlUtils.WEB_XML_PATH);
- }
-
- // TODO: needs fixing
- @Override
- public void removeServlet (final String servletClassName)
- {
- final Servlet servlet = WebXmlUtilsForJ2EE.findServlet(webApp, servletClassName);
- if (servlet == null)
- throw new IllegalArgumentException("Cannot find servlet named \"" + servletClassName + "\""); //$NON-NLS-1$//$NON-NLS-2$
-
- provider.modify(new ServletRemoverForJavaEE(project, servletClassName), WebXmlUtils.WEB_XML_PATH);
- }
-
-
- @Override
- public void addFilter (final String filterName,
- final String filterClass)
- {
- provider.modify(new FilterAdderForJ2EE(project, filterName, filterClass), WebXmlUtils.WEB_XML_PATH);
- }
-
-
- @Override
- public void removeFilter (final String filterClassName)
- {
- final Filter filter = WebXmlUtilsForJ2EE.findFilter(webApp, filterClassName);
- if (filter == null)
- throw new IllegalArgumentException("Cannot find filter named \"" + filterClassName + "\""); //$NON-NLS-1$//$NON-NLS-2$
-
- provider.modify(new FilterRemoverForJavaEE(project, filterClassName), WebXmlUtils.WEB_XML_PATH);
- }
-
-
- @Override
- public void addFilterMapping (final String filterName,
- final String filterClass,
- final String servletName)
- {
- provider.modify(new FilterMapperAdderForJ2EE(project, filterName, filterClass, servletName), WebXmlUtils.WEB_XML_PATH);
- }
-
-
- @Override
- public String getContextParamValue (final String paramName)
- {
- return WebXmlUtilsForJ2EE.getContextParamValue(webApp, paramName);
- }
-
-
- @Override
- public List<String> getContextParamValuesAsList(String paramName, String valuesDelimiterRegex)
- {
- return WebXmlUtilsForJ2EE.getContextParamValuesAsList(webApp, paramName, valuesDelimiterRegex);
- }
-
-
- @Override
- public void setContextParamValue(String paramName, String paramValue)
- {
- WebXmlUtilsForJ2EE.setContextParamValue(webApp, paramName, paramValue);
- }
-
-
- @Override
-
- public void addContextParam (final String paramName,
- final String paramValue,
- final String description)
- {
- provider.modify(new ContextParamAdderForJ2EE(project, paramName, paramValue, description), WebXmlUtils.WEB_XML_PATH);
- }
-
-
- @Override
- public void addListener (final String listenerClass)
- {
- provider.modify(new ListenerAdderForJ2EE(project, listenerClass), WebXmlUtils.WEB_XML_PATH);
- }
-
-
- @Override
- public Object getWebApp()
- {
- return webApp;
- }
-}
-
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/WebXmlUpdaterForJavaEE.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/WebXmlUpdaterForJavaEE.java
deleted file mode 100644
index ee79863eb..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/WebXmlUpdaterForJavaEE.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2009 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.jst.jsf.common.webxml.internal;
-
-import static org.eclipse.jst.jsf.common.webxml.WebXmlUtilsForJavaEE.findFilter;
-import static org.eclipse.jst.jsf.common.webxml.WebXmlUtilsForJavaEE.findServlet;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jst.j2ee.model.IModelProvider;
-import org.eclipse.jst.javaee.web.Filter;
-import org.eclipse.jst.javaee.web.Servlet;
-import org.eclipse.jst.javaee.web.WebApp;
-import org.eclipse.jst.jsf.common.webxml.WebXmlUtils;
-import org.eclipse.jst.jsf.common.webxml.WebXmlUtilsForJavaEE;
-import org.eclipse.jst.jsf.common.webxml.internal.operations.ContextParamAdderForJavaEE;
-import org.eclipse.jst.jsf.common.webxml.internal.operations.FilterAdderForJavaEE;
-import org.eclipse.jst.jsf.common.webxml.internal.operations.FilterMapperAdderForJavaEE;
-import org.eclipse.jst.jsf.common.webxml.internal.operations.FilterRemoverForJavaEE;
-import org.eclipse.jst.jsf.common.webxml.internal.operations.ListenerAdderForJavaEE;
-import org.eclipse.jst.jsf.common.webxml.internal.operations.ServletAdderForJavaEE;
-import org.eclipse.jst.jsf.common.webxml.internal.operations.ServletMappingAdderForJavaEE;
-import org.eclipse.jst.jsf.common.webxml.internal.operations.ServletRemoverForJavaEE;
-
-
-/**
- * @author Debajit Adhikary
- *
- */
-public class WebXmlUpdaterForJavaEE extends AbstractWebXmlUpdater
-{
- private final WebApp webApp;
-
-
- /**
- * @param webAppObj
- * @param project
- * @param provider
- * @param monitor
- */
- public WebXmlUpdaterForJavaEE (final Object webAppObj,
- final IProject project,
- final IModelProvider provider,
- final IProgressMonitor monitor)
- {
- super(webAppObj, project, provider, monitor);
- this.webApp = (WebApp) webAppObj;
- }
-
-
- @Override
- public void addServlet (final String servletName,
- final String servletClass,
- final String loadOnStartup)
- {
- provider.modify(new ServletAdderForJavaEE(project, servletName, servletClass, loadOnStartup), WebXmlUtils.WEB_XML_PATH);
- }
-
-
- @Override
- public void removeServlet (final String servletClassName)
- {
- final Servlet servlet = findServlet(servletClassName, webApp);
- if (servlet == null)
- throw new IllegalArgumentException("Cannot find servlet named \"" + servletClassName + "\""); //$NON-NLS-1$//$NON-NLS-2$
-
- provider.modify(new ServletRemoverForJavaEE(project, servletClassName), WebXmlUtils.WEB_XML_PATH);
- }
-
-
- @Override
- public void addServletMapping (final String servletName,
- final String servletClass,
- final String urlPattern)
- {
- provider.modify(new ServletMappingAdderForJavaEE(project, servletName, servletClass, urlPattern), WebXmlUtils.WEB_XML_PATH);
- }
-
-
- @Override
- public void addFilter (final String filterName,
- final String filterClass)
- {
- provider.modify(new FilterAdderForJavaEE(project, filterName, filterClass), WebXmlUtils.WEB_XML_PATH);
- }
-
-
- @Override
- public void removeFilter (final String filterClassName)
- {
- final Filter filter = findFilter(webApp, filterClassName);
- if (filter == null)
- throw new IllegalArgumentException("Cannot find filter named \"" + filterClassName + "\""); //$NON-NLS-1$//$NON-NLS-2$
-
- provider.modify(new FilterRemoverForJavaEE(project, filterClassName), WebXmlUtils.WEB_XML_PATH);
- }
-
-
- @Override
- public void addFilterMapping (final String filterName,
- final String filterClass,
- final String servletName)
- {
- provider.modify(new FilterMapperAdderForJavaEE(project, filterName, servletName), WebXmlUtils.WEB_XML_PATH);
- }
-
-
- @Override
- public String getContextParamValue (final String paramName)
- {
- return WebXmlUtilsForJavaEE.getContextParamValue(webApp, paramName);
- }
-
-
- @Override
- public List<String> getContextParamValuesAsList (final String paramName,
- final String valuesDelimiterRegex)
- {
- return WebXmlUtilsForJavaEE.getContextParamValuesAsList(webApp, paramName, valuesDelimiterRegex);
- }
-
-
- @Override
- public void setContextParamValue(String paramName, String paramValue)
- {
- WebXmlUtilsForJavaEE.setContextParamValue(webApp, paramName, paramValue);
- }
-
-
- @Override
- public void addContextParam (final String paramName,
- final String paramValue,
- final String description)
- {
- provider.modify(new ContextParamAdderForJavaEE(project, paramName, paramValue, description), WebXmlUtils.WEB_XML_PATH);
- }
-
-
- @Override
- public void addListener (final String listenerClass)
- {
- provider.modify(new ListenerAdderForJavaEE(project, listenerClass), WebXmlUtils.WEB_XML_PATH);
- }
-
-
- @Override
- public Object getWebApp()
- {
- return webApp;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ContextParamAdderForJ2EE.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ContextParamAdderForJ2EE.java
deleted file mode 100644
index 1ea49e4b3..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ContextParamAdderForJ2EE.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.jst.jsf.common.webxml.internal.operations;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.j2ee.model.ModelProviderManager;
-import org.eclipse.jst.j2ee.webapplication.WebApp;
-import org.eclipse.jst.jsf.common.webxml.WebXmlUtilsForJ2EE;
-
-
-/**
- * Runnable to add a context-param to web.xml.
- *
- * @author Debajit Adhikary
- *
- */
-public class ContextParamAdderForJ2EE implements Runnable
-{
- private final IProject project;
- private final String paramName;
- private final String paramValue;
- private final String description;
-
-
- /**
- * @param project
- * @param paramName
- * @param paramValue
- * @param description
- */
- public ContextParamAdderForJ2EE (final IProject project,
- final String paramName,
- final String paramValue,
- final String description)
- {
- this.project = project;
- this.paramName = paramName;
- this.paramValue = paramValue;
- this.description = description;
- }
-
-
- public void run ()
- {
- final WebApp webApp = (WebApp) ModelProviderManager.getModelProvider(project).getModelObject();
-
- WebXmlUtilsForJ2EE.addContextParam(webApp, paramName, paramValue, description);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ContextParamAdderForJavaEE.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ContextParamAdderForJavaEE.java
deleted file mode 100644
index 7b9aae749..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ContextParamAdderForJavaEE.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.jst.jsf.common.webxml.internal.operations;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.j2ee.model.ModelProviderManager;
-import org.eclipse.jst.javaee.web.WebApp;
-import org.eclipse.jst.jsf.common.webxml.WebXmlUtilsForJavaEE;
-
-
-/**
- * Runnable to add a context-param to web.xml.
- *
- * @author Debajit Adhikary
- *
- */
-public class ContextParamAdderForJavaEE implements Runnable
-{
- private final IProject project;
- private final String paramName;
- private final String paramValue;
- private final String description;
-
-
- /**
- * @param project
- * @param paramName
- * @param paramValue
- * @param description
- */
- public ContextParamAdderForJavaEE (final IProject project,
- final String paramName,
- final String paramValue,
- final String description)
- {
- this.project = project;
- this.paramName = paramName;
- this.paramValue = paramValue;
- this.description = description;
- }
-
-
- public void run ()
- {
- final WebApp webApp = (WebApp) ModelProviderManager.getModelProvider(project).getModelObject();
-
- WebXmlUtilsForJavaEE.addContextParam(webApp, paramName, paramValue, description);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/FilterAdderForJ2EE.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/FilterAdderForJ2EE.java
deleted file mode 100644
index d1ad0f995..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/FilterAdderForJ2EE.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.jst.jsf.common.webxml.internal.operations;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.j2ee.model.ModelProviderManager;
-import org.eclipse.jst.j2ee.webapplication.WebApp;
-import org.eclipse.jst.jsf.common.webxml.WebXmlUtilsForJ2EE;
-
-
-/**
- * Runnable to add a filter to web.xml.
- *
- * @author Debajit Adhikary
- *
- */
-public class FilterAdderForJ2EE implements Runnable
-{
- private final IProject project;
- private final String filterName;
- private final String filterClass;
-
-
- /**
- * @param project
- * @param filterName
- * @param filterClass
- */
- public FilterAdderForJ2EE (final IProject project,
- final String filterName,
- final String filterClass)
- {
- this.project = project;
- this.filterName = filterName;
- this.filterClass = filterClass;
- }
-
-
- public void run ()
- {
- final WebApp webApp = (WebApp) ModelProviderManager.getModelProvider(project).getModelObject();
-
- WebXmlUtilsForJ2EE.addFilter(webApp, filterName, filterClass);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/FilterAdderForJavaEE.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/FilterAdderForJavaEE.java
deleted file mode 100644
index 9faa0677a..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/FilterAdderForJavaEE.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.jst.jsf.common.webxml.internal.operations;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.j2ee.model.ModelProviderManager;
-import org.eclipse.jst.javaee.web.WebApp;
-import org.eclipse.jst.jsf.common.webxml.WebXmlUtilsForJavaEE;
-
-
-/**
- * Runnable to add a filter to web.xml.
- *
- * @author Debajit Adhikary
- *
- */
-public class FilterAdderForJavaEE implements Runnable
-{
- private final IProject project;
- private final String filterName;
- private final String filterClass;
-
-
- /**
- * @param project
- * @param filterName
- * @param filterClass
- */
- public FilterAdderForJavaEE (final IProject project,
- final String filterName,
- final String filterClass)
- {
- this.project = project;
- this.filterName = filterName;
- this.filterClass = filterClass;
- }
-
-
- public void run ()
- {
- final WebApp webApp = (WebApp) ModelProviderManager.getModelProvider(project).getModelObject();
-
- WebXmlUtilsForJavaEE.addFilter(webApp, filterName, filterClass);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/FilterMapperAdderForJ2EE.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/FilterMapperAdderForJ2EE.java
deleted file mode 100644
index 7dd02a8c9..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/FilterMapperAdderForJ2EE.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.jst.jsf.common.webxml.internal.operations;
-
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.j2ee.model.ModelProviderManager;
-import org.eclipse.jst.j2ee.webapplication.WebApp;
-import org.eclipse.jst.jsf.common.webxml.WebXmlUtilsForJ2EE;
-
-
-/**
- * Runnable to add a filter-mapping to web.xml.
- *
- * @author Debajit Adhikary
- *
- */
-public class FilterMapperAdderForJ2EE implements Runnable
-{
- private final IProject project;
- private final String filterName;
- private final String filterClass;
- private final String servletName;
-
-
- /**
- * @param project
- * @param filterName
- * @param filterClass
- * @param servletName
- */
- public FilterMapperAdderForJ2EE (final IProject project,
- final String filterName,
- final String filterClass,
- final String servletName)
- {
- this.project = project;
- this.filterName = filterName;
- this.filterClass = filterClass;
- this.servletName = servletName;
- }
-
-
- public void run ()
- {
- final WebApp webApp = (WebApp) ModelProviderManager.getModelProvider(project).getModelObject();
-
- WebXmlUtilsForJ2EE.addFilterMapping(webApp, filterName, filterClass, servletName);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/FilterMapperAdderForJavaEE.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/FilterMapperAdderForJavaEE.java
deleted file mode 100644
index 5fa9f4978..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/FilterMapperAdderForJavaEE.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.jst.jsf.common.webxml.internal.operations;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.j2ee.model.ModelProviderManager;
-import org.eclipse.jst.javaee.web.WebApp;
-import org.eclipse.jst.jsf.common.webxml.WebXmlUtilsForJavaEE;
-
-
-/**
- * Runnable to add a filter-mapping to web.xml.
- *
- * @author Debajit Adhikary
- *
- */
-public class FilterMapperAdderForJavaEE implements Runnable
-{
- private final IProject project;
- private final String filterName;
- private final String servletName;
-
-
- /**
- * @param project
- * @param filterName
- * @param servletName
- */
- public FilterMapperAdderForJavaEE (final IProject project,
- final String filterName,
- final String servletName)
- {
- this.project = project;
- this.filterName = filterName;
- this.servletName = servletName;
- }
-
-
- public void run ()
- {
- final WebApp webApp = (WebApp) ModelProviderManager.getModelProvider(project).getModelObject();
-
- WebXmlUtilsForJavaEE.addFilterMapping(webApp, filterName, servletName);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/FilterRemoverForJavaEE.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/FilterRemoverForJavaEE.java
deleted file mode 100644
index 68bd2f78e..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/FilterRemoverForJavaEE.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.jst.jsf.common.webxml.internal.operations;
-
-
-import static org.eclipse.jst.jsf.common.webxml.WebXmlUtilsForJavaEE.findFilter;
-import static org.eclipse.jst.jsf.common.webxml.WebXmlUtilsForJavaEE.removeFilter;
-import static org.eclipse.jst.jsf.common.webxml.WebXmlUtilsForJavaEE.removeFilterMappings;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.j2ee.model.ModelProviderManager;
-import org.eclipse.jst.javaee.web.Filter;
-import org.eclipse.jst.javaee.web.WebApp;
-
-
-/**
- * Removes a filter and its associated mappings from web.xml
- *
- * @author Debajit Adhikary
- *
- */
-public class FilterRemoverForJavaEE implements Runnable
-{
- private final IProject project;
- private final String filterClassName;
-
-
- /**
- * @param project
- * @param filterClassName
- */
- public FilterRemoverForJavaEE (final IProject project,
- final String filterClassName)
- {
- this.project = project;
- this.filterClassName = filterClassName;
- }
-
-
- public void run ()
- {
- final WebApp webApp = (WebApp) ModelProviderManager.getModelProvider(project).getModelObject();
- final Filter filter = findFilter(webApp, filterClassName);
-
- removeFilterMappings(webApp, filter);
- removeFilter(webApp, filter);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ListenerAdderForJ2EE.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ListenerAdderForJ2EE.java
deleted file mode 100644
index 25c70208d..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ListenerAdderForJ2EE.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.jst.jsf.common.webxml.internal.operations;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.j2ee.model.ModelProviderManager;
-import org.eclipse.jst.j2ee.webapplication.WebApp;
-import org.eclipse.jst.jsf.common.webxml.WebXmlUtilsForJ2EE;
-
-
-/**
- * Runnable to add a listener to web.xml.
- *
- * @author Debajit Adhikary
- *
- */
-public class ListenerAdderForJ2EE implements Runnable
-{
- private final IProject project;
- private final String listenerClass;
-
-
- /**
- * @param project
- * @param listenerClass
- */
- public ListenerAdderForJ2EE (final IProject project,
- final String listenerClass)
- {
- this.project = project;
- this.listenerClass = listenerClass;
- }
-
-
- public void run ()
- {
- final WebApp webApp = (WebApp) ModelProviderManager.getModelProvider(project).getModelObject();
-
- WebXmlUtilsForJ2EE.addListener(webApp, listenerClass);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ListenerAdderForJavaEE.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ListenerAdderForJavaEE.java
deleted file mode 100644
index ea8c600cd..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ListenerAdderForJavaEE.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.jst.jsf.common.webxml.internal.operations;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.j2ee.model.ModelProviderManager;
-import org.eclipse.jst.javaee.web.WebApp;
-import org.eclipse.jst.jsf.common.webxml.WebXmlUtilsForJavaEE;
-
-
-/**
- * Runnable to add a listener to web.xml.
- *
- * @author Debajit Adhikary
- *
- */
-public class ListenerAdderForJavaEE implements Runnable
-{
- private final IProject project;
- private final String listenerClass;
-
-
- /**
- * @param project
- * @param listenerClass
- */
- public ListenerAdderForJavaEE (final IProject project,
- final String listenerClass)
- {
- this.project = project;
- this.listenerClass = listenerClass;
- }
-
-
- public void run ()
- {
- final WebApp webApp = (WebApp) ModelProviderManager.getModelProvider(project).getModelObject();
-
- WebXmlUtilsForJavaEE.addListener(webApp, listenerClass);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ServletAdderForJ2EE.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ServletAdderForJ2EE.java
deleted file mode 100644
index 2626fed66..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ServletAdderForJ2EE.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.jst.jsf.common.webxml.internal.operations;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.j2ee.model.ModelProviderManager;
-import org.eclipse.jst.j2ee.webapplication.WebApp;
-import org.eclipse.jst.jsf.common.webxml.WebXmlUtilsForJ2EE;
-
-
-/**
- * Runnable to add a servlet to web.xml.
- *
- * @author Debajit Adhikary
- *
- */
-public class ServletAdderForJ2EE implements Runnable
-{
- private final IProject project;
- private final String servletName;
- private final String servletClass;
- private final String loadOnStartup;
-
-
- /**
- * @param project
- * @param servletName
- * @param servletClass
- * @param loadOnStartup
- */
- public ServletAdderForJ2EE (final IProject project,
- final String servletName,
- final String servletClass,
- final String loadOnStartup)
- {
- this.project = project;
- this.servletName = servletName;
- this.servletClass = servletClass;
- this.loadOnStartup = loadOnStartup;
- }
-
-
- public void run ()
- {
- final WebApp webApp = (WebApp) ModelProviderManager.getModelProvider(project).getModelObject();
-
- WebXmlUtilsForJ2EE.addServlet(webApp, servletName, servletClass, loadOnStartup);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ServletAdderForJavaEE.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ServletAdderForJavaEE.java
deleted file mode 100644
index fd324a3bf..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ServletAdderForJavaEE.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.jst.jsf.common.webxml.internal.operations;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.j2ee.model.ModelProviderManager;
-import org.eclipse.jst.javaee.web.WebApp;
-import org.eclipse.jst.jsf.common.webxml.WebXmlUtilsForJavaEE;
-
-
-/**
- * Runnable to add a servlet to web.xml.
- *
- * @author Debajit Adhikary
- *
- */
-public class ServletAdderForJavaEE implements Runnable
-{
- private final IProject project;
- private final String servletName;
- private final String servletClass;
- private final String loadOnStartup;
-
-
- /**
- * @param project
- * @param servletName
- * @param servletClass
- * @param loadOnStartup
- */
- public ServletAdderForJavaEE (final IProject project,
- final String servletName,
- final String servletClass,
- final String loadOnStartup)
- {
- this.project = project;
- this.servletName = servletName;
- this.servletClass = servletClass;
- this.loadOnStartup = loadOnStartup;
- }
-
-
- public void run ()
- {
- final WebApp webApp = (WebApp) ModelProviderManager.getModelProvider(project).getModelObject();
-
- WebXmlUtilsForJavaEE.addServlet(webApp, servletName, servletClass, loadOnStartup);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ServletMappingAdderForJ2EE.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ServletMappingAdderForJ2EE.java
deleted file mode 100644
index d5bf7528f..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ServletMappingAdderForJ2EE.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.jst.jsf.common.webxml.internal.operations;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.j2ee.model.ModelProviderManager;
-import org.eclipse.jst.j2ee.webapplication.WebApp;
-import org.eclipse.jst.jsf.common.webxml.WebXmlUtilsForJ2EE;
-
-
-/**
- * Runnable to add a servlet-mapping to web.xml.
- *
- * @author Debajit Adhikary
- *
- */
-public class ServletMappingAdderForJ2EE implements Runnable
-{
- private final IProject project;
- private final String servletName;
- private final String servletClass;
- private final String urlPatternString;
-
-
- /**
- * @param project
- * @param servletName
- * @param servletClass
- * @param urlPatternString
- */
- public ServletMappingAdderForJ2EE (final IProject project,
- final String servletName,
- final String servletClass,
- final String urlPatternString)
- {
- this.project = project;
- this.servletName = servletName;
- this.servletClass = servletClass;
- this.urlPatternString = urlPatternString;
- }
-
-
- public void run ()
- {
- final WebApp webApp = (WebApp) ModelProviderManager.getModelProvider(project).getModelObject();
-
- WebXmlUtilsForJ2EE.addServletMapping(webApp, servletName, servletClass, urlPatternString);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ServletMappingAdderForJavaEE.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ServletMappingAdderForJavaEE.java
deleted file mode 100644
index 16fe0848a..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ServletMappingAdderForJavaEE.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.jst.jsf.common.webxml.internal.operations;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.j2ee.model.ModelProviderManager;
-import org.eclipse.jst.javaee.web.WebApp;
-import org.eclipse.jst.jsf.common.webxml.WebXmlUtilsForJavaEE;
-
-
-/**
- * Runnable to add a servlet-mapping to web.xml.
- *
- * @author Debajit Adhikary
- *
- */
-public class ServletMappingAdderForJavaEE implements Runnable
-{
- private final IProject project;
- private final String servletName;
- private final String servletClass;
- private final String urlPatternString;
-
-
- /**
- * @param project
- * @param servletName
- * @param servletClass
- * @param urlPatternString
- */
- public ServletMappingAdderForJavaEE (final IProject project,
- final String servletName,
- final String servletClass,
- final String urlPatternString)
- {
- this.project = project;
- this.servletName = servletName;
- this.servletClass = servletClass;
- this.urlPatternString = urlPatternString;
- }
-
-
- public void run ()
- {
- final WebApp webApp = (WebApp) ModelProviderManager.getModelProvider(project).getModelObject();
-
- WebXmlUtilsForJavaEE.addServletMapping(webApp, servletName, servletClass, urlPatternString);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ServletRemoverForJ2EE.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ServletRemoverForJ2EE.java
deleted file mode 100644
index 9134a9a42..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ServletRemoverForJ2EE.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.jst.jsf.common.webxml.internal.operations;
-
-import static org.eclipse.jst.jsf.common.webxml.WebXmlUtilsForJ2EE.findServlet;
-import static org.eclipse.jst.jsf.common.webxml.WebXmlUtilsForJ2EE.removeServlet;
-import static org.eclipse.jst.jsf.common.webxml.WebXmlUtilsForJ2EE.removeServletMappings;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.j2ee.model.ModelProviderManager;
-import org.eclipse.jst.j2ee.webapplication.Servlet;
-import org.eclipse.jst.j2ee.webapplication.WebApp;
-
-
-/**
- * Removes a servlet and its associated mappings from web.xml.
- *
- * @author Debajit Adhikary
- *
- */
-public class ServletRemoverForJ2EE implements Runnable
-{
- private final IProject project;
- private final String servletClassName;
-
-
- /**
- * @param project
- * @param servletClassName
- */
- public ServletRemoverForJ2EE (final IProject project,
- final String servletClassName)
- {
- this.project = project;
- this.servletClassName = servletClassName;
- }
-
-
- public void run ()
- {
- final WebApp webApp = (WebApp) ModelProviderManager.getModelProvider(project).getModelObject();
- final Servlet servlet = findServlet(webApp, servletClassName);
-
- removeServletMappings(webApp, servlet);
- removeServlet(webApp, servlet);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ServletRemoverForJavaEE.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ServletRemoverForJavaEE.java
deleted file mode 100644
index baf6cd0ae..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal/operations/ServletRemoverForJavaEE.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.jst.jsf.common.webxml.internal.operations;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.j2ee.model.ModelProviderManager;
-import org.eclipse.jst.javaee.web.Servlet;
-import org.eclipse.jst.javaee.web.WebApp;
-import org.eclipse.jst.jsf.common.webxml.WebXmlUtilsForJavaEE;
-
-
-/**
- * Removes a servlet and its associated mappings from web.xml
- *
- * @author Debajit Adhikary
- *
- */
-public class ServletRemoverForJavaEE implements Runnable
-{
- private final IProject project;
- private final String servletClassName;
-
-
- /**
- * @param project
- * @param servletClassName
- */
- public ServletRemoverForJavaEE (final IProject project,
- final String servletClassName)
- {
- this.project = project;
- this.servletClassName = servletClassName;
- }
-
-
- public void run ()
- {
- final WebApp webApp = (WebApp) ModelProviderManager.getModelProvider(project).getModelObject();
- final Servlet servlet = WebXmlUtilsForJavaEE.findServlet(servletClassName, webApp);
-
- WebXmlUtilsForJavaEE.removeServletMappings(webApp, servlet);
- WebXmlUtilsForJavaEE.removeServlet(webApp, servlet);
- }
-}

Back to the top