Represents the context of the whole application.
Contains methods to navigate to domain objects, the current locale, the logged in user and the
currently selected domain object (if any).
Example
define([
"blueconic/api/application"
], function(application) {
// ...
});
Properties
-
featureFlags blueconic.api.data.domain.FeatureFlags
-
The feature flags.
-
selectedObject blueconic.api.data.domain._Base
-
The current selected domain object in the application.
-
The current logged in user.
-
readonly NOTIFICATION_TYPE String
-
All possible values for the notification type.
Properties:
Name Description ERROR Error state.
WARNING Warning state.
INFO Info state.
SUCCESS Success state.
Functions
-
getBaseUrl()dojo/Deferred
-
Return the most secure base URL of the server on which authorized REST calls can be done (for example; excel exports)
Returns:
Type Description dojo/Deferred The base URL wrapped in a promise. Example
- https://testtenant.blueconic.com - http://localhost:3737
-
getCurrentLocaleDateFormat()String
-
Returns the date format for current locale.
Returns:
Type Description String Date format for current user locale -
getFormattingLocale()String
-
Returns the locale used in the application and also considers the overrule locale that the user may have set on the "Personal" tab. This locale should be used when formatting dates, times and numbers.
Returns:
Type Description String A locale as defined by RFC 3066. -
getLink(object)String
-
Returns the relative link to the given domain object. Opening the link will navigate the user to the object in the workspace.
Name Type Description object blueconic.api.data.domain._Base The object to get a link to.
Returns:
Type Description String The relative link to the object. -
hideNotification()
-
Hides the currently visible notification.
-
logout()
-
Log out the current user and redirect to login page.
-
navigateTo(domainObject, checkUdn)
-
Function to navigate the user to another domain object in the workspace.
Name Type Description domainObject blueconic.api.data.domain._Base The domain object to open. The following types can be navigated to:
- blueconic.api.data.domain.Segment
- blueconic.api.data.domain.Dialogue
- blueconic.api.data.domain.Channel
- blueconic.api.data.domain.User
- blueconic.api.data.domain.Position
- blueconic.api.data.domain.Plugin
- blueconic.api.data.domain.ProfileProperty
- blueconic.api.data.domain.Connection
- blueconic.api.data.domain.Goal
- blueconic.api.data.domain.Lifecycle
- blueconic.api.data.domain.BlueConicHostname
checkUdn boolean If the unsaved data notification should be shown (if needed), defaults to true.
-
showNotification(options)
-
Shows a notification popup in the workspace.
Name Type Description options Object Configuration options that can be passed:
Name Datatype Description title String Title of the popup, empty by default. message String Message body of the popup, empty by default. timeout Integer Time in milliseconds the notification is shown. Default is 0 (does not disappear automatically). type NOTIFICATION_TYPE Type of notification: "ERROR", "INFO", "SUCCESS". Default is "INFO". fadeEffect Boolean Set to `true` to enable a fade effect. Default is `false`. Example
// Show a notification popup application.showNotification({ title: 'URL needed', message: 'Please enter a URL.', fadeEffect: false, type: application.NOTIFICATION_TYPE.ERROR, timeout: 2000 // 2 seconds });
Events
-
onPluginWidgetsInstalled(installedWidgets)
-
Event can be published when plugin widgets are installed (using application.emit()). This typically happens when finishing the onboarding wizard for now.
Name Type Description installedWidgets Array.<Object> the array of widgets on which "install()" has been called
-
onSelectedObjectChange(domainObject)
-
Event thrown when another domain object (e.g Segment) is selected.
Name Type Description domainObject blueconic.api.data.domain._Base The domain object which is selected.
-
onSelectedObjectUnloaded()
-
Event thrown when a domain object is unloaded, meaning there is no longer a domain object selected while there previously was.