AnsweredAssumed Answered

Pentaho Dashboard embedding - getHeaders problem

Question asked by Alessandro Corradi on May 15, 2018

Hi all,

 

That's the first time I'm trying to embed a test dashbord on my php based page. I'm using pentaho 8.0

I have a problem with getHeaders function:

 

 

PHP Code:

 

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://myserver:8080/pentaho/plugin/pentaho-cdf-dd/api/renderer/getHeaders?userid=user&password=password&solution=public&path=/Cdg/Test&file=test_20180508.wcdf&absolute=true&root=myserver:8080&inferScheme=false");
curl_setopt($ch, CURLOPT_USERPWD, "user:password");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
echo "<html><head>";?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">       
var contextPath = "http://myserver:8080/pentaho";       
var FULL_QUALIFIED_URL = 'http://myserver:8080/pentaho/';      
var webAppPath = 'http://myserver:8080/pentaho';      
var CONTEXT_PATH = 'http://myserver:8080/pentaho';
</script>
<?php$result = curl_exec($ch);echo $result;
//and so on...

The result is:

 

 

HTML Code:

 

  <title>test_20180508</title> <script language="javascript" type="text/javascript" src="webcontext.js?context=cdf&amp;requireJsOnly=true"></script>

1) title is correct so it seems make a correct call, that's correct;

2) the src parameters has not been modified with "root" getHeaders parameter, that's the problem :-P

 

What's wrong?

 

Thank you!!!

 

Alex

Outcomes