text: set define off
  set verify off
  set feedback off
  WHENEVER SQLERROR EXIT SQL.SQLCODE ROLLBACK
  begin wwv_flow.g_import_in_progress := true; end;
  /
   
  --       AAAA       PPPPP   EEEEEE  XX      XX
  --      AA  AA      PP  PP  EE       XX    XX
  --     AA    AA     PP  PP  EE        XX  XX
  --    AAAAAAAAAA    PPPPP   EEEE       XXXX
  --   AA        AA   PP      EE        XX  XX
  --  AA          AA  PP      EE       XX    XX
  --  AA          AA  PP      EEEEEE  XX      XX
  begin
  select value into wwv_flow_api.g_nls_numeric_chars from nls_session_parameters where parameter='NLS_NUMERIC_CHARACTERS';
  execute immediate 'alter session set nls_numeric_characters=''.,''';
  end;
  /
  prompt  WORKSPACE 1248716320362712
  --
  -- Workspace, User Group, User, and Team Development Export:
  --   Date and Time:   13:55 Thursday February 19, 2015
  --   Exported By:     ADMIN
  --   Export Type:     Workspace Export
  --   Version:         4.2.6.00.03
  --   Instance ID:     61904861268027
  --
  -- Import:
  --   Using Instance Administration / Manage Workspaces
  --   or
  --   Using SQL*Plus as the Oracle user APEX_040200
   
  begin
      wwv_flow_api.set_security_group_id(p_security_group_id=>1248716320362712);
  end;
  /
  ----------------
  -- W O R K S P A C E
  -- Creating a workspace will not create database schemas or objects.
  -- This API creates only the meta data for this APEX workspace
  prompt  Creating workspace AFW_INTERNAL...
  begin
  wwv_flow_api.g_varchar2_table := wwv_flow_api.empty_varchar2_table;
  end;
  /
  begin
  wwv_flow_fnd_user_api.create_company (
    p_id => 1248832723362826
   ,p_provisioning_company_id => 1248716320362712
   ,p_short_name => 'AFW_INTERNAL'
   ,p_display_name => 'AFW_INTERNAL'
   ,p_first_schema_provisioned => 'AFW_040215'
   ,p_company_schemas => 'AFW_040215'
   ,p_expire_fnd_user_accounts => 'N'
   ,p_fnd_user_max_login_failures => 15
   ,p_account_status => 'ASSIGNED'
   ,p_allow_plsql_editing => 'Y'
   ,p_allow_app_building_yn => 'Y'
   ,p_allow_sql_workshop_yn => 'Y'
   ,p_allow_websheet_dev_yn => 'Y'
   ,p_allow_team_development_yn => 'Y'
   ,p_allow_to_be_purged_yn => 'Y'
   ,p_allow_restful_services_yn => 'Y'
   ,p_source_identifier => 'AFW'
   ,p_path_prefix => 'SIE'
   ,p_workspace_image => wwv_flow_api.g_varchar2_table
  );
  end;
  /
  ----------------
  -- G R O U P S
  --
  prompt  Creating Groups...
  begin
  wwv_flow_api.create_user_groups (
    p_id => 3465508805818322,
    p_GROUP_NAME => 'OAuth2 Client Developer',
    p_SECURITY_GROUP_ID => 10,
    p_GROUP_DESC => 'Users authorized to register OAuth2 Client Applications');
  end;
  /
  begin
  wwv_flow_api.create_user_groups (
    p_id => 3465415780818322,
    p_GROUP_NAME => 'RESTful Services',
    p_SECURITY_GROUP_ID => 10,
    p_GROUP_DESC => 'Users authorized to use RESTful Services with this workspace');
  end;
  /
  begin
  wwv_flow_api.create_user_groups (
    p_id => 3465314794818316,
    p_GROUP_NAME => 'SQL Developer',
    p_SECURITY_GROUP_ID => 10,
    p_GROUP_DESC => 'Users authorized to use SQL Developer with this workspace');
  end;
  /
  ----------------
  -- U S E R S
  -- User repository for use with APEX cookie-based authentication.
  --
  prompt  Creating Users...
  begin
  wwv_flow_fnd_user_api.create_fnd_user (
    p_user_id      => '1248606725362712',
    p_user_name    => 'ADMIN',
    p_first_name   => '',
    p_last_name    => '',
    p_description  => '',
    p_email_address=> 'lgcarrier+apexframework@gmail.com',
    p_web_password => 'CCFBF05C86748A19E248C72B460DF243',
    p_web_password_format => 'HEX_ENCODED_DIGEST_V2',
    p_group_ids                    => '3465314794818316:3465415780818322:3465508805818322:',
    p_developer_privs              => 'ADMIN:CREATE:DATA_LOADER:EDIT:HELP:MONITOR:SQL',
    p_default_schema               => 'AFW_040215',
    p_account_locked               => 'N',
    p_account_expiry               => to_date('201312180000','YYYYMMDDHH24MI'),
    p_failed_access_attempts       => 0,
    p_change_password_on_first_use => 'N',
    p_first_password_use_occurred  => 'Y',
    p_allow_app_building_yn        => 'Y',
    p_allow_sql_workshop_yn        => 'Y',
    p_allow_websheet_dev_yn        => 'Y',
    p_allow_team_development_yn    => 'Y',
    p_allow_access_to_schemas      => '');
  end;
  /
  ----------------
  --Application Builder Preferences
  --
  ----------------
  --Click Count Logs
  --
  ----------------
  --csv data loading
  --
  ----------------
  --mail
  --
  ----------------
  --mail log
  --
  begin
   wwv_flow_api.create_mail_log (
      p_mail_to => 'lgcarrier+apexframework@gmail.com',
      p_mail_from => 'lgcarrier+apexframework@gmail.com',
      p_mail_replyto => 'lgcarrier+apexframework@gmail.com',
      p_mail_subj => 'Application Express Request',
      p_mail_cc => '',
      p_mail_bcc => '',
      p_mail_send_error => '',
      p_last_updated_by => 'LGCARRIER',
      p_last_updated_on => to_date('201502191110','YYYYMMDDHH24MI'));
  end;
  /
  ----------------
  --app models
  --
  ----------------
  --password history
  --
  ----------------
  --preferences
  --
  ----------------
  --service mods
  --
  ----------------
  --query builder
  --
  ----------------
  --sql scripts
  --
  ----------------
  --sql commands
  --
  ----------------
  --user access log
  --
   
  prompt ...RESTful Services
   
  -- SET SCHEMA
   
  begin
   
     wwv_flow_api.g_id_offset := 0;
     wwv_flow_hint.g_schema   := 'AFW_040215';
     wwv_flow_hint.check_schema_privs;
   
  end;
  /
  
   
  --------------------------------------------------------------------
  prompt  SCHEMA AFW_040215 - User Interface Defaults, Table Defaults
  --
  -- Import using sqlplus as the Oracle user: APEX_040200
  -- Exported 13:55 Thursday February 19, 2015 by: ADMIN
  --
   
  --------------------------------------------------------------------
  prompt User Interface Defaults, Attribute Dictionary
  --
  -- Exported 13:55 Thursday February 19, 2015 by: ADMIN
  --
  -- SHOW EXPORTING WORKSPACE
   
  begin
   
     wwv_flow_api.g_id_offset := 0;
     wwv_flow_hint.g_exp_workspace := 'AFW_INTERNAL';
   
  end;
  /
  
  commit;
  begin
  execute immediate 'begin sys.dbms_session.set_nls( param => ''NLS_NUMERIC_CHARACTERS'', value => '''''''' || replace(wwv_flow_api.g_nls_numeric_chars,'''''''','''''''''''') || ''''''''); end;';
  end;
  /
  set verify on
  set feedback on
  set define on
  prompt  ...done
  