/** * User and Device and Org Profile. * The properties of this Object will be null until after Ext.onSpaceReady fires. * * * Ext.onSpaceReady().then( * function() { * Ext.space.Logger.log("current username", Ext.space.Profile.user.userId); * } * ); * */Ext.define("Ext.space.Profile", { singleton: true, /** * Details on the device including the unique id, name, and platform * @readonly * @type {Ext.space.profile.Device} */ device: null, /** * Details about the current Sencha user * @readonly * @type {Ext.space.profile.User} */ user: null, /** * The organization detail this app belongs to. * @readonly * @type {Ext.space.profile.Org} */ org: null, /** * @private */ constructor: function() { Ext.onSpaceReady().then(this.init.bind(this)); }, init: function() { var device = Ext.space.Communicator.device; var session = Ext.space.Communicator.session; this.device = new Ext.space.profile.Device(device); this.user = new Ext.space.profile.User(session); this.org = new Ext.space.profile.Org(session); } }); /** * Device Profile information. * Created by Ext.space.Profile */Ext.define("Ext.space.profile.Device", { /** * Device Name * @readonly * @type {String} */ name: null, /** * The platform/manufacturer of the device. * @readonly * @type {String} */ platform: null, /** * The vendor specific unique identifier of the device. * @readonly * @type {String} */ uuid: null, /** * @private */ constructor: function(props) { this.name = props.name; this.platform = props.platformName; this.uuid = props.uuid; } }); /** * User Profile information. * Created by Ext.space.Profile */Ext.define("Ext.space.profile.User", { /** * User ID * @readonly * @type {String} */ userId: null, /** * @private */ constructor: function(props) { this.userId = props.userId; } }); /** * Device Profile information. * Created by Ext.space.Profile */Ext.define("Ext.space.profile.Org", { /** * Org Name * @readonly * @type {String} */ name: null, /** * @private */ constructor: function(props) { this.name = props.org; } });