Aptify JavaScript API: Required Rigging
In order to use the Aptify JavaScript API on a webpage, you'll need to do three things first: include the right scripts, authenticate, and make sure Aptify's loaded all the stuff it needs.
Necessary Scripts
In general, if you're working with the non-visual API, you'll just need the minified Framework file and the unminified External Framework configuration file. However, since we've chosen to split our files according to Framework vs. Applications instead of Non-UI vs. UI, Applications entities have their JavaScript GE subclasses in the minified Applications files. You may end up wanting that too. These files are available in the various subdirectories of your installed Aptify web client's script/Aptify folder.
You'll also need a couple of third-party minified files, kendo.all.min.js and jquery.signalR-2.0.2.min.js. Both are available via CDN, or you can grab them from your installed Aptify web client's script folder.
Finally, you'll need to load the signalR autogenerated scripts living in your Aptify Services website. Find the address of your Aptify Services site and use that base address + "/signalR/hubs".
Load order is important! Here's the right one (including Applications files) for minified releases in the 5.5.2.x series:
kendo.all.min.js Aptify.Framework.Configuration.External.js Aptify.Applications.Configuration.External.js http(s)://servicessite/signalr/hubs jquery.signalR-2.0.2.min.js Aptify.Framework-5.5.2.x.min.js Aptify.Applications-5.5.2.x.min.js
If you've no need for the Applications files, simply remove them.
Authentication
Once all those scripts have loaded, and the DOM is ready, you're ready to authenticate. (We useHeadJS to load scripts, but you can use whatever you like.)
$(document).ready(function () { Aptify.framework.utility.authenticateUser({ executeStartupItems: true, resultCallback: function (result) { if (result.isSuccess) { // Now we've got to wait until the Part Cache is ready } } }); });
Waiting for the Part Cache
Much of what Aptify caches is UI data, but there's plenty of non-visual stuff there too. You need to wait until the initial caching has completed before doing anything else. (All this code goes inside the resultCallback from authentication.)
Aptify.framework.utility.partCacheReady(function () { // Your code goes here! For example, you might load up a GE and apply some bindings to it. });
Copyright © 2014-2019 Aptify - Confidential and Proprietary