portals-portalapps-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r771543 - in /portals/applications/rss/trunk: rss-jar/ rss-jar/src/main/java/org/apache/portals/applications/rss/ rss-jar/src/main/java/org/apache/portals/applications/transform/impl/ rss-war/ rss-war/src/main/webapp/WEB-INF/ rss-war/src/ma...
Date Tue, 05 May 2009 03:35:29 GMT
Author: ate
Date: Tue May  5 03:35:27 2009
New Revision: 771543

URL: http://svn.apache.org/viewvc?rev=771543&view=rev
Log:
JS2-972: commons-logging unsuited for cross-context webapplication invocation usage - migrating
to slf4j
- removing apa-webapp-logging usage and dependency
- cleaning out remaining commons-logging usages
- using Spring provided ServletContextListener for setting up relative log4j logging in the
rss war
- removing invalid (pluto specific) portlet.tld which wasn't used anyway
- removing jetspeed specific container servlet from web.xml (needs to be "infused" for each
container)
- dropping complete dependency and usage of xalan and xerces: using Java5 "native" provided
parsers works just as well (and cuts down the war file with 30%) 
- cleaning up other dependencies

Added:
    portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/classes/
    portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/classes/log4j.properties
      - copied, changed from r771262, portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/log4j.properties
Removed:
    portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/log4j.properties
    portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/portlet.tld
Modified:
    portals/applications/rss/trunk/rss-jar/pom.xml
    portals/applications/rss/trunk/rss-jar/src/main/java/org/apache/portals/applications/rss/RomeRSSPortlet.java
    portals/applications/rss/trunk/rss-jar/src/main/java/org/apache/portals/applications/transform/impl/JetspeedTransform.java
    portals/applications/rss/trunk/rss-war/pom.xml
    portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/portlet.xml
    portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/velocity/velocity.properties
    portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/web.xml

Modified: portals/applications/rss/trunk/rss-jar/pom.xml
URL: http://svn.apache.org/viewvc/portals/applications/rss/trunk/rss-jar/pom.xml?rev=771543&r1=771542&r2=771543&view=diff
==============================================================================
--- portals/applications/rss/trunk/rss-jar/pom.xml (original)
+++ portals/applications/rss/trunk/rss-jar/pom.xml Tue May  5 03:35:27 2009
@@ -38,15 +38,12 @@
 		<javax.servlet.version>2.4</javax.servlet.version>
         <org.apache.portals.bridges.common.version>1.0.4</org.apache.portals.bridges.common.version>
 		<org.apache.portals.bridges.velocity.version>1.0.4</org.apache.portals.bridges.velocity.version>
-		<spring.version>2.5.2</spring.version>
+		<spring.version>2.5.6</spring.version>
 		<velocity.version>1.5</velocity.version>
-		<xalan.version>2.4.1</xalan.version>
-		<xerces.version>2.3.0</xerces.version>
-		<xml-apis.version>2.0.2</xml-apis.version>
 		<rome.version>0.8</rome.version>
-		<commons-logging.version>1.1</commons-logging.version>
 		<rome.version>0.8</rome.version>
 		<jdom.version>1.0</jdom.version>
+        <slf4j.version>1.5.6</slf4j.version>
 	</properties>
 
 	<!-- Dependencies -->
@@ -82,16 +79,22 @@
 			<artifactId>velocity</artifactId>
 			<version>${velocity.version}</version>
 		</dependency>
+        <dependency>
+           <groupId>org.slf4j</groupId>
+           <artifactId>slf4j-api</artifactId>
+           <version>${slf4j.version}</version>
+        </dependency>
 
 		<dependency>
-			<groupId>commons-logging</groupId>
-			<artifactId>commons-logging</artifactId>
-			<version>${commons-logging.version}</version>
-		</dependency>
-		<dependency>
 			<groupId>org.springframework</groupId>
 			<artifactId>spring</artifactId>
 			<version>${spring.version}</version>
+            <exclusions>
+               <exclusion>
+                  <groupId>commons-logging</groupId>
+                  <artifactId>commons-logging</artifactId>
+               </exclusion>
+            </exclusions>
 		</dependency>
 		<dependency>
 			<groupId>rome</groupId>
@@ -106,24 +109,6 @@
 
 
 		<!-- Runtime Dependencies -->
-		<dependency>
-			<groupId>xml-apis</groupId>
-			<artifactId>xml-apis</artifactId>
-			<scope>runtime</scope>
-			<version>${xml-apis.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>xerces</groupId>
-			<artifactId>xercesImpl</artifactId>
-			<scope>runtime</scope>
-			<version>${xerces.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>xalan</groupId>
-			<artifactId>xalan</artifactId>
-			<scope>runtime</scope>
-			<version>${xalan.version}</version>
-		</dependency>
 
 	</dependencies>
 

Modified: portals/applications/rss/trunk/rss-jar/src/main/java/org/apache/portals/applications/rss/RomeRSSPortlet.java
URL: http://svn.apache.org/viewvc/portals/applications/rss/trunk/rss-jar/src/main/java/org/apache/portals/applications/rss/RomeRSSPortlet.java?rev=771543&r1=771542&r2=771543&view=diff
==============================================================================
--- portals/applications/rss/trunk/rss-jar/src/main/java/org/apache/portals/applications/rss/RomeRSSPortlet.java
(original)
+++ portals/applications/rss/trunk/rss-jar/src/main/java/org/apache/portals/applications/rss/RomeRSSPortlet.java
Tue May  5 03:35:27 2009
@@ -27,8 +27,8 @@
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.apache.portals.bridges.velocity.GenericVelocityPortlet;
 
 import org.apache.velocity.context.Context;
@@ -46,7 +46,7 @@
 public class RomeRSSPortlet extends GenericVelocityPortlet
 {
 
-    protected Log log = LogFactory.getLog(RomeRSSPortlet.class);
+    protected Logger log = LoggerFactory.getLogger(RomeRSSPortlet.class);
 
     /**
      * @see javax.portlet.Portlet#init(javax.portlet.PortletConfig)

Modified: portals/applications/rss/trunk/rss-jar/src/main/java/org/apache/portals/applications/transform/impl/JetspeedTransform.java
URL: http://svn.apache.org/viewvc/portals/applications/rss/trunk/rss-jar/src/main/java/org/apache/portals/applications/transform/impl/JetspeedTransform.java?rev=771543&r1=771542&r2=771543&view=diff
==============================================================================
--- portals/applications/rss/trunk/rss-jar/src/main/java/org/apache/portals/applications/transform/impl/JetspeedTransform.java
(original)
+++ portals/applications/rss/trunk/rss-jar/src/main/java/org/apache/portals/applications/transform/impl/JetspeedTransform.java
Tue May  5 03:35:27 2009
@@ -61,11 +61,6 @@
         {
             if (transformerFactory == null)
             {
-                System.setProperty(JAX_TRANSFORM_PROPERTY, jaxTransformFactoryProp);
-                System.setProperty(JAX_SAX_PARSER_PROPERTY, jaxSaxFactoryProp);
-                System.setProperty(JAX_DOM_PARSER_PROPERTY, jaxDomFactoryProp);
-                System.setProperty(SAX_XML_READER_PROPERTY, saxXmlReaderProp);
-
                 TransformerFactory tFactory = TransformerFactory.newInstance();
                 domFactory = DocumentBuilderFactory.newInstance();
                 domFactory.setValidating(false);
@@ -86,42 +81,8 @@
 
     private static SAXTransformerFactory transformerFactory = null;
 
-    //
-    // JAXP Service Configuration
-    //
-    private final static String CONFIG_JAX_FACTORY_SAX = "jax.factory.sax";
-
-    private final static String jaxSaxFactoryProp = "org.apache.xerces.jaxp.SAXParserFactoryImpl";
-
-    private final static String CONFIG_JAX_FACTORY_DOM = "jax.factory.dom";
-
-    private final static String jaxDomFactoryProp = "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl";
-
-    private final static String CONFIG_JAX_FACTORY_TRANSFORM = "jax.factory.transform";
-
-    private final static String jaxTransformFactoryProp = "org.apache.xalan.processor.TransformerFactoryImpl";
-
     private final static Object mutex = new Object();
 
-    //
-    // JAXP System Wide Properties
-    //
-    private static final String JAX_TRANSFORM_PROPERTY = "javax.xml.transform.TransformerFactory";
-
-    private static final String JAX_SAX_PARSER_PROPERTY = "javax.xml.parsers.SAXParserFactory";
-
-    private static final String JAX_DOM_PARSER_PROPERTY = "javax.xml.parsers.DocumentBuilderFactory";
-
-    //
-    // Standard Parser Vendor Property
-    //
-    private static final String SAX_XML_READER_PROPERTY = "org.xml.sax.driver";
-
-    //
-    // Standard Parser Vendor Configuration
-    //
-    private final static String saxXmlReaderProp = "org.apache.xerces.parsers.SAXParser";
-
     // DTD Map
     static private Map dtds = new HashMap();
 
@@ -262,11 +223,6 @@
         {
             if (transformerFactory == null)
             {
-                System.setProperty(JAX_TRANSFORM_PROPERTY, jaxTransformFactoryProp);
-                System.setProperty(JAX_SAX_PARSER_PROPERTY, jaxSaxFactoryProp);
-                System.setProperty(JAX_DOM_PARSER_PROPERTY, jaxDomFactoryProp);
-                System.setProperty(SAX_XML_READER_PROPERTY, saxXmlReaderProp);
-
                 TransformerFactory tFactory = TransformerFactory.newInstance();
                 domFactory = DocumentBuilderFactory.newInstance();
                 domFactory.setValidating(false);

Modified: portals/applications/rss/trunk/rss-war/pom.xml
URL: http://svn.apache.org/viewvc/portals/applications/rss/trunk/rss-war/pom.xml?rev=771543&r1=771542&r2=771543&view=diff
==============================================================================
--- portals/applications/rss/trunk/rss-war/pom.xml (original)
+++ portals/applications/rss/trunk/rss-war/pom.xml Tue May  5 03:35:27 2009
@@ -34,19 +34,26 @@
 
 	<!-- Dependencies -->
 	<properties>
+        <javax.servlet.version>2.4</javax.servlet.version>
         <org.apache.portals.bridges.common.version>1.0.4</org.apache.portals.bridges.common.version>
 		<velocity-tools.version>1.3</velocity-tools.version>
 		<commons-digester.version>1.8</commons-digester.version>
 		<commons-lang.version>2.1</commons-lang.version>
 		<commons-collections.version>3.2</commons-collections.version>
-		<log4j.version>1.2.14</log4j.version>
 		<oro.version>2.0.8</oro.version>
+        <slf4j.version>1.5.6</slf4j.version>
 	</properties>
 	<dependencies>
 
 		<!-- Runtime Dependencies -->
 
         <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+            <version>${javax.servlet.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.portals.bridges</groupId>
             <artifactId>portals-bridges-common</artifactId>
             <version>${org.apache.portals.bridges.common.version}</version>
@@ -60,16 +67,16 @@
 		</dependency>
 
 		<dependency>
-			<groupId>velocity-tools</groupId>
-			<artifactId>velocity-tools</artifactId>
-			<version>${velocity-tools.version}</version>
-			<scope>runtime</scope>
-		</dependency>
-		<dependency>
 			<groupId>commons-digester</groupId>
 			<artifactId>commons-digester</artifactId>
 			<scope>runtime</scope>
 			<version>${commons-digester.version}</version>
+            <exclusions>
+               <exclusion>
+                  <groupId>commons-logging</groupId>
+                  <artifactId>commons-logging</artifactId>
+               </exclusion>
+            </exclusions>
 		</dependency>
 		<dependency>
 			<groupId>commons-lang</groupId>
@@ -89,17 +96,19 @@
 			<version>${oro.version}</version>
 			<scope>runtime</scope>
 		</dependency>
-		<dependency>
-			<groupId>log4j</groupId>
-			<artifactId>log4j</artifactId>
-			<version>${log4j.version}</version>
-			<scope>runtime</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.portals.applications</groupId>
-			<artifactId>apa-webapp-logging</artifactId>
-			<version>1.0-SNAPSHOT</version>
-		</dependency>
+        <dependency>
+           <groupId>org.slf4j</groupId>
+           <artifactId>slf4j-log4j12</artifactId>
+           <version>${slf4j.version}</version>
+        </dependency>
+        <dependency>
+           <groupId>org.slf4j</groupId>
+           <artifactId>jcl-over-slf4j</artifactId>
+           <version>${slf4j.version}</version>
+        </dependency>
 	</dependencies>
+    <build>
+       <finalName>apa-rss</finalName>
+    </build>
 
 </project>

Copied: portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/classes/log4j.properties
(from r771262, portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/log4j.properties)
URL: http://svn.apache.org/viewvc/portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/classes/log4j.properties?p2=portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/classes/log4j.properties&p1=portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/log4j.properties&r1=771262&r2=771543&rev=771543&view=diff
==============================================================================
--- portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/log4j.properties (original)
+++ portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/classes/log4j.properties
Tue May  5 03:35:27 2009
@@ -44,17 +44,17 @@
 #
 # pa.log
 #
-log4j.appender.pa = org.apache.log4j.FileAppender
-log4j.appender.pa.file = ${webApplicationRoot}/logs/pa.log
-log4j.appender.pa.layout = org.apache.log4j.PatternLayout
-log4j.appender.pa.layout.conversionPattern = %d [%t] %-5p %c - %m%n
-log4j.appender.pa.append = false
-
-#
-# velocity.log
-#
-log4j.appender.velocity = org.apache.log4j.FileAppender
-log4j.appender.velocity.file = ${webApplicationRoot}/logs/velocity.log
-log4j.appender.velocity.layout = org.apache.log4j.PatternLayout
-log4j.appender.velocity.layout.conversionPattern = %d [%t] %-5p %c - %m%n
-log4j.appender.velocity.append = false
+log4j.appender.pa = org.apache.log4j.FileAppender
+log4j.appender.pa.file = ${org.apache.portals.applications.rss.webappRoot}/logs/pa.log
+log4j.appender.pa.layout = org.apache.log4j.PatternLayout
+log4j.appender.pa.layout.conversionPattern = %d [%t] %-5p %c - %m%n
+log4j.appender.pa.append = false
+
+#
+# velocity.log
+#
+log4j.appender.velocity = org.apache.log4j.FileAppender
+log4j.appender.velocity.file = ${org.apache.portals.applications.rss.webappRoot}/logs/velocity.log
+log4j.appender.velocity.layout = org.apache.log4j.PatternLayout
+log4j.appender.velocity.layout.conversionPattern = %d [%t] %-5p %c - %m%n
+log4j.appender.velocity.append = false

Modified: portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewvc/portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/portlet.xml?rev=771543&r1=771542&r2=771543&view=diff
==============================================================================
--- portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/portlet.xml (original)
+++ portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/portlet.xml Tue May  5
03:35:27 2009
@@ -15,10 +15,10 @@
 See the License for the specific language governing permissions and
 limitations under the License.
 -->
-<portlet-app id="rss" 
-    xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" version="1.0"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
+<portlet-app id="apa-rss"
+  xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" version="2.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">
 
 <portlet id="RSS">
     <description>RSS is a simple XML-based system that allows users to subscribe to
their favorite websites. 

Modified: portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/velocity/velocity.properties
URL: http://svn.apache.org/viewvc/portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/velocity/velocity.properties?rev=771543&r1=771542&r2=771543&view=diff
==============================================================================
--- portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/velocity/velocity.properties
(original)
+++ portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/velocity/velocity.properties
Tue May  5 03:35:27 2009
@@ -28,10 +28,10 @@
 
 runtime.log = velocity.log
 
-# use Commons Logging for routing Velocity message through our IsolatedLog4JLogger
-runtime.log.logsystem.class =org.apache.portals.applications.webapp.logging.velocity.CommonsLoggingLog4JLogSystem
+# use Log4J for routing Velocity messages
+runtime.log.logsystem.class =org.apache.velocity.runtime.log.Log4JLogChute
 # Log4J Category used (default is "velocity")
-runtime.log.logsystem.log4j.category = velocity
+runtime.log.logsystem.log4j.logger = velocity
 
 #----------------------------------------------------------------------------
 # T E M P L A T E  E N C O D I N G
@@ -68,7 +68,7 @@
 
 include.path=.
 include.cache = false
-include.output.errormsg.start = <!-- include error : 
+include.output.errormsg.start = <\!-- include error \: 
 include.output.errormsg.end   =  see error log -->
 
 #----------------------------------------------------------------------------

Modified: portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/web.xml?rev=771543&r1=771542&r2=771543&view=diff
==============================================================================
--- portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/web.xml (original)
+++ portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/web.xml Tue May  5 03:35:27
2009
@@ -15,28 +15,21 @@
 See the License for the specific language governing permissions and
 limitations under the License.
 -->
-<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
-                         "http://java.sun.com/dtd/web-app_2_3.dtd">
-<web-app>
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="2.4"
+    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee   http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+    
   <display-name>RSS Portlet Application</display-name>
   <description>Apache Portals Applications: RSS PA</description>
 
-  <listener>
-    <listener-class>org.apache.portals.applications.webapp.logging.Log4JConfigurator</listener-class>
-  </listener>
+
+    <context-param>
+        <param-name>webAppRootKey</param-name>
+        <param-value>org.apache.portals.applications.rss.webappRoot</param-value>
+    </context-param>
+    <listener>
+      <listener-class>org.springframework.web.util.WebAppRootListener</listener-class>
+    </listener>
   
-  <servlet>
-    <servlet-name>JetspeedContainer</servlet-name>
-    <display-name>Jetspeed Container</display-name>
-    <description>MVC Servlet for Jetspeed Portlet Applications</description>
-    <servlet-class>org.apache.jetspeed.container.JetspeedContainerServlet</servlet-class>
-    <init-param>
-      <param-name>contextName</param-name>
-      <param-value>rss</param-value>
-    </init-param>                          
-    <load-on-startup>100</load-on-startup>      
-  </servlet>
-    
     <!-- Define Velocity Servlet -->
 	<servlet>
 		<servlet-name>velocity</servlet-name>
@@ -69,14 +62,4 @@
 		<url-pattern>*.vm</url-pattern>
 	</servlet-mapping>	
 
-  <servlet-mapping>
-     <servlet-name>
-        JetspeedContainer
-     </servlet-name>
-     <url-pattern>
-       /container/*
-     </url-pattern>
-  </servlet-mapping>
-    
-
 </web-app>



Mime
View raw message