com.ibm.xsp.registry
Interface FacesRegistry

All Superinterfaces:
com.ibm.xsp.registry.FacesReferenceContainer
All Known Subinterfaces:
FacesSharableRegistry

public interface FacesRegistry
extends com.ibm.xsp.registry.FacesReferenceContainer

A registry is used to resolve from tag names and namespace URIs used in the .xsp files to the class of the object that should be created from such a tag. It contains all the information registered in the ".xsp-config" files, so it also lists the properties available on a tag, whether properties are required, the expected class of the property value, etc.

The main view of the registry is as a collection of namespaces, which in turn contain definitions for tags, and the tags define properties. A namespace is represented by a FacesLibrary. A tag is defined by a FacesDefinition, and a property is defined by a FacesProperty . Each namespace is built up from the collection of config files that declare the same namespace-uri. The config files are represented by FacesLibraryFragments. [Please do not confuse FacesLibrary with XspLibrary.]

Another view of the registry is as a collection of projects, which are locations containing config files. So an application registry will have a project corresponding to the application, containing the definitions of custom controls in that application, and it will also use projects that define the XPages runtime tags. A project is a FacesProject, and a configuration file is a FacesLibraryFragment.

The FacesRenderKitLibrarys are almost never used. There is a feature in the .xsp file format known as a "render kit tag", where for a control named xp:inputText, you can put a render kit tag like xp:inputText.rcp within that control, and any property values that are set on the render kit tag will be applied to the control instance only when the XPage is running in the "rcp" (Notes Client) platform. Normally the render kit tag will accept properties that are defined on the control tag (xp:inputText), but you can also define extra properties that may only be used on the render kit tag, that are not applicable to the control tag. Those extra properties are defined in the xsp-config file, in a subsection labeled by render-kit-id, containing renderer definitions. The renderer definition does not define all the properties allowed on the render kit tag, but just defines the extra properties other than the control properties. Each subsection, defining a file's contribution for a render-kit, is represented by a FacesRenderKitFragment. They contain FacesRendererDefinitions corresponding to the extra properties allowed on a specific render kit tag. The renderer definitions are not included in namespaces, and not are searched for by tag name, so they are not accessible from most definition-related methods. All the render-kit subsections from different config files that have the same render-kit-id are grouped together into FacesRenderKitLibrarys. Note that generally when people refer to a RenderKit, they are not referring to render kit tags, but to the runtime platform (Notes Client or web) and the appearance of controls when displayed in that platform (controls may appear differently when shown in different platforms, even without render kit tags).

The different projects are generally correspond to different registries - see FacesSharableRegistry for the concept of having multiple interconnected registries.

A FacesRegistry contains a collection of FacesProjects. The FacesProjects will contain FacesLibraryFragments, which may in turn contain FacesRenderKitFragments, where both kinds of fragments can contain many FacesDefinitions.

Related FacesLibraryFragments and FacesRenderKitFragments are grouped together in FacesLibrarys and FacesRenderKitLibrarys respectively.

A FacesLibrary groups together all non- FacesRendererDefinition FacesDefinitions, from known FacesProjects, that are defined with the same namespaceUri. (See FacesLibraryFragment.getNamespaceUri())

A FacesRenderKitLibrary groups together all FacesRendererDefinitions, from known FacesProjects, that have the same renderKitId. (See FacesRenderKitFragment.getRenderKitId())

Each application defines a single FacesRegistry with namespaces containing the definitions of all tags, which correspond to components or complex types in pages, that can be run by that application.


Method Summary
 FacesComplexDefinition findComplex(java.lang.String uri, java.lang.String id)
           
 java.util.List<FacesComplexDefinition> findComplexDefs()
           
 FacesComponentDefinition findComponent(java.lang.String uri, java.lang.String id)
           
 java.util.List<FacesComponentDefinition> findComponentDefs()
           
 FacesCompositeComponentDefinition findComposite(java.lang.String uri, java.lang.String id)
           
 java.util.List<FacesCompositeComponentDefinition> findCompositeDefs()
           
 FacesDefinition findDef(java.lang.String referenceId)
          null or a FacesDefinition with the given value as FacesDefinition.getReferenceId().
 FacesDefinition findDef(java.lang.String uri, java.lang.String id)
          null or a FacesDefinition for the given namespace URI and FacesDefinition.getId(), where if the result is non-null and FacesDefinition.isTag(), then it corresponds to a tag in that namespace.
 java.util.List<FacesDefinition> findDefs()
          Finds most definitions available from this registry.
 java.lang.String getId()
          Not necessarily unique, an ID used as an identifier, usually corresponding to the current application.
 FacesLibrary getLibrary(java.lang.String namespaceUri)
          Finds the only FacesLibrary in this FacesRegistry with the specified namespaceUri, or returns null if there is none.
 java.util.Collection<java.lang.String> getNamespaceUris()
          The String namespaceUris known to this registry.
 java.util.List<FacesProject> getProjectList()
          Returns all the FacesProjects this registry is aware of, both those that were created in this registry or in any other registry that this delegates to.
 java.util.Collection<java.lang.String> getRenderKitIds()
          The String ids of the render-kits known to this registry.
 FacesRenderKitLibrary getRenderKitLibrary(java.lang.String renderKitId)
          Returns the FacesRenderKitLibrary with the specified renderKitId.
 boolean isNamespaceUri(java.lang.String uri)
          true if the namespaceUri is known to this registry.
 
Methods inherited from interface com.ibm.xsp.registry.FacesReferenceContainer
refreshReferences
 

Method Detail

getId

java.lang.String getId()
Not necessarily unique, an ID used as an identifier, usually corresponding to the current application.

Returns:

getRenderKitLibrary

FacesRenderKitLibrary getRenderKitLibrary(java.lang.String renderKitId)
Returns the FacesRenderKitLibrary with the specified renderKitId. See the discussion of FacesRenderKitLibrary in FacesRegistry.


getLibrary

FacesLibrary getLibrary(java.lang.String namespaceUri)
Finds the only FacesLibrary in this FacesRegistry with the specified namespaceUri, or returns null if there is none. See FacesLibrary.getNamespaceUri().

Parameters:
namespaceUri - the namespaceUri to find the library for.
Returns:
null or a FacesLibrary whose namespaceUri is the same as the argument.

getNamespaceUris

java.util.Collection<java.lang.String> getNamespaceUris()
The String namespaceUris known to this registry. The order is random-ish.

Returns:

getRenderKitIds

java.util.Collection<java.lang.String> getRenderKitIds()
The String ids of the render-kits known to this registry. The order is random-ish.

Returns:

getProjectList

java.util.List<FacesProject> getProjectList()
Returns all the FacesProjects this registry is aware of, both those that were created in this registry or in any other registry that this delegates to. The FacesProjects are unique by id. The projects in the local application are last. Note, when searching this project list, you should generally begin at the end and work back.

Returns:
the FacesProjects accessible from this registry.

isNamespaceUri

boolean isNamespaceUri(java.lang.String uri)
true if the namespaceUri is known to this registry.

Parameters:
uri -
Returns:

findDef

FacesDefinition findDef(java.lang.String uri,
                        java.lang.String id)
null or a FacesDefinition for the given namespace URI and FacesDefinition.getId(), where if the result is non-null and FacesDefinition.isTag(), then it corresponds to a tag in that namespace. The result may also be a non-tag definition (for example, an abstract tag superclass, or a group of properties which may be referenced by tags).

Parameters:
uri -
id -
Returns:

findDef

FacesDefinition findDef(java.lang.String referenceId)
null or a FacesDefinition with the given value as FacesDefinition.getReferenceId(). This search is slightly odd, as it first searches the entire registry by FacesDefinition.getId(), and then by FacesDefinition.getReferenceId(). This means that it is faster to search for abstract definitions and groups, as their ID is generally the same as their referenceId. For definitions that correspond to a tag in an XPage, the ID is the tag name, while the reference ID is the component-type or complex-id. The reference ID is used to refer to a definition from subclass tags or to refer to a definition's description when using the xsp-config label reference mechanism.

Parameters:
referenceId -
Returns:

findDefs

java.util.List<FacesDefinition> findDefs()
Finds most definitions available from this registry. This includes the definitions of tags that are resolved by tag-name/namespace-uri lookup, and other non-tag definitions (where FacesDefinition.isTag() is false).

This excludes overridden tag-name/namespace-uri duplicates, for example, where an application defines a tag with the same namespace-uri and tag-name as an XPages runtime tag, this list will contain the application tag but not the XPages runtime tag.

Also excluded are FacesRendererDefinition definitions (see the discussion of FacesRenderKitLibrary in FacesRegistry).

Returns:
most definitions, including all definitions that can be resolved by tag name lookup.

findComponent

FacesComponentDefinition findComponent(java.lang.String uri,
                                       java.lang.String id)

findComposite

FacesCompositeComponentDefinition findComposite(java.lang.String uri,
                                                java.lang.String id)

findComplex

FacesComplexDefinition findComplex(java.lang.String uri,
                                   java.lang.String id)

findComponentDefs

java.util.List<FacesComponentDefinition> findComponentDefs()

findCompositeDefs

java.util.List<FacesCompositeComponentDefinition> findCompositeDefs()

findComplexDefs

java.util.List<FacesComplexDefinition> findComplexDefs()