Registration Prerequisites Provider Record Input Registration Example

8-54 Oracle Fusion Middleware Developers Guide for Oracle Portal exception when others then dbms_output.put_lineERROR: Could not register Cache Provider; dbms_output.put_lineSQLERRM: || SQLERRM; rollback; end; Note: After you have registered your provider, you may also refresh the Portlet Repository programmatically using wwpro_api_ provider_registry.refresh_portlet_repository or through the Oracle Portal user interface. Part III Part III Content Management APIs Part III contains the following chapters: ■ Chapter 9, Content Management API Introduction ■ Chapter 10, Getting Started with Content Management APIs ■ Chapter 11, Performing Simple Content Management Tasks ■ Chapter 12, Extending Your Portal ■ Chapter 13, Searching Portal Content ■ Chapter 14, Creating Multi-Lingual Content ■ Chapter 15, Implementing Content Security ■ Chapter 16, Using the Content Management Event Framework 9 Content Management API Introduction 9-1 9 Content Management API Introduction This chapter provides an overview of a selection of the APIs provided with Oracle Portal. You can use these particular APIs to write code for performing content management tasks. It contains the following sections: ■ Section 9.1, Overview ■ Section 9.2, Content Management APIs ■ Section 9.3, Providing Access to the APIs and Secure Views ■ Section 9.4, Guidelines for Using the APIs ■ Section 9.5, Guidelines for Using the Secure Views ■ Section 9.6, Code Samples

9.1 Overview

Oracle Portal uses a schema within the Oracle Metadata Repository, shown in Figure 9–1 , to store the content and metadata associated with the portal instance. This schema is sometimes referred to as the content repository. For example, when a contributor adds a file item to a portal page, the file is uploaded to a table in the portal schema of the MDS Repository along with the metadata supplied. Figure 9–1 The MDS Repository 9-2 Oracle Fusion Middleware Developers Guide for Oracle Portal For more information about the MDS Repository and Oracle Portal architecture in general, refer to the Oracle Fusion Middleware Administrators Guide for Oracle Portal. Oracle Portal provides many built-in tools to help you manage the content in the portal schema of the MDS Repository right from your Web browser. However, sometimes you may find that you need to work with your content in an environment outside of the Oracle Portal browser-based user interface. The following are some examples of when you might want to do this: ■ Building an alternative user interface when the product user interface does not quite meet your requirements, for instance: – to change the look and feel of the wizards to meet your own corporate design – to add custom validations – to provide a custom search form or search results page ■ Bulk loading content with metadata ■ Integrating with external applications and content management systems ■ Archiving items for example, moving them to an archive page or offline storage ■ Managing versions for example, deleting or purging noncurrent versions, limiting the number of versions, and so on ■ Integrating with external workflow systems The content management APIs enable you to interact with the portal schema of the MDS Repository programmatically, rather than by using the Oracle Portal user interface. For more information, refer to Section 9.2, Content Management APIs . You can also query the data in the content repository using a set of secure views. For more information, refer to Section 9.2.1, Secure Content Repository Views .

9.2 Content Management APIs

There are multiple public APIs that enable you to programmatically perform many content management tasks, such as adding items and creating pages. The majority of the APIs for content management are contained within the WWSBR_ API package. You may also find the following API packages useful when writing code to perform content management tasks: ■ The WWSRC_API package contains APIs for performing searches on content in the portal schema of the MDS Repository. ■ The WWSEC_API package contains APIs for controlling access to content in the portal schema of the MDS Repository. ■ The WWCTX_API package contains APIs for managing a session context for a specific user. ■ The WWPRO_API_INVALIDATION package contains APIs for invalidating content in Oracle Web Cache. Note: Only use public APIs in your code. The use of non-public APIs is not supported and may cause your code to break when upgrading to new releases. Content Management API Introduction 9-3 For more information about these packages, refer to Section F.1, Supported APIs . For a full list of the supported PLSQL APIs, refer to the Oracle Portal PLSQL API Reference on Portal Center: http:portalcenter.oracle.com In the Portal Focus Areas section, click Portlet Development, then in the APIs and References section, click PLSQL API Reference.

9.2.1 Secure Content Repository Views

Held within the portal schema are a number of content repository views. You can use these views to query back data on the documents and items stored in the content repository. For a list of the secure views, refer to Section F.2, Secure Views . Many of the content management APIs that are discussed in this manual require you to pass object IDs as parameters. To do this, you need to know the IDs of the objects with which you want to work. You can use the secure content repository views to find the IDs of portal objects. For more information, refer to Section 10.3, Finding an Object ID .

9.2.2 Terminology

To maintain backward compatibility with the Oracle9iAS Portal Release 1 3.0.9 content area APIs and views, many of the API procedure and parameter names and the view and column names continue to use Release 1 terminology. You may find Table 9–1 useful to map the Release 1 terminology to the current terminology.

9.3 Providing Access to the APIs and Secure Views

The portal schema automatically has the appropriate access to the public APIs and secure views. To enable another schema to access the public APIs and secure views, use the following script: ORACLE_HOMEportaladminplsqlwwcprovsyns.sql To provide access to the APIs, perform the following steps: 1. Change to the directory containing the provsyns.sql script: Windows: cd ORACLE_HOME\portal\admin\plsql\wwc LinuxUnix: cd ORACLE_HOMEportaladminplsqlwwc 2. Log in to SQLPlus as the portal schema owner. For example: sqlplus portaloracle1 Note: Direct access to other tables and views in the portal schema of the MDS Repository is not supported, as the definition of those tables and views may change between releases. Table 9–1 Mapping of Release 1 Terminology to Current Terminology Release 1 Terminology Current Terminology content area page group folder page navigation bar navigation page 9-4 Oracle Fusion Middleware Developers Guide for Oracle Portal You must run provsyns.sql as the portal schema owner. By default the portal schema is called PORTAL. An administrator can use Oracle Internet Directory to obtain the portal schema password as follows: a. Navigate to: – Entry Management – cn=OracleContext – cn=Products – cn=IAS – cn=Infrastructure Databases – OrclReferenceName=Infrastructure Database for example, iasdb.server.domain.com – OrclResourceName=Schema Name for example, PORTAL b. Click this entry. c. Look for the orclpasswordattribute value in the right panel. This is the schema password. 3. Run the provsyns.sql script: SQLprovsyns.sql schema Where schema is the name of the schema to which you want to grant access.

9.4 Guidelines for Using the APIs

When using the APIs described in this manual, you should follow the best practice guidelines described in the following sections.

9.4.1 Using a Separate Schema

When creating procedures and packages that use the content management APIs, create them in a separate schema of the database in which Oracle Portal is installed. Do not create them in the portal schema. Creating additional procedures and packages in the portal schema is not supported and they may be lost when upgrading to a new release. Once you have created the schema for your procedures and packages, you must grant it access to the APIs and secure content repository views. For information about how to do this, refer to Section 9.3, Providing Access to the APIs and Secure Views .

9.4.2 Using Constants

All the API packages include predefined constants that you can use to easily refer to Oracle Portal objects and metadata. For example, the WWSBR_API package includes constants for base attributes such as ATTRIBUTE_AUTHOR and ATTRIBUTE_TEXT, seeded item types such as ITEM_TYPE_FILE and ITEM_TYPE_URL, and image alignment options such as ALIGN_BOTTOM and ALIGN RIGHT. To make your code robust, you should use these constants wherever possible for object IDs and attribute values. That way, if the actual ID or values change, your code will still work because the name of the constant will stay the same. Tip: Ignore any messages related to a missing file when running provsyns.sql.