Inheriting Item Level Privileges from the Page

Using the Content Management Event Framework 16-3 The WWSBR_EVENT_Q queue is a multiconsumer queue. This enables more than one subscriber to consume a single message, allowing for multiple subscribers without having to make multiple copies of each message. Since all messages in the queue have the same priority, this queue works on a first-in first-out basis. Each message that CMEF enqueues to the WWSBR_EVENT_Q queue contains a payload that contains information about the portal object to which the event relates, such as page ID or page group ID. Subscribers can use this payload information to perform actions on the portal object. The contents of the CMEF message payload are described in more detail in Section 16.3.6, CMEF Message Payload . CMEF enqueues messages for immediate consumption, that is, a message is posted on the WWSBR_EVENT_Q queue as soon as an action occurs in the portal; there is no delay. Messages created by CMEF do not have an expiration time.

16.2.2 Subscribers and Dequeuing Messages

On the consuming end, subscribers have various mechanisms to consume the messages produced by CMEF. Subscribers can process messages as they arrive, and thus must wait for the messages to arrive. Alternatively, subscribers can choose to be notified when the messages arrive. These notifications can be Oracle Call Interface OCI callback functions, PLSQL functions, or even e-mails.

16.2.2.1 Adding a Subscriber to the WWSBR_EVENT_Q Queue

For a subscriber to be able to consume messages produced by CMEF, you need to add it to the WWSBR_EVENT_Q queue using the DBMS_AQADM.ADD_SUBSCRIBER procedure and you need to login as the Portal schema user: GRANT EXECUTE ON DBMS_AQADM TO PORTAL_SCHEMA; GRANT Aq_administrator_role TO PORTAL_SCHEMA; Example 16–1 adds the JAY subscriber to the WWSBR_EVENT_Q queue. Example 16–1 Adding a Subscriber to WWSBR_EVENT_Q subscriber := sys.aq_agentJAY, null, null; dbms_aqadm.add_subscriber queue_name = portal.wwsbr_event_q, subscriber = subscriber ; Since Oracle Streams AQ supports a maximum of 1024 subscribers for each multiconsumer queue, you can add up to a maximum of 1024 subscribers to the Table 16–1 AQ Message Properties Set by CMEF Message Property Type Value PRIORITY BINARY_INTEGER 1 DELAY BINARY_INTEGER NO_DELAY EXPIRATION BINARY_INTEGER NEVER CORRELATION VARCHAR2128 NULL RECIPIENT_LIST AQ_RECIPIENT_LIST_T NULL EXCEPTION_QUEUE VARCHAR251 WWSBR_EVENT_ERR_Q ORIGINAL_MSGID RAW16 NULL 16-4 Oracle Fusion Middleware Developers Guide for Oracle Portal WWSBR_EVENT_Q queue. All consumers that are added as subscribers to this queue must have unique values for the AQ_AGENT parameter. You can remove a subscriber using the DBMS_AQADM.REMOVE_SUBSCRIBER procedure. For an example of a simple subscriber, refer to Section 16.3.1, Creating Subscriber Code .

16.2.2.2 Subscriber Queue Management

Oracle Enterprise Manager DBA Studio enables you to manage Oracle Streams AQ. You can use DBA Studio to create queue tables, create queues, browse AQ messages, archive or purge AQ messages, add AQ subscribers, and manage propagation. DBA Studio also shows the topology for the propagation of messages between queues at database level and queue level. The Oracle Diagnostics and Tuning pack supports alerts and monitoring for AQ queues. You can set up alerts for when the number of messages for a particular subscriber exceeds a threshold, or when there is an error in propagation. In addition, you can monitor queues for the number of messages in a ready state or the number of messages for each subscriber, and so on. You can also manage the subscriber queue using the standard AQ APIs. For more information, refer to your Oracle Enterprise Manager documentation.

16.2.2.3 Dequeuing Messages

The operation of retrieving messages from a queue is known as dequeuing Figure 16–1 . Figure 16–1 The Dequeuing Process You use the DBMS_AQ.DEQUEUE procedure for dequeuing messages from the WWSBR_EVENT_Q queue. Example 16–2 illustrates dequeuing for the subscriber JAY.