You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by dd...@apache.org on 2005/03/08 16:59:30 UTC
svn commit: r156536 [2/2] - in portals/pluto/trunk/descriptors: ./ src/
src/conf/ src/conf/org/ src/conf/org/apache/ src/conf/org/apache/pluto/
src/conf/org/apache/pluto/descriptors/
src/conf/org/apache/pluto/descriptors/portlet/
src/conf/org/apache/pluto/descriptors/servlet/ src/java/ src/java/org/
src/java/org/apache/ src/java/org/apache/pluto/
src/java/org/apache/pluto/descriptors/
src/java/org/apache/pluto/descriptors/common/
src/java/org/apache/pluto/descriptors/portlet/
src/java/org/apache/pluto/descriptors/services/
src/java/org/apache/pluto/descriptors/services/impl/
src/java/org/apache/pluto/descriptors/servlet/ src/test/ src/test/org/
src/test/org/apache/ src/test/org/apache/pluto/
src/test/org/apache/pluto/descriptors/
src/test/org/apache/pluto/descriptors/portlet/
src/test/org/apache/pluto/descriptors/servlet/
Added: portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/services/impl/ContextPortletAppDescriptorServiceImpl.java
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/services/impl/ContextPortletAppDescriptorServiceImpl.java?view=auto&rev=156536
==============================================================================
--- portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/services/impl/ContextPortletAppDescriptorServiceImpl.java (added)
+++ portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/services/impl/ContextPortletAppDescriptorServiceImpl.java Tue Mar 8 07:59:17 2005
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.services.impl;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.IOException;
+import java.net.URL;
+
+import javax.servlet.ServletContext;
+
+import org.apache.pluto.descriptors.servlet.WebAppDD;
+import org.apache.pluto.descriptors.services.impl.AbstractWebAppDescriptorService;
+
+/**
+ * Portlet Application Deployment Descriptor Service which
+ * retrieves reads the descriptor from the ServletContext.
+ *
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Mar 5, 2005
+ */
+public class ContextPortletAppDescriptorServiceImpl extends AbstractPortletAppDescriptorService {
+
+ public static final String PORTLET_XML_URI = "/WEB-INF/portlet.xml";
+
+ private ServletContext ctx;
+
+ public ContextPortletAppDescriptorServiceImpl(ServletContext ctx) {
+ super(ctx.getServletContextName());
+ this.ctx = ctx;
+ }
+
+ protected InputStream getInputStream()
+ throws IOException {
+ return ctx.getResourceAsStream(PORTLET_XML_URI);
+ }
+
+ protected OutputStream getOutputStream()
+ throws IOException {
+ URL url = ctx.getResource(PORTLET_XML_URI);
+ return url.openConnection().getOutputStream();
+ }
+}
+
Added: portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/services/impl/ContextWebAppDescriptorServiceImpl.java
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/services/impl/ContextWebAppDescriptorServiceImpl.java?view=auto&rev=156536
==============================================================================
--- portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/services/impl/ContextWebAppDescriptorServiceImpl.java (added)
+++ portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/services/impl/ContextWebAppDescriptorServiceImpl.java Tue Mar 8 07:59:17 2005
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.services.impl;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.IOException;
+import java.net.URL;
+
+import javax.servlet.ServletContext;
+
+import org.apache.pluto.descriptors.servlet.WebAppDD;
+import org.apache.pluto.descriptors.services.impl.AbstractWebAppDescriptorService;
+
+/**
+ * <B>TODO</B>: Document
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Mar 5, 2005
+ */
+public class ContextWebAppDescriptorServiceImpl extends AbstractWebAppDescriptorService {
+
+ public static final String WEB_XML_URI = "/WEB-INF/web.xml";
+
+ private ServletContext ctx;
+
+ public ContextWebAppDescriptorServiceImpl(ServletContext ctx) {
+ super(ctx.getServletContextName());
+ this.ctx = ctx;
+ }
+
+ protected InputStream getInputStream()
+ throws IOException {
+ return ctx.getResourceAsStream(WEB_XML_URI);
+ }
+
+ protected OutputStream getOutputStream()
+ throws IOException {
+ URL url = ctx.getResource(WEB_XML_URI);
+ return url.openConnection().getOutputStream();
+ }
+}
+
Added: portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/services/impl/FilePortletAppDescriptorServiceImpl.java
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/services/impl/FilePortletAppDescriptorServiceImpl.java?view=auto&rev=156536
==============================================================================
--- portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/services/impl/FilePortletAppDescriptorServiceImpl.java (added)
+++ portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/services/impl/FilePortletAppDescriptorServiceImpl.java Tue Mar 8 07:59:17 2005
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.services.impl;
+
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileInputStream;
+
+/**
+ *
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Mar 5, 2005
+ */
+public class FilePortletAppDescriptorServiceImpl extends AbstractPortletAppDescriptorService {
+
+ private static final String PORTLET_XML_FILE = "WEB-INF"+File.separator+"portlet.xml";
+
+ private File file;
+
+ public FilePortletAppDescriptorServiceImpl(File file) {
+ super(file.getName());
+ this.file = new File(file, PORTLET_XML_FILE);
+ }
+
+ protected InputStream getInputStream() throws IOException {
+ if(file.exists()) {
+ return new FileInputStream(file);
+ }
+ return null;
+ }
+
+ protected OutputStream getOutputStream() throws IOException {
+ if(file.exists()) {
+ return new FileOutputStream(file);
+ }
+ return null;
+ }
+}
+
Added: portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/services/impl/FileWebAppDescriptorServiceImpl.java
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/services/impl/FileWebAppDescriptorServiceImpl.java?view=auto&rev=156536
==============================================================================
--- portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/services/impl/FileWebAppDescriptorServiceImpl.java (added)
+++ portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/services/impl/FileWebAppDescriptorServiceImpl.java Tue Mar 8 07:59:17 2005
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.services.impl;
+
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileInputStream;
+
+/**
+ *
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Mar 5, 2005
+ */
+public class FileWebAppDescriptorServiceImpl extends AbstractWebAppDescriptorService {
+
+ private static final String WEB_XML_FILE = "WEB-INF/web.xml";
+
+ private File file;
+
+ public FileWebAppDescriptorServiceImpl(File file) {
+ super(file.getName());
+ this.file = new File(file, WEB_XML_FILE);
+ }
+
+ protected InputStream getInputStream() throws IOException {
+ if(file.exists()) {
+ return new FileInputStream(file);
+ }
+ return null;
+ }
+
+ protected OutputStream getOutputStream() throws IOException {
+ if(file.exists()) {
+ return new FileOutputStream(file);
+ }
+ return null;
+ }
+}
+
Added: portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/services/impl/StreamPortletAppDescriptorServiceImpl.java
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/services/impl/StreamPortletAppDescriptorServiceImpl.java?view=auto&rev=156536
==============================================================================
--- portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/services/impl/StreamPortletAppDescriptorServiceImpl.java (added)
+++ portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/services/impl/StreamPortletAppDescriptorServiceImpl.java Tue Mar 8 07:59:17 2005
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.services.impl;
+
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+
+/**
+ * <B>TODO</B>: Document
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Mar 7, 2005
+ */
+public class StreamPortletAppDescriptorServiceImpl
+ extends AbstractPortletAppDescriptorService {
+
+ private InputStream in;
+ private OutputStream out;
+
+ public StreamPortletAppDescriptorServiceImpl(String contextPath,
+ InputStream in,
+ OutputStream out) {
+ super(contextPath);
+ this.in = in;
+ this.out = out;
+ }
+
+ protected InputStream getInputStream() throws IOException {
+ return in;
+ }
+
+ protected OutputStream getOutputStream() throws IOException {
+ return out;
+ }
+}
+
Added: portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/AuthConstraintDD.java
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/AuthConstraintDD.java?view=auto&rev=156536
==============================================================================
--- portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/AuthConstraintDD.java (added)
+++ portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/AuthConstraintDD.java Tue Mar 8 07:59:17 2005
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.servlet;
+
+/**
+ * <B>TODO</B>: Document
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Feb 28, 2005
+ */
+public class AuthConstraintDD {
+
+ private String description;
+ private String roleName;
+
+ public AuthConstraintDD() {
+
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getRoleName() {
+ return roleName;
+ }
+
+ public void setRoleName(String roleName) {
+ this.roleName = roleName;
+ }
+
+}
+
Added: portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/EjbRefDD.java
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/EjbRefDD.java?view=auto&rev=156536
==============================================================================
--- portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/EjbRefDD.java (added)
+++ portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/EjbRefDD.java Tue Mar 8 07:59:17 2005
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.servlet;
+
+/**
+ * <B>TODO</B>: Document
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Feb 28, 2005
+ */
+public class EjbRefDD {
+
+ private String description;
+ private String ejbRefName;
+ private String ejbRefType;
+ private String home;
+ private String remote;
+ private String ejbLink;
+ private String runAs;
+
+ public EjbRefDD() {
+
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getEjbRefName() {
+ return ejbRefName;
+ }
+
+ public void setEjbRefName(String ejbRefName) {
+ this.ejbRefName = ejbRefName;
+ }
+
+ public String getEjbRefType() {
+ return ejbRefType;
+ }
+
+ public void setEjbRefType(String ejbRefType) {
+ this.ejbRefType = ejbRefType;
+ }
+
+ public String getHome() {
+ return home;
+ }
+
+ public void setHome(String home) {
+ this.home = home;
+ }
+
+ public String getRemote() {
+ return remote;
+ }
+
+ public void setRemote(String remote) {
+ this.remote = remote;
+ }
+
+ public String getEjbLink() {
+ return ejbLink;
+ }
+
+ public void setEjbLink(String ejbLink) {
+ this.ejbLink = ejbLink;
+ }
+
+ public String getRunAs() {
+ return runAs;
+ }
+
+ public void setRunAs(String runAs) {
+ this.runAs = runAs;
+ }
+
+}
+
Added: portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/EnvEntryDD.java
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/EnvEntryDD.java?view=auto&rev=156536
==============================================================================
--- portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/EnvEntryDD.java (added)
+++ portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/EnvEntryDD.java Tue Mar 8 07:59:17 2005
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.servlet;
+
+/**
+ * <B>TODO</B>: Document
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Feb 28, 2005
+ */
+public class EnvEntryDD {
+
+ private String description;
+ private String envEntryName;
+ private String envEntryValue;
+ private String envEntryType;
+
+ public EnvEntryDD() {
+
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getEnvEntryName() {
+ return envEntryName;
+ }
+
+ public void setEnvEntryName(String envEntryName) {
+ this.envEntryName = envEntryName;
+ }
+
+ public String getEnvEntryValue() {
+ return envEntryValue;
+ }
+
+ public void setEnvEntryValue(String envEntryValue) {
+ this.envEntryValue = envEntryValue;
+ }
+
+ public String getEnvEntryType() {
+ return envEntryType;
+ }
+
+ public void setEnvEntryType(String envEntryType) {
+ this.envEntryType = envEntryType;
+ }
+
+}
+
Added: portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/ErrorPageDD.java
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/ErrorPageDD.java?view=auto&rev=156536
==============================================================================
--- portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/ErrorPageDD.java (added)
+++ portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/ErrorPageDD.java Tue Mar 8 07:59:17 2005
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2004 The Apache Software FoundationType
+ *
+ * Licensed under the Apache License, VersionType 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissionTypes and
+ * limitationTypes under the License.
+ */
+package org.apache.pluto.descriptors.servlet;
+
+/**
+ * <B>TODO</B>: Document
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Mar 4, 2005
+ */
+public class ErrorPageDD {
+
+ private String errorCode;
+ private String exceptionType;
+ private String location;
+
+ public ErrorPageDD() {
+
+ }
+
+ public String getErrorCode() {
+ return errorCode;
+ }
+
+ public void setErrorCode(String errorCode) {
+ this.errorCode = errorCode;
+ }
+
+ public String getExceptionType() {
+ return exceptionType;
+ }
+
+ public void setExceptionType(String exceptionType) {
+ this.exceptionType = exceptionType;
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public void setLocation(String location) {
+ this.location = location;
+ }
+
+}
+
Added: portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/FilterDD.java
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/FilterDD.java?view=auto&rev=156536
==============================================================================
--- portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/FilterDD.java (added)
+++ portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/FilterDD.java Tue Mar 8 07:59:17 2005
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.servlet;
+
+import java.util.List;
+
+import org.apache.pluto.descriptors.common.IconDD;
+
+/**
+ * Filter DD() uration as contained within the
+ * web.xml Deployment Descriptor.
+ *
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Feb 28, 2005
+ */
+public class FilterDD {
+
+ private String filterName;
+ private String filterClass;
+ private String displayName;
+
+ private String description;
+ private IconDD icon;
+ private List initParams;
+
+ public FilterDD() {
+
+ }
+
+ public String getFilterName() {
+ return filterName;
+ }
+
+ public void setFilterName(String filterName) {
+ this.filterName = filterName;
+ }
+
+ public String getFilterClass() {
+ return filterClass;
+ }
+
+ public void setFilterClass(String filterClass) {
+ this.filterClass = filterClass;
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public IconDD getIcon() {
+ return icon;
+ }
+
+ public void setIcon(IconDD icon) {
+ this.icon = icon;
+ }
+
+ public List getInitParams() {
+ return initParams;
+ }
+
+ public void setInitParams(List initParams) {
+ this.initParams = initParams;
+ }
+
+ public boolean isValid() {
+ return filterName != null && filterClass != null;
+ }
+}
+
Added: portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/FilterMappingDD.java
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/FilterMappingDD.java?view=auto&rev=156536
==============================================================================
--- portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/FilterMappingDD.java (added)
+++ portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/FilterMappingDD.java Tue Mar 8 07:59:17 2005
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.servlet;
+
+import java.util.Set;
+
+/**
+ * FilterMapping configuration as contained within the
+ * web.xml Deployment Descriptor.
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Feb 28, 2005
+ */
+public class FilterMappingDD {
+
+ private String filterName;
+ private String servletName;
+ private Set urlPattern;
+ private Set dispatchers;
+
+ public FilterMappingDD() {
+
+ }
+
+ public String getFilterName() {
+ return filterName;
+ }
+
+ public void setFilterName(String filterName) {
+ this.filterName = filterName;
+ }
+
+ public Set getUrlPatterns() {
+ return urlPattern;
+ }
+
+ public void setUrlPatterns(Set urlPattern) {
+ this.urlPattern = urlPattern;
+ }
+
+ public String getServletName() {
+ return servletName;
+ }
+
+ public void setServletName(String servletName) {
+ this.servletName = servletName;
+ }
+
+ public Set getDispatchers() {
+ return dispatchers;
+ }
+
+ public void setDispatchers(Set dispatchers) {
+ this.dispatchers = dispatchers;
+ }
+
+}
+
Added: portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/FormLoginConfigDD.java
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/FormLoginConfigDD.java?view=auto&rev=156536
==============================================================================
--- portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/FormLoginConfigDD.java (added)
+++ portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/FormLoginConfigDD.java Tue Mar 8 07:59:17 2005
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.servlet;
+
+/**
+ * <B>TODO</B>: Document
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Mar 4, 2005
+ */
+public class FormLoginConfigDD {
+
+ private String formLoginPage;
+ private String formErrorPage;
+
+ public FormLoginConfigDD() {
+
+ }
+
+ public String getFormLoginPage() {
+ return formLoginPage;
+ }
+
+ public void setFormLoginPage(String formLoginPage) {
+ this.formLoginPage = formLoginPage;
+ }
+
+ public String getFormErrorPage() {
+ return formErrorPage;
+ }
+
+ public void setFormErrorPage(String formErrorPage) {
+ this.formErrorPage = formErrorPage;
+ }
+}
+
Added: portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/ListenerDD.java
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/ListenerDD.java?view=auto&rev=156536
==============================================================================
--- portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/ListenerDD.java (added)
+++ portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/ListenerDD.java Tue Mar 8 07:59:17 2005
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.servlet;
+
+/**
+ * <B>TODO</B>: Document
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Feb 28, 2005
+ */
+public class ListenerDD {
+
+ private String listenerClass;
+
+ public ListenerDD() {
+
+ }
+
+ public String getListenerClass() {
+ return listenerClass;
+ }
+
+ public void setListenerClass(String listenerClass) {
+ this.listenerClass = listenerClass;
+ }
+}
+
Added: portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/LoadOnStartupDD.java
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/LoadOnStartupDD.java?view=auto&rev=156536
==============================================================================
--- portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/LoadOnStartupDD.java (added)
+++ portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/LoadOnStartupDD.java Tue Mar 8 07:59:17 2005
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.servlet;
+
+/**
+ * <B>TODO</B>: Document
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Mar 8, 2005
+ */
+public class LoadOnStartupDD {
+
+ private int priority;
+
+ public LoadOnStartupDD() {
+
+ }
+
+ public int getPriority() {
+ return priority;
+ }
+
+ public void setPriority(int priority) {
+ this.priority = priority;
+ }
+
+}
+
Added: portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/LoginConfigDD.java
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/LoginConfigDD.java?view=auto&rev=156536
==============================================================================
--- portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/LoginConfigDD.java (added)
+++ portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/LoginConfigDD.java Tue Mar 8 07:59:17 2005
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.servlet;
+
+/**
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Feb 28, 2005
+ */
+public class LoginConfigDD {
+
+ private String authMethod;
+ private String realmName;
+ private FormLoginConfigDD formLoginConfig;
+
+ public LoginConfigDD() {
+
+ }
+
+ public String getAuthMethod() {
+ return authMethod;
+ }
+
+ public void setAuthMethod(String authMethod) {
+ this.authMethod = authMethod;
+ }
+
+ public String getRealmName() {
+ return realmName;
+ }
+
+ public void setRealmName(String realmName) {
+ this.realmName = realmName;
+ }
+
+ public FormLoginConfigDD getFormLoginConfig() {
+ return formLoginConfig ;
+ }
+
+ public void setFormLoginConfig(FormLoginConfigDD formLoginConfig) {
+ this.formLoginConfig = formLoginConfig;
+ }
+}
+
Added: portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/MimeMappingDD.java
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/MimeMappingDD.java?view=auto&rev=156536
==============================================================================
--- portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/MimeMappingDD.java (added)
+++ portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/MimeMappingDD.java Tue Mar 8 07:59:17 2005
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.servlet;
+
+import java.util.List;
+
+/**
+ * <B>TODO</B>: Document
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Feb 28, 2005
+ */
+public class MimeMappingDD {
+
+ private String extension;
+ private String mimeType;
+
+ public MimeMappingDD() {
+
+ }
+
+ public String getMimeType() {
+ return mimeType;
+ }
+
+ public void setMimeType(String mimeType) {
+ this.mimeType = mimeType;
+ }
+
+ public String getExtension() {
+ return extension;
+ }
+
+ public void setExtension(String extension) {
+ this.extension = extension;
+ }
+
+}
+
Added: portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/ResourceRefDD.java
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/ResourceRefDD.java?view=auto&rev=156536
==============================================================================
--- portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/ResourceRefDD.java (added)
+++ portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/ResourceRefDD.java Tue Mar 8 07:59:17 2005
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.servlet;
+
+/**
+ * <B>TODO</B>: Document
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Feb 28, 2005
+ */
+public class ResourceRefDD {
+
+ private String description;
+ private String resRefName;
+ private String resType;
+ private String resAuth;
+ private String resSharingScope;
+
+ public ResourceRefDD() {
+
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getResRefName() {
+ return resRefName;
+ }
+
+ public void setResRefName(String resRefName) {
+ this.resRefName = resRefName;
+ }
+
+ public String getResType() {
+ return resType;
+ }
+
+ public void setResType(String resType) {
+ this.resType = resType;
+ }
+
+ public String getResAuth() {
+ return resAuth;
+ }
+
+ public void setResAuth(String resAuth) {
+ this.resAuth = resAuth;
+ }
+
+ public String getResSharingScope() {
+ return resSharingScope;
+ }
+
+ public void setResSharingScope(String resSharingScope) {
+ this.resSharingScope = resSharingScope;
+ }
+
+}
+
Added: portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/SecurityConstraintDD.java
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/SecurityConstraintDD.java?view=auto&rev=156536
==============================================================================
--- portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/SecurityConstraintDD.java (added)
+++ portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/SecurityConstraintDD.java Tue Mar 8 07:59:17 2005
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.servlet;
+
+import java.util.List;
+
+/**
+ * <B>TODO</B>: Document
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Feb 28, 2005
+ */
+public class SecurityConstraintDD {
+
+ private String displayName;
+ private List webResourceCollection;
+ private AuthConstraintDD authConstraint;
+ private UserDataConstraintDD userDataConstraint;
+
+ public SecurityConstraintDD() {
+
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public List getWebResourceCollections() {
+ return webResourceCollection;
+ }
+
+ public void setWebResourceCollections(List webResourceCollection) {
+ this.webResourceCollection = webResourceCollection;
+ }
+
+ public AuthConstraintDD getAuthConstraint() {
+ return authConstraint;
+ }
+
+ public void setAuthConstraint(AuthConstraintDD authConstraint) {
+ this.authConstraint = authConstraint;
+ }
+
+ public UserDataConstraintDD getUserDataConstraint() {
+ return userDataConstraint;
+ }
+
+ public void setUserDataConstraint(
+ UserDataConstraintDD userDataConstraint) {
+ this.userDataConstraint = userDataConstraint;
+ }
+
+
+}
+
Added: portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/SecurityRoleDD.java
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/SecurityRoleDD.java?view=auto&rev=156536
==============================================================================
--- portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/SecurityRoleDD.java (added)
+++ portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/SecurityRoleDD.java Tue Mar 8 07:59:17 2005
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.servlet;
+
+/**
+ * <B>TODO</B>: Document
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Feb 28, 2005
+ */
+public class SecurityRoleDD {
+
+ private String description;
+ private String roleName;
+
+ public SecurityRoleDD() {
+
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getRoleName() {
+ return roleName;
+ }
+
+ public void setRoleName(String roleName) {
+ this.roleName = roleName;
+ }
+
+}
+
Added: portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/ServletDD.java
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/ServletDD.java?view=auto&rev=156536
==============================================================================
--- portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/ServletDD.java (added)
+++ portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/ServletDD.java Tue Mar 8 07:59:17 2005
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.servlet;
+
+import java.util.List;
+import java.util.ArrayList;
+
+import org.apache.pluto.descriptors.common.IconDD;
+
+/**
+ * Filter DD() uration as contained within the
+ * web.xml Deployment Descriptor.
+ *
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Feb 28, 2005
+ */
+public class ServletDD {
+
+ private String servletName;
+ private String servletClass;
+ private String displayName;
+ private String description;
+ private String jspFile;
+ private LoadOnStartupDD loadOnStartup;
+
+ private IconDD icon;
+ private List initParams = new ArrayList();
+ private List securityRoleRefs = new ArrayList();
+
+ public ServletDD() {
+
+ }
+
+ public String getServletName() {
+ return servletName;
+ }
+
+ public void setServletName(String servletName) {
+ this.servletName = servletName;
+ }
+
+ public String getServletClass() {
+ return servletClass;
+ }
+
+ public void setServletClass(String servletClass) {
+ this.servletClass = servletClass;
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public String getJspFile() {
+ return jspFile;
+ }
+
+ public void setJspFile(String jspFile) {
+ this.jspFile = jspFile;
+ }
+
+ public LoadOnStartupDD getLoadOnStartup() {
+ return loadOnStartup;
+ }
+
+ public void setLoadOnStartup(LoadOnStartupDD loadOnStartup) {
+ this.loadOnStartup = loadOnStartup;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public IconDD getIcon() {
+ return icon;
+ }
+
+ public void setIcon(IconDD icon) {
+ this.icon = icon;
+ }
+
+ public List getInitParams() {
+ return initParams;
+ }
+
+ public void setInitParams(List initParams) {
+ this.initParams = initParams;
+ }
+
+ public List getSecurityRoleRefs() {
+ return securityRoleRefs;
+ }
+
+ public void setSecurityRoleRefs(List securityRoleRefs) {
+ this.securityRoleRefs = securityRoleRefs;
+ }
+
+}
+
Added: portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/ServletMappingDD.java
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/ServletMappingDD.java?view=auto&rev=156536
==============================================================================
--- portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/ServletMappingDD.java (added)
+++ portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/ServletMappingDD.java Tue Mar 8 07:59:17 2005
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.servlet;
+
+/**
+ * ServletMapping configuration as contained within the
+ * web.xml Deployment Descriptor.
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Feb 28, 2005
+ */
+public class ServletMappingDD {
+
+ private String filterName;
+ private String urlPattern;
+
+ public ServletMappingDD() {
+
+ }
+
+ public String getServletName() {
+ return filterName;
+ }
+
+ public void setServletName(String filterName) {
+ this.filterName = filterName;
+ }
+
+ public String getUrlPattern() {
+ return urlPattern;
+ }
+
+ public void setUrlPattern(String urlPattern) {
+ this.urlPattern = urlPattern;
+ }
+
+
+}
+
Added: portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/SessionConfigDD.java
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/SessionConfigDD.java?view=auto&rev=156536
==============================================================================
--- portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/SessionConfigDD.java (added)
+++ portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/SessionConfigDD.java Tue Mar 8 07:59:17 2005
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.servlet;
+
+/**
+ * <B>TODO</B>: Document
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Feb 28, 2005
+ */
+public class SessionConfigDD {
+
+ private int sessionTimeout;
+
+ public SessionConfigDD() {
+
+ }
+
+ public int getSessionTimeout() {
+ return sessionTimeout;
+ }
+
+ public void setSessionTimeout(int sessionTimeout) {
+ this.sessionTimeout = sessionTimeout;
+ }
+
+}
+
Added: portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/TaglibDD.java
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/TaglibDD.java?view=auto&rev=156536
==============================================================================
--- portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/TaglibDD.java (added)
+++ portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/TaglibDD.java Tue Mar 8 07:59:17 2005
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.servlet;
+
+/**
+ * <B>TODO</B>: Document
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Feb 28, 2005
+ */
+public class TaglibDD {
+
+ private String taglibUri;
+ private String taglibLocation;
+
+ public TaglibDD() {
+
+ }
+
+ public String getTaglibUri() {
+ return taglibUri;
+ }
+
+ public void setTaglibUri(String taglibUri) {
+ this.taglibUri = taglibUri;
+ }
+
+ public String getTaglibLocation() {
+ return taglibLocation;
+ }
+
+ public void setTaglibLocation(String taglibLocation) {
+ this.taglibLocation = taglibLocation;
+ }
+
+}
+
Added: portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/UserDataConstraintDD.java
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/UserDataConstraintDD.java?view=auto&rev=156536
==============================================================================
--- portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/UserDataConstraintDD.java (added)
+++ portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/UserDataConstraintDD.java Tue Mar 8 07:59:17 2005
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.servlet;
+
+/**
+ * <B>TODO</B>: Document
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Feb 28, 2005
+ */
+public class UserDataConstraintDD {
+
+ public static final String NONE = "NONE";
+ public static final String INTEGRAL = "INTEGRAL";
+ public static final String CONFIDENTIAL = "CONFIDENTIAL";
+
+ private String description;
+ private String transportGuarantee;
+
+ public UserDataConstraintDD() {
+
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getTransportGuarantee() {
+ return transportGuarantee;
+ }
+
+ public void setTransportGuarantee(String transportGuarantee) {
+ this.transportGuarantee = transportGuarantee;
+ }
+
+}
+
Added: portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/WebAppDD.java
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/WebAppDD.java?view=auto&rev=156536
==============================================================================
--- portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/WebAppDD.java (added)
+++ portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/WebAppDD.java Tue Mar 8 07:59:17 2005
@@ -0,0 +1,266 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.servlet;
+
+import java.util.Set;
+import java.util.Iterator;
+import java.util.HashSet;
+
+import org.apache.pluto.descriptors.common.IconDD;
+
+/**
+ * WebApplication configuration as contained
+ * within the web.xml Deployment Descriptor.
+ *
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Feb 28, 2005
+ */
+public class WebAppDD {
+
+ private IconDD icon;
+ private String displayName;
+ private String description;
+ private boolean distributable;
+ private Set contextParams;
+ private Set filters;
+ private Set filterMappings;
+ private Set listeners;
+ private Set servlets;
+ private Set servletMappings;
+ private SessionConfigDD sessionConfig;
+ private Set mimeMappings;
+ private WelcomeFileListDD welcomeFileSet;
+ private Set errorPages;
+ private Set taglibs;
+ private Set resourceRefs;
+ private Set securityConstraints;
+ private LoginConfigDD loginConfig;
+ private Set securityRoles;
+ private Set envEntrys;
+ private Set ejbRefs;
+
+ public WebAppDD() {
+
+ }
+
+ public IconDD getIcon() {
+ return icon;
+ }
+
+ public void setIcon(IconDD icon) {
+ this.icon= icon;
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public boolean isDistributable() {
+ return distributable;
+ }
+
+ public void setDistributable() {
+ this.distributable = true;
+ }
+
+ public void setDistributable(boolean distributable) {
+ this.distributable = distributable;
+ }
+
+ /**
+ * Retrieve the context parameters.
+ * @return InitParamDD instances.
+ */
+ public Set getContextParams() {
+ return contextParams;
+ }
+
+ public void setContextParams(Set contextParams) {
+ this.contextParams = contextParams;
+ }
+
+ public Set getFilters() {
+ return filters;
+ }
+
+ public void setFilters(Set filters) {
+ this.filters = filters;
+ }
+
+ public Set getFilterMappings() {
+ return filterMappings;
+ }
+
+ public void setFilterMappings(Set filterMappings) {
+ this.filterMappings = filterMappings;
+ }
+
+ public Set getListeners() {
+ return listeners;
+ }
+
+ public void setListeners(Set listeners) {
+ this.listeners = listeners;
+ }
+
+ public Set getServlets() {
+ return servlets;
+ }
+
+ public void setServlets(Set servlets) {
+ this.servlets = servlets;
+ }
+
+ public Set getServletMappings() {
+ return servletMappings;
+ }
+
+ public void setServletMappings(Set servletMappings) {
+ this.servletMappings = servletMappings;
+ }
+
+ public SessionConfigDD getSessionConfig() {
+ return sessionConfig ;
+ }
+
+ public void setSessionConfig(SessionConfigDD sessionConfig) {
+ this.sessionConfig = sessionConfig;
+ }
+
+ public Set getMimeMappings() {
+ return mimeMappings;
+ }
+
+ public void setMimeMappings(Set mimeMappings) {
+ this.mimeMappings = mimeMappings;
+ }
+
+ public WelcomeFileListDD getWelcomeFileList() {
+ return welcomeFileSet;
+ }
+
+ public void setWelcomeFileList(WelcomeFileListDD welcomeFileSet) {
+ this.welcomeFileSet = welcomeFileSet;
+ }
+
+ public Set getErrorPages() {
+ return errorPages;
+ }
+
+ public void setErrorPages(Set errorPages) {
+ this.errorPages = errorPages;
+ }
+
+ public Set getTaglibs() {
+ return taglibs;
+ }
+
+ public void setTaglibs(Set taglibs) {
+ this.taglibs = taglibs;
+ }
+
+ public Set getResourceRefs() {
+ return resourceRefs;
+ }
+
+ public void setResourceRefs(Set resourceRefs) {
+ this.resourceRefs = resourceRefs;
+ }
+
+ public Set getSecurityConstraints() {
+ return securityConstraints;
+ }
+
+ public void setSecurityConstraints(Set securityConstraints) {
+ this.securityConstraints = securityConstraints;
+ }
+
+ public LoginConfigDD getLoginConfig() {
+ return loginConfig;
+ }
+
+ public void setLoginConfig(LoginConfigDD loginConfig) {
+ this.loginConfig = loginConfig;
+ }
+
+ public Set getSecurityRoles() {
+ return securityRoles;
+ }
+
+ public void setSecurityRoles(Set securityRoles) {
+ this.securityRoles = securityRoles;
+ }
+
+ public Set getEnvEntrys() {
+ return envEntrys;
+ }
+
+ public void setEnvEntrys(Set envEntrys) {
+ this.envEntrys = envEntrys;
+ }
+
+ public Set getEjbRefs() {
+ return ejbRefs;
+ }
+
+ public void setEjbRefs(Set ejbRefs) {
+ this.ejbRefs = ejbRefs;
+ }
+
+// Helpers
+
+ public ServletDD getServlet(String name) {
+ HashSet set = new HashSet(servlets);
+ Iterator it = set.iterator();
+ ServletDD dd;
+ while(name!=null && it.hasNext()) {
+ dd = (ServletDD)it.next();
+ if(name.equals(dd.getServletName())) {
+ return dd;
+ }
+ }
+ return null;
+ }
+
+ public ServletMappingDD getServletMapping(String uri) {
+ HashSet set = new HashSet(servletMappings);
+ Iterator it = set.iterator();
+ ServletMappingDD dd;
+ while(uri!=null && it.hasNext()) {
+ dd = (ServletMappingDD)it.next();
+ if(uri.equals(dd.getUrlPattern())) {
+ return dd;
+ }
+ }
+ return null;
+ }
+
+
+}
+
Added: portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/WebResourceCollectionDD.java
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/WebResourceCollectionDD.java?view=auto&rev=156536
==============================================================================
--- portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/WebResourceCollectionDD.java (added)
+++ portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/WebResourceCollectionDD.java Tue Mar 8 07:59:17 2005
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.servlet;
+
+import java.util.Set;
+
+/**
+ * <B>TODO</B>: Document
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Mar 4, 2005
+ */
+public class WebResourceCollectionDD {
+
+ private String webResourceName;
+ private String description;
+ private Set httpMethods;
+ private Set urlPatterns;
+
+ public WebResourceCollectionDD() {
+
+ }
+
+ public String getWebResourceName() {
+ return webResourceName;
+ }
+
+ public void setWebResourceName(String webResourceName) {
+ this.webResourceName = webResourceName;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Set getHttpMethods() {
+ return httpMethods;
+ }
+
+ public void setHttpMethods(Set httpMethods) {
+ this.httpMethods = httpMethods;
+ }
+
+ public Set getUrlPatterns() {
+ return urlPatterns;
+ }
+
+ public void setUrlPatterns(Set urlPatterns) {
+ this.urlPatterns = urlPatterns;
+ }
+
+
+}
+
Added: portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/WelcomeFileListDD.java
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/WelcomeFileListDD.java?view=auto&rev=156536
==============================================================================
--- portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/WelcomeFileListDD.java (added)
+++ portals/pluto/trunk/descriptors/src/java/org/apache/pluto/descriptors/servlet/WelcomeFileListDD.java Tue Mar 8 07:59:17 2005
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.servlet;
+
+import java.util.List;
+
+/**
+ * <B>TODO</B>: Document
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Feb 28, 2005
+ */
+public class WelcomeFileListDD {
+
+ private List welcomeFiles;
+
+ public WelcomeFileListDD() {
+
+ }
+
+ public List getWelcomeFiles() {
+ return welcomeFiles;
+ }
+
+ public void setWelcomeFiles(List welcomeFiles) {
+ this.welcomeFiles = welcomeFiles;
+ }
+
+}
+
Added: portals/pluto/trunk/descriptors/src/test/org/apache/pluto/descriptors/portlet/CastorMappingTest.java
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/descriptors/src/test/org/apache/pluto/descriptors/portlet/CastorMappingTest.java?view=auto&rev=156536
==============================================================================
--- portals/pluto/trunk/descriptors/src/test/org/apache/pluto/descriptors/portlet/CastorMappingTest.java (added)
+++ portals/pluto/trunk/descriptors/src/test/org/apache/pluto/descriptors/portlet/CastorMappingTest.java Tue Mar 8 07:59:17 2005
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.portlet;
+
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.net.URL;
+import java.util.Enumeration;
+
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+import junit.framework.Test;
+import org.exolab.castor.xml.Unmarshaller;
+import org.exolab.castor.mapping.Mapping;
+import org.apache.pluto.descriptors.servlet.WebAppDD;
+import org.apache.pluto.descriptors.services.impl.FilePortletAppDescriptorServiceImpl;
+import org.apache.pluto.descriptors.services.impl.StreamPortletAppDescriptorServiceImpl;
+
+/**
+ *
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Mar 4, 2005
+ */
+public class CastorMappingTest extends TestCase {
+
+ private boolean debug = false;
+
+
+//
+ public void setUp() throws Exception {
+ this.debug = false;
+ }
+
+ public void testUnmarshalWebXml() throws Exception {
+ InputStream in = getClass().getResourceAsStream("portlet.xml");
+ PortletAppDD config =
+ new StreamPortletAppDescriptorServiceImpl(
+ "test", in, (OutputStream)null
+ ).read();
+
+ assertTrue(config!=null);
+ assertTrue(config.getPortlets()!=null);
+ assertTrue(config.getPortlets().size() > 0);
+ }
+
+ /**
+ * Start the tests.
+ *
+ * @param theArgs the arguments. Not used
+ */
+ public static void main(String[] theArgs) {
+ junit.awtui.TestRunner.main(
+ new String[] { CastorMappingTest.class.getName()});
+ }
+
+ /**
+ * @return a test suite (<code>TestSuite</code>) that includes all methods
+ * starting with "test"
+ */
+ public static Test suite() {
+ // All methods starting with "test" will be executed in the test suite.
+ return new TestSuite(CastorMappingTest.class);
+ }
+
+}
+
Added: portals/pluto/trunk/descriptors/src/test/org/apache/pluto/descriptors/servlet/CastorMappingTest.java
URL: http://svn.apache.org/viewcvs/portals/pluto/trunk/descriptors/src/test/org/apache/pluto/descriptors/servlet/CastorMappingTest.java?view=auto&rev=156536
==============================================================================
--- portals/pluto/trunk/descriptors/src/test/org/apache/pluto/descriptors/servlet/CastorMappingTest.java (added)
+++ portals/pluto/trunk/descriptors/src/test/org/apache/pluto/descriptors/servlet/CastorMappingTest.java Tue Mar 8 07:59:17 2005
@@ -0,0 +1,107 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.servlet;
+
+import java.io.FileWriter;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+import junit.framework.Test;
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+import org.exolab.castor.mapping.Mapping;
+import org.apache.xml.serialize.OutputFormat;
+import org.apache.xml.serialize.XMLSerializer;
+
+/**
+ *
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Mar 4, 2005
+ */
+public class CastorMappingTest extends TestCase {
+
+ private boolean debug = false;
+
+
+//
+ public void setUp() throws Exception {
+ this.debug = false;
+ }
+
+ public void testUnmarshalWebXml() throws Exception {
+ URL webXmlMapping = getClass().getResource("castor-web-xml-mapping.xml");
+ Mapping mapping = new Mapping();
+ mapping.loadMapping(webXmlMapping);
+ InputStream webXml = getClass().getResourceAsStream("web.xml");
+ Unmarshaller unmarshaller = new Unmarshaller(mapping);
+ unmarshaller.setIgnoreExtraElements(false);
+ unmarshaller.setDebug(debug);
+ WebAppDD config = (WebAppDD)unmarshaller.unmarshal(new InputStreamReader(webXml));
+ assertTrue(config!=null);
+ }
+
+ public void testMarshalWebXml() throws Exception {
+ URL webXmlMapping = getClass().getResource("castor-web-xml-mapping.xml");
+ Mapping mapping = new Mapping();
+ mapping.loadMapping(webXmlMapping);
+ InputStream webXml = getClass().getResourceAsStream("web.xml");
+ Unmarshaller unmarshaller = new Unmarshaller(mapping);
+ WebAppDD config = (WebAppDD)unmarshaller.unmarshal(new InputStreamReader(webXml));
+
+ OutputFormat of = new OutputFormat();
+ of.setIndenting(true);
+ of.setIndent(4); // 2-space indention
+ of.setLineWidth(16384);
+ // As large as needed to prevent linebreaks in text nodes
+ of.setDoctype(
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN",
+ "http://java.sun.com/dtd/web-app_2_3.dtd");
+
+ FileWriter writer = new FileWriter("newWeb.xml");
+ XMLSerializer serializer = new XMLSerializer(writer, of);
+ Marshaller marsh = new Marshaller(serializer.asDocumentHandler());
+ marsh.setDebug(debug);
+ marsh.setMapping(mapping);
+ marsh.marshal(config);
+
+ }
+
+
+ /**
+ * Start the tests.
+ *
+ * @param theArgs the arguments. Not used
+ */
+ public static void main(String[] theArgs) {
+ junit.awtui.TestRunner.main(
+ new String[] { CastorMappingTest.class.getName()});
+ }
+
+ /**
+ * @return a test suite (<code>TestSuite</code>) that includes all methods
+ * starting with "test"
+ */
+ public static Test suite() {
+ // All methods starting with "test" will be executed in the test suite.
+ return new TestSuite(CastorMappingTest.class);
+ }
+
+}
+