Deleting Pages Deleting Content

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; Extending Your Portal 12-3 ■ p_caid is the ID of the page group to which you want to add the page. ■ p_name is the internal name for the new page. This name is used in path based URLs. ■ p_display_name is the display name title for the new page. ■ p_type_id is the ID of the page type on which you want to base the page. The page type must be available to the page group in which you are creating the page. Seeded page types have the following constants defined: – wwsbr_api.FOLDER_TYPE_CONTAINER – wwsbr_api.FOLDER_TYPE_URL – wwsbr_api.FOLDER_TYPE_PLSQL – A value from the ID column of the WWSBR_FOLDER_TYPES view You can find the IDs for custom page types by querying the ID column of the WWSBR_FOLDER_TYPES view. ■ p_type_caid is the ID of the page group to which the page type used for the page belongs. This value must be the same as the page group in which you are creating the page p_caid or the Shared Objects page group use the wwsbr_api.SHARED_ OBJECTS constant.

12.3 Creating Categories and Perspectives

If you have already defined a quite large taxonomy for your portal, you might prefer to set it up programmatically, rather than use the Oracle Portal user interface. Use the add_category API to create a new category Example 12–3 . Use the add_ perspective API to create a new perspective Example 12–4 . To create a category or perspective, users must have Manage Classifications privileges or higher on the page group. Example 12–3 Creating a Category add_category API declare l_new_category_id number; l_caid number := 33; begin l_new_category_id := wwsbr_api.add_category p_caid = l_caid, p_parent_id = 0, p_name = newcategory1, p_display_name = New Category 1 ; -- Process cache invalidation messages. wwpro_api_invalidation.execute_cache_invalidation; exception ... end; Example 12–4 Creating a Perspective add_perspective API declare 12-4 Oracle Fusion Middleware Developers Guide for Oracle Portal l_new_perspective_id number; l_caid number := 33; begin l_new_perspective_id := wwsbr_api.add_perspective p_caid = 33, p_parent_id = 0, p_name = newperspective1, p_display_name = New Perspective 1 ; -- Process cache invalidation messages. wwpro_api_invalidation.execute_cache_invalidation; exception ... end; ■ p_caid is the ID of the page group in which you want to create the category or perspective. ■ p_parent_id is the ID of the category or perspective under which you want to create the new category or perspective. If this is a top-level category or perspective, use 0 zero. ■ p_name is the internal name for the new category or perspective. ■ p_display_name is the display name for the new category or perspective.

12.4 Creating Items

To create an item on a page, use the add_item API Example 12–5 . This API returns the master ID of the item, which is not the items unique ID. To look up the ID of the item after it is created, query the WWSBR_ALL_ITEMS view as shown in Example 10–7 . For more information about the difference between an items unique ID and its master item ID, refer to Section 10.2, API Parameters . Example 12–5 Creating a Text Item add_item API declare l_new_item_master_id number; begin l_new_item_master_id := wwsbr_api.add_item p_caid = 33, p_folder_id = 13923, p_display_name = Movie Review, p_type_id = wwsbr_api.ITEM_TYPE_TEXT, p_type_caid = wwsbr_api.SHARED_OBEJCTS, p_region_id = 5, p_text = This is the text of the review., ; -- Process cache invalidation messages. wwpro_api_invalidation.execute_cache_invalidation; exception ... end; ■ p_caid is the ID of the page group that owns the page in which you want to create the item. ■ p_folder_id is the ID of the page in which you want to create the item.