Adding a Subscriber to WWSBR_EVENT_Q Running a CMEF Subscriber

16-12 Oracle Fusion Middleware Developers Guide for Oracle Portal

16.3.6 CMEF Message Payload

Every Oracle Portal user interface or PLSQL content management action falls under one of the three main CMEF events: INSERT, UPDATE, DELETE. States provide more meaning to events. For example, the following types of ADDINSERT ITEM events: ■ Add an item and publish it immediately. ■ Add an item and publish it at a later date. ■ Add an item that requires approval, because the user has Manage Items With Approval privileges. For a detailed list of the actions and related events and states, refer to Appendix G, Content Management Event Framework Events . Each CMEF event has an associated CMEF message payload as shown in Table 16–2 . Table 16–2 CMEF Message Payload Properties Message Property Type Description ACTION VARCHAR230 The portal action that triggered the event. RAW_EVENT VARCHAR230 The event produced as a result of the portal action. STATE VARCHAR230 Provides additional information related to the event. OBJECT_ID NUMBER The ID of the object to which the event relates for example, item, page, category, and so on. OBJECT_SITE_ID NUMBER The ID of the page group to which the object belongs. OBJECT_LANGUAGE VARCHAR230 The session language. NULL if the action is independent of language. PAGE_ID NUMBER For items, the ID of the page on which the item appears. NULL for other objects. PAGE_SITE_ID NUMBER For items, the ID of the page group to which the page identified in PAGE_ID belongs. NULL for non-item related events. OBJECT_CLASS VARCHAR230 Records the class of object about which an event has been raised. EVENTS_USER VARCHAR2256 The name of the user who performed the portal action. EVENTS_DATE VARCHAR260 The date on which the event occurred. Format: dd-mon-yyyy HH12:MI PM ID1 OVERLOADED NUMBER For items, the item type ID. For pages, the page type ID. For item and page types, the base type ID. Using the Content Management Event Framework 16-13

16.3.7 Oracle Portal Actions and CMEF Events

This section describes some of the most common portal actions and shows how to include code in your subscriber to detect these actions. These actions may occur through the Oracle Portal user interface, the Oracle Portal PLSQL APIs, or WebDAV. For a more detailed list of portal actions and the events and message payloads that they generate, refer to Appendix G, Content Management Event Framework Events .

16.3.7.1 Page and Page Group Actions

In Oracle Portal, a portal is a collection of one or more page groups. A page group is a hierarchical collection of pages for which common attributes and mechanisms can be established.

16.3.7.1.1 Creating a Page Creating a page produces the following CMEF message

payload: The first message is for the page itself, and the second is for the portlet instance that displays the default navigation page on the page. If you want your subscriber to respond to the creation of a page, perform the following check: if message.object_class = PAGE and message.raw_event = wwsbr_event_q_access.EVENT_INSERT then . . . end if; SITE_ID1 OVERLOADED NUMBER For item types, the ID of the page group to which the item type belongs. For pages, the ID of the page group to which the page type belongs. For item and page types, the ID of the page group to which the base type belongs. GROUP_ID NUMBER When multiple messages are associated with a particular event, related messages have the same group ID. OBJECT PATH VARCHAR24000 A unique path to the portal object being referenced by this message on the queue this can be NULL. It is used only for pages, items, categories, perspectives, item types, and page types. OBJECT UID VARCHAR24000 A unique immutable identifier to the portal object being referenced by this message. It is used only for pages, items, categories, perspectives, item types, and page types. Action Event State Object Class ADD_PAGE INSERT PUBLISHED PAGE ADD_ITEM INSERT PUBLISHED ITEM Table 16–2 Cont. CMEF Message Payload Properties Message Property Type Description 16-14 Oracle Fusion Middleware Developers Guide for Oracle Portal

16.3.7.1.2 Updating the Access Control List of a Page Changing the ACL of a page so that

it does not inherit from that of its page group, then clicking Apply or OK produces the following message payload: Now, adding a user to the ACL of a page, then clicking Add produces the following message payload: Changing the ACL of a page so that it does not inherit from that of its page group, immediately adding a user or group to the ACL, and then clicking Apply or OK produces the following message payload: Changing the ACL of a page so that it inherits that of the page group then clicking Apply or OK produces the following message payload: Clicking Apply or OK on the Page Properties page, produces an additional message:

16.3.7.1.3 Updating the Access Control List of a Page Group Updating the access control list

ACL of a page group by adding a user or group, or deleting a user or group produces the following message payload: If you want your subscriber to respond to general ACL updates on a page group, perform the following check: Action Event State Object Class SPECIFY_PAGE_ACL UPDATE GENERAL PAGE Action Event State Object Class ADD_PAGE_ACL UPDATE GENERAL PAGE Action Event State Object Class SPECIFY_AND_ ADD_PAGE_ACL UPDATE GENERAL PAGE Action Event State Object Class INHERIT_PAGE_ ACL UPDATE GENERAL PAGE Action Event State Object Class UPDATE_PAGE_ACL UPDATE GENERAL PAGE Action Event State Object Class ADD_PAGEGROUP_ ACL or DELETE_PAGE_ GROUP_ACL UPDATE GENERAL PAGE_GROUP UPDATE_PAGE_ GROUP_ACL UPDATE GENERAL PAGE_GROUP Using the Content Management Event Framework 16-15 if message.action = UPDATE_PAGE_GROUP_ACL and message.object_class = PAGE_GROUP and message.raw.event = wwsbr_event_q_access.EVENT_UPDATE then . . . end if; However, if you are more interested in filtering for actual update and delete events on the page groups ACL, then your subscriber should perform the following checks: if message.object_class = PAGE_GROUP and message.raw_event = wwsbr_event_q_access.EVENT_UPDATE then if message.action = ADD_PAGE_GROUP_ACL then . . . end if; if message.action = DELETE_PAGE_GROUP_ACL then . . . end if; . . . end if;

16.3.7.1.4 Deleting a Page Deleting a page produces the following message payload:

16.3.7.2 Item Actions

Items are one of the basic components of a portal page. Items in a portal are based on item types. An action on an item triggers a CMEF event irrespective of the item type. For example, an ADD_ITEM action occurs whenever a user adds an item of a base, extended, or custom item type. This ensures that there is consistent CMEF messaging behavior when an item action occurs.

16.3.7.2.1 Creating an Item and Publishing it at the Same Time If a user has Manage

privileges, creating an item of any type on a page produces the following message payload: If you want you subscriber to respond to this action, perform the following check: if message.action = ADD_ITEM and message.object_class = ITEM and Note: The ADD_PAGE_GROUP_ACL and DELETE_PAGE_ GROUP_ACL events are triggered when the user clicks Add for each user that is added todeleted from the ACL. The UPDATE_PAGE_ GROUP_ACL is generated when the user clicks Apply or OK. Action Event State Object Class DELETE_PAGE DELETE PURGED PAGE Note: Events are not generated for the sub-pages or items that are on the page. Action Event State Object Class ADD_ITEM INSERT PUBLISHED ITEM