Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
dberkesacn
Partner - Creator III
Partner - Creator III

Mashup QS Desktop to Enterprise Server

Hi,

Could it be a problem if I develop a Mashup in the local host (Sense Desktop) with the mashup builder and after I upload / import it to Sense Server ?

Now I have Connection Lost msg when I would like to open the Mashup in Servers' QMC, with View button.

Thanks,

Daniel

1 Solution

Accepted Solutions
Anonymous
Not applicable

I've customized the code you attached but unfortunately it still doesn't work. I've used this code:

/* On localhost QlikSense Desktop */

if  ( location.host == 'localhost' ) {

console.log ( 'Detected Host: ' , hostName ) ;

var app = qlik.openApp('blah.qvf', config);

} ;

/* On QlikSense Test Server  blah */

if  ( location.host == 'blah' ) {

console.log ( 'Detected Host: ' , hostName ) ;

var app = qlik.openApp('blahId', config);

} ;


I've changed the hostName to location.host to get the information but something is wrong. I've tried your solution too but that didn't work either. It seems like a variable (hostName) but it doesn't have any value, that's why I was trying to get that information via location.host.


Any idea what could be the problem?


(Btw if I am just using one openApp method and change the Blah.qvf to the appID it works fine.)

View solution in original post

8 Replies
Anonymous
Not applicable

Have you changed the openApp to point to the App ID of the app on the server ?

I normally use a few if statements like this to auto sort it :

/* On localhost QlikSense Desktop */

if  ( hostName == 'localhost' ) {

console.log ( 'Detected Host: ' , hostName ) ;

var app = qlik.openApp('blah.qvf', config);

} ;

/* On QlikSense Test Server  blah */

if  ( hostName == 'blah' ) {

console.log ( 'Detected Host: ' , hostName ) ;

var app = qlik.openApp('blahId', config);

} ;

/* On QlikSense Prod Server blah */

if  ( hostName == 'blah' ) {

console.log ( 'Detected Host: ' , hostName ) ;

var app = qlik.openApp('blahId', config);

} ;

You'll have to change all the blah 's to you you real names / id's.

Anonymous
Not applicable

Hi Bill,

Could you explain me this code please? And should I just put these lines in the javascript file?

Thanks,

Zoltan

Anonymous
Not applicable

Have a look at this entry in the online Help

Deploying your mashup to the repository ‒ Qlik Sense

Especially this bit I have pasted in :

2. Update the JavaScript file. In a Qlik Sense environment, the openApp function references an app ID instead of the app name. See the following examples.


Below this in the Help are examples of how to use openApp in QlikSense Desktop vs. Server which in essence is App Name vs. App ID.

Anonymous
Not applicable

I've customized the code you attached but unfortunately it still doesn't work. I've used this code:

/* On localhost QlikSense Desktop */

if  ( location.host == 'localhost' ) {

console.log ( 'Detected Host: ' , hostName ) ;

var app = qlik.openApp('blah.qvf', config);

} ;

/* On QlikSense Test Server  blah */

if  ( location.host == 'blah' ) {

console.log ( 'Detected Host: ' , hostName ) ;

var app = qlik.openApp('blahId', config);

} ;


I've changed the hostName to location.host to get the information but something is wrong. I've tried your solution too but that didn't work either. It seems like a variable (hostName) but it doesn't have any value, that's why I was trying to get that information via location.host.


Any idea what could be the problem?


(Btw if I am just using one openApp method and change the Blah.qvf to the appID it works fine.)

Anonymous
Not applicable

Bill, I finally managed to solve the issue, I had to use double quotes instead of single. Now it's working fine, thank you.

Anonymous
Not applicable

Ooops!!


Forgot to say the variable hostName needs setting first.

var hostName = window.location.hostname;


Then a console.log immediately after will say what it actually is in your environment


console.log ( 'Detected Host: ' , hostName ) ;

dberkesacn
Partner - Creator III
Partner - Creator III
Author

thanks zoltan.farkas‌ and @bill.markham

Anonymous
Not applicable

Do beware though that if on the server you delete and recreate the app will get a new App ID and your MashUp will stop working until amended to reflect the new App Id.

But if you publish the App to a stream and then publish a new version of the App to replace it, then the App in the stream will retain its original App Id and the MashUp will continue working fine.  So best to do it this way.