diff options
Diffstat (limited to 'jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/webxml/internal')
18 files changed, 0 insertions, 1348 deletions
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); - } -} |