------------------------------------------------------------------------------- 
-- 
--  @Copyright (c) 1999-2002, Oracle Corporation. All rights reserved. 
--  @headcom 
-- 
--  Registration script of Example_XML provider.
-- 
--  This script calls the wwpro_api_provider.register API to register
--  the Example_XML provider with portal.
-- 
--  @usage   execute in portal schema 
-- 
--  @scope   Public 
-- 
------------------------------------------------------------------------------- 

set serverout on size 1000000

declare
    l_provider_id  integer;
    l_provider wwpro_api_provider_registry.provider_record;
begin

    --
    -- Set the provider record with the appropriate values.
    -- 
    l_provider.name := 'Example_XML';
    l_provider.node_id := null;
    l_provider.timeout := 15;
    l_provider.timeout_msg_id := null;
    l_provider.implementation_style
      := wwpro_api_provider_registry.PLSQL_IMPL;
    l_provider.implementation_owner := user;
    l_provider.implementation_name := 'example_provider';
    l_provider.enable_distribution := false;
    l_provider.login_frequency
      := wwpro_api_provider_registry.LOGIN_FREQUENCY_NEVER;

    -- Call the provider registration API.
    l_provider_id := wwpro_api_provider_registry.register_provider(
        p_provider_rec => l_provider
    );

    -- Commit the changes.
    commit;

    -- Display provider information.
    dbms_output.put_line('Provider Example US, provider_id = ' || l_provider_id);
    wwpro_api_provider_registry.print_provider(
        p_id => l_provider_id, 
        p_language => wwnls_api.AMERICAN
    );

exception
    when others then 
        dbms_output.put_line('ERROR: ' || l_provider.name 
            || ' did not successfully registered');
        dbms_output.put_line('SQLERRM='||SQLERRM);
end;
/

show errors
