Deleting Items Deleting Content

11-20 Oracle Fusion Middleware Developers Guide for Oracle Portal 12 Extending Your Portal 12-1 12 Extending Your Portal This chapter describes how to use the APIs provided with Oracle Portal to extend your portal. It contains the following sections: ■ Section 12.1, Creating a Page Group ■ Section 12.2, Creating Pages ■ Section 12.3, Creating Categories and Perspectives ■ Section 12.4, Creating Items ■ Section 12.5, Setting Perspectives Attributes of Pages and Items ■ Section 12.6, Approving and Rejecting Items For more information about any of these 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.

12.1 Creating a Page Group

To create a new page group, use the add_content_area API as shown in Example 12–1 . Example 12–1 Creating a Page Group add_content_area API declare l_new_page_group_id number; begin -- Create the page group. l_new_page_group_id := wwsbr_api.add_content_area p_name = ENTERTAINMENT, p_display_name = Entertainment Page Group, p_versioning = wwsbr_api.VERSIONING_AUDIT, p_default_language = us ; -- process cache invalidation messages. wwpro_api_invalidation.execute_cache_invalidation; exception Tip: Remember, if you are calling the APIs from a Web provider or external application, you need to set the session context first. For more information, refer to Section 10.1, Setting the Session Context . 12-2 Oracle Fusion Middleware Developers Guide for Oracle Portal ... end; ■ p_name is the internal name for the new page group. This name is used in path based URLs and must be unique. ■ p_display_name is the display name for the new page group. ■ p_versioning is the version level for items in the page group. It can take the following values: – wwsbr_api.VERSIONING_NONE – wwsbr_api.VERSIONING_SIMPLE – wwsbr_api.VERSIONING_AUDIT ■ p_default_language is the default language for the page group.

12.2 Creating Pages

If you want to create a new page, use the add_folder API. By default, the new page has two regions: a portlet region containing the default navigation page of the page group, and an item region. This means that pages created programmatically, rather than through the Oracle Portal user interface, may be quite limited in their layout. However, you can programmatically create pages with a more sophisticated layout by basing the parent page of the new page on a Portal Template with the desired layout. Then if you configure the page group to automatically copy parent page properties, your new page will use the same template as its parent. Using this method means that your pages can have any layout that you require. You cannot use this API to create JSP pages or navigation pages. To create these types of pages, use the Create Page Wizard in Oracle Portal. If the page type on which you base the page has default values set for any page properties, these values override any values set using this API. To define privileges for your new page, use the APIs in the WWSEC_API package Example 12–2 . For more information, refer to Section 15.2, Setting Page Level Privileges . Example 12–2 Creating a Page add_folder API declare l_new_page_id number; l_caid number := 33; begin -- create the page. l_new_page_id := wwsbr_api.add_folder p_caid = l_caid, p_name = ENTERTAINMENT, p_display_name = Entertainment Page, p_type_id = wwsbr_api.FOLDER_TYPE_CONTAINER, p_type_caid = wwsbr_api.SHARED_OBJECTS, ; -- Process cache invalidation messages. wwpro_api_invalidation.execute_cache_invalidation; exception ... end;