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

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

CREATE OR REPLACE VIEW xxas_blocks_list_v
AS
SELECT 'flexible' "type"
      ,b.menu_id
      ,b.function_id
      ,b.function_id "id"
      ,NVL(b.prompt
          ,xxas_com_msg_pkg.get_string('XXAS_BK_UNTITLED_TITLE')
          ) || ' ('
            || xxas_util_pkg.decode_lookup('XXAS_BLOCK_TYPES',UPPER(b.block_type))
            || ')' "line1"
      --,NVL(lower(b.function_icon),'wrench') "icon"
      ,'block-' || b.block_type "pageId"
      ,b.menu_id || '_' || b.function_id "objectId"
FROM   xxas_blocks_v b
ORDER BY b.entry_sequence;

BEGIN
  xxas_fnd_dictionary_pkg.add_view
   (p_application_short_name => xxas_util_pkg.app
   ,p_view_name              => 'XXAS_BLOCKS_LIST_V'
   ,p_description            => 'Applaud Blocks List');
END;
/

COMMIT;
EXIT;

