blob: 90b47a3ac8bddea5b9fb00f1060c758eaf8bee90 [file] [log] [blame]
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. The ASF licenses this file to You
under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<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>