/* $Id$ */
/*============================================================================*
 |                 Copyright (c) 2014 Applaud Solutions UK Ltd                |
 |                             All rights reserved                            |
 *===========================================================================*/

SET VERIFY OFF
SET FEEDBACK OFF
SET SCAN OFF
WHENEVER OSERROR  EXIT FAILURE ROLLBACK
WHENEVER SQLERROR EXIT FAILURE ROLLBACK

DECLARE

  --
  -- Local constants and variables
  --
  l_SERVICE CONSTANT xxas_com_service_repository.service_name%TYPE
                       := 'Export';
                       
BEGIN
      
  xxas_com_sr_pkg.set_rest_service
    (p_service_name       => l_SERVICE
    ,p_description        => 'Export results'
    ,p_path               => 'export/'
    ,p_consumes           => 'application/xml'
    ,p_produces           => 'application/xml'
    );
   
  xxas_com_sr_pkg.set_rest_method
    (p_service_name       => l_SERVICE
    ,p_method_name        => 'ExportSearchResults'
    ,p_description        => 'Export people search results'
    ,p_path               => 'search-export'
    ,p_methods            => 'GET'
    ,p_consumes           => 'application/xml'
    ,p_produces           => 'application/xml'
    ,p_remove_root_ele    => true
    ,p_bipub_dd_app       => 'XXAS'
    ,p_bipub_dd_code      => 'XXASEMPPEOPLESEARCH'
    ,p_sql                =>
      q'[
          select 
            xxas_export_pkg.search_export_xml({requestParams}) "data"
          from dual
      ]'
    );     
END;
/
COMMIT;
EXIT;    