jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edgarp...@apache.org
Subject svn commit: r472354 - in /jackrabbit/trunk/contrib/jcrtaglib: ./ src/examples/web/WEB-INF/ src/examples/web/WEB-INF/taglib/ src/java/org/apache/jackrabbit/taglib/ src/java/org/apache/jackrabbit/taglib/bean/ src/java/org/apache/jackrabbit/taglib/compara...
Date Wed, 08 Nov 2006 00:50:15 GMT
Author: edgarpoce
Date: Tue Nov  7 16:50:14 2006
New Revision: 472354

URL: http://svn.apache.org/viewvc?view=rev&rev=472354
Log:
maven 2 descriptor
remove commons logging dependency
remove spring dependency
and some minor changes

Added:
    jackrabbit/trunk/contrib/jcrtaglib/pom.xml
Removed:
    jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/bean/SpringBeanFactory.java
Modified:
    jackrabbit/trunk/contrib/jcrtaglib/src/examples/web/WEB-INF/taglib/jcr.tld
    jackrabbit/trunk/contrib/jcrtaglib/src/examples/web/WEB-INF/web.xml
    jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/CountTag.java
    jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/IfPresentTag.java
    jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/NodesTag.java
    jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/OutTag.java
    jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/PropertiesTag.java
    jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/QueryTag.java
    jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/SessionTag.java
    jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/SetTag.java
    jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/SizeTag.java
    jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/VersionsTag.java
    jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/bean/SimpleBeanFactory.java
    jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/comparator/JEXLItemComparator.java
    jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/filter/JEXLItemFilter.java
    jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/size/AbstractSizeCalculator.java
    jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/size/SimpleSizeCalculator.java
    jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/template/SimpleTemplateEngine.java
    jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/traverser/ExpandedNodeTraverser.java
    jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/traverser/ExpandedNodesTraverser.java
    jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/utils/JCRTagConstants.java
    jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/utils/JCRTagUtils.java

Added: jackrabbit/trunk/contrib/jcrtaglib/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcrtaglib/pom.xml?view=auto&rev=472354
==============================================================================
--- jackrabbit/trunk/contrib/jcrtaglib/pom.xml (added)
+++ jackrabbit/trunk/contrib/jcrtaglib/pom.xml Tue Nov  7 16:50:14 2006
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+	Copyright 2006 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.
+	
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+	<modelVersion>4.0.0</modelVersion>
+	<prerequisites>
+		<maven>2.0.4</maven>
+	</prerequisites>
+
+	<!-- POM Identification -->
+
+	<groupId>org.apache.jackrabbit</groupId>
+	<artifactId>jcr-taglib</artifactId>
+	<version>1.1-SNAPSHOT</version>
+	<packaging>jar</packaging>
+
+	<name>JCR taglib</name>
+
+	<description>JCR taglib</description>
+
+	<!-- Dependencies -->
+
+	<dependencies>
+
+		<dependency>
+			<groupId>org.apache.jackrabbit</groupId>
+			<artifactId>jackrabbit-core</artifactId>
+			<version>1.1-SNAPSHOT</version>
+			<scope>provided</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>javax.servlet</groupId>
+			<artifactId>jstl</artifactId>
+			<version>1.0.6</version>
+			<type>jar</type>
+			<scope>compile</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>taglibs</groupId>
+			<artifactId>standard</artifactId>
+			<version>1.0.6</version>
+			<type>jar</type>
+			<scope>provided</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>javax.servlet</groupId>
+			<artifactId>servlet-api</artifactId>
+			<version>2.3</version>
+			<type>jar</type>
+			<scope>provided</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>log4j</groupId>
+			<artifactId>log4j</artifactId>
+			<version>1.2.12</version>
+			<scope>provided</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>commons-jexl</groupId>
+			<artifactId>commons-jexl</artifactId>
+			<version>1.0</version>
+			<scope>compile</scope>
+		</dependency>
+
+	</dependencies>
+
+	<build>
+		<sourceDirectory>src/java</sourceDirectory>
+		<pluginManagement>
+			<plugins>
+				<!-- Compiler -->
+				<plugin>
+					<groupId>org.apache.maven.plugins</groupId>
+					<artifactId>maven-compiler-plugin</artifactId>
+					<inherited>true</inherited>
+					<configuration>
+						<source>1.5</source>
+						<target>1.5</target>
+						<debug>true</debug>
+						<showDeprecation>true</showDeprecation>
+						<showWarnings>true</showWarnings>
+						<optimize>false</optimize>
+					</configuration>
+				</plugin>
+			</plugins>
+		</pluginManagement>
+	</build>
+</project>

Modified: jackrabbit/trunk/contrib/jcrtaglib/src/examples/web/WEB-INF/taglib/jcr.tld
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcrtaglib/src/examples/web/WEB-INF/taglib/jcr.tld?view=diff&rev=472354&r1=472353&r2=472354
==============================================================================
--- jackrabbit/trunk/contrib/jcrtaglib/src/examples/web/WEB-INF/taglib/jcr.tld (original)
+++ jackrabbit/trunk/contrib/jcrtaglib/src/examples/web/WEB-INF/taglib/jcr.tld Tue Nov  7
16:50:14 2006
@@ -22,7 +22,12 @@
 			<rtexprvalue>false</rtexprvalue>
 		</attribute>
 		<attribute>
-			<name>repositoryJNDI</name>
+			<name>jndiAddress</name>
+			<required>false</required>
+			<rtexprvalue>false</rtexprvalue>
+		</attribute>
+		<attribute>
+			<name>jndiProperties</name>
 			<required>false</required>
 			<rtexprvalue>false</rtexprvalue>
 		</attribute>
@@ -366,48 +371,6 @@
 			<name>var</name>
 			<required>true</required>
 			<rtexprvalue>false</rtexprvalue>
-		</attribute>
-		<attribute>
-			<name>sortID</name>
-			<required>false</required>
-			<rtexprvalue>true</rtexprvalue>
-		</attribute>
-		<attribute>
-			<name>sortExp</name>
-			<required>false</required>
-			<rtexprvalue>true</rtexprvalue>
-		</attribute>
-		<attribute>
-			<name>ascending</name>
-			<required>false</required>
-			<rtexprvalue>true</rtexprvalue>
-			<type>boolean</type>
-		</attribute>
-		<attribute>
-			<name>traverserID</name>
-			<required>false</required>
-			<rtexprvalue>true</rtexprvalue>
-		</attribute>
-		<attribute>
-			<name>traverserParam</name>
-			<required>false</required>
-			<rtexprvalue>true</rtexprvalue>
-		</attribute>
-		<attribute>
-			<name>traverserDepth</name>
-			<required>false</required>
-			<rtexprvalue>true</rtexprvalue>
-			<type>int</type>
-		</attribute>
-		<attribute>
-			<name>filterID</name>
-			<required>false</required>
-			<rtexprvalue>true</rtexprvalue>
-		</attribute>
-		<attribute>
-			<name>filterExp</name>
-			<required>false</required>
-			<rtexprvalue>true</rtexprvalue>
 		</attribute>
 	</tag>
 

Modified: jackrabbit/trunk/contrib/jcrtaglib/src/examples/web/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcrtaglib/src/examples/web/WEB-INF/web.xml?view=diff&rev=472354&r1=472353&r2=472354
==============================================================================
--- jackrabbit/trunk/contrib/jcrtaglib/src/examples/web/WEB-INF/web.xml (original)
+++ jackrabbit/trunk/contrib/jcrtaglib/src/examples/web/WEB-INF/web.xml Tue Nov  7 16:50:14
2006
@@ -38,15 +38,18 @@
 	
 	<!--  Default repository -->
 	<resource-env-ref>
-		<description>
-			Jackrabbit repository factory
-		</description>
-		<resource-env-ref-name>
-			jcr/repositoryFactory
-		</resource-env-ref-name>
-		<resource-env-ref-type>
-			org.apache.jackrabbit.core.jndi.BindableRepository
-		</resource-env-ref-type>
+		<env-entry-name>jcr/jndi/properties</env-entry-name>
+		<env-entry-value>
+			java.naming.factory.initial=org.apache.jackrabbit.core.jndi.provider.DummyInitialContextFactory
+			java.naming.provider.url=http://www.apache.org/jackrabbit
+		</env-entry-value>
+		<env-entry-type>java.lang.String</env-entry-type>
+	</resource-env-ref>
+
+	<resource-env-ref>
+		<env-entry-name>jcr/jndi/address</env-entry-name>
+		<env-entry-value>jackrabbit.repository</env-entry-value>
+		<env-entry-type>java.lang.String</env-entry-type>
 	</resource-env-ref>
 
 	<!--  Bean Factory  -->

Modified: jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/CountTag.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/CountTag.java?view=diff&rev=472354&r1=472353&r2=472354
==============================================================================
--- jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/CountTag.java
(original)
+++ jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/CountTag.java
Tue Nov  7 16:50:14 2006
@@ -26,12 +26,11 @@
 import javax.servlet.jsp.JspTagException;
 import javax.servlet.jsp.tagext.TagSupport;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.jackrabbit.taglib.filter.ItemFilter;
 import org.apache.jackrabbit.taglib.traverser.Traverser;
 import org.apache.jackrabbit.taglib.utils.JCRTagConstants;
 import org.apache.jackrabbit.taglib.utils.JCRTagUtils;
+import org.apache.log4j.Logger;
 import org.apache.taglibs.standard.tag.common.core.NullAttributeException;
 import org.apache.taglibs.standard.tag.el.core.ExpressionUtil;
 
@@ -45,7 +44,7 @@
  */
 public class CountTag extends TagSupport
 {
-    private static Log log = LogFactory.getLog(CountTag.class);
+	private static Logger log = Logger.getLogger(CountTag.class);
 
     public static String TAG_NAME = "count";
 

Modified: jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/IfPresentTag.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/IfPresentTag.java?view=diff&rev=472354&r1=472353&r2=472354
==============================================================================
--- jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/IfPresentTag.java
(original)
+++ jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/IfPresentTag.java
Tue Nov  7 16:50:14 2006
@@ -25,10 +25,9 @@
 import javax.servlet.jsp.JspTagException;
 import javax.servlet.jsp.jstl.core.ConditionalTagSupport;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.jackrabbit.taglib.utils.JCRTagConstants;
 import org.apache.jackrabbit.taglib.utils.JCRTagUtils;
+import org.apache.log4j.Logger;
 
 /**
  * Conditional tag that evaluates the existence of the given node.
@@ -38,7 +37,7 @@
 public class IfPresentTag extends ConditionalTagSupport
 {
     /** Logger */
-    private static Log log = LogFactory.getLog(IfPresentTag.class);
+	private static Logger log = Logger.getLogger(IfPresentTag.class);
 
     /** Tag Name */
     public static String TAG_NAME = "set";

Modified: jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/NodesTag.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/NodesTag.java?view=diff&rev=472354&r1=472353&r2=472354
==============================================================================
--- jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/NodesTag.java
(original)
+++ jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/NodesTag.java
Tue Nov  7 16:50:14 2006
@@ -26,13 +26,12 @@
 import javax.servlet.jsp.JspTagException;
 import javax.servlet.jsp.jstl.core.LoopTagSupport;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.jackrabbit.taglib.comparator.ItemComparator;
 import org.apache.jackrabbit.taglib.filter.ItemFilter;
 import org.apache.jackrabbit.taglib.traverser.Traverser;
 import org.apache.jackrabbit.taglib.utils.JCRTagConstants;
 import org.apache.jackrabbit.taglib.utils.JCRTagUtils;
+import org.apache.log4j.Logger;
 import org.apache.taglibs.standard.tag.common.core.NullAttributeException;
 import org.apache.taglibs.standard.tag.el.core.ExpressionUtil;
 
@@ -43,7 +42,7 @@
  */
 public class NodesTag extends LoopTagSupport
 {
-    private static Log log = LogFactory.getLog(NodesTag.class);
+	private static Logger log = Logger.getLogger(NodesTag.class);
 
     public static String TAG_NAME = "nodes";
 
@@ -105,7 +104,7 @@
     /**
      * Children Nodes
      */
-    private Iterator nodes;
+    protected Iterator nodes;
 
     /**
      *  

Modified: jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/OutTag.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/OutTag.java?view=diff&rev=472354&r1=472353&r2=472354
==============================================================================
--- jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/OutTag.java (original)
+++ jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/OutTag.java Tue
Nov  7 16:50:14 2006
@@ -24,11 +24,10 @@
 import javax.servlet.jsp.JspException;
 import javax.servlet.jsp.tagext.TagSupport;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.jackrabbit.taglib.template.TemplateEngine;
 import org.apache.jackrabbit.taglib.utils.JCRTagConstants;
 import org.apache.jackrabbit.taglib.utils.JCRTagUtils;
+import org.apache.log4j.Logger;
 
 /**
  * Displays Node and property values with the given template engine.
@@ -37,7 +36,7 @@
  */
 public class OutTag extends TagSupport
 {
-    private static Log log = LogFactory.getLog(OutTag.class);
+	private static Logger log = Logger.getLogger(OutTag.class);
 
     /** Tag Name */
     public static String TAG_NAME = "out";

Modified: jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/PropertiesTag.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/PropertiesTag.java?view=diff&rev=472354&r1=472353&r2=472354
==============================================================================
--- jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/PropertiesTag.java
(original)
+++ jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/PropertiesTag.java
Tue Nov  7 16:50:14 2006
@@ -30,12 +30,11 @@
 
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.collections.IteratorUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.jackrabbit.taglib.comparator.ItemComparator;
 import org.apache.jackrabbit.taglib.filter.ItemFilter;
 import org.apache.jackrabbit.taglib.utils.JCRTagConstants;
 import org.apache.jackrabbit.taglib.utils.JCRTagUtils;
+import org.apache.log4j.Logger;
 
 /**
  * Iterates over the properties of the given node.
@@ -45,7 +44,7 @@
 public class PropertiesTag extends LoopTagSupport
 {
     /** logger */
-    private static Log log = LogFactory.getLog(PropertiesTag.class);
+	private static Logger log = Logger.getLogger(PropertiesTag.class);
 
     /** tag name */
     public static String TAG_NAME = "properties";

Modified: jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/QueryTag.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/QueryTag.java?view=diff&rev=472354&r1=472353&r2=472354
==============================================================================
--- jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/QueryTag.java
(original)
+++ jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/QueryTag.java
Tue Nov  7 16:50:14 2006
@@ -26,10 +26,9 @@
 import javax.servlet.jsp.JspTagException;
 import javax.servlet.jsp.jstl.core.LoopTagSupport;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.jackrabbit.taglib.utils.JCRTagConstants;
 import org.apache.jackrabbit.taglib.utils.JCRTagUtils;
+import org.apache.log4j.Logger;
 import org.apache.taglibs.standard.tag.el.core.ExpressionUtil;
 
 /**
@@ -42,7 +41,7 @@
 public class QueryTag extends LoopTagSupport
 {
     /** logger */
-    private static Log log = LogFactory.getLog(QueryTag.class);
+	private static Logger log = Logger.getLogger(QueryTag.class);
 
     /** tag name */
     public static String TAG_NAME = "query";

Modified: jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/SessionTag.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/SessionTag.java?view=diff&rev=472354&r1=472353&r2=472354
==============================================================================
--- jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/SessionTag.java
(original)
+++ jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/SessionTag.java
Tue Nov  7 16:50:14 2006
@@ -16,21 +16,26 @@
  */
 package org.apache.jackrabbit.taglib;
 
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
 import java.security.Principal;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
 
 import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.SimpleCredentials;
+import javax.naming.InitialContext;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.jsp.JspException;
 import javax.servlet.jsp.PageContext;
 import javax.servlet.jsp.tagext.TagSupport;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.jackrabbit.taglib.utils.JCRTagConstants;
 import org.apache.jackrabbit.taglib.utils.JCRTagUtils;
+import org.apache.log4j.Logger;
 
 /**
  * <p>
@@ -42,19 +47,29 @@
 public class SessionTag extends TagSupport
 {
     /** logger */
-    private static Log log = LogFactory.getLog(SessionTag.class);
-
+	private static Logger log = Logger.getLogger(SessionTag.class);
+	
+	/**
+	 * jcr repository
+	 */
+	private static Map repositories = new HashMap() ;
+	
+	/**
+	 * JNDI address where a Repository is registered
+	 */
+	private String jndiAddress = JCRTagConstants.REPOSITORY_JNDI_ADDRESS ;
+
+	/**
+	 * JNDI properties to create the initial context
+	 */
+	private String jndiProperties = JCRTagConstants.REPOSITORY_JNDI_PROPERTIES ;
+	
     /**
      * Session instance
      */
     private Session session;
 
     /**
-     * Name of the jndi address of a repository other than the default.
-     */
-    private String repositoryJNDI = JCRTagConstants.JNDI_DEFAULT_REPOSITORY;;
-
-    /**
      * Workspace name.
      */
     private String workspace;
@@ -102,7 +117,6 @@
             log.debug("Cleaning state");
         }
         this.password = null;
-        this.repositoryJNDI = JCRTagConstants.JNDI_DEFAULT_REPOSITORY;
         this.var = JCRTagConstants.KEY_SESSION;
         this.user = null;
         this.workspace = null;
@@ -120,16 +134,6 @@
     }
 
     /**
-     * Sets the repository JNDI address
-     * 
-     * @param repository
-     */
-    public void setRepositoryJNDI(String repository)
-    {
-        this.repositoryJNDI = repository;
-    }
-
-    /**
      * Sets the variable where the Session will be stored
      * 
      * @param target
@@ -193,7 +197,7 @@
         this.previousSession = pageContext.getAttribute(this.var);
 
         // Get the repository
-        Repository repo = (Repository) JCRTagUtils.lookup(this.repositoryJNDI);
+        Repository repo = (Repository) this.getRepository();
 
         // Get the session
         try
@@ -294,5 +298,48 @@
         super.release();
         this.init();
     }
+    
+    /**
+     * get a repository either from a cache or via JNDI
+     * 
+     * @return
+     */
+    private Repository getRepository() {
+    	String address = (String) JCRTagUtils.lookup(this.jndiAddress) ;
+    	String props = (String) JCRTagUtils.lookup(this.jndiProperties) ;
+    	String key = props + address; 
+    	
+    	// lookup cached repository
+    	if (repositories.get(key)== null) {
+    		try {
+            	InitialContext ctx = null ;
+            	if (props!=null) {
+            		Properties properties = new Properties() ;
+                	InputStream is = new ByteArrayInputStream(props.getBytes("UTF-8")) ;
+                	properties.load(is) ;
+                	ctx = new InitialContext(properties) ; 
+            	} else {
+            		ctx = new InitialContext();
+            	}
+            	Repository repo = (Repository) ctx.lookup(address) ;
+            	 if (repo!=null) {
+            		 synchronized (this) {
+            			 repositories.put(key, repo) ;	
+        			}
+            	 }
+    		} catch (Exception e) {
+				log.error("unable to get repository", e);
+			}
+    	}
+ 		return (Repository) repositories.get(key) ;
+    }
+
+	public void setJndiAddress(String jndiAddress) {
+		this.jndiAddress = jndiAddress;
+	}
+
+	public void setJndiProperties(String jndiProperties) {
+		this.jndiProperties = jndiProperties;
+	}
 
 }

Modified: jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/SetTag.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/SetTag.java?view=diff&rev=472354&r1=472353&r2=472354
==============================================================================
--- jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/SetTag.java (original)
+++ jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/SetTag.java Tue
Nov  7 16:50:14 2006
@@ -24,10 +24,9 @@
 import javax.servlet.jsp.PageContext;
 import javax.servlet.jsp.tagext.TagSupport;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.jackrabbit.taglib.utils.JCRTagConstants;
 import org.apache.jackrabbit.taglib.utils.JCRTagUtils;
+import org.apache.log4j.Logger;
 import org.apache.taglibs.standard.tag.common.core.Util;
 
 /**
@@ -38,7 +37,7 @@
 public class SetTag extends TagSupport
 {
     /** logger */
-    private static Log log = LogFactory.getLog(SetTag.class);
+	private static Logger log = Logger.getLogger(SetTag.class);
 
     /** Tag Name */
     public static String TAG_NAME = "set";

Modified: jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/SizeTag.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/SizeTag.java?view=diff&rev=472354&r1=472353&r2=472354
==============================================================================
--- jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/SizeTag.java
(original)
+++ jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/SizeTag.java
Tue Nov  7 16:50:14 2006
@@ -29,13 +29,12 @@
 import javax.servlet.jsp.JspTagException;
 import javax.servlet.jsp.tagext.TagSupport;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.jackrabbit.taglib.filter.ItemFilter;
 import org.apache.jackrabbit.taglib.size.SizeCalculator;
 import org.apache.jackrabbit.taglib.traverser.Traverser;
 import org.apache.jackrabbit.taglib.utils.JCRTagConstants;
 import org.apache.jackrabbit.taglib.utils.JCRTagUtils;
+import org.apache.log4j.Logger;
 import org.apache.taglibs.standard.tag.common.core.NullAttributeException;
 import org.apache.taglibs.standard.tag.el.core.ExpressionUtil;
 
@@ -48,7 +47,7 @@
 public class SizeTag extends TagSupport
 {
     /** logger */
-    private static Log log = LogFactory.getLog(SizeTag.class);
+	private static Logger log = Logger.getLogger(SizeTag.class);
 
     /** tag name */
     public static String TAG_NAME = "size";

Modified: jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/VersionsTag.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/VersionsTag.java?view=diff&rev=472354&r1=472353&r2=472354
==============================================================================
--- jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/VersionsTag.java
(original)
+++ jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/VersionsTag.java
Tue Nov  7 16:50:14 2006
@@ -17,34 +17,33 @@
 package org.apache.jackrabbit.taglib;
 
 import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-import javax.jcr.version.Version;
-import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.JspTagException;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.jackrabbit.taglib.utils.JCRTagUtils;
+import org.apache.log4j.Logger;
 
 /**
  * Iterates over the versions of the given node
  * 
  * @author <a href="mailto:edgarpoce@gmail.com">Edgar Poce </a>
  */
-public class VersionsTag extends NodesTag
-{
-    /** logger */
-    private static Log log = LogFactory.getLog(VersionsTag.class);
+public class VersionsTag extends NodesTag {
+	/** logger */
+	private static Logger log = Logger.getLogger(VersionsTag.class);
 
-    /** tag name */
-    public static String TAG_NAME = "versions";
+	/** tag name */
+	public static String TAG_NAME = "versions";
+
+	@Override
+	protected void prepare() throws JspTagException {
+		try {
+			Node node = super.getNode();
+			this.nodes = node.getVersionHistory().getAllVersions();
+		} catch (Exception e) {
+			String msg = JCRTagUtils.getMessage(e);
+			log.error(msg, e);
+			throw new JspTagException(msg);
+		}
+	}
 
-    /**
-     * Override superclass getNode.
-     * @return the baseVersion of the given Node
-     */
-    protected Node getNode() throws JspException, RepositoryException
-    {
-        Node node = super.getNode() ;
-        Version version = node.getBaseVersion() ;
-        return version ;
-    }
 }

Modified: jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/bean/SimpleBeanFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/bean/SimpleBeanFactory.java?view=diff&rev=472354&r1=472353&r2=472354
==============================================================================
--- jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/bean/SimpleBeanFactory.java
(original)
+++ jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/bean/SimpleBeanFactory.java
Tue Nov  7 16:50:14 2006
@@ -16,8 +16,7 @@
  */
 package org.apache.jackrabbit.taglib.bean;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.log4j.Logger;
 
 /**
  * Bean creation based on class name.<br>
@@ -27,7 +26,7 @@
  */
 public class SimpleBeanFactory implements BeanFactory
 {
-    private static Log log = LogFactory.getLog(SimpleBeanFactory.class);
+    private static Logger log = Logger.getLogger(SimpleBeanFactory.class);
 
     /**
      * @param id
@@ -37,7 +36,6 @@
     {
         try
         {
-            ClassLoader tcl = Thread.currentThread().getContextClassLoader();
             Class beanClass = Class.forName(id);
             Object bean = beanClass.newInstance();
             return bean;

Modified: jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/comparator/JEXLItemComparator.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/comparator/JEXLItemComparator.java?view=diff&rev=472354&r1=472353&r2=472354
==============================================================================
--- jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/comparator/JEXLItemComparator.java
(original)
+++ jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/comparator/JEXLItemComparator.java
Tue Nov  7 16:50:14 2006
@@ -22,8 +22,7 @@
 import org.apache.commons.jexl.ExpressionFactory;
 import org.apache.commons.jexl.JexlContext;
 import org.apache.commons.jexl.JexlHelper;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.log4j.Logger;
 
 /**
  * It compares any javax.jcr.Item based on a JEXL valid expression wich returns
@@ -34,7 +33,7 @@
  */
 public class JEXLItemComparator implements ItemComparator
 {
-    private static Log log = LogFactory.getLog(JEXLItemComparator.class);
+    private static Logger log = Logger.getLogger(JEXLItemComparator.class);
 
     /** Context */
     JexlContext jc = JexlHelper.createContext();

Modified: jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/filter/JEXLItemFilter.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/filter/JEXLItemFilter.java?view=diff&rev=472354&r1=472353&r2=472354
==============================================================================
--- jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/filter/JEXLItemFilter.java
(original)
+++ jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/filter/JEXLItemFilter.java
Tue Nov  7 16:50:14 2006
@@ -22,8 +22,7 @@
 import org.apache.commons.jexl.ExpressionFactory;
 import org.apache.commons.jexl.JexlContext;
 import org.apache.commons.jexl.JexlHelper;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.log4j.Logger;
 
 /**
  * It evaluates any javax.jcr.Item based on a JEXL valid expression which
@@ -35,7 +34,7 @@
  */
 public class JEXLItemFilter implements ItemFilter
 {
-    private static Log log = LogFactory.getLog(JEXLItemFilter.class);
+    private static Logger log = Logger.getLogger(JEXLItemFilter.class);
 
     /** Contex */
     JexlContext jc = JexlHelper.createContext();

Modified: jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/size/AbstractSizeCalculator.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/size/AbstractSizeCalculator.java?view=diff&rev=472354&r1=472353&r2=472354
==============================================================================
--- jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/size/AbstractSizeCalculator.java
(original)
+++ jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/size/AbstractSizeCalculator.java
Tue Nov  7 16:50:14 2006
@@ -16,8 +16,7 @@
  */
 package org.apache.jackrabbit.taglib.size;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.log4j.Logger;
 
 /**
  * Superclass of SizeCalculator 
@@ -27,7 +26,7 @@
 public abstract class AbstractSizeCalculator implements SizeCalculator
 {
     /** Logger */
-    private static Log log = LogFactory.getLog(AbstractSizeCalculator.class);
+	private static Logger log = Logger.getLogger(AbstractSizeCalculator.class);
 
     /** Unit */
     protected int unit = SizeCalculator.BITS;

Modified: jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/size/SimpleSizeCalculator.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/size/SimpleSizeCalculator.java?view=diff&rev=472354&r1=472353&r2=472354
==============================================================================
--- jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/size/SimpleSizeCalculator.java
(original)
+++ jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/size/SimpleSizeCalculator.java
Tue Nov  7 16:50:14 2006
@@ -23,8 +23,7 @@
 import javax.jcr.RepositoryException;
 import javax.jcr.ValueFormatException;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.log4j.Logger;
 
 /**
  * SizeCalculator for testing purposes.
@@ -34,7 +33,7 @@
 public class SimpleSizeCalculator extends AbstractSizeCalculator
 {
     /** Logger */
-    private static Log log = LogFactory.getLog(SimpleSizeCalculator.class);
+	private static Logger log = Logger.getLogger(SimpleSizeCalculator.class);
 
     /**
      * Constructor

Modified: jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/template/SimpleTemplateEngine.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/template/SimpleTemplateEngine.java?view=diff&rev=472354&r1=472353&r2=472354
==============================================================================
--- jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/template/SimpleTemplateEngine.java
(original)
+++ jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/template/SimpleTemplateEngine.java
Tue Nov  7 16:50:14 2006
@@ -21,8 +21,7 @@
 import javax.jcr.Property;
 import javax.servlet.jsp.PageContext;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.log4j.Logger;
 
 /**
  * Template for testing purposes.
@@ -31,7 +30,7 @@
  */
 public class SimpleTemplateEngine implements TemplateEngine
 {
-    private static Log log = LogFactory.getLog(SimpleTemplateEngine.class);
+	private static Logger log = Logger.getLogger(SimpleTemplateEngine.class);
 
     public void setTemplate(String id)
     {

Modified: jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/traverser/ExpandedNodeTraverser.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/traverser/ExpandedNodeTraverser.java?view=diff&rev=472354&r1=472353&r2=472354
==============================================================================
--- jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/traverser/ExpandedNodeTraverser.java
(original)
+++ jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/traverser/ExpandedNodeTraverser.java
Tue Nov  7 16:50:14 2006
@@ -24,8 +24,7 @@
 import javax.jcr.PathNotFoundException;
 import javax.jcr.RepositoryException;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.log4j.Logger;
 
 /**
  * <p>
@@ -41,7 +40,7 @@
  */
 public class ExpandedNodeTraverser extends AbstractTraverser
 {
-    private static Log log = LogFactory.getLog(ExpandedNodeTraverser.class);
+	private static Logger log = Logger.getLogger(ExpandedNodeTraverser.class);
 
     /**
      * Preorder strategy recusively only for parent Nodes.

Modified: jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/traverser/ExpandedNodesTraverser.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/traverser/ExpandedNodesTraverser.java?view=diff&rev=472354&r1=472353&r2=472354
==============================================================================
--- jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/traverser/ExpandedNodesTraverser.java
(original)
+++ jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/traverser/ExpandedNodesTraverser.java
Tue Nov  7 16:50:14 2006
@@ -25,8 +25,7 @@
 import javax.jcr.RepositoryException;
 
 import org.apache.commons.collections.IteratorUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.log4j.Logger;
 
 /**
  * This Traverser collects the children of the ancestors in the path from the
@@ -38,7 +37,7 @@
 public class ExpandedNodesTraverser extends AbstractTraverser
 {
 
-    private static Log log = LogFactory.getLog(ExpandedNodesTraverser.class);
+	private static Logger log = Logger.getLogger(ExpandedNodesTraverser.class);
 
     /**
      * Preorder strategy recusively only for parent Nodes.

Modified: jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/utils/JCRTagConstants.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/utils/JCRTagConstants.java?view=diff&rev=472354&r1=472353&r2=472354
==============================================================================
--- jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/utils/JCRTagConstants.java
(original)
+++ jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/utils/JCRTagConstants.java
Tue Nov  7 16:50:14 2006
@@ -23,7 +23,9 @@
  */
 public interface JCRTagConstants
 {
-    public static String JNDI_DEFAULT_REPOSITORY = "jcr/repositoryFactory";
+    public static String REPOSITORY_JNDI_PROPERTIES = "jcr/jndi/properties";
+    
+    public static String REPOSITORY_JNDI_ADDRESS = "jcr/jndi/address";
 
     public static String JNDI_BEAN_FACTORY = "jcr/beanFactory";
 

Modified: jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/utils/JCRTagUtils.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/utils/JCRTagUtils.java?view=diff&rev=472354&r1=472353&r2=472354
==============================================================================
--- jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/utils/JCRTagUtils.java
(original)
+++ jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/utils/JCRTagUtils.java
Tue Nov  7 16:50:14 2006
@@ -28,9 +28,8 @@
 import javax.servlet.jsp.PageContext;
 import javax.servlet.jsp.tagext.Tag;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.jackrabbit.taglib.bean.BeanFactory;
+import org.apache.log4j.Logger;
 import org.apache.taglibs.standard.tag.common.core.NullAttributeException;
 import org.apache.taglibs.standard.tag.el.core.ExpressionUtil;
 
@@ -41,7 +40,9 @@
  */
 public class JCRTagUtils
 {
-    private static Log log = LogFactory.getLog(JCRTagUtils.class);
+	private static Logger log = Logger.getLogger(JCRTagUtils.class);
+	
+	private static BeanFactory beanFactory ;
 
     /**
      * Get an object from jndi
@@ -182,8 +183,7 @@
      */
     public static Object getBean(String id)
     {
-        BeanFactory factory = (BeanFactory) lookup(JCRTagConstants.JNDI_BEAN_FACTORY);
-        Object bean = factory.getBean(id);
+        Object bean = getBeanFactory().getBean(id);
         if (bean == null)
         {
             log.warn("No bean for id = " + id);
@@ -198,6 +198,18 @@
      */
     public static String getMessage(Exception e) {
         return e.getClass().getName() + ". " + e.getMessage() ;
+    }
+    
+    private static BeanFactory getBeanFactory() {
+    	if (beanFactory==null) {
+    		try {
+        		String impl = (String) lookup(JCRTagConstants.JNDI_BEAN_FACTORY);
+        		beanFactory = (BeanFactory) Class.forName(impl).newInstance();
+    		} catch (Exception e) {
+				log.error("unable to create bean factory", e) ;
+			}
+    	}
+    	return beanFactory ;
     }
 
 }



Mime
View raw message