You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by at...@apache.org on 2009/04/02 17:28:09 UTC

svn commit: r761322 - in /portals/jetspeed-2/portal/trunk: applications/jetspeed/src/main/webapp/WEB-INF/ applications/jetspeed/src/main/webapp/WEB-INF/classes/ components/jetspeed-cm/ components/jetspeed-page-manager/ components/jetspeed-page-manager/...

Author: ate
Date: Thu Apr  2 15:28:08 2009
New Revision: 761322

URL: http://svn.apache.org/viewvc?rev=761322&view=rev
Log:
Fixing hot deploy broken on Java6 because of the outdated version of Xerces used by Jetspeed (in WEB-INF/lib).
Removed all the xerces dependencies AFAIK which could pull in xerces in the portal lib folder.
Only required code change needed in CastorFileSystemDocumentHandler for pretty printing written out psml files.
Solved that by replacing the xerces based XMLSerializer with the dom4J XMLWriter (which doesn't depend on Xerces).
In addition, the Castor Unmarhaller need to be told to *not* try to use Xerces by default, for which an override castor.properties in WEB-INF/classes is needed.  

Added:
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/classes/
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/classes/castor.properties   (with props)
Modified:
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/   (props changed)
    portals/jetspeed-2/portal/trunk/components/jetspeed-cm/pom.xml
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/pom.xml
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/CastorFileSystemDocumentHandler.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/pom.xml

Propchange: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/
------------------------------------------------------------------------------
    (empty)

Added: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/classes/castor.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/classes/castor.properties?rev=761322&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/classes/castor.properties (added)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/classes/castor.properties Thu Apr  2 15:28:08 2009
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+
+# Defines the XML parser to be used by Castor. 
+# The parser must implement org.xml.sax.Parser.
+org.exolab.castor.parser=org.xml.sax.helpers.XMLReaderAdapter
+

Propchange: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/classes/castor.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/classes/castor.properties
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/classes/castor.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-cm/pom.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-cm/pom.xml?rev=761322&r1=761321&r2=761322&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-cm/pom.xml (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-cm/pom.xml Thu Apr  2 15:28:08 2009
@@ -127,11 +127,6 @@
             <scope>runtime</scope>
         </dependency>
         <dependency>
-            <groupId>xerces</groupId>
-            <artifactId>xercesImpl</artifactId>
-            <scope>runtime</scope>
-        </dependency>
-        <dependency>
         	<groupId>net.sf.ehcache</groupId>
         	<artifactId>ehcache</artifactId>
         </dependency>

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/pom.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/pom.xml?rev=761322&r1=761321&r2=761322&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/pom.xml (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/pom.xml Thu Apr  2 15:28:08 2009
@@ -73,10 +73,6 @@
             <artifactId>castor</artifactId>
         </dependency>
         <dependency>
-            <groupId>xerces</groupId>
-            <artifactId>xercesImpl</artifactId>
-        </dependency>
-        <dependency>
             <groupId>commons-collections</groupId>
             <artifactId>commons-collections</artifactId>
         </dependency>
@@ -96,6 +92,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>xerces</groupId>
+            <artifactId>xercesImpl</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>xalan</groupId>
             <artifactId>xalan</artifactId>
             <scope>test</scope>

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/CastorFileSystemDocumentHandler.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/CastorFileSystemDocumentHandler.java?rev=761322&r1=761321&r2=761322&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/CastorFileSystemDocumentHandler.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/CastorFileSystemDocumentHandler.java Thu Apr  2 15:28:08 2009
@@ -47,11 +47,10 @@
 import org.apache.jetspeed.page.document.FailedToUpdateDocumentException;
 import org.apache.jetspeed.page.document.Node;
 import org.apache.jetspeed.page.document.NodeException;
-import org.apache.xml.serialize.OutputFormat;
-import org.apache.xml.serialize.Serializer;
-import org.apache.xml.serialize.XMLSerializer;
 import org.castor.mapping.BindingType;
 import org.castor.mapping.MappingUnmarshaller;
+import org.dom4j.io.OutputFormat;
+import org.dom4j.io.XMLWriter;
 import org.exolab.castor.mapping.Mapping;
 import org.exolab.castor.mapping.MappingException;
 import org.exolab.castor.mapping.MappingLoader;
@@ -119,10 +118,9 @@
         verifyPath(documentRootDir);
         this.fileCache = fileCache;
         this.fileCache.addListener(this);
-        this.format = new OutputFormat();
-        format.setIndenting(true);
-        format.setIndent(4);
-        format.setEncoding(PSML_DOCUMENT_ENCODING);
+        this.format = new OutputFormat("    ", true, PSML_DOCUMENT_ENCODING);
+        this.format.setXHTML(true);
+        this.format.setExpandEmptyElements(false);
         
         SAXParserFactory factory = SAXParserFactory.newInstance();
         SAXParser parser = factory.newSAXParser();
@@ -234,8 +232,8 @@
             // polymorphic collection to strip artifical <menu-element>
             // tags enabling Castor XML binding; see JETSPEED-INF/castor/page-mapping.xml
             writer = new OutputStreamWriter(new FileOutputStream(f), PSML_DOCUMENT_ENCODING);
-            Serializer serializer = new XMLSerializer(writer, this.format);
-            final ContentHandler handler = serializer.asContentHandler();
+            XMLWriter xmlWriter = new XMLWriter(writer, this.format);
+            final ContentHandler handler = xmlWriter;
             
             Marshaller marshaller = new Marshaller(new ContentHandler()
                 {

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/pom.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/pom.xml?rev=761322&r1=761321&r2=761322&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/pom.xml (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/pom.xml Thu Apr  2 15:28:08 2009
@@ -113,11 +113,6 @@
             <artifactId>xml-apis</artifactId>
             <scope>runtime</scope>
         </dependency>
-        <dependency>
-            <groupId>xerces</groupId>
-            <artifactId>xercesImpl</artifactId>
-            <scope>runtime</scope>
-        </dependency>
         <!-- 
         The following commented out dependencies are necessary to run the TestSerializer unit test. However,
          since this brings in circular dependency references to the build (breaking the build),



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org