Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 2000, 2009, Oracle and/or its affiliates. All rights reserved.
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES

## Package com.bea.portlet.adapter.faces

Support for JSF applications in a portal.

See
Description

Class Summary
ScopedIdBuilder | Builds scoped identifiers for JSF content in portals.
ScopedIdSupport | Utility class that supports generation of scoped identifiers for JSF content in portals.

## Package com.bea.portlet.adapter.faces Description

Support for JSF applications in a portal.

### Overview

JSF applications associate a unique identifier with each JSF component in the component tree. When multiple JSF applications appear on a portal page, it becomes necessary to further scope these unique identifiers.

These features are provided to support scoping JSF component identifiers on a portal page:

- the `namingContainer` tag,
- the `NamingContainerComponent` and
- the scoped identifier builder.

#### The namingContainer Tag

The `namingContainer` tag is a custom JSF tag that introduces a `NamingContainerComponent` in the JSF component tree.

The `namingContainer` tag is expected to be the immediate child of the JSF `view` tag. It is not necessary to add the `namingContainer` tag to to JSF `subview` tag unless the `subview` needs to make use of a scoped identifier builder.

The `namingContainer` tag supports the attributes:

- `id`: (optional) the identifier of a page scoped attribute referencing a scoped identifier builder
- `defaultScopeKey`: (optional, runtime) the default scope key to use if the request is not being processed within a `facesContent` control in a portal (default: `portal`)
- `idSeparator`: (optional, runtime) the separator for sucessive appends to the id part if a constructed scoped identifier (default: `:`)

#### The NamingContainerComponent

The `NamingContainerComponent` is a custom JSF component that introduces a `NamingContext` into the JSF component tree.

The identifier of the `NamingContainerComponent` is a scope key determined by the portal.

#### The Scoped Identifier Builder

The `scoped identifier builder` is an object that is suitable for use in JSF value binding expressions that provides a convenient way to construct scoped identifiers.

To use a `scoped identifier builder`, add the `namingContainer` tag to the JSF `view` or `subview` and supply a valid `id` attribute. The `id` attribute specifies the name of a request-scoped attribute referencing an instance of `ScopedIdBuilder`.

The `ScopedIdBuilder` allows JSF value binding expressions to be used to construct a scoped identifier.

To construct a scoped identifier, begin with a JSF value binding expression of this form:

    <id>.scopedId[<quoted-string>]

This form may then be followed by expressions of these forms:

- `.prefix[<quoted-string>]`
- `.suffix[<quoted-string>]`
- `.id[<quoted-string>]`

Terminate the JSF value binding expression with `.string` to yield the constructed scoped identifier.

For example, this JSF value binding expression

    facesContent.scopedId['worldMap'].prefix['#'].string

might produce an identifier like this

    #facesPortal1:worldMap

#### Component Identifiers and Client Identifiers

Each component in a JSF component tree has an identifier. The identifier can be assigned explicitly or assigned by the JSF framework.

The JSF framework assigns another identifier, the client identifier, to each component in a JSF component tree. The client identifier is constructed by appending the component identifier to the client identifier of the nearest ancestor component that implmenents the `NamingContext` marker interface.

### Terminology

#### The ID Part

The middle part of a constructed scoped identifier.

During the construction of a scoped identifier, the id part is distinguished from the prefix and suffix parts by the fact that sucessive appends to the id part are separated by a configurable separator string. The default separator string is "`:`".

#### The Prefix Part

The initial part (prefix) of a constructed scoped identifier.

#### The Suffix Part

The final part (suffix) of a constructed scoped identifier.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES

Copyright © 2000, 2009, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.