Return-Path: Delivered-To: apmail-portals-pluto-scm-archive@www.apache.org Received: (qmail 20017 invoked from network); 29 Jul 2004 13:46:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 29 Jul 2004 13:46:34 -0000 Received: (qmail 83486 invoked by uid 500); 29 Jul 2004 13:46:34 -0000 Delivered-To: apmail-portals-pluto-scm-archive@portals.apache.org Received: (qmail 83438 invoked by uid 500); 29 Jul 2004 13:46:33 -0000 Mailing-List: contact pluto-scm-help@portals.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list pluto-scm@portals.apache.org Received: (qmail 83415 invoked by uid 500); 29 Jul 2004 13:46:33 -0000 Delivered-To: apmail-jakarta-pluto-cvs@apache.org Received: (qmail 83404 invoked by uid 99); 29 Jul 2004 13:46:33 -0000 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.27.1) with SMTP; Thu, 29 Jul 2004 06:46:31 -0700 Received: (qmail 19999 invoked by uid 1753); 29 Jul 2004 13:46:30 -0000 Date: 29 Jul 2004 13:46:30 -0000 Message-ID: <20040729134630.19998.qmail@minotaur.apache.org> From: blumm@apache.org To: jakarta-pluto-cvs@apache.org Subject: cvs commit: jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl Deploy.java X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N blumm 2004/07/29 06:46:30 Modified: portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl WebApplicationDefinitionImpl.java portal/src/webapp/WEB-INF/data/xml servletdefinitionmapping.xml portal/src/java/org/apache/pluto/portalImpl/xml XmlParser.java portal/src/java/org/apache/pluto/portalImpl Deploy.java Added: portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl TagDefinitionSet.java ResourceRef.java Log: Changes made to Pluto to swallow WSAD generated JSR168 war files: [1] Ignore extra elements and attributes in Web.xml and do not do validation while parsing the document. [2] Modified code for handling of multiple s. [3] Added code to handle tag. Submitted by: Yongcheng Li/ycli@us.ibm.com Revision Changes Path 1.6 +42 -30 jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/WebApplicationDefinitionImpl.java Index: WebApplicationDefinitionImpl.java =================================================================== RCS file: /home/cvs/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/WebApplicationDefinitionImpl.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- WebApplicationDefinitionImpl.java 7 Jun 2004 13:21:42 -0000 1.5 +++ WebApplicationDefinitionImpl.java 29 Jul 2004 13:46:30 -0000 1.6 @@ -49,20 +49,20 @@ // - public String icon; - public String distributable; - public String sessionConfig; - public String mimeMapping; - public String welcomeFileList; - public String errorPage; - public String resourceRef; - public String securityConstraint; - public String loginConfig; - public String securityRole; - public String envEntry; - public String ejbRef; - private Collection castorMimeMappings = new ArrayList(); - // + public String icon = null; + public String distributable = null; + public String sessionConfig = null; + public String mimeMapping = null; + public String welcomeFileList = null; + public String errorPage = null; + public String taglib = null; + public String resourceRef = null; + public String securityConstraint = null; + public String loginConfig = null; + public String securityRole = null; + public String envEntry = null; + public String ejbRef = null; + private Collection castorMimeMappings = new ArrayList(); // private String contextPath = null; @@ -74,7 +74,12 @@ private Collection servletMappings = new ArrayList(); private ServletDefinitionList servlets = new ServletDefinitionListImpl(); private SecurityRoleSet securityRoles = new org.apache.pluto.portalImpl.om.common.impl.SecurityRoleSetImpl(); - private Collection castorTagDefinitions = new ArrayList(); + + // modified by YCLI: START :: to handle multiple taglib tags and resource-ref tag + // private TagDefinition castorTagDefinition = new TagDefinition(); + private TagDefinitionSet taglibs = new TagDefinitionSet(); + private ResourceRef castorResourceRef = new ResourceRef(); + // modified by YCLI: END // WebApplicationDefinition implementation. @@ -293,15 +298,6 @@ buffer.append(((ServletMappingImpl)iterator.next()).toString(indent+2)); } - iterator = castorTagDefinitions.iterator(); - if (iterator.hasNext()) { - StringUtils.newLine(buffer,indent); - buffer.append("CastorTagDefinitions:"); - } - while (iterator.hasNext()) { - buffer.append(((TagDefinitionImpl)iterator.next()).toString(indent+2)); - } - StringUtils.newLine(buffer,indent); buffer.append("contextPath='"); buffer.append(contextPath); buffer.append("'"); StringUtils.newLine(buffer,indent); @@ -312,16 +308,32 @@ /** * @return */ + + // modified by YCLI: START :: handling multiple taglib tags and resource-ref tag + + public TagDefinitionSet getTagDefinitionSet() + { + return taglibs; + } + public Collection getCastorTagDefinitions() { - return castorTagDefinitions; + return (TagDefinitionSet) taglibs; } - /** - * @param definition - */ - public void setCastorTagDefinitions(Collection definition) { - castorTagDefinitions = definition; + public void setCastorTagDefinitions(TagDefinitionSet taglibs) + { + this.taglibs = taglibs; } + + public ResourceRef getResourceRef() { + return castorResourceRef; + } + + public void setResourceRef(ResourceRef resourceRef) { + castorResourceRef = resourceRef; + } + // modified by YCLI: END + /** * @return Returns the castorMimeMappings. */ 1.1 jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/TagDefinitionSet.java Index: TagDefinitionSet.java =================================================================== /* * Copyright 2003,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.portalImpl.om.servlet.impl; import java.util.Iterator; import java.util.Locale; import org.apache.pluto.portalImpl.om.common.AbstractSupportSet; import org.apache.pluto.portalImpl.om.common.Support; import org.apache.pluto.util.StringUtils; public class TagDefinitionSet extends AbstractSupportSet implements java.io.Serializable, Support { // DescriptionSet implemenation. public TagDefinition get(Locale locale) { return null; } // Support implementation. /* (non-Javadoc) * @see org.apache.pluto.portalImpl.om.common.Support#postBuild(Object) */ public void postBuild(Object parameter) throws Exception { } /* (non-Javadoc) * @see org.apache.pluto.portalImpl.om.common.Support#postLoad(Object) */ public void postLoad(Object parameter) throws Exception { } /* (non-Javadoc) * @see org.apache.pluto.portalImpl.om.common.Support#postStore(Object) */ public void postStore(Object parameter) throws Exception { } /* (non-Javadoc) * @see org.apache.pluto.portalImpl.om.common.Support#preBuild(Object) */ public void preBuild(Object parameter) throws Exception { } /* (non-Javadoc) * @see org.apache.pluto.portalImpl.om.common.Support#preStore(Object) */ public void preStore(Object parameter) throws Exception { } // additional methods public String toString() { return toString(0); } public String toString(int indent) { /* StringBuffer buffer = new StringBuffer(50); StringUtils.newLine(buffer,indent); buffer.append(getClass().toString()); buffer.append(": "); Iterator iterator = this.iterator(); while (iterator.hasNext()) { buffer.append(((TagDefinition)iterator.next()).toString(indent+2)); } return buffer.toString(); */ return null; } } 1.1 jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/ResourceRef.java Index: ResourceRef.java =================================================================== /* * Copyright 2003,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. */ /* * (C) Copyright IBM Corp. 2003 */ package org.apache.pluto.portalImpl.om.servlet.impl; public class ResourceRef { private String description = "my description"; private String name = "name"; private String type = "type"; private String auth = "container"; private String sharing = "shareable"; /** * @return */ public String getDescription() { return description; } /** * @return */ public String getName() { return name; } public String getType() { return type; } public String getAuth() { return auth; } public String getSharing() { return sharing; } /** * @param string */ public void setDescription(String string) { description = string; } /** * @param string */ public void setName(String string) { name = string; } public void setType(String string) { type = string; } public void setAuth(String string) { auth = string; } public void setSharing(String string) { sharing = string; } } 1.6 +29 -3 jakarta-pluto/portal/src/webapp/WEB-INF/data/xml/servletdefinitionmapping.xml Index: servletdefinitionmapping.xml =================================================================== RCS file: /home/cvs/jakarta-pluto/portal/src/webapp/WEB-INF/data/xml/servletdefinitionmapping.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- servletdefinitionmapping.xml 7 Jun 2004 13:21:42 -0000 1.5 +++ servletdefinitionmapping.xml 29 Jul 2004 13:46:30 -0000 1.6 @@ -40,6 +40,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -208,6 +232,11 @@ + + + + @@ -232,9 +261,6 @@ - - - 1.3 +3 -1 jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/xml/XmlParser.java Index: XmlParser.java =================================================================== RCS file: /home/cvs/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/xml/XmlParser.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- XmlParser.java 2 Mar 2004 14:48:58 -0000 1.2 +++ XmlParser.java 29 Jul 2004 13:46:30 -0000 1.3 @@ -75,7 +75,9 @@ Constants.RES_WEB_DTD, Constants.RES_WEB_DTD_NAME)); - domParser.setFeature("http://xml.org/sax/features/validation", true); + // modified by YCLI: START :: do not do validation for web.xml + domParser.setFeature("http://xml.org/sax/features/validation", false); + // modified by YCLI: END domParser.setFeature("http://apache.org/xml/features/dom/include-ignorable-whitespace", false); InputSource source = new InputSource( webXml ); 1.9 +12 -1 jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/Deploy.java Index: Deploy.java =================================================================== RCS file: /home/cvs/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/Deploy.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- Deploy.java 9 Jul 2004 10:35:26 -0000 1.8 +++ Deploy.java 29 Jul 2004 13:46:30 -0000 1.9 @@ -189,6 +189,12 @@ XmlParser.parsePortletXml(new FileInputStream(portletXml)); Unmarshaller unmarshaller = new Unmarshaller(mappingPortletXml); + + // modified by YCLI: START :: to ignore extra elements and attributes + unmarshaller.setIgnoreExtraElements(true); + unmarshaller.setIgnoreExtraAttributes(true); + // modified by YCLI: END + PortletApplicationDefinitionImpl portletApp = (PortletApplicationDefinitionImpl) unmarshaller.unmarshal( portletDocument); @@ -213,7 +219,12 @@ XmlParser.parseWebXml(new FileInputStream(webXml)); Unmarshaller unmarshallerWeb = new Unmarshaller(mappingWebXml); - unmarshallerWeb.setIgnoreExtraElements(true); + + // modified by YCLI: START :: to ignore extra elements and attributes + unmarshallerWeb.setIgnoreExtraElements(true); + unmarshallerWeb.setIgnoreExtraAttributes(true); + // modified by YCLI: END + webApp = (WebApplicationDefinitionImpl) unmarshallerWeb.unmarshal( webDocument);