Overview Oracle Fusion Middleware Online Documentation Library

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. Content Management API Introduction 9-5 For a full list of the constants available in each API package, 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.4.3 Invalidating the Cache

Many of the APIs automatically generate cache invalidation messages for the pages that are affected by the changes. Therefore, you should always call wwpro_api_ invalidation.execute_cache_invalidation at the end of your routine to process these messages see Example 11–3 for an example of how to do this. If you do not call this procedure, your changes may not be visible until the affected pages are invalidated through other means. There is no need to call execute_cache_invalidation more than once. For example, if you are adding or updating multiple items in a loop, call execute_ cache_invalidation when the loop is complete.

9.4.4 Issuing Commits

The APIs do not issue commits. However, if you are calling the APIs from a browser session through Portal Services, Portal Services will perform an automatic commit before returning control to the browser. The wwpro_api_invalidation.execute_cache_invalidation API also issues a commit. If you are calling the APIs from an external environment for example, SQLPlus or a Web provider, and you need to commit before processing the cache invalidations, you must explicitly issue a commit statement in your code. Similarly, if you need to rollback, do so before calling execute_cache_invalidation.

9.4.5 Resetting CMEF Global Variables

If you are using the content management APIs in conjunction with the Content Management Event Framework CMEF you need to make sure that you reset the