Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong base URL when deployed on a two level path. #1160

Open
jdevora opened this issue Jan 9, 2023 · 1 comment
Open

Wrong base URL when deployed on a two level path. #1160

jdevora opened this issue Jan 9, 2023 · 1 comment

Comments

@jdevora
Copy link

jdevora commented Jan 9, 2023

My company forces to deploy all the webapps on a second level URL, in this case, Pentaho should be deployed at https://mycompanysite/aplicaciones/pentaho

I renamed the war file to aplicaciones#pentaho and changed all the necessary configuration parameters and got it working with one exception.
Some of the URLs, when working with an ETL, get the last folder chopped
image
Notice that the pentaho part of the URL is missing.

I started to look at the javascript and it turns out that in the file pentaho-solutions/system/pentaho-cdf/js/cdf-bootstrap-script-includes.js
at line 5266 you can see

if(webAppPath==undefined){webAppPath="/"+pathArray[1];}

I changed it to

if(webAppPath==undefined){webAppPath="/"+pathArray[1]+"/"+pathArray[2];}

And everything is working fine.

I know that this is a corner case and the suggestion is just a "hack" to make it work, but the rest of the URLs are generated correctly; that means that the correct logic to guess the correct webAppPath should exist somewhere else in the code.

Cheers

PS: The Pentaho I installed is pentaho-server-ce-9.3.0.0-428.zip

@dcleao
Copy link
Member

dcleao commented Jan 13, 2023

Hi @jdevora, thanks for the report.

The statement you mention is from this code section: https://github.com/webdetails/cdf/blob/9.3/core-js/src/main/javascript/cdf-legacy/Dashboards.Startup.js#L30-L41.

The webAppPath will only not be defined if there is no defined CONTEXT_PATH variable. For this to happen, you would be using Pentaho's CDF code from outside Pentaho, perhaps? Typically, in such a case, you'd include the script http://yourserver.com/pentaho/plugin/pentaho-cdf/api/cdf-embed.js, which should properly setup the Pentaho JS Context for CDF.

I'm also assuming you have configured your Pentaho Server's context path according to: https://help.hitachivantara.com/Documentation/Pentaho/9.3/Setup/Customize_the_Pentaho_Server#Change_the_web_application_name_or_port.

If this does not solve the problem, please open a bug in https://jira.pentaho.com/projects/CDF and link it back here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants