Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
OmarBenSalem

How to reload a Mashup? dev-hub

Hi folks,

I'm really in an urgent need, I'll very appreciating if someone can help me!
Here's my question; I've created a Mashup using an application; but when I apport changes in the application, my mashup does not change, the graphics are the same and nothing seems to change (while with single configurator, when I reload, the graph will respond to the made changes)
My question is; how and what to do to "force' my mashup to consider the reload process and thus force it to make changes in every reload; to be dynamic !?

I've seen someone in the net talking about a app.doReload() function but I have no idea where and how to use it :
here is my .js code :

/*

* Bootstrap-based responsive mashup

* @owner Enter you name here (xxx)

*/

/*

*    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 ) {

  var control = false;

  qlik.setOnError( function ( error ) {

  $( '#popupText' ).append( error.message + "<br>" );

  if ( !control ) {

  control = true;

  $( '#popup' ).delay( 1000 ).fadeIn( 1000 ).delay( 11000 ).fadeOut( 1000 );

  }

  } );

  $( "#closePopup" ).click( function () {

  $( '#popup' ).hide();

  } );

  if ( $( 'ul#qbmlist li' ).length === 0 ) {

  $( '#qbmlist' ).append( "<li><a>No bookmarks available</a></li>" );

  }

  $( "body" ).css( "overflow: hidden;" );

  function AppUi ( app ) {

  var me = this;

  this.app = app;

  app.global.isPersonalMode( function ( reply ) {

  me.isPersonalMode = reply.qReturn;

  } );

  app.getAppLayout( function ( layout ) {

  $( "#title" ).html( layout.qTitle );

  $( "#title" ).attr( "title", "Last reload:" + layout.qLastReloadTime.replace( /T/, ' ' ).replace( /Z/, ' ' ) );

  //TODO: bootstrap tooltip ??

  } );

  app.getList( 'SelectionObject', function ( reply ) {

  $( "[data-qcmd='back']" ).parent().toggleClass( 'disabled', reply.qSelectionObject.qBackCount < 1 );

  $( "[data-qcmd='forward']" ).parent().toggleClass( 'disabled', reply.qSelectionObject.qForwardCount < 1 );

  } );

  app.getList( "BookmarkList", function ( reply ) {

  var str = "";

  reply.qBookmarkList.qItems.forEach( function ( value ) {

  if ( value.qData.title ) {

  str += '<li><a data-id="' + value.qInfo.qId + '">' + value.qData.title + '</a></li>';

  }

  } );

  str += '<li><a data-cmd="create">Create</a></li>';

  $( '#qbmlist' ).html( str ).find( 'a' ).on( 'click', function () {

  var id = $( this ).data( 'id' );

  if ( id ) {

  app.bookmark.apply( id );

  } else {

  var cmd = $( this ).data( 'cmd' );

  if ( cmd === "create" ) {

  $( '#createBmModal' ).modal();

  }

  }

  } );

  } );

  $( "[data-qcmd]" ).on( 'click', function () {

  var $element = $( this );

  switch ( $element.data( 'qcmd' ) ) {

  //app level commands

  case 'clearAll':

  app.clearAll();

  break;

  case 'back':

  app.back();

  break;

  case 'forward':

  app.forward();

  break;

  case 'lockAll':

  app.lockAll();

  break;

  case 'unlockAll':

  app.unlockAll();

  break;

  case 'createBm':

  var title = $( "#bmtitle" ).val(), desc = $( "#bmdesc" ).val();

  app.bookmark.create( title, desc );

  $( '#createBmModal' ).modal( 'hide' );

  break;

  }

  } );

  }

  //callbacks -- inserted here --

  function regions(reply, app){}

  //open apps -- inserted here --

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

  //get objects -- inserted here --

  app.getObject('QV03','akPAHT');

  app.getObject('QV04','pcmy');

  app.getObject('QV02','SsQXRxU');

  app.getObject('QV01','auywUtv');

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

  app.createList({

  "qFrequencyMode": "V",

  "qDef": {

  "qFieldDefs": [

  "Oica Region"

  ]

  },

  "qExpressions": [],

  "qInitialDataFetch": [

  {

  "qHeight": 20,

  "qWidth": 1

  }

  ],

  "qLibraryId": "AjMvrJj"

  },regions);

if ( app ) {

  new AppUi( app );

  }

} );

4 Replies
lakshmikandh
Specialist II
Specialist II

in QS desktop if app is reloaded, Mashup will reflect the reloaded data in app objects same as single configurater,

Please check if you are refering to the correct app id and object id of the refreshed app.

app.getObject('QV03','akPAHT');

app.getObject('QV04','pcmy');

app.getObject('QV02','SsQXRxU');

app.getObject('QV01','auywUtv');

OmarBenSalem
Author

Hi and thank you for the reply,

I didn't create the .js code, I just dragged the graphics;

I then guess the ObjectsID are right.

With that being said, I'm working with sense Desktop (for now) but still, the mashup doesn't refrech when I do a reload ! With Single Configurator, it does refresh !

And I'm willing to use this in an entreprise environment..

OmarBenSalem
Author

I found out that It finally reloaded ! But it took so long !
My question now, is the reload of the mashup automated in the server ?

lakshmikandh
Specialist II
Specialist II

using desktop you cannot automate the reload.

You need QS Enterprise , in that you can schedule tasks in QMC.