Moving an Item to a Different Page Moving Pages

Performing Simple Content Management Tasks 11-17 Example 11–11 shows how to copy a page. Example 11–11 Creating a Copy of a Page copy_folder API declare l_new_pageid number; begin l_new_pageid := wwsbr_api.copy_folder p_id = 12345, p_siteid = 33, p_parent_id = 10000 p_name = page1, p_title = page1 ; -- Process cache invalidation messages. wwpro_api_invalidation.execute_cache_invalidation; exception ... end; ■ p_id is the ID of the page that you want to copy. ■ p_siteid is the ID of the page group to which the page belongs. ■ p_parent_id is the ID of the page under which you want to copy the page. ■ p_name is the name for the new page created by the copy operation. ■ p_title is the display name for the new page created by the copy operation.

11.5 Deleting Content

When content is no longer required, you can use APIs to remove it from the portal and free up space. This section contains the following examples: ■ Section 11.5.1, Deleting Items ■ Section 11.5.2, Deleting Pages

11.5.1 Deleting Items

You can use the delete_item API to delete all versions of an item or just a single specific version. This API also deletes all sub items associated with the versions being deleted. When you delete an item using this API, you can choose to accept the default delete mode for the page group or override this setting. Example 11–12 deletes version 1 of an item permanently from the page group. The item version is permanently removed, even if the page group is set up to retain deleted items. Example 11–12 Deleting an Item delete_item API begin procedure delete_item p_master_item_id = 48037, p_caid = 54, p_version_number = 1, p_mode = wwsbr_api.DELETE_ITEM_PURGE ; 11-18 Oracle Fusion Middleware Developers Guide for Oracle Portal -- Process cache invalidation messages. wwpro_api_invalidation.execute_cache_invalidation; exception ... end; ■ p_master_item_id is the master ID of the item that you want to delete. ■ p_caid is the ID of the page group to which the item belongs. ■ p_version_number is the version of the item that you want to delete. If you attempt to delete the current version of the item, the ITEM_ACTIVE_VERSION exception is raised. If you do not specify an item version, all versions of the item are deleted. ■ p_mode is the mode to use when deleting the item. It can take the following values: – wwsbr_api.DELETE_ITEM_DEFAULT uses the page group setting. – wwsbr_api.DELETE_ITEM_PURGE deletes the item immediately, regardless of the page group setting. – wwsbr_api.DELETE_ITEM_LAZYDELETE marks the item as deleted, regardless of the page group setting. To restore a previously deleted item, use the undelete_item API Example 11–13 . If the item had any sub-items, those sub-items are also restored. Example 11–13 Restoring a Previously Deleted Item undelete_item API begin wwsbr_api.undelete_item p_thing_id = 12345, p_caid = 33 ; -- Process cache invalidation messages. wwpro_api_invalidation.execute_cache_invalidation; exception ... end; ■ p_thing_id is the unique ID of the deleted item that you want to restore. ■ p_caid is the ID of the page group to which the item belongs. Tip: If you want to delete the current version of the item, you must either delete all versions, or use the Oracle Portal user interface to revert to a previous version. Note: You can restore a deleted item only if the page group that owns the item is set up to retain deleted items, or the item was deleted using the wwsbr_api.DELETE_ITEM_LAZYDELETE mode, and the item has not been purged from the content repository.