Exception Handling Listening for Messages

Using the Content Management Event Framework 16-9 agent_list1 := sys.aq_agentl_subscriber, l_queue, null; loop -- Listen for messages. dbms_aq.listen agent_list = agent_list, wait = wait_time, agent = agent_w_message ; -- If there are messages for the subscriber then dequeue them. if agent_w_message.name = l_subscriber then dequeue_options.wait := dbms_aq.NO_WAIT; dequeue_options.consumer_name := l_subscriber; dequeue_options.navigation := dbms_aq.[NEXT_MESSAGE|FIRST_MESSAGE]; dequeue_options.dequeue_mode := l_mode; -- Dequeue messages. dbms_aq.dequeue queue_name = l_queue, dequeue_options = dequeue_options, message_properties = message_properties, payload = message, msgid = message_handle ; -- Determine the type of event that occurred and act accordingly. ... your code here ... end if; end loop; -- Process cache invalidation messages. wwpro_api_invalidation.execute_cache_invalidation; end;

16.3.2 Adding a Subscriber to WWSBR_EVENT_Q

A subscriber subscribes to a queue from where it consumes messages. You have to add a subscriber to the WWSBR_EVENT_Q queue in order to process CMEF event messages, as shown in Example 16–6 . Example 16–6 Adding a Subscriber to WWSBR_EVENT_Q declare subscriber sys.aq_agent; begin subscriber := sys.aq_agentsubscriber, null, null; dbms_aqadm.add_subscriber queue_name = portal schema.wwsbr_event_q, subscriber = subscriber ; end;

16.3.3 Enabling CMEF Events at the Page Group Level

In Oracle Portal, CMEF is enabled or disabled at the page group level. By default, CMEF is enabled when a user creates a page group, and thus, events are triggered whenever changes occur within the Oracle Portal user interface or WebDAV. To enable or disable CMEF for a page group, perform the following steps: 16-10 Oracle Fusion Middleware Developers Guide for Oracle Portal 1. Go to any page of the page group and switch to Edit mode.

2. In the toolbar at the top of the page, click the Properties link next to Page Group.

Figure 16–2 The Page Group Properties Link on the Edit Mode Toolbar

3. Click the Configure tab to bring it forward.

4. In the Content Management Event Framework section you can see whether CMEF is enabled or disabled. If you want to change this setting, click the Edit link Figure 16–3 . Figure 16–3 Status of CMEF for a Page Group

5. To enable CMEF, select the Enable Content Management Event Framework check

box Figure 16–4 . To disable CMEF, clear the check box. Figure 16–4 Enabling or Disabling CMEF for a Page Group

6. Click OK to save your changes.

7. Click Close to return to the page.

Note: Make sure you click the link next to Page Group and not the one next to Page Figure 16–2 . Using the Content Management Event Framework 16-11