You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by ju...@apache.org on 2005/05/20 10:13:04 UTC

svn commit: r171077 [4/4] - in /incubator/jackrabbit/trunk/contrib/jcrtaglib: ./ src/ src/examples/ src/examples/web/ src/examples/web/WEB-INF/ src/examples/web/WEB-INF/classes/ src/examples/web/WEB-INF/lib/ src/examples/web/WEB-INF/repository/ src/examples/web/WEB-INF/src/ src/examples/web/WEB-INF/taglib/ src/java/ src/java/org/ src/java/org/apache/ src/java/org/apache/jackrabbit/ src/java/org/apache/jackrabbit/taglib/ src/java/org/apache/jackrabbit/taglib/bean/ src/java/org/apache/jackrabbit/taglib/comparator/ src/java/org/apache/jackrabbit/taglib/filter/ src/java/org/apache/jackrabbit/taglib/size/ src/java/org/apache/jackrabbit/taglib/template/ src/java/org/apache/jackrabbit/taglib/traverser/ src/java/org/apache/jackrabbit/taglib/utils/ src/test/ src/test/org/ src/test/org/apache/ src/test/org/apache/jackrabbit/ src/test/org/apache/jackrabbit/taglib/ src/test/org/apache/jackrabbit/taglib/test/ xdocs/ xdocs/examples/

Added: incubator/jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/utils/JCRTagUtils.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/utils/JCRTagUtils.java?rev=171077&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/utils/JCRTagUtils.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/utils/JCRTagUtils.java Fri May 20 01:13:01 2005
@@ -0,0 +1,203 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * 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.jackrabbit.taglib.utils;
+
+import javax.jcr.Item;
+import javax.jcr.Node;
+import javax.jcr.PathNotFoundException;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.servlet.jsp.JspException;
+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.taglibs.standard.tag.common.core.NullAttributeException;
+import org.apache.taglibs.standard.tag.el.core.ExpressionUtil;
+
+/**
+ * JCR taglib utils
+ * 
+ * @author <a href="mailto:edgarpoce@gmail.com">Edgar Poce </a>
+ */
+public class JCRTagUtils
+{
+    private static Log log = LogFactory.getLog(JCRTagUtils.class);
+
+    /**
+     * Get an object from jndi
+     * 
+     * @param name
+     * @return @throws
+     *         JspException
+     */
+    public static Object lookup(String name)
+    {
+        Object o = null;
+        try
+        {
+            InitialContext ctx = new InitialContext();
+            Context env = (Context) ctx.lookup("java:comp/env");
+            o = env.lookup(name);
+        } catch (NamingException e)
+        {
+            String msg = "Unable to get object from jndi: " + name + ". "
+                    + e.getMessage();
+            log.error(msg, e);
+        }
+        return o;
+    }
+
+    /**
+     * Get a session for the given key
+     * 
+     * @param pc
+     * @param key
+     * @throws JspException
+     */
+    public static Session getSession(String tagName, String expression,
+            Tag tag, PageContext pageCtx) throws JspException
+    {
+        Session session = null;
+        try
+        {
+            session = (Session) ExpressionUtil.evalNotNull(tagName, "session",
+                    expression, Object.class, tag, pageCtx);
+            if (log.isDebugEnabled())
+            {
+                log.debug("Session found. User=" + session.getUserID());
+            }
+
+        } catch (ClassCastException e)
+        {
+            String msg = "Unable to get session for expression= " + expression
+                    + ". " + e.getMessage();
+            log.error(msg, e);
+            throw new IllegalArgumentException(msg);
+        }
+        return session;
+    }
+
+    /**
+     * <p>
+     * Get a node.
+     * </p>
+     * <p>
+     * The value can be a String or a EL expression referencing a Node instance.
+     * </p>
+     * 
+     * @param tagName
+     * @param attribute
+     * @param expression
+     * @param tag
+     * @param pageCtx
+     * @param session
+     * @return a node
+     * @throws JspException
+     * @throws RepositoryException
+     * @throws PathNotFoundException
+     */
+    public static Item getItem(String tagName, String expression, Tag tag,
+            PageContext pageCtx, Session session) throws JspException,
+            PathNotFoundException, RepositoryException
+    {
+        Item item = null;
+        Object o = (Object) ExpressionUtil.evalNotNull(tagName, "node",
+                expression, Object.class, tag, pageCtx);
+        // Path to the node
+        if (o instanceof String)
+        {
+            String path = (String) o;
+            if (path.startsWith("/"))
+            { // Absolute path
+                item = (Item) session.getItem(path);
+            } else
+            { // Relative path
+                item = getCD(tagName, tag, pageCtx, session).getNode(path);
+            }
+        } else if (o instanceof Item)
+        {
+            item = (Item) o;
+            if (!item.getSession().equals(session))
+            {
+                throw new JspException(
+                        "The referenced node belongs to another session.");
+            }
+        } else
+        {
+            String msg = "The node attribute evaluation "
+                    + "returned an unexpected type. " + o.getClass().getName();
+            log.warn(msg);
+            throw new JspException(msg);
+        }
+        return item;
+    }
+
+    /**
+     * Get the current working directory
+     * 
+     * @param session
+     * @param pc
+     * @return a node 
+     * @throws RepositoryException
+     * @throws JspException
+     */
+    private static Node getCD(String tagName, Tag tag, PageContext pageCtx,
+            Session session) throws RepositoryException, JspException
+    {
+        Node item = null ;
+        try {
+            item = (Node) ExpressionUtil.evalNotNull(tagName, "node", "${"
+                    + JCRTagConstants.KEY_CD + "}", Object.class, tag, pageCtx);
+        } catch (NullAttributeException e) {
+            item = session.getRootNode();
+        }
+        return item;
+    }
+
+    /**
+     * Create a bean for the class specified in the given jndi entry
+     * 
+     * @param jndi
+     * @return a bean
+     */
+    public static Object getBean(String id)
+    {
+        BeanFactory factory = (BeanFactory) lookup(JCRTagConstants.JNDI_BEAN_FACTORY);
+        Object bean = factory.getBean(id);
+        if (bean == null)
+        {
+            log.warn("No bean for id = " + id);
+        }
+        return bean;
+    }
+
+    /**
+     * Get the message from the Exception
+     * @param e
+     * @return
+     */
+    public static String getMessage(Exception e) {
+        return e.getClass().getName() + ". " + e.getMessage() ;
+    }
+
+}
\ No newline at end of file

Propchange: incubator/jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/utils/JCRTagUtils.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/utils/package.html
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/utils/package.html?rev=171077&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/utils/package.html (added)
+++ incubator/jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/utils/package.html Fri May 20 01:13:01 2005
@@ -0,0 +1,3 @@
+<body>
+Contains Utils classes.
+</body>
\ No newline at end of file

Propchange: incubator/jackrabbit/trunk/contrib/jcrtaglib/src/java/org/apache/jackrabbit/taglib/utils/package.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcrtaglib/src/test/org/apache/jackrabbit/taglib/InitServlet.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcrtaglib/src/test/org/apache/jackrabbit/taglib/InitServlet.java?rev=171077&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcrtaglib/src/test/org/apache/jackrabbit/taglib/InitServlet.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcrtaglib/src/test/org/apache/jackrabbit/taglib/InitServlet.java Fri May 20 01:13:01 2005
@@ -0,0 +1,93 @@
+package org.apache.jackrabbit.taglib;
+
+import javax.jcr.Node;
+import javax.jcr.Repository;
+import javax.jcr.Session;
+import javax.jcr.SimpleCredentials;
+import javax.jcr.query.Query;
+import javax.jcr.query.QueryResult;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+
+import org.apache.commons.collections.IteratorUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jackrabbit.taglib.utils.JCRTagConstants;
+
+/**
+ * Create test nodes    
+ */
+public class InitServlet extends HttpServlet
+{
+    private static Log log = LogFactory.getLog(InitServlet.class);
+
+    private Repository repo;
+
+    public void destroy()
+    {
+    }
+
+    public void init() throws ServletException
+    {
+        this.createTree() ;
+    }
+    
+    private void createTree(){
+        try {
+            Repository repo = this.getRepository() ;
+            Session s = repo.login(new SimpleCredentials("admin", "".toCharArray())) ;
+            Node root = s.getRootNode() ;
+            if (!root.hasNode("TestA")) {
+                // Tree
+                Node ta = root.addNode("TestA", "nt:unstructured") ;
+                ta.setProperty("prop1", "prop1 value V0");
+                Node tb= root.addNode("TestB") ;
+                
+                // Versionable
+                ta.addMixin("mix:versionable");
+                s.save() ;
+                ta.checkin() ;
+                ta.checkout() ;
+                ta.setProperty("prop1", "prop1 value V1");
+                ta.save() ;
+                ta.checkin() ;
+                
+                // Level 2
+                ta.checkout() ;
+                Node ta2= ta.addNode("A-L2") ;
+                ta2.setProperty("msg", "test message");
+                tb.addNode("B-L2(1)");
+                tb.addNode("B-L2(2)");
+                // Level 3
+                Node ta3 = ta2.addNode("A-L3") ;
+                Node ta4_1 = ta3.addNode("A-L4_1") ;
+                Node ta4_2 = ta3.addNode("A-L4_3") ;
+                s.save() ;
+                
+                Query q = s.getWorkspace().getQueryManager().createQuery("SELECT * FROM nt:unstructured WHERE jcr:path LIKE '/A/%'", Query.SQL) ;
+                QueryResult qr = q.execute() ;
+                if (IteratorUtils.toList(qr.getNodes()).size()==0) {
+                    log.error("Index is not working");
+                }
+            }
+            s.logout() ;
+        } catch (Exception e) {
+            log.error("Unable to init repo",e);
+        }
+        
+    }
+    
+    private Repository getRepository() throws ServletException {
+        try {
+            InitialContext ctx = new InitialContext() ;
+            Context env = (Context) ctx.lookup("java:comp/env");
+            Repository repo = (Repository) env.lookup(JCRTagConstants.JNDI_DEFAULT_REPOSITORY);
+            return repo ;
+        }catch (Exception e) {
+            throw new ServletException(e.toString(), e);
+        }
+    }
+
+}
\ No newline at end of file

Propchange: incubator/jackrabbit/trunk/contrib/jcrtaglib/src/test/org/apache/jackrabbit/taglib/InitServlet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcrtaglib/src/test/org/apache/jackrabbit/taglib/test/BeanFactoryTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcrtaglib/src/test/org/apache/jackrabbit/taglib/test/BeanFactoryTest.java?rev=171077&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcrtaglib/src/test/org/apache/jackrabbit/taglib/test/BeanFactoryTest.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcrtaglib/src/test/org/apache/jackrabbit/taglib/test/BeanFactoryTest.java Fri May 20 01:13:01 2005
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * 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.jackrabbit.taglib.test;
+
+import org.apache.jackrabbit.taglib.bean.SimpleBeanFactory;
+import org.apache.jackrabbit.taglib.bean.SpringBeanFactory;
+import org.apache.jackrabbit.taglib.traverser.PreorderTraverser;
+import org.apache.jackrabbit.taglib.traverser.Traverser;
+
+import junit.framework.TestCase;
+
+/**
+ * Bean factory test
+ */
+public class BeanFactoryTest extends TestCase
+{
+    public void testSpring() {
+        SpringBeanFactory factory = new SpringBeanFactory() ;
+        factory.setConfig("jcrtaglib-beans.xml") ;
+        Traverser traverser  = (Traverser) factory.getBean("traverser.preorder") ;
+        if (traverser==null) {
+            fail("Traverser not found") ;
+        }
+    }
+    
+    public void testSimple() {
+        SimpleBeanFactory factory = new SimpleBeanFactory() ;
+        Traverser traverser = (Traverser) factory.getBean(PreorderTraverser.class.getName()) ;
+        if (traverser==null) {
+            fail("Traverser not found") ;
+        }
+    }
+
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcrtaglib/src/test/org/apache/jackrabbit/taglib/test/BeanFactoryTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcrtaglib/xdocs/configuration.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcrtaglib/xdocs/configuration.xml?rev=171077&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcrtaglib/xdocs/configuration.xml (added)
+++ incubator/jackrabbit/trunk/contrib/jcrtaglib/xdocs/configuration.xml Fri May 20 01:13:01 2005
@@ -0,0 +1,95 @@
+<?xml version="1.0"?>
+<!--
+	Copyright 2004-2005 The Apache Software Foundation or its licensors,
+	as applicable.
+	
+	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.
+-->
+<document>
+	<properties>
+		<title>Configuration</title>
+	</properties>
+	<body>
+		<section name="Configuration">
+			<p>
+				See:<br/>
+				1. web.xml - /src/examples/web/WEB-INF/web.xml<br/>
+				1. context.xml - /src/examples/web/jcrtaglib.xml<br/>
+			</p>
+			<subsection name="JCR repository factory">
+				<p>
+					The default JCR repository must be set under the
+					following JNDI address: "jcr/repositoryFactory".
+				</p>
+			</subsection>
+
+			<subsection name="BeanFactory">
+				<p>
+					The default BeanFactory must be set under the
+					following JNDI address: "jcr/beanFactory".
+				</p>
+			</subsection>
+
+			<subsection name="Traverser">
+				<p>
+					The default traverser ID must be set under the
+					following JNDI address: "jcr/traverser/default"
+				</p>
+			</subsection>
+
+			<subsection name="ItemFilter">
+				<p>
+					The default filter ID must be set under the
+					following JNDI address: "jcr/filter/default"
+				</p>
+			</subsection>
+
+			<subsection name="ItemComparator">
+				<p>
+					The default sort ID must be set under the following
+					JNDI address: "jcr/comparator/default"
+				</p>
+			</subsection>
+
+			<subsection name="TemplateEngine">
+				<p>
+					The default template Engine ID must be set under the
+					following JNDI address:
+					"jcr/template/engine/default"
+				</p>
+			</subsection>
+
+			<subsection name="SizeCalculator">
+				<p>
+					The default SizeCalculator ID must be set under
+					the following JNDI address: "jcr/size/default"
+				</p>
+			</subsection>
+
+			<subsection name="Login">
+				<p>
+					This information is used when no user and password
+					is provided in jcr:session tag, and the user is not
+					logged through container managed security.
+					<br />
+					The default user name must be set under the
+					following JNDI address: "jcr/login/anonuser"
+					<br />
+					The password for the default user must be set under
+					the following JNDI address: "jcr/login/anonpwd"
+				</p>
+			</subsection>
+
+		</section>
+	</body>
+</document>
\ No newline at end of file

Propchange: incubator/jackrabbit/trunk/contrib/jcrtaglib/xdocs/configuration.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcrtaglib/xdocs/customization.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcrtaglib/xdocs/customization.xml?rev=171077&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcrtaglib/xdocs/customization.xml (added)
+++ incubator/jackrabbit/trunk/contrib/jcrtaglib/xdocs/customization.xml Fri May 20 01:13:01 2005
@@ -0,0 +1,142 @@
+<?xml version="1.0"?>
+<!--
+	Copyright 2004-2005 The Apache Software Foundation or its licensors,
+	as applicable.
+	
+	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.
+-->
+<document>
+	<properties>
+		<title>Customization</title>
+	</properties>
+	<body>
+		<section name="BeanFactory">
+			<p>
+				The BeanFactory is responsible of the creation and
+				lifecycle of beans. It can be a simple implementation or
+				it can be a wrapper of an IoC framework such as
+				Spring (included). <br/>
+				Traverser, ItemFilter, ItemComparator and
+				SizeCalculator instances are provided by this class
+				based on the ID. The beanFactory is accessed through a
+				JNDI address (see
+				<a href="configuration.html#BeanFactory">
+					configuration
+				</a>
+				).
+			</p>
+		</section>
+		<section name="Traverser">
+			<p>
+				The Traverser is a visitor which walks through the tree
+				and returns a Collection of nodes.
+				<br />
+				Included traversers are:
+			</p>
+			<ol>
+				<li>
+					<b>PreorderTraverser</b>
+					<br />
+					Preorder traverse strategy
+				</li>
+				<li>
+					<b>PostorderTraverser</b>
+					<br />
+					Postorder traverse strategy
+				</li>
+				<li>
+					<b>LevelByLevelTraverser</b>
+					<br />
+					Level by level traverse strategy
+				</li>
+				<li>
+					<b>AncestorsTraverser</b>
+					<br />
+					This implementation may be useful for displaying the
+					breadcrumb.
+				</li>
+				<li>
+					<b>ExpandedNodeTraverser</b>
+					<br />
+					This Traverser collects only the children of the
+					ancestors in the path from the root node to the
+					target node. It's useful for displaying a tree with
+					only one node expanded.
+					<br />
+					In order to work the target node must be provided as
+					a parameter (see traverserParam attribute in
+					<a href="tag-reference.html#nodes">jcr:nodes</a>
+					).
+				</li>
+				<li>
+					<b>ExpandedNodesTraverser</b>
+					<br />
+					This Traverser collects the children of the
+					ancestors in the path from the root node to any of
+					the target nodes. It's useful for displaying a tree
+					with many nodes expanded.
+					<br />
+					In order to work the target nodes must be provided
+					as a parameter (see traverserParam attribute in
+					<a href="tag-reference.html#nodes">jcr:nodes</a>
+					), a jstl expression referencing a Collection or
+					Iterator of Nodes.
+				</li>
+			</ol>
+		</section>
+		<section name="ItemFilter">
+			<p>
+				An ItemFilter implementation is responsible of
+				evaluating whether the given javax.jcr.Item should be
+				included based on the given expression (see filterExp
+				attribute in
+				<a href="tag-reference.html#nodes">jcr:nodes</a>
+				).
+				<br />
+				A JEXLItemFilter implementation is provided. It
+				evaluates any javax.jcr.Item based on a JEXL valid
+				expression which returns a Boolean instance. The
+				javax.jcr.Item to be evaluated is added to the
+				JEXLContext under the key "item". A valid JEXL
+				expression would be "item.name.equals('MyNodeName')".
+			</p>
+		</section>
+		<section name="ItemComparator">
+			<p>
+				An ItemComparator implementation is responsible of
+				handling comparison of any javax.jcr.Item based on the
+				given expression.
+				<br />
+				A JEXLItemComparator implementation is provided. It
+				compares any javax.jcr.Item based on a JEXL valid
+				expression which returns a comparable instance. The
+				javax.jcr.Item is added to the JEXLContext with the name
+				of "item". A valid JEXL expression would be "item.name".
+			</p>
+		</section>
+		<section name="TemplateEngine">
+			<p>
+				A TemplateEngine can be a simple template engine or can
+				be a wrapper of a powerful template engine such as
+				Velocity. It writes nodes and properties with the given
+				template to the given writer.
+			</p>
+		</section>
+		<section name="SizeCalculator">
+			<p>
+				A SizeCalculator implementation is responsible of
+				calculating the size that uses a given Node or Property.
+			</p>
+		</section>
+	</body>
+</document>
\ No newline at end of file

Propchange: incubator/jackrabbit/trunk/contrib/jcrtaglib/xdocs/customization.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcrtaglib/xdocs/examples.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcrtaglib/xdocs/examples.xml?rev=171077&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcrtaglib/xdocs/examples.xml (added)
+++ incubator/jackrabbit/trunk/contrib/jcrtaglib/xdocs/examples.xml Fri May 20 01:13:01 2005
@@ -0,0 +1,61 @@
+<?xml version="1.0"?>
+<!--
+	Copyright 2004-2005 The Apache Software Foundation or its licensors,
+	as applicable.
+	
+	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.
+-->
+<document>
+	<properties>
+		<title>Examples</title>
+	</properties>
+	<body>
+		<section name="Displaying a menu">
+			<p>
+				JCR tags contains a few Traversers which will help you
+				on drawing trees.
+			</p>
+			<subsection name="ExpandedNodeTraverser">
+				<p>
+					With this traverser you get a menu with only one
+					node expanded.
+				</p>
+				<p>
+					&lt;jcr:nodes
+					<br />
+					node="/"
+					<br />
+					var="node"
+					<br />
+					traverserID="org.apache.jackrabbit.tags.traverser.ExpandedNodeTraverser"
+					<br />
+					traverserParam="/pathToMyNode/myNode"
+					<br />
+					traverserDepth="5"&gt;
+					<br />
+					<br />
+					&lt;c:forEach begin="0" end="${node.depth}"&gt;
+					<br />
+					&amp;nbsp;
+					<br />
+					&lt;/c:forEach&gt;
+					<br />
+					/ &lt;c:out value="${node.name}"/&gt;&lt;br/&gt;
+					<br />
+					&lt;/jcr:nodes&gt;
+					<br />
+				</p>
+			</subsection>
+		</section>
+	</body>
+</document>
\ No newline at end of file

Propchange: incubator/jackrabbit/trunk/contrib/jcrtaglib/xdocs/examples.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcrtaglib/xdocs/index.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcrtaglib/xdocs/index.xml?rev=171077&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcrtaglib/xdocs/index.xml (added)
+++ incubator/jackrabbit/trunk/contrib/jcrtaglib/xdocs/index.xml Fri May 20 01:13:01 2005
@@ -0,0 +1,41 @@
+<?xml version="1.0"?>
+<!--
+	Copyright 2004-2005 The Apache Software Foundation or its licensors,
+	as applicable.
+	
+	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.
+-->
+<document>
+	<properties>
+		<title>Overview</title>
+	</properties>
+	<body>
+		<section name="JCR taglib">
+			<p>
+				This project contains a set of custom tags that lets you
+				read and display information from a JCR repository.<br/>
+				Generated on may 12th, 2005.
+			</p>
+		</section>
+		<section name="Requirements">
+			<p>
+				This software requires a JSP container that supports the Java Servlet 2.3 and JavaServer Pages 1.2 specifications.
+			</p>
+		</section>
+		<section name="Download">
+			<p>
+				Download <a href="jcrtaglib.zip">sources</a>.
+			</p>
+		</section>
+	</body>
+</document>

Propchange: incubator/jackrabbit/trunk/contrib/jcrtaglib/xdocs/index.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcrtaglib/xdocs/navigation.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcrtaglib/xdocs/navigation.xml?rev=171077&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcrtaglib/xdocs/navigation.xml (added)
+++ incubator/jackrabbit/trunk/contrib/jcrtaglib/xdocs/navigation.xml Fri May 20 01:13:01 2005
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+	Copyright 2004-2005 The Apache Software Foundation or its licensors,
+	as applicable.
+	
+	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 name="JCRTags">
+	<title>JCRTags</title>
+	<body>
+		<menu name="JCR Tags">
+			<item name="Overview" href="/index.html" />
+			<item name="Tag reference" href="/tag-reference.html" />
+			<item name="Configuration" href="/configuration.html" />
+			<item name="Customization" href="/customization.html" />
+			<item name="Examples" href="/examples.html" />
+		</menu>
+	</body>
+</project>

Propchange: incubator/jackrabbit/trunk/contrib/jcrtaglib/xdocs/navigation.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcrtaglib/xdocs/tag-reference.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcrtaglib/xdocs/tag-reference.xml?rev=171077&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcrtaglib/xdocs/tag-reference.xml (added)
+++ incubator/jackrabbit/trunk/contrib/jcrtaglib/xdocs/tag-reference.xml Fri May 20 01:13:01 2005
@@ -0,0 +1,959 @@
+<?xml version="1.0"?>
+<!--
+	Copyright 2004-2005 The Apache Software Foundation or its licensors,
+	as applicable.
+	
+	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.
+-->
+<document>
+	<properties>
+		<title>Tag reference</title>
+	</properties>
+
+	<body>
+		<section name="Tag reference">
+			JCR tags detailed description.
+			<ul>
+				<li>
+					<a href="#jcr:session">jcr:session</a>
+				</li>
+				<li>
+					<a href="#jcr:cd">jcr:cd</a>
+				</li>
+				<li>
+					<a href="#jcr:nodes">jcr:nodes</a>
+				</li>
+				<li>
+					<a href="#jcr:properties">jcr:properties</a>
+				</li>
+				<li>
+					<a href="#jcr:set">jcr:set</a>
+				</li>
+				<li>
+					<a href="#jcr:out">jcr:out</a>
+				</li>
+				<li>
+					<a href="#jcr:count">jcr:count</a>
+				</li>
+				<li>
+					<a href="#jcr:size">jcr:size</a>
+				</li>
+				<li>
+					<a href="#jcr:versions">jcr:versions</a>
+				</li>
+				<li>
+					<a href="#jcr:query">jcr:query</a>
+				</li>
+				<li>
+					<a href="#jcr:ifPresent">jcr:ifPresent</a>
+				</li>
+			</ul>
+		</section>
+
+		<!--  Session -->
+		<section name="jcr:session">
+			<a name="session" />
+			<p>
+				Creates a session for the given repository.
+				<br />
+				It creates a jcr Session and stores it in a page scope
+				variable.
+			</p>
+			<subsection name="Attributes">
+				<ul>
+					<li>
+						<b>repositoryJNDI</b>
+						[optional]
+						<br />
+						Name of the jndi address of a repository other
+						than the default. See
+						<a href="configuration.html#repository">
+							configuration
+						</a>
+						.
+					</li>
+					<li>
+						<b>workspace</b>
+						[optional]
+						<br />
+						Workspace name.
+					</li>
+					<li>
+						<b>var</b>
+						[optional]
+						<br />
+						Name of the target page context variable where
+						the session will be stored.
+					</li>
+					<li>
+						<b>user</b>
+						[optional]
+						<br />
+						<ol>
+							<li>Name of the user for loggin in</li>
+							<li>
+								If no user is provided then use
+								Container managed security principal.
+							</li>
+							<li>
+								If the user is not logged in use default
+								user and password.
+							</li>
+						</ol>
+
+					</li>
+					<li>
+						<b>password</b>
+						[optional]
+						<br />
+						User's password.
+						<br />
+						Password used for creating a new JCR Session.
+					</li>
+				</ul>
+			</subsection>
+			<subsection name="Examples">
+				<p>
+					&lt;jcr:session&gt;
+					<br />
+					... Use the session here
+					<br />
+					&lt;/jcr:session&gt;
+					<br />
+				</p>
+			</subsection>
+		</section>
+
+		<!-- CD -->
+		<section name="jcr:cd">
+			<a name="cd" />
+			<p>
+				Sets the current directory. Relative paths in jcr tags
+				will be be relative to the current directory.
+			</p>
+			<subsection name="Attributes">
+				<ul>
+					<li>
+						<b>session</b>
+						[optional]
+						<br />
+						Name of the scoped variable where the jcr
+						session is stored.
+					</li>
+					<li>
+						<b>node [required]</b>
+						<br />
+						JSTL expression referencing a node instance or
+						full path
+						<br />
+						e.g. "${mynode}" or "mynode"
+					</li>
+					<li>
+						<b>scope</b>
+						[optional] default is Page context
+						<br />
+						Scope of the variable to store the current
+						working directory.
+					</li>
+				</ul>
+			</subsection>
+			<subsection name="Examples">
+				<p>
+					<br />
+					&lt;jcr:session&gt;
+					<br />
+					&lt;jcr:cd node="/myNode"/&gt;
+					<br />
+					...
+					<br />
+					&lt;/jcr:cd&gt;
+					<br />
+					&lt;/jcr:session&gt;
+				</p>
+			</subsection>
+		</section>
+
+		<!--  Nodes -->
+		<section name="jcr:nodes">
+			<a name="nodes" />
+			<p>
+				Iterates through the traversed nodes from the given
+				node.
+			</p>
+			<subsection name="Attributes">
+				<ul>
+					<li>
+						<b>session</b>
+						[optional]
+						<br />
+						Name of the scoped variable where the jcr
+						session is stored.
+					</li>
+					<li>
+						<b>node [required]</b>
+						<br />
+						JSTL expression referencing a node instance or
+						full path
+						<br />
+						e.g. "${mynode}" or "mynode"
+					</li>
+					<li>
+						<b>sortID</b>
+						[optional]
+						<br />
+						<a href="customization.html#ItemComparator">
+							ItemComparator
+						</a>
+						ID.
+						<br />
+						See
+						<a href="customization.html#BeanFactory">
+							BeanFactory
+						</a>
+						.
+					</li>
+					<li>
+						<b>sortExp</b>
+						[optional]
+						<br />
+						Expression used by the ItemComparator to
+						evaluate nodes.
+					</li>
+					<li>
+						<b>ascending</b>
+						[optional]
+						<br />
+						Sort order
+					</li>
+					<li>
+						<b>traverserID</b>
+						[optional]
+						<br />
+						<a href="customization.html#Traverser">
+							Traverser
+						</a>
+						ID. See
+						<a href="customization.html#BeanFactory">
+							BeanFactory
+						</a>
+						.
+					</li>
+					<li>
+						<b>traverserParam</b>
+						[optional]
+						<br />
+						Parameter that affects Traverser behaviour. See
+						<a href="customization.html#Traverser">
+							customization
+						</a>
+						.
+					</li>
+					<li>
+						<b>traverserDepth</b>
+						[optional]
+						<br />
+						Traverse depth
+					</li>
+					<li>
+						<b>filterID</b>
+						[optional]
+						<br />
+						<a href="customization.html#ItemFilter">
+							ItemFilter
+						</a>
+						ID. See
+						<a href="customization.html#BeanFactory">
+							BeanFactory
+						</a>
+						.
+					</li>
+					<li>
+						<b>filterExp</b>
+						[optional]
+						<br />
+						Expression used by the ItemFilter to evaluate
+						nodes. The evaluation must return a Boolean
+						instance.
+					</li>
+				</ul>
+			</subsection>
+			<subsection name="Examples">
+				<p>
+					Using jstl core taglib to show the node's path.
+					<br />
+					&lt;jcr:session&gt;
+					<br />
+					&lt;jcr:nodes node="/" var="node"
+					traverserDepth="1"&gt;
+					<br />
+					&lt;c:out value="${node.path}"/&gt;
+					<br />
+					&lt;/jcr:nodes&gt;
+					<br />
+					&lt;/jcr:session&gt;
+				</p>
+			</subsection>
+		</section>
+
+		<!--  Properties -->
+		<section name="jcr:properties">
+			<a name="properties" />
+			<p>Iterates through the properties of the given node.</p>
+			<subsection name="Attributes">
+				<ul>
+					<li>
+						<b>session</b>
+						[optional]
+						<br />
+						Name of the scoped variable where the jcr
+						session is stored.
+					</li>
+					<li>
+						<b>node [required]</b>
+						<br />
+						JSTL expression referencing a node instance or
+						full path
+						<br />
+						e.g. "${mynode}" or "mynode"
+					</li>
+					<li>
+						<b>sortID</b>
+						[optional]
+						<br />
+						<a href="customization.html#ItemComparator">
+							ItemComparator
+						</a>
+						ID.
+						<br />
+						See
+						<a href="customization.html#BeanFactory">
+							BeanFactory
+						</a>
+						.
+					</li>
+					<li>
+						<b>sortExp</b>
+						[optional]
+						<br />
+						Expression used by the ItemComparator to
+						evaluate properties.
+					</li>
+					<li>
+						<b>ascending</b>
+						[optional]
+						<br />
+						Sort order.
+					</li>
+					<li>
+						<b>filterID</b>
+						[optional]
+						<br />
+						<a href="customization.html#ItemFilter">
+							ItemFilter
+						</a>
+						ID. See
+						<a href="customization.html#BeanFactory">
+							BeanFactory
+						</a>
+						.
+					</li>
+					<li>
+						<b>filterExp</b>
+						[optional]
+						<br />
+						Expression used by the ItemFilter to evaluate
+						nodes. The evaluation must return a Boolean
+						instance.
+					</li>
+				</ul>
+			</subsection>
+			<subsection name="Examples">
+				<p>
+					Using jstl core taglib to show the property's path.
+					<br />
+					&lt;jcr:session&gt;
+					<br />
+					&lt;jcr:properties node="/" var="property"&gt;
+					<br />
+					&lt;c:out value="${property.path}"/&gt;
+					<br />
+					&lt;/jcr:properties&gt;
+					<br />
+					&lt;/jcr:session&gt;
+				</p>
+			</subsection>
+		</section>
+
+		<!--  Set -->
+		<section name="jcr:set">
+			<a name="set" />
+			<p>
+				Stores the given node or property in a page context
+				scoped variable.
+			</p>
+			<subsection name="Attributes">
+				<ul>
+					<li>
+						<b>session</b>
+						[optional]
+						<br />
+						Name of the scoped variable where the jcr
+						session is stored.
+					</li>
+					<li>
+						<b>item [required]</b>
+						<br />
+						Expression referencing an Item instance or full
+						path
+						<br />
+						e.g. "${mynode}" or "mynode"
+					</li>
+					<li>
+						<b>property</b>
+						[optional]
+						<br />
+						Property name. (Valid only when item is a Node)
+					</li>
+					<li>
+						<b>var</b>
+						[optional]
+						<br />
+						Page context variable where the jcr Item weill
+						be stored.
+					</li>
+					<li>
+						<b>scope</b>
+						[optional] default is Page context
+						<br />
+						Scope of the variable to store the current
+						working directory.
+					</li>					
+				</ul>
+			</subsection>
+			<subsection name="Examples">
+				<p>
+					Displaying the path to a node.
+					<br />
+					&lt;jcr:session&gt;
+					<br />
+					&lt;jcr:set node="pahtToMyNode/myNode" var="myNode"
+					/&gt;
+					<br />
+					&lt;c:out value="${myNode.path}"/&gt;
+					<br />
+					&lt;/jcr:session&gt;
+				</p>
+			</subsection>
+		</section>
+
+		<!-- Out -->
+		<section name="jcr:out">
+			<a name="out" />
+			<p>
+				Displays Node and property values through the given
+				template engine and template.
+				<br />
+				See
+				<a href="configuration.html#TemplateEngine">
+					configuration
+				</a>
+				.
+			</p>
+			<subsection name="Attributes">
+				<ul>
+					<li>
+						<b>session</b>
+						[optional]
+						<br />
+						Name of the scoped variable where the jcr
+						session is stored.
+					</li>
+					<li>
+						<b>item [required]</b>
+						<br />
+						JSTL expression referencing an Item instance or
+						full path
+						<br />
+						e.g. "${mynode}" or "mynode"
+					</li>
+					<li>
+						<b>property</b>
+						[optional]
+						<br />
+						Property name.
+					</li>
+					<li>
+						<b>templateEngine</b>
+						[optional]
+						<br />
+						<a href="customization.html#TemplateEngine">
+							TemplateEngine
+						</a>
+						ID. See
+						<a href="customization.html#BeanFactory">
+							BeanFactory
+						</a>
+						.
+					</li>
+					<li>
+						<b>template</b>
+						[optional]
+						<br />
+						Template name.
+					</li>
+				</ul>
+			</subsection>
+			<subsection name="Examples">
+				<p>
+					Displaying a node with the default template engine.
+					<br />
+					&lt;jcr:session&gt;
+					<br />
+					&lt;jcr:out node="/" /&gt;
+					<br />
+					<br />
+					Displaying a property with the default template
+					engine.
+					<br />
+					&lt;jcr:out node="/" property="jcr:primaryType"
+					/&gt;
+					<br />
+					&lt;/jcr:session&gt;
+				</p>
+			</subsection>
+		</section>
+
+		<!-- Count -->
+		<section name="jcr:count">
+			<a name="count" />
+			<p>Counts the nodes returned by the given Traverser.</p>
+			<subsection name="Attributes">
+				<ul>
+					<li>
+						<b>session</b>
+						[optional]
+						<br />
+						Name of the scoped variable where the jcr
+						session is stored.
+					</li>
+					<li>
+						<b>node [required]</b>
+						<br />
+						JSTL expression referencing a node instance or
+						full path
+						<br />
+						e.g. "${mynode}" or "mynode"
+					</li>
+					<li>
+						<b>traverserID</b>
+						[optional]
+						<br />
+						<a href="customization.html#Traverser">
+							Traverser
+						</a>
+						ID. See
+						<a href="customization.html#BeanFactory">
+							BeanFactory
+						</a>
+						.
+					</li>
+					<li>
+						<b>traverserParam</b>
+						[optional]
+						<br />
+						Parameter that affects Traverser behaviour. See
+						<a href="customization.html#Traverser">
+							customization
+						</a>
+						.
+					</li>
+					<li>
+						<b>traverserDepth</b>
+						[optional]
+						<br />
+						Traverse depth
+					</li>
+					<li>
+						<b>filterID</b>
+						[optional]
+						<br />
+						<a href="customization.html#ItemFilter">
+							ItemFilter
+						</a>
+						ID. See
+						<a href="customization.html#BeanFactory">
+							BeanFactory
+						</a>
+						.
+					</li>
+					<li>
+						<b>filterExp</b>
+						[optional]
+						<br />
+						Expression used by the ItemFilter to evaluate
+						nodes. The evaluation must return a Boolean
+						instance.
+					</li>
+				</ul>
+			</subsection>
+			<subsection name="Examples">
+				<p>
+					Displaying the number of children for the root node
+					for the default traverser.
+					<br />
+					&lt;jcr:session&gt;
+					<br />
+					&lt;jcr:count node="/" traverserDepth="1"&gt;
+					<br />
+					&lt;/jcr:session&gt;
+				</p>
+			</subsection>
+		</section>
+
+		<!-- Size -->
+		<section name="jcr:size">
+			<a name="size" />
+			<p>
+				Estimates the cumulative size of the nodes returned by
+				the given Traverser and displays the value.
+			</p>
+			<subsection name="Attributes">
+				<ul>
+					<li>
+						<b>session</b>
+						[optional]
+						<br />
+						Name of the scoped variable where the jcr
+						session is stored.
+					</li>
+					<li>
+						<b>node [required]</b>
+						<br />
+						JSTL expression referencing a node instance or
+						full path
+						<br />
+						e.g. "${mynode}" or "mynode"
+					</li>
+					<li>
+						<b>traverserID</b>
+						[optional]
+						<br />
+						<a href="customization.html#Traverser">
+							Traverser
+						</a>
+						ID. See
+						<a href="customization.html#BeanFactory">
+							BeanFactory
+						</a>
+						.
+					</li>
+					<li>
+						<b>traverserParam</b>
+						[optional]
+						<br />
+						Parameter that affects Traverser behaviour. See
+						<a href="customization.html#Traverser">
+							customization
+						</a>
+						.
+					</li>
+					<li>
+						<b>traverserDepth</b>
+						[optional]
+						<br />
+						Traverse depth
+					</li>
+					<li>
+						<b>filterID</b>
+						[optional]
+						<br />
+						<a href="customization.html#ItemFilter">
+							ItemFilter
+						</a>
+						ID. See
+						<a href="customization.html#BeanFactory">
+							BeanFactory
+						</a>
+						.
+					</li>
+					<li>
+						<b>filterExp</b>
+						[optional]
+						<br />
+						Expression used by the ItemFilter to evaluate
+						nodes. The evaluation must return a Boolean
+						instance.
+					</li>
+					<li>
+						<b>calculatorID</b>
+						[optional]
+						<br />
+						<a
+							href="customization.html#StorageCalculator">
+							StorageCalculator
+						</a>
+						ID. See
+						<a href="customization.html#BeanFactory">
+							BeanFactory
+						</a>
+						.
+					</li>
+					<li>
+						<b>unit</b>
+						[optional]
+						<br />
+						Size unit ( bytes | kb | mb | gb )
+					</li>
+				</ul>
+			</subsection>
+			<subsection name="Examples">
+				<p>
+					Displaying the size of a node.
+					<br />
+					&lt;jcr:session&gt;
+					<br />
+					&lt;jcr:size node="/" traverserDepth="0" /&gt; bytes
+					<br />
+					<br />
+					Displaying the size of the node plus the children
+					nodes.
+					<br />
+					&lt;jcr:size node="/" traverserDepth="1" /&gt; bytes
+					<br />
+					&lt;/jcr:session&gt;
+				</p>
+			</subsection>
+		</section>
+
+		<!--  Versions -->
+		<section name="jcr:versions">
+			<a name="versions" />
+			<p>Iterates through the versions of the given node.</p>
+			<subsection name="Attributes">
+				<ul>
+					<li>
+						<b>session</b>
+						[optional]
+						<br />
+						Name of the scoped variable where the jcr
+						session is stored.
+					</li>
+					<li>
+						<b>node [required]</b>
+						<br />
+						JSTL expression referencing a node instance or
+						full path
+						<br />
+						e.g. "${mynode}" or "mynode"
+					</li>
+					<li>
+						<b>traverserID</b>
+						[optional]
+						<br />
+						<a href="customization.html#Traverser">
+							Traverser
+						</a>
+						ID. See
+						<a href="customization.html#BeanFactory">
+							BeanFactory
+						</a>
+						.
+					</li>
+					<li>
+						<b>traverserParam</b>
+						[optional]
+						<br />
+						Parameter that affects Traverser behaviour. See
+						<a href="customization.html#Traverser">
+							customization
+						</a>
+						.
+					</li>
+					<li>
+						<b>traverserDepth</b>
+						[optional]
+						<br />
+						Traverse depth
+					</li>
+					<li>
+						<b>sortID</b>
+						[optional]
+						<br />
+						<a href="customization.html#ItemComparator">
+							ItemComparator
+						</a>
+						ID.
+						<br />
+						See
+						<a href="customization.html#BeanFactory">
+							BeanFactory
+						</a>
+						.
+					</li>
+					<li>
+						<b>sortExp</b>
+						[optional]
+						<br />
+						Expression used by the ItemComparator to
+						evaluate nodes.
+					</li>
+					<li>
+						<b>ascending</b>
+						[optional]
+						<br />
+						Sort order
+					</li>
+					<li>
+						<b>filterID</b>
+						[optional]
+						<br />
+						<a href="customization.html#ItemFilter">
+							ItemFilter
+						</a>
+						ID. See
+						<a href="customization.html#BeanFactory">
+							BeanFactory
+						</a>
+						.
+					</li>
+					<li>
+						<b>filterExp</b>
+						[optional]
+						<br />
+						Expression used by the ItemFilter to evaluate
+						nodes. The evaluation must return a Boolean
+						instance.
+					</li>
+				</ul>
+			</subsection>
+			<subsection name="Examples">
+				<p>
+					Using jstl core taglib to show the node's path.
+					<br />
+					&lt;jcr:session&gt;
+					<br />
+					&lt;jcr:versions node="/" var="version"&gt;
+					<br />
+					&lt;c:out value="${version.created}"/&gt;
+					<br />
+					&lt;/jcr:versions&gt;
+					<br />
+					&lt;/jcr:session&gt;
+				</p>
+			</subsection>
+		</section>
+
+		<!-- Query -->
+		<section name="jcr:query">
+			<p>Iterates through the query result nodes.</p>
+			<subsection name="Attributes">
+				<ul>
+					<li>
+						<b>session</b>
+						[optional]
+						<br />
+						Name of the scoped variable where the jcr
+						session is stored.
+					</li>
+					<li>
+						<b>stmt [required]</b>
+						<br />
+						Query statement
+					</li>
+					<li>
+						<b>lang</b>
+						[optional] (default XPATH)
+						<br />
+						Language
+					</li>
+					<li>
+						<b>var</b>
+						[optional]
+						<br />
+						Page context variable where the jcr Node will be
+						stored.
+					</li>
+				</ul>
+			</subsection>
+			<subsection name="Examples">
+				<p>
+					<br />
+					&lt;jcr:session&gt;
+					<br />
+					&lt;jcr:query stmt="//*" var="node" lang="xpath"&gt;
+					<br />
+					Node: &gt;c:out value="${node.path}"/&gt; &lt;br&gt;
+					<br />
+					&lt;/jcr:query&gt;
+					<br />
+					&lt;/jcr:session&gt;
+				</p>
+			</subsection>
+		</section>
+
+		<!-- IfPresent -->
+		<section name="jcr:ifPresent">
+			<p>
+				Conditional tag that evaluates the existence of the
+				given node.
+			</p>
+			<subsection name="Attributes">
+				<ul>
+					<li>
+						<b>session</b>
+						[optional]
+						<br />
+						Name of the scoped variable where the jcr
+						session is stored.
+					</li>
+					<li>
+						<b>item [required]</b>
+						<br />
+						Item reference or path
+					</li>
+					<li>
+						<b>property</b>
+						[optional]
+						<br />
+						Property name.
+					</li>
+					<li>
+						<b>value</b>
+						<br />
+						[optional] default is true
+						<br />
+						values: [true | false]
+						<br />
+						expected evaluation result
+					</li>
+				</ul>
+			</subsection>
+			<subsection name="Examples">
+				<p>
+					<br />
+					&lt;jcr:session&gt;
+					<br />
+					&lt;jcr:ifPresent node="/pahtToMyNode/myNode" /&gt;
+					<br />
+					... do some stuff
+					<br />
+					&lt;/jcr:ifPresent&gt;
+					<br />
+					&lt;/jcr:session&gt;
+				</p>
+			</subsection>
+		</section>
+
+
+	</body>
+</document>
\ No newline at end of file

Propchange: incubator/jackrabbit/trunk/contrib/jcrtaglib/xdocs/tag-reference.xml
------------------------------------------------------------------------------
    svn:eol-style = native