{"id":2485579,"date":"2023-02-28T15:56:31","date_gmt":"2023-02-28T18:56:31","guid":{"rendered":"https:\/\/www2.tc.df.gov.br\/transparenciafiscal\/?page_id=2485579"},"modified":"2023-08-07T18:04:33","modified_gmt":"2023-08-07T21:04:33","slug":"siscoex","status":"publish","type":"page","link":"https:\/\/www2.tc.df.gov.br\/transparenciafiscal\/siscoex\/","title":{"rendered":"SISCOEX"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><p>[vc_row full_width=&#8221;stretch_row_content_no_spaces&#8221; full_height=&#8221;yes&#8221; css=&#8221;.vc_custom_1677617097052{margin-top: -160px !important;}&#8221;][vc_column][vc_column_text]<\/p>\n<div id=\"fancyboxID-SISCOEX\" class=\"hentry\" style=\"height: 80vh;width: 100vw\"><div id=\"powerbi-embedded-2485578\" style=\"height: 100%; width: 100%;\"><\/div>\t\t<script type=\"text\/javascript\">\r\n\t\t\t(function ($) {\r\n\t\t\t\t\"use strict\";\r\n\t\t\t\t$(document).ready(function () {\r\n\t\t\t\t\tvar models = window['powerbi-client'].models;\r\n\t\t\t\t\tvar restURL = \"https:\/\/www2.tc.df.gov.br\/transparenciafiscal\/wp-json\/wp\/v2\/powerbi\/getToken\";\r\n\t\t\t\t\tvar tmpdata = jQuery.get({\r\n\t\t\t\t\t\turl: restURL,\r\n\t\t\t\t\t\tasync: false,\r\n\t\t\t\t\t\tsuccess: function (data) {\r\n\t\t\t\t\t\t\tvar access_token = data.responseText;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tvar access_token = tmpdata.responseText;\r\n\t\t\t\t\taccess_token = access_token.replace(\/\"\/g, \"\");\r\n\t\t\t\t\t\/\/ console.log('New Access Token:  ' + access_token );\r\n\t\t\t\t\t\/\/ sessionStorage.setItem('access_token', 'access_token' );\r\n\t\t\t\t\tsessionStorage.setItem('access_token', access_token);\r\n\t\t\t\t\t\/\/ console.log(sessionStorage.getItem('access_token'));\r\n\t\t\t\t\tvar embedConfiguration = {\r\n\t\t\t\t\t\ttype: 'report',\r\n\t\t\t\t\t\tembedUrl: 'https:\/\/app.powerbi.com\/reportEmbed?reportId=1a57f9dc-89dd-454d-bfbf-cc5ba1740c1f&groupId=fb42afd7-c348-42fb-99cd-4e71ba352cc9',\r\n\t\t\t\t\t\ttokenType: models.TokenType.Aad,\r\n\t\t\t\t\t\taccessToken: access_token,\r\n\t\t\t\t\t\tsettings: {\r\n\t\t\t\t\t\t\tfilterPaneEnabled: false,\r\n\t\t\t\t\t\t\tnavContentPaneEnabled: false,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocaleSettings: {\r\n\t\t\t\t\t\t\t\tlanguage: 'pt',\r\n\t\t\t\t\t\t\t\tformatLocale: 'pt'\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tid: '1a57f9dc-89dd-454d-bfbf-cc5ba1740c1f',\r\n\t\t\t\t\t\t\tpageName: 'ReportSection?experience=power-bi&bookmarkGuid=Bookmarked0cd673d7b3ea04b110',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\/\/ ****\r\n\t\t\t\t\t\/\/ apply filters before report load\r\n\t\t\t\t\t\/\/ ****\r\n\t\t\t\t\t\/\/ get query string and convert to powerbi filter\r\n\t\t\t\t\tvar urlParams = new URLSearchParams(window.location.search);\r\n\t\t\t\t\t\/\/ if filters value exists parse the encoded string to JSON and set as filter\r\n\t\t\t\t\tif (urlParams.has('filters')) {\r\n\t\t\t\t\t\tvar urlFilters = JSON.parse(urlParams.get(\"filters\"));\r\n\t\t\t\t\t\tvar filters = urlFilters;\r\n\t\t\t\t\t\tembedConfiguration.filters = filters;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\/\/ ****\r\n\t\t\t\t\t\/\/ apply slicers before report load\r\n\t\t\t\t\t\/\/ ****\r\n\t\t\t\t\tif (urlParams.has(\"slicers\")) {\r\n\t\t\t\t\t\tvar urlSlicers = JSON.parse(urlParams.get(\"slicers\"));\r\n\t\t\t\t\t\tembedConfiguration.slicers = urlSlicers;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar $container = $('#powerbi-embedded-2485578');\r\n\t\t\t\t\t\t\t\t\t\t\tvar report = powerbi.embed($container.get(0), embedConfiguration);\r\n\t\t\t\t\t\t\/\/ set timeOut to refresh token\r\n\t\t\t\t\t\treport.on(\"loaded\", function (event) {\r\n\t\t\t\t\t\t\tfunction test(report) {\r\n\t\t\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t\t\tupdateToken().then(function (data) {\r\n\t\t\t\t\t\t\t\t\t\tconsole.log(\"Resetting token: \" + report.getAccessToken());\r\n\t\t\t\t\t\t\t\t\t\t\/\/ console.log(data);\r\n\t\t\t\t\t\t\t\t\t\treport.setAccessToken(data)\r\n\t\t\t\t\t\t\t\t\t\t\t.then(function (resp) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"New token: \" + report.getAccessToken());\r\n\t\t\t\t\t\t\t\t\t\t\t\tsessionStorage.setItem('access_token', report.getAccessToken());\r\n\t\t\t\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t\t\t\t\t.catch(function (error) { console.log(error) });\r\n\t\t\t\t\t\t\t\t\t\ttest(report);\r\n\t\t\t\t\t\t\t\t\t}).catch(function (error) { console.log(error) });\r\n\t\t\t\t\t\t\t\t}, 1000 * 60 * 10);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttest(report);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tfunction updateToken() {\r\n\t\t\t\t\t\t\tvar restURL = \"https:\/\/www2.tc.df.gov.br\/transparenciafiscal\/wp-json\/wp\/v2\/powerbi\/getToken\";\r\n\t\t\t\t\t\t\treturn new Promise(function (resolve, reject) {\r\n\t\t\t\t\t\t\t\t$.ajax({\r\n\t\t\t\t\t\t\t\t\turl: restURL,\r\n\t\t\t\t\t\t\t\t\tmethod: \"GET\",\r\n\t\t\t\t\t\t\t\t}).done(function (response) {\r\n\t\t\t\t\t\t\t\t\tresolve(response);\r\n\t\t\t\t\t\t\t\t}).fail(function (error) {\r\n\t\t\t\t\t\t\t\t\tconsole.log(\"Error: \" + error);\r\n\t\t\t\t\t\t\t\t\treject(error);\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\/\/ var xhttp = new XMLHttpRequest();\r\n\t\t\t\t\t\t\/\/ xhttp.onreadystatechange = function() {\r\n\t\t\t\t\t\t\/\/ \tif (this.readyState == 4 && this.status == 200) {\r\n\t\t\t\t\t\t\/\/ \t\t\/\/ console.log(\"Resetting token: \" + report.getAccessToken());\r\n\t\t\t\t\t\t\/\/ \t\t\/\/ report.setAccessToken(this.responseText);\r\n\t\t\t\t\t\t\/\/ \t\t\/\/ console.log(\"New token: \" + report.getAccessToken());\r\n\t\t\t\t\t\t\/\/ \t\treturn this.responseText;\r\n\t\t\t\t\t\t\/\/ \t}\r\n\t\t\t\t\t\t\/\/ };\r\n\t\t\t\t\t\t\/\/ setTimeout(() => {\r\n\t\t\t\t\t\t\/\/ \txhttp.open(\"GET\", restURL, true);\r\n\t\t\t\t\t\t\/\/ \txhttp.setRequestHeader(\"Content-type\", \"application\/json\");\r\n\t\t\t\t\t\t\/\/ \txhttp.send();\r\n\t\t\t\t\t\t\/\/ \tupdateToken();\r\n\t\t\t\t\t\t\/\/ }, 1000*60*55);\r\n\t\t\t\t\t\t\t\t\t})\r\n\t\t\t})(jQuery);\r\n\t\t<\/script>\r\n\t\t<\/div>\n<p>[\/vc_column_text][\/vc_column][\/vc_row]<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>[vc_row full_width=&#8221;stretch_row_content_no_spaces&#8221; full_height=&#8221;yes&#8221; css=&#8221;.vc_custom_1677617097052{margin-top: -160px !important;}&#8221;][vc_column][vc_column_text] [\/vc_column_text][\/vc_column][\/vc_row]<\/p>\n","protected":false},"author":39,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"","meta":{"_relevanssi_hide_post":"","_relevanssi_hide_content":"","_relevanssi_pin_for_all":"","_relevanssi_pin_keywords":"","_relevanssi_unpin_keywords":"","_relevanssi_related_keywords":"","_relevanssi_related_include_ids":"","_relevanssi_related_exclude_ids":"","_relevanssi_related_no_append":"","_relevanssi_related_not_related":"","_relevanssi_related_posts":"","_relevanssi_noindex_reason":"","footnotes":""},"class_list":["post-2485579","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www2.tc.df.gov.br\/transparenciafiscal\/wp-json\/wp\/v2\/pages\/2485579","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www2.tc.df.gov.br\/transparenciafiscal\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www2.tc.df.gov.br\/transparenciafiscal\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www2.tc.df.gov.br\/transparenciafiscal\/wp-json\/wp\/v2\/users\/39"}],"replies":[{"embeddable":true,"href":"https:\/\/www2.tc.df.gov.br\/transparenciafiscal\/wp-json\/wp\/v2\/comments?post=2485579"}],"version-history":[{"count":28,"href":"https:\/\/www2.tc.df.gov.br\/transparenciafiscal\/wp-json\/wp\/v2\/pages\/2485579\/revisions"}],"predecessor-version":[{"id":2485651,"href":"https:\/\/www2.tc.df.gov.br\/transparenciafiscal\/wp-json\/wp\/v2\/pages\/2485579\/revisions\/2485651"}],"wp:attachment":[{"href":"https:\/\/www2.tc.df.gov.br\/transparenciafiscal\/wp-json\/wp\/v2\/media?parent=2485579"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}