/* $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_form_list_v
AS 
SELECT 'flexible' "type"
      --,NVL(EXTRACTVALUE(xfr.view_xml,'View/@title'),'Untitled') "line1"
      ,NVL(EXTRACTVALUE(XDBURIType(xfr.any_path).getXML(),'View/@title'),'Untitled') "line1"
      ,xfr.any_path "line3"
      --,'detail' "icon"
      ,xfr.any_path
      --,xxas_com_rest_util_pkg.uri_from_app_route('form-view')||xfr.any_path "href"
      ,xxas_com_rest_util_pkg.uri_from_app_route('forms?modal=/form-view')||'/'||xfr.form_id "href"
      ,xxas_forms_pkg.form_item_actions
      (xfr.form_id)
      .get_xml() "linked"
      ,xfr.title
FROM xxas_forms_resource xfr
ORDER BY xfr.title;
  
BEGIN
  xxas_fnd_dictionary_pkg.add_view
   (p_application_short_name => xxas_util_pkg.app
   ,p_view_name              => 'xxas_form_list_v'
   ,p_description            => 'Applaud Forms List View');
END;
/
COMMIT;
EXIT;
