C.1 Configuration and Location of Catalog Definitions

The rcv-config section of your adf-config.xml file defines the name of the default catalog. The rcv-config element is not available by default in your application's adf-config.xml file. You must add it if you want to change the name of the default catalog or, if you have chosen to implement multiple catalogs, specify a catalog selector class.

The Resource Catalog service stores catalog definition files in MDS at the resource-catalog-root directory. The resource-catalog-root is defined as an MDS namespace, hence the exact location depends on your MDS configuration. The default resource-catalog-root is defined by the mds-package-prefix attribute in the adf-rcs-config element in your adf-config.xml:

When you create or access catalogs using the Resource Catalog service APIs, the fully qualified MDS reference for the catalog (its storage location in the MDS repository) is dynamically constructed by appending the catalog identifier to the resource-catalog-root as follows:

resource-catalog-root/catalog_id.xml

If the value of resource-catalog-root is /oracle/adf/rc/metadata then all your catalog definitions must be stored within the /oracle/adf/rc/metadata MDS package.

If you create a catalog definition file and save it in MDS at /oracle/adf/rc/metadata/myFirstCatalog.xml, then that catalog's identifier would be myFirstCatalog. If this is to be the default catalog for your application, then catalog-name should be set to myFirstCatalog in adf-config.xml.

If your application requires multiple catalogs, you can organize them into sub packages. In this case, you might create a catalog definition file in MDS at /oracle/adf/rc/metadata/hr/personalization.xml. That catalog's identifier would be hr/personalization. If this is to be the default catalog for your application, then catalog-name should be set to hr/personalization.

C.2 Default Catalog Definition

Example C-1 shows the default catalog definition file to illustrate the most common elements.

Example C-1 Example of a Catalog Definition

<?xml version = '1.0' encoding = 'UTF-8'?>
<catalogDefinition xmlns="http://xmlns.oracle.com/adf/rcs/catalog"
id="catalogDefinition"
name="Default Resource Catalog"
description="Default resource catalog definition containing sample entries">
<contents>
<!-- **********************************************************************
* Custom folder exposing ADF Faces components *
* Comment out this element if you want to remove it from the catalog. *
*********************************************************************** -->
<customFolder id="facesComponents" name="ADF Faces Components"
description="ADF Faces components you can add to application pages"
factoryClass="oracle.adfinternal.view.page.editor.componentcatalog.adapter.ComponentObjectFactory"/>
<!-- **********************************************************************
* Dynamically include the portlets custom folder into the catalog at *
* runtime. The custom folder will only be included if the portlet runtime *
* jar files are included in the application classpath. *
*********************************************************************** -->
<customContent id="portletContent"
contentProviderClass="oracle.adf.rc.webcenter.WebCenterContentProvider"/>
<!-- **********************************************************************
* Uncomment the following <customFolder> element if you have configured *
* the Document Library service in your application and want to include *
* documents in the catalog. *
*********************************************************************** -->
<!--
<customFolder id="doclibDocuments"
name="Documents"
description="Documents from the Document Library Service"
factoryClass="oracle.webcenter.content.model.rc.CustomFolderContextFactory"/>
-->
<!-- **********************************************************************
* Uncomment the following <resource> element if you have configured the *
* Document Library service in your application and want to include the *
* Document Library main view in the catalog. *
* *
* NOTE: application.classpath is an implicitly defined "repository" for *
* accessing ADF Libraries that are included in your classpath *
*********************************************************************** -->
<!--
<resource id="doclibMainView"
name="Document Library Task Flow"
description="Main view of the Document Library Service"
repository="application.classpath"
path="doclib-service-view.jar/ADF_TaskFlow/oracle+webcenter+doclib+view+jsf+taskflows+mainView.xml#doclib-document-library"/>
-->
<!-- **********************************************************************
* To create a link to a task flow in an ADF Library: *
* 1) add a <resource> tag to your catalog definition & set the *
* "repository" attribute to "application.classpath" *
* (see doclibMainView above) *
* 3) set the "repository" attribute to the name of your file system *
* connection. *
* 4) set the "path" attribute for the task flow you are interested in. *
* The path is of the following form: *
* *
* path_to_jar/ADF_TaskFlow/task_flow_path *
* *
* To obtain the task_flow_path, use the file system connection from (1) *
* and navigate to the task flow in your ADF Library. Mouse-over your task *
* flow so its tool-tip is displayed. The tool-tip shows he fully qualified*
* ID of the task flow. Take this value and replace all occurrances of "/" *
* with "+". For example: *
* *
* Tool-tip:
oracle/webcenter/collab/announcement/view/taskflows/main-view-definition.xml#announcement-main-view
* Task_flow_path:
oracle+webcenter+collab+announcement+view+taskflows+main-view-definition.xml#announcement-main-view
*********************************************************************** -->
</contents>
</catalogDefinition>

The name of the resource bundle to be used for obtaining translated attribute values, where <attribute.... isKey="true"/>. The resourceBundle attribute can also be used at lower levels in the document, such as on individual attributes elements. Refer to the XSD for further details.

definitionFilter

The fully qualified name of a Java class that implements the oracle.adf.rc.spi.plugin.catalog.CatalogDefinitionFilter. You can use a definition filter to dynamically exclude entries from a catalog at runtime. One common use of a definition filter is to provide different views of the same catalog to users with different roles. For example, Oracle WebCenter Spaces uses a definition filter to hide entries for services that the administrator has disabled.

C.4.2 dynamicFolder

The dynamicFolder element defines a folder that is dynamically populated based upon the results of a query.

Dynamic folders have attributes just like any other entry. For information about including attributes for elements, see Section C.4.4, "attributes."

The identifier of a repository or connection you want to include in the search that generates the contents of the dynamic folder.

path

The path to the folder that should be included in the search.

includeSubfolders

A flag that indicates whether the search should be limited to the specified folder or include its subfolders as well.

C.4.3 folder

The folder element defines a catalog folder, used to organize content in the catalog. Folders can contain any number of entries including other folders. You can mix different types of catalog elements in the same folder.

Folders can have attributes just like any other entry. For information about including attributes for elements, see Section C.4.4, "attributes."

In addition to folder and contents elements, customFolder and customContent elements are displayed in the default catalog definition file. These elements are used to define content generated using Resource Catalog adapters.

You can comment out existing customFolder and customContent elements in your catalog definition file if required, but not add new ones. This is because you must use Resource Catalog APIs to define content in these elements and the required APIs are not exposed in this release.

C.4.4 attributes

Entries in a resource catalog have associated attributes that describe the entry. Values for some attributes can be obtained directly from the resources or from the name and description attributes on each XML element in the catalog definition. However, these values may not always be appropriate for displaying to end users, and often they are not available in different languages. Attributes defined using the attributes element in the catalog definition let you override those available from other sources. In addition, these attributes can be defined in terms of a key to a resource bundle so the actual values displayed reflect the current user's locale.

Within the attributes element you can insert any number of individual attribute elements that define the attributes you want to apply to a resource catalog entry.

The name of the resource bundle to be used for obtaining translated attribute values.

C.4.5 attribute

The attribute element defines an attribute for a resource catalog entry that corresponds to a descriptor in the schema element. For information about attributes, see Section C.4.4, "attributes." Oracle Composer uses the following attributes:

Title

Description

Subject

IconURI

ToolTip

You should include at least a Title and Description attribute for each catalog entry. A Subject attribute is also highly recommended to facilitate keyword searching of the resource catalog. The Title attribute overrides the name attribute on the parent element and is used to declare a display name that is translated through a resource bundle. Similarly, the Description attribute overrides the description attribute on the parent element and is used to declare a description that is translated through a resource bundle.

You can declare your own attributes by including them in the schema element. For more information, see Section C.4.8, "schema."

A flag indicating whether the value is a literal value (false) or a key to a resource bundle (true). In most cases, attributes should be resource bundle keys and the values translated through a resource bundle. The resource bundle can be declared at the catalog level or on various lower level elements such as attributes.

resourceBundle

The name of the resource bundle to be used for obtaining translated attribute values.

For task flows included in your Resource Catalog, you can use the attribute element to pass task flow parameters and attributes of the enclosing Show Detail Frame component. You can do this by prefixing the attributeId values for the task flow parameters and Show Detail Frame attributes with parameter. and attr. respectively as shown in the following example:

The identifier for the element in the catalog. Identifiers are required and must be unique at the folder level.

name

The name of the element.

description

The text describing the element.

repository

Name of the connection used to lookup the resource.

path

The path to the resource. For a task flow in an ADF Library, the path is of the following form:

path_to_jar/ADF_TaskFlow/task_flow_path

To obtain the task_flow_path, create a file system connection in Application Connections and navigate to the task flow in your ADF Library. The tooltip for the task flow shows the fully qualified ID of the task flow. Take this value and replace all occurrences of "/" with "+".

C.4.7 component

The component element is used to include a custom XML resource, such as a simple ADF Faces component or a YouTube video, in the catalog. The component element must be located within the contents section. You can add more than one component element in a catalog definition file.

The component element must contain a parameters element with a nested parameter element. Set the id for the parameter element to xml. Include the XML fragment inside this parameter element, within a CDATA (character data) tag. To generate an ADF Faces ID for the component at runtime, set the id on the component to # (hash symbol).

Example C-10 shows the code to add a Panel Customizable component to the Resource Catalog.

The name of a Java class that implements the oracle.adf.rc.component.ComponentFactory interface and generates a resource catalog item based on a set of parameters. Each ComponentFactory implementation defines the set of parameters it requires. For example, XmlComponentFactory requires a single parameter named xml and the value of the parameter is a block of XML representing a component or components that can be inserted into a page.

C.4.8 schema

The schema element contains one or more descriptor elements. The descriptor elements provide the resource catalog service with information about the attributes used within the catalog, such as whether they are searchable.