Skip to content

Instantly share code, notes, and snippets.

app.getObject(nate_non_published_config.object_ids.get_scatter_html_id(), nate_non_published_config.object_ids.get_scatter_qlik_id());
//Locking all hopefully sometime after object comes back and asks for layout
//Delibierately causing a request aborted error by waiting for getObject to call getLayout,
//the getObject should return the handle quickly, the sbusequent getLayout will take awhile because the scatterplot is memory-intensive to render
//so when the app.field(...).select(...) happens *after* the GetLayout is sent, but *before* it can return...
//then:
//
// qlik.js:11047 Error from Engine:
// {jsonrpc: "2.0", id: 9, error: {…}}
App API
var app = qlik.openApp(...)
app.field(field_name).select([el_index1, el_index2])
->
Engine Translation
{"delta":false,"method":"GetField","handle":1,"params":["ID","$"],"jsonrpc":"2.0","id":5}
...response with handle: 4...
{"delta":false,"method":"LowLevelSelect","handle":4,"params":[[0,1,2],false,false],"jsonrpc":"2.0","id":10}
//November 2017 code
//-----------
//the request-aborted is logged in this `core.models/app.open` function
//which binds to `e.session.Error`, waits 1 second, then console logs. Notice it only logs if:
//e.error is something
//and e.error is not handled : `!e.error.isHandled`
}),
define("core.models/app", ["core.models/rpc-base", "core.models/rpc-session", "core.models/engine", "core.utils/deferred", "util"], function(e, t, n, i, r) {
"use strict";
//1. notice the core.models/app also has this.session.rpc and this.rpc
//2. it is responsible for
//has useful funtions like GetVersion; the global methods https://gist.github.com/theredpea/95d8904f8eef98a89c2d164d81dfb9b5
// or GetConfiguration but it is not documented??? https://help.qlik.com/en-US/search/?q=GetConfiguration
//3. "extends" (an rpc-base concept) the "App" type...
//4. Has the `current` property, which is defineProperty and is a function, which returns `s`;, and `s` is a scoped variable
// seems only time the s is set back to a falsey is:
//s === this && (s = void 0,
//a = !0),
//notice `init` ; `s` is set to `l`, which and `l` is set to `this`, so "current" represents an instance this `cores.models/app` object
//seems like single-object-service returns an object which *only exposes an `init` function*
//and that init calls `i` in the below minification case
// parsed by apis/single-url, convenient
//stored in `k` which is passed into the `i` function; uses the "hasOption" API used on viz's in Qlik
// which correspond to the options that are set for the single-configurator
// 'currsel'
// 'clearselections'
// 'noanimate'
// 'nointeraction'
//notice interaction just passes straight through to ... qvangular?
g.currApp = function(e) {
var n;
return (n = e && e.backendApi && e.backendApi.model.session && e.backendApi.model.session.currentApp ?
//if there's e.backendApi.model.*session*.currentApp, then assign to n
e.backendApi.model.session.currentApp
//else if there's not assign ...
: e && e.backendApi && e.backendApi.model.app ?
//if there is e.backendApi.model.*app*
e.backendApi.model.app :
//Related to the is_personal_mode / desktop mode question:
//https://gist.github.com/theredpea/f0a927242332d4d9d1c9aaaa5aa700aa/edit
//But regarding the *version*, see "About Service API"
//https://help.qlik.com/en-US/sense-developer/November2017/Subsystems/AboutServiceAPI/Content/AboutServiceAPI/AboutServiceAPI-Get-SystemInfo.htm
//https://hostname/api/about/v1/systeminfo
//Example URL:
//https://usrem-nnd.qliktech.com/api/about/v1/systeminfo

Techniques:

  1. iterate through all fields ; createList for each (which CreateSessionObject separate individual lists) (via createList API)
    1. To get list of fields in the first place, loops through the Current Selections bar DOM. Don't know why it doesnt at least use one of the below techniques, which reliably return which fields have selections.
    2. For each App API createList method call with { qDef: ... } I believe it must translate into similar as the CreateSessionObject below with { qListObjectDef: ...}... there is no direct Engine CreateList method
  2. getList "SelectionObject" which calls "CreateSessionObject" of type "SelectionObject" (via [field API](http://help.qlik.com/en-US/sense-developer/September2017/Subsystems/APIs/Conten
//requireNative, overseen in EF's screen
var app = requireNative('app');
var user_promise;
var user_result;
//inject the '$http' service by wrapping this in angular controller, or using a substitue for http
var refresh_user = function () {
//Only need to get this information once
user_promise = $http({
method: 'GET',
url: urlService.path('/qps/user')