Setting the Session Context API Parameters

10-4 Oracle Fusion Middleware Developers Guide for Oracle Portal

10.3.3 Finding Region IDs

When adding an item to a page using the add_item API, you need to know the ID of the region in which you want to place the item. You can add items only to item regions that have been set up to allow content to be added to them. Example 10–6 shows a query that finds out the IDs and types of the insertable regions on a particular page. Given this information, you can choose the region ID of an appropriate region on the page in which to place your new item. Example 10–6 Finding the IDs and Types of Insertable Regions on a Given Page select distinct r.id Region ID, r.type Type from wwsbr_all_content_areas c, wwsbr_all_folders f, wwsbr_all_folder_regions r where f.name = page and c.name = pagegroup and c.id = f.caid and f.id = r.folder.id and f.caid = r.folder.caid and r.allow_content = 1 and c.language = language and c.language = f.language and f.language = r.language or r.language is null

10.3.4 Finding an Item ID

Example 10–7 illustrates how to find the ID of an item by querying the WWSBR_ALL_ ITEMS view. Example 10–7 Finding the ID of the Current Version of an Item Given its Master Item ID select id from wwsbr_all_items where masterid = 513 and caid = 53 and active = 1 and is_current_version = 1 and language = language To avoid duplicate rows when querying for currently published items, always include the LANGUAGE, ACTIVE active=1, and IS_CURRENT_VERSION is_current_ version=1 columns. Example 10–8 shows how to select all items on a given page folder_id=1 and a given page group caid=75. Example 10–8 Finding Item IDs select i.display_name title, i.id latestversion from wwsbr_all_items i where i.folder_id = 1 and i.caid = 75 and i.active = 1 and i.is_current_version = 1 and i.language = language -- The current session language. or exists -- A row for the item in the page group default language. Getting Started with Content Management APIs 10-5 select pg.id from wwsbr_all_content_areas pg where pg.id = i.caid and pg.default_language = i.language and not exists -- A row for the item in the current language. select i2.id from wwsbr_all_items i2 where i2.id = i.id and i2.language = language and i2.active = i.active and i2.is_current_version = i.is_current_version order by i.id