The Jakarta Project The Jakarta Slide Project

Main

Resources

User's Guide

Administrator's Guide

HOW-TOs

Programmer's Corner

Slide API

Reference

Slide Tags for Struts

The Jakarta Slide project includes JSP tag libraries to support the creation of web-based presentation layers accessing and displaying content stored in Slide repositories.

To keep the tag library code lean, we have to decided to rely on existing tag libraries to support basic functionality like iteration and conditionals. Two such libraries are currently supported: Struts 1.x and the JSP Standard Tag Library (JSTL) Early Access releases. The Slide tag library cannot effectively be used on its own, but requires one of the above fundamental libraries.

The tag library for Struts provides many tags for building a web interface to Slide. These tags are designed to integrate well with the Struts tag library and application framework.

For more information on Struts see http://jakarta.apache.org/struts/.

WARNING: This tag library should be considered experimental and might undergo some drastic changes in the future.

Tag NameDescription
domain Expose the Slide domain as bean.
namespace Expose a specific Slide namespace as bean.
node Expose a particular ObjectNode in the Slide namespace as bean.
revision Expose a revision-descriptor of an ObjectNode as bean.
content Retrieve the content of a node.
property Expose a property of a node as bean.
iterateLocks Iterate over all locks in a scope of the namespace, up to a specified depth.
iterateMembers Iterate over all the children of a node, up to a specified depth.
domain - Expose the Slide domain as bean.

The main purpose of this tag is to provide means to iterate over the list of defined namespaces.

The DomainBean exposed by this tag provides the following properties:

  • defaultNamespace: a NamespaceBean that represents the domain's default namespace
  • defaultNamespaceName: the name of the domain's default namespace
  • namespaces: a collection of all the domain's namespaces as NamespaceBean objects
  • namespaceNames: a collection of the names of all the defined namespaces
The bean is only exposed inside the body of the domain tag.

Attribute NameDescription
id

Specifies the name of the scripting variable (and associated page scope attribute) under which the DomainBean will be made available.

[Required]
namespace - Expose a specific Slide namespace as bean.

This tag lets you select the namespace that should be accessed.

The namespace tag can optionally expose a NamespaceBean that has the following properties:

  • name: the name of the namespace
  • usersPath: the path at which user nodes are stored
The bean is only exposed inside the body of the namespace tag.

Attribute NameDescription
id

Specifies the name of the scripting variable (and associated page scope attribute) under which the NamespaceBean will be made available.

name

Specifies the name of the namespace that should be accessed.

[Required] [RT Expr]
node - Expose a particular ObjectNode in the Slide namespace as bean.

The node tag lets you access a particular ObjectNode of a Slide namespace. You have to specify the URI of the node that should be accessed.

This tag can optionally expose a NodeBean with the following properties:

  • branches: a collection of the names of the branches that exist for the node
  • children: a collection of the children of the node as NodeBean objects
  • hasChildren: whether the node has children
  • hasRevisions: whether the node has revisions
  • isLocked: whether the node is locked
  • isVersioned: whether the node is versioned
  • locks: a collection of active locks on the node as LockBean objects
  • name: the leaf name of the node
  • parent: the parent node as NodeBean
  • permissions: a collection of permissions defined for the node as PermissionBean objects
  • revisions: a collection of revisions of the node as RevisionBean objects
  • initialRevision: the initial revision of the node as RevisionBean
  • latestRevision: the latest revision of the node as RevisionBean
  • roles: a collection of the names of the roles the node has
  • type: the type of the node as string
  • uri: the node's URI
The bean is only exposed inside the body of the node tag.

Attribute NameDescription
id

Specifies the name of the scripting variable (and associated page scope attribute) under which the NodeBean will be made available.

uri

Specifies the URI of the node to access.

[RT Expr]
uriName

The name of the bean containing the URI of the node to access.

uriProperty

Name of the property of the bean specified by uriName, whose getter returns the URI of the node to access.

uriScope

The bean scope within which to search for the bean named by the uriName property, or 'any scope' if not specified.

resolveLinks

Specifies whether links should be resolved when retrieving the node.

[RT Expr]
revision - Expose a revision-descriptor of an ObjectNode as bean.

The revision tag lets you access a specific revision of a node, either identified by the version number or the branch name. It must be nested inside a node tag.

This tag can optionally expose a RevisionBean with the following properties:

  • branch: the name of the branch the revision belongs to
  • number: the version number of the revision
  • properties: a collection of properties of the revision as PropertyBean objects
The bean is only exposed inside the body of the revision tag.

Attribute NameDescription
id

Specifies the name of the scripting variable (and associated page scope attribute) under which the RevisionBean will be made available.

number

Specifies the version number of the revision to retrieve.

[RT Expr]
branch

Specifies the branch name of the revision to retrieve.

[RT Expr]
content - Retrieve the content of a node.

Using the content tag, you have access to the actual content of a node (or a particular revision of a node).

If you provide the 'id' attribute, the content will be exposed as a String in the page context. Alternatively, you can specify the 'idReader' attribute, so that the content is made available as a java.io.Reader object. If none of these two are specified, the content will be printed to the output stream.

Attribute NameDescription
id

Specifies the name of the page scope attribute under which the content will be made available as String.

idReader

Specifies the name of the page scope attribute under which the content will be made available as java.io.Reader.

property - Expose a property of a node as bean.

This tag lets you access a specific property of a node or node revision. It must be nested inside a node or revision tag.

If you provide the 'id' attribute, the property tag will expose a PropertyBean with the following attributes:

  • name: the name of the property
  • namespace: the namespace of the property
  • value: the value of the property as string
The bean is only exposed inside the body of the property tag.

Attribute NameDescription
id

Specifies the name of the scripting variable (and associated page scope attribute) under which the PropertyBean will be made available.

namespace

Specifies the namespace of the property.

[RT Expr]
name

Specifies the name of the property.

[RT Expr]
iterateLocks - Iterate over all locks in a scope of the namespace, up to a specified depth.

This tag extends the Struts iterate tag to provide an iteration over the active locks in the namespace, starting at a certain scope and up to a configurable depth.

The scope of the locks iteration is defined by the URI of the parent node tag, thus the iterateLocks tag must be nested in a node tag.

This tag exposes a LockBean for every step of the iteration, which has the following properties:

  • objectUri: the URI of the locked object
  • subjectUri: the URI of the subject that owns the lock
  • typeUri: the URI that defines the type of the lock, pointing to an action node.
  • expirationDate: the expiration date of the lock, as java.util.Date object
  • isExclusive: whether the lock is exclusive.
  • isShared: whether the lock is shared.
The bean is only exposed inside the body of the iteration tag.

Attribute NameDescription
id

Specifies the name of the scripting variable (and associated page scope attribute) under which the LockBeans will be made available.

depth

Specifies the depth of the lock discovery.

[RT Expr]
indexId

The name of a page scope JSP bean that will contain the current index of the collection on each iteration.

[RT Expr]
length

The maximum number of locks to be iterated through on this page. This can be either an integer that directly expresses the desired value, or the name of a JSP bean (in any scope) of type java.lang.Integer that defines the desired value. If not present, there will be no limit on the number of iterations performed.

[RT Expr]
offset

The zero-relative index of the starting point at which the locks will be iterated through. This can be either an integer that directly expresses the desired value, or the name of a JSP bean (in any scope) of type java.lang.Integer that defines the desired value. If not present, zero is assumed (meaning that the collection will be iterated from the beginning.

[RT Expr]
iterateMembers - Iterate over all the children of a node, up to a specified depth.

This tag extends the Struts iterate tag to provide an iteration over all the direct or indirect members of a node, up to a specified depth. Optionally, nodes can be included or excluded by their role and/or type.

The scope of the members iteration is defined by the URI of the parent node tag, thus the iterateMembers tag must be nested in a node tag.

This tag exposes a NodeBean for every step of the iteration. See the documentation of the node tag for a list of properties of the NodeBean.

Attribute NameDescription
id

Specifies the name of the scripting variable (and associated page scope attribute) under which the NodeBeans will be made available.

depth

Specifies the depth of the member traversal.

[RT Expr]
excludeTypes

Comma-separated list of node types (e.g. subject, action, group) that should be excluded from the iteration.

[RT Expr]
excludeRoles

Comma-separated list of node roles (e.g. user, root) that should be excluded from the iteration.

[RT Expr]
includeTypes

Comma-separated list of node types (e.g. subject, action, group) that should be included in the iteration. Note that types listed in excludeTypes will not be included, even if they are also specified in this attribute.

[RT Expr]
includeRoles

Comma-separated list of node roles (e.g. user, root) that should be included in the iteration. Note that roles listed in includeRoles will not be included, even if they are also specified in this attribute.

[RT Expr]
indexId

The name of a page scope JSP bean that will contain the current index of the collection on each iteration.

[RT Expr]
length

The maximum number of members to be iterated through on this page. This can be either an integer that directly expresses the desired value, or the name of a JSP bean (in any scope) of type java.lang.Integer that defines the desired value. If not present, there will be no limit on the number of iterations performed.

[RT Expr]
offset

The zero-relative index of the starting point at which members will be iterated through. This can be either an integer that directly expresses the desired value, or the name of a JSP bean (in any scope) of type java.lang.Integer that defines the desired value. If not present, zero is assumed (meaning that the collection will be iterated from the beginning.

[RT Expr]

Copyright © 1999-2001, Apache Software Foundation