As of today, I have not yet been able to solve all the integration problems reported at the time!
I want to summarize the steps taken and the results obtained during my attempts trying to clarify:
To embed a Pentaho CDE inside an html page, I added the call to the script:
<script src = "<pentaho-server-position> /pentaho/plugin/pentaho-cdf-dd/api/renderer/cde-embed.js"> </script>
I have prepared a div for the CDE dashboard in the body.
<div id = "dashboardContainer"> </div>
Finally I added, in the script section, the specific function and the call to it.
GetPentahoDashboard () function
{
var path = "<full_path> /";
var file = "<filename> .wcdf";
require (["dash!" + path + "/" + file],
(Sample Dash) function {(
new SampleDash ("dashboardContainer"). render ();
});
}
GetPentahoDashboard ();
I state that having installed the Pentaho server on a server other than the application server (my Server) the problems encountered were of two types:
• Cross-reference problems
• Authentication problems
Cross-reference problemsIn order to embed the pentaho C-Tools I had to present the settings.xml files in the three directories:
<server-pentaho>/pentaho_solutions/system/cda/
<server-pentaho>/pentaho_solutions/system/pentaho-cdf/
<server-pentaho>/pentaho_solutions/system/pentaho-cdf-dd/
In these files, the line has been changed:
<allow-cross-domain-resources>false</allow-cross-domain-resources>
versus:
<allow-cross-domain-resources>true</allow-cross-domain-resources>
Also adding the server the myServer Address in the white list:
<cross-domain-resources-whitelist><!-- intentionally left blank --></cross-domain-resources-whitelist>
As specified below:
<cross-domain-resources-whitelist>http://myServerAddress</cross-domain-resources-whitelist>
But this is not enough.
To avoid CORS errors during web calls, you must also add the two files in the directory
<pentaho-server>/tomcat/webapps/pentaho/WEB-INF/lib/
after downloading them from the Internet:
• filter-cors-2.6.jar
• java-property-utils-1.9.1.jar
and added the specific filter in the file
<pentaho-server>/tomcat/webapps/pentaho/WEB-INF/web.xml
the following section:
<filter>
<filter-name> CORS </filter-name>
<filter-class> com.thetransactioncompany.cors.CORSFilter </filter-class>
</filter>
<filter mapping>
<filter-name> CORS </filter-name>
<model-url> / * </model-url>
</ filter mapping>
Authentication problemsFor authentication, since the call is generated from an html page, authentication must be implicit in the call.
To do this, to allow pentaho to use necessary within the call is to modify the file
<server-pentaho>/pentaho_solution/system/security.properties
By setting the parameter
requestParameterAuthenticationEnabled=true
changing the default setting (false).
This change allows the userid and password parameters to be passed but this does not seem to be the command line solution.
In fact, the execution of the first script is performed:
<script src="<pentaho-server-location>/pentaho/plugin/pentaho-cdf-dd/api/renderer/cde-embed.js?userid=<username>&password=<password>"> </script>
But this is not the case for the second call:
require (["dash!" + path + "/" + file],
(Sample Dash) function {(
new SampleDash ("dashboardContainer").render();
});
where executing the require statement fails to authenticate.
I also tried making an explicit call, passing the username and password in the request:
require (["<sever-pentaho-position>/pentaho/plugin/pentaho-cdf-dd/api/renderer/getDashboard?path="+path+"/"+file+"&userid=<username>& password=<password>"],
(Sample Dash) function {(
new SampleDash ("dashboardContainer")).render();
});
but it crashes later.
The feeling is that something is missing that allows me to authenticate the session.
I should perhaps authenticate in advance with a call to j_spring_security_check as documented in
https://help.pentaho.com/Documentation/8.0/Developer_Center/REST_APIbut I can't get the cookie back to use on requests.
Do you have any suggestions about this?
Thank you in advance,
Alessandro