6 Replies Latest reply: Apr 21, 2016 2:13 AM by Erik Wetterberg RSS

    Deploying Mashup to Server

    Paul Nowicki

      All,

       

      I'm trying to create a mashup and deploy it on my qlik sense server.  I've taken the off canvas bootstrap template available on branch.qlik.com and updated it using one of our qlik sense apps.  I've followed the instructions on how to deploy it found on this link ny Adam Cooke: Deploy Qlik Sense mashup from desktop to server – Webofwork

       

      I can now access the .html from my server https://QlikSenseServer/mashup/index.html

       

      However, the QlikSense content doesn't come through.  I believe my issue is in the configuration of the .js script that comes with the bootstrap.  I can't quite figure out how to update the sample code with my server and app information.  Has anyone already done this and can give some details on how to update the following base code:

       

      /*global require*/

      /*

      *    Fill in host and port for Qlik engine

      */

      var prefix = window.location.pathname.substr( 0, window.location.pathname.toLowerCase().lastIndexOf( "/extensions" ) + 1 );

       

      var config = {

        host: window.location.hostname,

        prefix: prefix,

        port: window.location.port,

        isSecure: window.location.protocol === "https:"

      };

      //to avoid errors in workbench: you can remove this when you have added an app

      var app;

      require.config({

        baseUrl: (config.isSecure ? "https://" : "http://" ) + config.host + (config.port ? ":" + config.port : "" ) + config.prefix + "resources"

      });

       

      require( ["js/qlik"], function ( qlik ){

        qlik.setOnError( function ( error ){

        alert( error.message );

        });

       

        $(document).ready(function() {

         $('[data-toggle=offcanvas]').click(function() {

           $('.row-offcanvas').toggleClass('active');

         });

        });

       

        //callbacks -- inserted here --

        //open apps -- inserted here --

        //get objects -- inserted here --

        //create cubes and lists -- inserted here --

      });

        • Re: Deploying Mashup to Server
          Erik Wetterberg

          Hi Paul,

          This looks pretty OK. Have you modified the openApp call?? You need to replace the filename used in Qlik Sense desktop with the GUID used in Qlik Sense server. Easiest way to find the GUID is to open the app in the standard Qlik Sense client, and the GUID will be in the URL.

           

          If that does not help, open the browser console and see if you get any error messages.

           

          Hope this helps

           

          Erik

            • Re: Deploying Mashup to Server
              Paul Nowicki

              Thanks Erik, I am able to get the app name and have updated the script.  However, I'm not sure what I need for host and prefix for the server.  For example, I'm deploying to https://QlikSenseServer/mashup/index.html

               

              var config = {

                host: window.location.hostname,

                prefix: prefix,

                port: 443,

                isSecure: window.location.protocol === "https:"

              };


              I found my port on the QMC and updated it in the script.  However, is my host just simply "QlikSenseServer" and what about prefix, I'm assuming it is "/"


              I've been guessing at these parameters and I'll probably get it right eventually, but any additional help would be great!

                • Re: Deploying Mashup to Server
                  Paul Nowicki

                  Ok, I figured it out through experimentation.  Here is what I've learned.

                   

                  The host name can be found in the QMC under the Nodes menu option. 

                  The port can be found in the QMC under the proxies" menu option, "Service listen port HTTPS (default)"

                  prefix I set to "/"

                  • Re: Deploying Mashup to Server
                    Erik Wetterberg

                    Hi,

                    Is your mashup hosted on Qlik Sense Server or on a separate web server (IIS , Apache etc..)

                     

                    If your mashup is hosted on your Qlik Sense server, the default setup should work fine, but the url to the mashup would be something like 'server/[virtual proxy/]extensions/mashupname/something.html.

                     

                    If it is on a separate web server you need to set the config parameters:

                     

                    • host should be the Qlik Sense server host. If your mashup is hosted on Qlik Sense server, using window.location.hostname should work fine.
                    • prefix is your virtual proxy, it looks like you are not using one, the default setup(which gets it from the window url) should work fine, it will set it to /
                    • in most cases you don't need to specify the port, 443 is the default port used for https, so it should work

                     

                    Erik

                • Re: Deploying Mashup to Server
                  Mitali Ajgaonkar

                  How many users can see the mashup and interact with it simultaneously when it is deployed on server?