Select the Require Approval for All Users check box

16-36 Oracle Fusion Middleware Developers Guide for Oracle Portal -- Set the value for the portal URL. wf_engine.setitemattrtextl_itemtype, l_itemkey, PORTAL_URL, l__url; -- Set the value for the portal item ID. wf_engine.setitemattrnumberl_itemtype, l_itemkey, PORTAL_ITEM_ID, message.object_id; -- Set the value for the portal page group ID. wf_engine.setitemattrnumberl_itemtype, l_itemkey, PORTAL_SITE_ID, message.object_site_id; -- Start the workflow process. wf_engine.startprocessl_itemtype, l_itemkey; end if; end if; end_time := dbms_utility.get_time; if end_time - begin_time 3000 then exit; end if; end loop; exception when OTHERS then dbms_output.put_linesqlerrm; end workflow_approval; You also need to create a procedure to check whether the user specified a file name for the item to determine whether or not it can be approved. The workflow process delegates the actual validation and approval of the item to this CHECK_URL procedure. Example 16–18 shows how to create the CHECK_URL procedure. Example 16–18 The CHECK_URL Procedure create or replace procedure check_url itemtype in varchar2, itemkey in varchar2, actid in number, funcmode in varchar2, resultout out varchar2 is MIME_TYPE_TEXT constant varchar230 := textplain; agent_list dbms_aq.aq_agent_list_t; wait_time integer := 30; begin_time pls_integer; end_time pls_integer; agent_w_message aq_agent; dequeue_options dbms_aq.dequeue_options_t; message_properties dbms_aq.message_properties_t; message_handle RAW16; message portal.wwsbr_event; l_subscriber varchar230 := CMEF_WORKFLOW; l_queue varchar230 := PORTAL.WWSBR_EVENT_Q; l_mode BINARY_INTEGER := dbms_aq.REMOVE; l_attribute_site_id number := 0; l_event varchar230; l_doc wwdoc_api.document_record; l_desc varchar24000; l_itemtype varchar2100 := WF; l_itemkey varchar2100; l_url varchar2100; l_siteid number; l_itemid number; l_ignore boolean := FALSE; l_is_indirect boolean := TRUE; Using the Content Management Event Framework 16-37 l_portal_user_name varchar230 := portal; l_portal_password varchar230 := portal password; begin -- Get the values for the attributes stored in the procedure. l_url := wf_engine.getitemattrtextitemtype,itemkey,PORTAL_URL,l_ignore; l_itemid := wf_engine.getitemattrnumberitemtype,itemkey,PORTAL_ITEM_ID,l_ ignore; l_siteid := wf_engine.getitemattrnumberitemtype,itemkey,PORTAL_SITE_ID,l_ ignore; -- Set the portal context. portal.wwctx_api.set_contextl_portal_user_name, l_portal_password; -- If the item type is a URL item and no URL is specified. if l_url is null then begin -- Update the item to indicate that the URL needs to be specified. l_desc := font color=REDNO URL SPECIFIEDfont; -- Reset the CMEF global variables. wwsbr_api.clear_cmef_context; wwsbr_api.set_attribute p_site_id = l_siteid, p_thing_id = l_itemid, p_attribute_site_id = l_attribute_site_id, p_attribute_id = wwsbr_api.attribute_description, p_attribute_value = l_desc p_log_cmef_message = FALSE ; -- Reject the item. wwsbr_api.reject p_item_id = l_itemid, p_site_id = l_siteid, p_is_indirect = l_is_indirect, p_comment = Rejected ; -- Reset the CMEF global variables. wwsbr_api.clear_cmef_context; end; else -- Approve the item. begin wwsbr_api.approve p_item_id = l_itemid, p_site_id = l_siteid, p_comment = Approved ; -- Reset the CMEF global variables. wwsbr_api.clear_cmef_context; end; end if; commit; -- Process cache invalidation messages. wwpro_api_invalidation.execute_cache_invalidation; exception when OTHERS then dbms_output.put_linesqlerrm; end check_url;