use ecomp_sdk;

SET FOREIGN_KEY_CHECKS=0;

UPDATE fn_menu 
SET ACTION='welcome'
WHERE LABEL='Home';

UPDATE fn_menu 
SET ACTION='v2/userProfile'
WHERE LABEL='Search';

UPDATE fn_menu 
SET ACTION='v2/userProfile/post_search'
WHERE LABEL='Import from WEBPHONE';

UPDATE fn_menu 
SET ACTION='v2/userProfile/self_profile'
WHERE LABEL='Self';

UPDATE fn_menu 
SET ACTION='v2/admin/admin'
WHERE LABEL='Roles';

UPDATE fn_menu 
SET ACTION='v2/admin/role_function_list'
WHERE LABEL='Role Functions';

UPDATE fn_menu 
SET ACTION='v2/admin/usage_list'
WHERE LABEL='Usage';

UPDATE fn_menu 
SET ACTION='v2/admin/cache_admin'
WHERE LABEL='Cache Admin';

UPDATE fn_menu 
SET ACTION='v2/admin/admin_menu_edit'
WHERE LABEL='Menus';

UPDATE fn_menu 
SET ACTION='v2/create' 
WHERE LABEL='Create Reports';

UPDATE fn_menu 
SET ACTION='v2/report-list' 
WHERE LABEL='All Reports';

-- fn_menu - update menu icon
UPDATE fn_menu 
SET `IMAGE_SRC`='icon ion-ios-home' 
WHERE  `LABEL`='Home';

UPDATE fn_menu 
SET `IMAGE_SRC`='icon ion-md-pie' 
WHERE  `LABEL`='Reports';

UPDATE fn_menu 
SET `IMAGE_SRC`='ion-md-person' 
WHERE  `LABEL`='Profile';

UPDATE fn_menu 
SET `IMAGE_SRC`='icon ion-md-star' 
WHERE  `LABEL`='Admin';

-- Added run_report function_cd for fn_restricted_url -
Insert into fn_function (FUNCTION_CD,FUNCTION_NAME,TYPE,ACTION) values ('run_report','Report Run','*','*');

-- Added run_report function_cd for fn_role_function -
Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'run_report');
Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'run_report');

DELETE FROM fn_restricted_url;
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('/report*','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('/report/*','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('/report/wizard/*','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('/schedule_report/*','menu_home');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('addRole','menu_admin');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('addRoleFunction','menu_admin');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('admin','menu_admin');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('async_test.htm','menu_home');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('attachment.htm','menu_admin');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('broadcast.htm','menu_admin');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('chatWindow.htm','menu_home');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('contact_list.htm','menu_home');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('contactus/*','menu_home');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('customer_dynamic_list.htm','menu_home');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('enmtreport','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('enmtreport/','enmt_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('event.htm','menu_home');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('event_list.htm','menu_home');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('feedback/*','menu_home');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('gauge.htm','menu_tab');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('get_role','menu_admin');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('get_role_functions','menu_admin');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('gmap_controller.htm','menu_tab');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('gmap_frame.htm','menu_tab');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('jbpm_designer.htm','menu_job_create');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('jbpm_drools.htm','menu_job_create');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('job.htm','menu_admin');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('map.htm','menu_tab');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('map_download.htm','menu_tab');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('map_grid_search.htm','menu_tab');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('mobile_welcome.htm','menu_home');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('novamap_controller.htm','menu_map');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('post_search/process','menu_admin');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('post_search/search','menu_admin');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('post_search/search','menu_profile');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('process_job.htm','menu_job_create');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('profile.htm','menu_profile_create');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('profile/*','menu_admin');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('raptor.htm','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('raptor.htm','view_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('raptor/dashboard/run/*','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('raptor2.htm','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('raptor_blob_extract.htm','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('raptor_blob_extract.htm','view_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('raptor_email_attachment.htm','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('raptor_search.htm','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('removeRole','menu_admin');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('removeRoleFunction','menu_admin');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report-catalog/*','menu_home');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report/report_wizard/*','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report/security/*','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report/security/addReportRole','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report/security/addReportUser','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report/security/toggleRoleEditAccess/*','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report/security/toggleUserEditAccess/*','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report/wizard/*','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report/wizard/add_formfield_tab_data/*','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report/wizard/copy_report/*','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report/wizard/drill_down_param/*','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report/wizard/getDrillDownReportList','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report/wizard/get_formfield_groups_data/*','run_report');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report/wizard/get_report_log/*','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report/wizard/list_child_report_col/*','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report/wizard/list_child_report_ff/*','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report/wizard/list_columns','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report/wizard/list_formfields','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report/wizard/retrieveTotalForTheColList','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report/wizard/retrieve_col_tab_wise_data/*','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report/wizard/retrieve_data/*','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report/wizard/retrieve_data/true','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report/wizard/retrieve_def_tab_wise_data/*','run_report');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report/wizard/retrieve_form_tab_wise_data/*','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report/wizard/retrieve_form_tab_wise_data/*/*','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report/wizard/retrieve_form_tab_wise_data/*/delete','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report/wizard/retrieve_sql_tab_wise_data/*','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report/wizard/save_def_tab_data/*','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report/wizard/save_formfield_groups_data','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report/wizard/save_formfield_tab_data/*','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report/wizard/security/*','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report2.htm','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report_blob_extract.htm','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report_email_attachment.htm','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report_list.htm','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('report_search.htm','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('role.htm','menu_admin');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('role/saveRole.htm','menu_admin');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('role_function.htm','menu_admin');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('role_function_list/*','menu_admin');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('role_list/*','menu_admin');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('samplePage','menu_sample');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('sample_animated_map.htm','menu_tab');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('sample_heat_map.htm','menu_tab');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('sample_heat_map_no_header.htm','menu_tab');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('sample_map.htm','menu_home');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('sample_map_2.htm','menu_tab');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('sample_map_3.htm','menu_tab');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('serviceModels','menu_admin');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('serviceModels','serviceModels  ');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('tab2_sub1.htm','menu_tab');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('tab2_sub2_link1.htm','menu_tab');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('tab2_sub2_link2.htm','menu_tab');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('tab2_sub3.htm','menu_tab');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('tab3.htm','menu_tab');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('tab4.htm','menu_tab');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('template.jsp','menu_home');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('test.htm','menu_admin');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('v2','menu_home');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('v2/cell_check','menu_home');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('v2/contactus','menu_home');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('v2/cuidupdate','menu_perf_rpt');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('v2/feedback/*','menu_perf_rpt');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('v2/feedback/*','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('v2/run.*','menu_perf_rpt');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('v2/run.*','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('v2/run/*','menu_perf_rpt');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('v2/run/*','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('v2/run/*/*','menu_perf_rpt');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('v2/run/*/*','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('v2/welcome','menu_home');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('welcome','menu_reports');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('welcome/*','menu_home');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('workflows','menu_admin');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('workflows/addWorkflow','menu_admin');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('workflows/editWorkflow','menu_admin');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('workflows/list','menu_admin');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('workflows/removeAllWorkflows','menu_admin');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('workflows/removeWorkflow','menu_admin');
Insert into fn_restricted_url (RESTRICTED_URL,FUNCTION_CD) values ('workflows/saveCronJob','menu_admin');


commit;