/**
* Licensed Materials - Property of IBM
*
* IBM Cognos Products: Content Explorer
*
* Copyright IBM Corp. 2015, 2018
*
* US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
*/
define('bacontentnav/nls/ContentNavResources',{
"root": true,
"cs": true,
"da": true,
"de": true,
"es": true,
"fi": true,
"fr": true,
"he": true,
"hr": true,
"hu": true,
"it": true,
"ja": true,
"kk": true,
"ko": true,
"no": true,
"nb": true,
"nl": true,
"pl": true,
"pt": true,
"pt-br": true,
"ro": true,
"ru": true,
"sl": true,
"sv": true,
"th": true,
"tr": true,
"zh": true,
"zh-cn": true,
"zh-tw": true
});
/**
* Licensed Materials - Property of IBM
* IBM Cognos Products: ba-content-nav
* (C) Copyright IBM Corp. 2022
* US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
*/
define('bacontentnav/nls/root/ContentNavResources',{
"allContent": "All content",
"allGenericItems": "All",
"myContent": "My content",
"copy": "Copy to",
"confirmDelete": "Confirm delete",
"confirmDeleteMessage": "Deleting entries can break links. Are you sure you want to delete the selected entries?",
"dashboards": "Dashboards",
"explorations": "Explorations",
"delete": "Delete",
"edit": "Edit",
"notebooks": "Notebooks",
"modificationTime": "Modified",
"modifiedWithColon": "Modified:",
"move": "Move to",
"name": "Name",
"tenant": "Tenant",
"tenantSettings": "Tenant Settings",
"tenantSet": "Tenant updated",
"tenantSetError": "Error setting tenant",
"tenantClear": "Tenant cleared",
"tenantClearError": "Error clearing tenant",
"owner": "Owner",
"reports": "Reports",
"copyMove": "Copy or move:",
"copyOnly": "Copy",
"noOfItemSelected": "%{noOfItems} selected",
"selectDestination": "Select a destination",
"selectAccountGroupOrRole": "Select groups, users or roles",
"members": "Members",
"teamContent": "Team content",
"folderTeamContent": "Folder (Team Content)",
"folders": "Folders",
"goToCloudLocation": "Go to cloud location",
"type": "Type",
"typeWithColon": "Type:",
"others": "Other",
"unknown": "Unknown",
"description": "Description",
"general": "General",
"advancedProperties": "Advanced",
"location": "Location",
"schedule": "Schedule",
"created": "Created",
"createdWithColon": "Created:",
"disableThisEntry": "Disable this entry",
"hideThisEntry": "Hide this entry",
"indexed": "Indexed",
"language": "Language",
"reportOutputVersions": "Report output versions",
"reportOutputVersion": "Report output version",
"rowsPerPageHtmlReport": "Rows per page in HTML Reports",
"package": "Package",
"data": "Data",
"dataModule": "Data module",
"mode": "Mode",
"live": "Live",
"snapshot": "Snapshot",
"noSnapshotsFound": "No Snapshot found",
"uploadedFile": "Uploaded file",
"fileUpload": "Upload files",
"dataSetEx": "Data set",
"externalRepository": "External repository",
"queryMode": "Query mode",
"queryModeCompatible": "Compatible",
"queryModeDynamic": "Dynamic",
"report": "Report",
"activeReport": "Active Report",
"query": "Query",
"analysis": "Analysis",
"permission": "Permissions",
"capabilities": "Capabilities",
"newItemMenuLabel": "New",
"newFolderDefaultName": "New Folder",
"newFolderLabel": "New folder",
"switchViewsLabel": "Switch Views",
"emptyTableContentMessage": "There's nothing in this folder.",
"emptyRecentList": "You haven't viewed any content recently.",
"back": "Back",
"optionsMenuLabel": "Options",
"defaultAction": "Default action",
"reportOptions": "Report options",
"promptValues": "Prompt values",
"runTheReport": "Run the report",
"viewMostRecentReport": "View most recent report",
"openWithReportStudio": "Open with Report Studio",
"comingSoon": "Coming soon",
"recentlyViewed": "Recently viewed",
"destination": "Destination:",
"lastUsed": "Last Used",
"reportView": "Report View",
"reportViews": "Report Views",
"adminFolder": "Administration",
"folder": "Folder",
"dashboard": "Dashboard",
"dashboardTemplate": "Dashboard Template",
"exploration": "Exploration",
"story": "Story",
"stories": "Stories",
"notebook": "Notebook",
"workspace": "Workspace",
"pagelet": "Page",
"content": "Content",
"directory": "Namespaces",
"dataSet": "Data set",
"powerPlayCube": "PowerPlay Cube",
"powerPlayReport": "PowerPlay Report",
"powerPlay8Report": "PowerPlay Report",
"powerPlay8ReportView": "PowerPlay Report View",
"reportTemplate": "Report Template",
"packageConfigurations": "Package Configuration",
"agent": "Agent",
"agentDefinition": "Agent Definition",
"agentDefinitionView": "Agent View",
"dataMovementTask": "Data Movement Task",
"dataMovementTaskAlias": "Data Movement Task Alias",
"document": "Document",
"DocumentRetention": "Document properties",
"jobDefinition": "Job Definition",
"job": "Job",
"jobs": "Jobs",
"metricsDataSourceETLTask": "Metrics Data Source ETL Task",
"metricsExportTask": "Metrics Export Task",
"metricsFileImportTask": "Metrics File Import Task",
"metricsMaintenanceTask": "Metrics Maintenance Task",
"planningTask": "Planning Task",
"shortcut": "Shortcut",
"shortcuts": "Shortcuts",
"URL": "URL",
"launchable": "Launchable",
"dataSetFolder": "Data Set Folder",
"ViewAccessibleLabel": "View %{label}",
"overrideReportOptions": "Override the default report options",
"formats": "Formats",
"saveReport": "Save the report",
"promptForValues": "Prompt me",
"html": "HTML",
"pdf": "PDF",
"spreadsheetML": "Excel",
"xlsxData": "Excel Data",
"csv": "CSV",
"xml": "XML",
"runAs": "Run as",
"permissionHeader": "Permission",
"read": "Read",
"write": "Write",
"execute": "Execute",
"setPolicy": "Set Policy",
"full": "Full",
"traverse": "Traverse",
"toastDoneMoving": "%{noOfItems} items were moved.",
"toastDoneCopying": "%{noOfItems} items were copied.",
"toastDoneShortcutting": "%{noOfItems} shortcuts were created.",
"toastDoneDeleting": "%{noOfItems} items were deleted.",
"toastDoneMovingSingular": "%{nameOfItem} was moved.",
"toastDoneCopyingSingular": "%{nameOfItem} was copied.",
"toastDoneShortcuttingSingular": "%{nameOfItem} was created.",
"toastCreateNewFolder": "%{nameOfFolder} was created.",
"toastDoneDeletingSingular": "%{nameOfItem} was deleted.",
"toastLaunchPerspectiveError": "Cannot open %{objectType}.",
"toastItemsWereAdded": "%{noOfItems} items were added to the profile.",
"toastItemsWereAddedSingular": "%{noOfItems} item was added to the profile.",
"toastItemsAlreadyAddedSingular": "Item has already been added to the profile.",
"toastItemsAlreadyAdded": "Items have already been added to the profile.",
"toastRunRequestWasSubmitted": "Run request was submitted.",
"toastNoCapabilityForContainer": "No capabilities or permissions to save into '%{nameOfContainer}'.",
"shortCutName": "%{nameOfItem}%{shortCutLabel}",
"ok": "OK",
"cancel": "Cancel",
"permissionDetails": "Permission Details",
"grant": "Grant",
"deny": "Deny",
"overrideParentPermissions": "Override parent permissions",
"applyToAllChildren": "Apply to all children",
"policiesTableLable": "Policies",
"policesAddButtonLabel": "Member",
"policesAddMemberButtonLabel": "Add",
"policesRemove": "Remove",
"policiesFindAUserHint": "Search",
"policiesFindModeMenuTip": "Search method",
"policiesFindMode": "Search",
"policiesTypeInMode": "Type in",
"policyFilterAccounts": "Users",
"policyFilterRoles": "Roles",
"policyFilterGroups": "Groups",
"policyToastMessageSyntax": "Type the names of the entries to find, separated by semi-colons. Use the format namespace/user, group or role; For example, type Cognos/Everyone",
"policyToastMessageNamespace": "You must first select a namespace.",
"emptyPolicyList": "Nothing found",
"applyLabel": "Apply",
"permissionRead": "Read",
"permissionRun": "Run",
"permissionWrite": "Write",
"permissionFull": "Full",
"permissionCustom": "Custom",
"permissionDetailsColumnAccess": "Access",
"permissionDetailsColumnPermission": "Permission",
"permissionDetailsColumnAction": "Action",
"permissionSetAccess": "Set access",
"preferencesMyCredentials": "My credentials",
"preferencesCredentialsLabel": "Credentials",
"preferencesDataSourceCredentialsLabel": "Data Servers",
"preferencesDatasourceTitle": "Data server credentials",
"preferencesDatasourceHeader": "Data server name",
"preferencesGroupsAndRoles": "Groups and Roles",
"preferencesMyCapabilities": "My Capabilities",
"preferencesCredentialsHintText": "Specify the users, groups or roles that can use your credentials to run activities:",
"preferencesCapabilitiesHintText": "These capabilities are available to you:",
"preferencesGroupsAndRolesHintText": "In this session, you can use the access permissions of these groups and roles:",
"preferencesDataSourceCredentialsHintText": "You have saved credentials for these data servers:",
"enableAccessibilitySupport": "Enable accessibility support",
"languages": "Languages",
"True": "True",
"False": "False",
"id": "ID",
"run": "Run",
"createVersion": "Create a version",
"create": "Create",
"size": "Size",
"sizeByte": "%{value} B",
"sizeKiloByte": "%{value} KB",
"sizeMegaByte": "%{value} MB",
"sizeGigaByte": "%{value} GB",
"sizeTeraByte": "%{value} TB",
"sizePetaByte": "%{value} PB",
"refreshedDatetime": "Refreshed time",
"dataRefreshed": "Data refreshed",
"dataRefWithColon": "Data refreshed:",
"missingPermissions": "You need permissions to view the properties for this item.",
"missingPolicies": "You only see entries that you have permissions for. You might see different entries if you sign in to a different namespace",
"versions": "Versions",
"archives": "Archives",
"occurrences": "Occurrences",
"days": "Day(s)",
"months": "Month(s)",
"errorMessages": "Messages",
"errorMessageLengthFolderName": "Please enter a folder name that does not exceed 255 characters.",
"errorMessageApostropheError": "Please enter a file name that does not contain both ' and \" characters",
"error": "Error",
"warn": "Warning",
"fatal": "Fatal",
"debug": "Debug",
"info": "Information",
"runTime": "Run time",
"requestTime": "Request time",
"startTime": "Start time",
"endTime": "End time",
"successful": "Successful",
"failed": "Failed",
"noSavedOutputs": "There are no saved outputs.",
"noVersions": "No versions available",
"noReportOptionsAvailable": "No report options record available.",
"showDetails": "Open details panel",
"unavailable": "Unavailable",
"runInBackgroundOption": "Run in background",
"selectAFormat": "Please select a format",
"delivery": "Delivery",
"now": "Now",
"later": "Later",
"invalidTime": "Time selected is earlier than current time. Please select again.",
"executionPrompt": "Prompt for values",
"currentValues": "Current values",
"noPromptsValuesSet": "You currently have no prompt values set",
"setValues": "Set values",
"numOfPromptValues": "prompt values",
"clear": "Clear",
"sourceReport": "Source Report",
"reportName": "Report Name",
"reportLocation": "Report Location",
"burst": "Burst the report",
"sourcePackage": "Source Package",
"packageName": "Package Name",
"packageLocation": "Package Location",
"confirmTakeOwnership": "Confirm Take Ownership",
"confirmTakeOwnershipMessage": "Are you sure you want to take ownership of the selected entries?",
"SetLabel": "Set...",
"externalRepositories": "External Repositories",
"toastTakeOwnership": "You now own %{noOfItemsClaimed} of %{noOfItems} selected items.",
"runAsUser": "With user's credentials",
"runWithOwnerCapabilities": "With owner capabilities",
"runAsOwner": "As %{ownerName}",
"pdfOptions": "PDF options",
"set": "Set",
"passwordNotMatched": "Passwords don't match or are missing",
"Orientation": "Orientation",
"default": "Default",
"portrait": "Portrait",
"landscape": "Landscape",
"pageSize": "Paper size",
"letter": "Letter",
"legal": "Legal",
"11x17": "11x17",
"A3": "A3",
"A4": "A4",
"B4JIS": "B4 JIS",
"B5JIS": "B5 JIS",
"requiresPasswordToOpenReport": "Requires a password to open the report",
"requiresPasswordToAccessOptions": "Requires a password to access options",
"password": "Password:",
"confirmPassword": "Confirm Password:",
"runHistory": "Run History",
"viewRunHistory": "View...",
"jobAdvancedProperties": "Properties",
"scheduleAJob": "Schedule Job",
"viewCurrentVersions": "View document versions",
"viewArchivedVersions": "View archived versions",
"renameCollisionError": "%{name} already exists. Try a different name.",
"nameCollision": "An item with this name already exists:",
"nameCollisionMessage": "What do you want to do?",
"copyReplace": "Copy and replace",
"keepBoth": "Keep both",
"copySkip": "Don't copy",
"moveReplace": "Move and replace",
"moveSkip": "Don't move",
"repeatNameCollisionAction": "Do this for the next %{noItems} conflicts",
"repeatNameCollisionActionSingular": "Do this for the next conflict",
"bulkNameCollision": "There are %{noOfItems} items with names that already exist",
"overwrite": "Overwrite",
"rename": "Rename",
"nameCollisionGeneric": "There are one or more items with a name that already exists.",
"repeatedDeleteError": "One or more of these items are already in the process of being deleted. Wait until the delete action completes and try again.",
"repeatedDeleteErrorTitle": "Repeated delete",
"details": "Details:",
"role": "Role",
"account": "Account",
"contact": "Contact",
"distributionList": "Distribution list",
"group": "Group",
"namespace": "Namespace",
"SetLanguagesLabel": "Set...",
"SetExternalRespostoryLabel": "Set...",
"SetCapabilitiesLabel": "Set...",
"JobAdvancedSettings": "Set...",
"JobSchedule": "Set...",
"JobAdvancedRunHistory": "View...",
"invalidNumber": "The value entered is not a number. Type a number.",
"exceedMaxLength": "The text is too long. Shorten to %{maxLength} characters.",
"invalidInput": "Invalid input",
"invalidEmailMessage": "Email address is not valid.",
"typeInHintText": "Example: Namespace1/name; Namespace2/name;",
"importDeployment": "Import deployment",
"exportDeployment": "Export deployment",
"between": "Between",
"greaterOrEqual": "Greater than or equal to %{upperboundValue}",
"lessOrEqual": "Less than or equal to %{lowerboundValue}",
"and": "and",
"properties": "Properties - %{objectName}",
"none": "None",
"objectDeleted": "This object doesn't exist",
"PageLayout": "Page Layout",
"PageStyle": "Style",
"Gateway": "Gateway",
"PowerPlayReport": "PowerPlay Report",
"more": "More",
"title": "Title",
"itemName": "Item name",
"showMissingPolicies": "show",
"hideMissingPolicies": "hide",
"nowOrLaterRadioOptions": "Run now or later options",
"runHistoryUnits": "Run history units",
"reportOutputVersionsUnits": "Report output versions units",
"breadCrumbsAccessibleLabel": "Ancestor Folders",
"selectAllFolder": "Select all in folder",
"deselectAllFolder": "Deselect all in folder",
"clearAllSelected": "Clear all selected",
"a11yContentListUpdatedNotification": "Now showing contents of %{folderOrPackageName}",
"a11yPropertyPane": "Properties of object %{nameOfObject}",
"moreActionsMenu": "More Actions Menu",
"itemType": "Item type",
"confirmCancelMessage": "Do you want to discard your changes?",
"confirmCancel": "Confirm cancel",
"formatOptions": "Format options",
"listControlColumns": "List Columns",
"source": "Source",
"external": "External",
"removeSelectedItem": "Remove selected item",
"deleteReportVersion": "Delete report version",
"dataset": "Data set",
"numberRows": "Number of rows",
"numberColumns": "Number of columns",
"TimeToRefresh": "Time to refresh",
"LastRefreshedBy": "Refreshed by",
"OverwriteFileSuccessfully": "Successfully overwrote the object %{nameOfObject}",
"RenameFileSuccessfully": "Successfully renamed the object from %{originalNameOfObject} to %{newNameOfObject}",
"showAllHistory": "Show all history",
"history": "History",
"user": "User",
"confirmDeleteAllowed": "You do not have permission to delete: %{number} item(s). Would you like to proceed and delete the rest?",
"download": "Download",
"personal": "Personal",
"customization": "Customization",
"schemas": "Schemas",
"connections": "Connections",
"numberOutOfRange": "The value entered must be a number between %{min} and %{max}",
"numberTooSmall": "The value entered must be a number greater than %{min}",
"numberTooBig": "The value entered must be a number less than %{max}",
"searchReturnedNoResults": "Your search returned no results.",
"tryChangingSearchTerms": "Please try a different search term.",
"searchAllYourData": "Search all your data",
"search": "Search",
"saveSearch": "Save search",
"narrowYourSearch": "Narrow your search",
"all": "All",
"packages": "Packages",
"savedSearch": "Saved searches",
"haventSavedSearches": "You haven't saved any searches.",
"clickTheSaveButton": "Tap the Save search icon after you search.",
"remove": "Remove",
"searchWasDeleted": "Search was deleted",
"searchWasntDeleted": "Search wasn't deleted",
"searchWasSaved": "Search was saved",
"searchWasntSaved": "Search wasn't saved",
"socialInsightsProject": "Social Insights",
"errorWithSearch": "There was an error with your search.",
"saveTenSearches": "You can save 10 searches.",
"deleteASearch": "Delete one to save another.",
"models": "Models",
"today": "Today",
"yesterday": "Yesterday",
"date": "Date",
"clearAll": "Clear all",
"EnterSearchTerms": "Enter a search term before you select a filter type.",
"pastWeek": "Past week",
"pastMonth": "Past month",
"createShortcut": "Create shortcut",
"createShortcutDialogTitle": "Create shortcut:",
"shortcutTo": "Shortcut to",
"shortcutToItem": "Shortcut to %{itemName}",
"add": "Add",
"close": "Close",
"confirmClearTenant": "Confirm clear tenant",
"confirmClearTenantText": "Clearing the tenant will change the value to \"None\" and might allow other tenants to access the content.
Click OK to make the entry public or Cancel to keep the current tenant",
"changeTenantWarning": "Changing the tenant of an entry also changes the tenant of child entries.",
"dataSource": "Data Server",
"dataSourceConnection": "Connection",
"dataSourceSignon": "Sign on",
"searchForAssets": "You can search for assets",
"results": "Results",
"filterBy": "Filter by",
"resultLimit": "Result limit",
"noAccessRecent": "No access",
"noAccessRecentMsg": "You don't have access to this asset. It might have been disabled or deleted, or your permissions might have been reduced. Verify the state of the asset at its expected source location. You can remove the asset from your recent items by clicking OK.",
"capability": "Capability",
"loading": "Loading",
"save": "Save",
"saveAs": "Save as",
"saveAsLabel": "Save as:",
"teamFolders": "Team Folders",
"open": "Open",
"openDialogTitle": "Open file",
"openDialogFooter": "Open and cancel button",
"saveDialogTitle": "Save as",
"saveDialogFooter": "Save and cancel button",
"toastSaveErrorSameNameDifferentType": "'%{nameOfItem}' already exists with a different type. Please choose a different name.",
"filesToOpen": "Files to open:",
"confirmRefreshUpload": "Confirm replacement of existing data",
"msgConfirmRefreshUpload": "The file '%{fileName}' already exists. Do you want to replace its data with the data contained in the selected file?",
"userDataSource": "CSV",
"dataAsset": "XLS",
"xls": "XLS",
"xlsx": "XLSX",
"sav": "SAV",
"txt": "TXT",
"circle": "In progress",
"sortHeader": "Sort by",
"filterHeader": "Filter by",
"sort": "Sort",
"sortBy": "Sort by",
"order": "Order",
"previous": "Previous",
"collapsedBreadCrumb": "Collapsed items",
"sortedAscending": "Ascending",
"sortedDescending": "Descending",
"itemsOverLimit": "The specified name '%{itemName}' has exceeded the maximum (20) limit. Please specify a different name to continue.",
"searchFolder": "Type any text",
"text": "Keywords",
"noFilterResult": "No data matched your search.",
"tryOtherFilter": "Try selecting a different filter.",
"visualization": "Visualization",
"cosConnection": "Cloud object storage connection",
"cosConnections": "Cloud object storage connections",
"cosLocation": "Cloud location",
"resourceFolder": "Resource folder",
"unableToOpenFolderMsg": "Unable to open the specified folder"
});
/*
*+------------------------------------------------------------------------+
*| Licensed Materials - Property of IBM
*| IBM Cognos Products: Content Explorer
*| (C) Copyright IBM Corp. 2015
*|
*| US Government Users Restricted Rights - Use, duplication or disclosure
*| restricted by GSA ADP Schedule Contract with IBM Corp.
*+------------------------------------------------------------------------+
*/
define('bacontentnav/nls/StringResource',['i18n!./ContentNavResources', 'polyglot'], function(localeResources, Polyglot) {
'use strict';
/**
* Module which provides simple access to string resources.
*
*/
var poly = new Polyglot({
phrases: localeResources
});
var StringResources = function() {
return undefined;
};
/**
* Get the string resource for the given key and interpolation options
*
* @param key The key of the string to return
* @param interpolationOptions Optional interpolation options (see poly.t documentation for details)
* @returns The string to display
*/
StringResources.prototype.get = function(key, interpolationOptions) {
return poly.t(key, interpolationOptions);
};
return new StringResources();
});
/*
*+------------------------------------------------------------------------+
*| Licensed Materials - Property of IBM
*| IBM Cognos Products: Content Explorer
*| (C) Copyright IBM Corp. 2015, 2018
*|
*| US Government Users Restricted Rights - Use, duplication or disclosure
*| restricted by GSA ADP Schedule Contract with IBM Corp.
*+------------------------------------------------------------------------+
*/
define('bacontentnav/utils/GlassContextHelper',[], function() {
'use strict';
var _singletonInstance = null;
var GlassContextHelper = function() {
if (GlassContextHelper.prototype._singletonInstance) {
return GlassContextHelper.prototype._singletonInstance;
}
GlassContextHelper.prototype._singletonInstance = this;
};
/*
@glassContext - glassContext
@jqXHR - jQuery XMLHttpRequest returned by Glass Ajax service on fail
Is temporary and should be removed when Glass handles the showing of error messages
*/
GlassContextHelper.prototype.showAjaxServiceErrorMessage = function(glassContext, jqXHR) {
var messages = '';
if (jqXHR) {
var responseJSON = jqXHR.responseJSON;
if (responseJSON) {
if (responseJSON.messages) {
messages = jqXHR.responseJSON.messages.join('\n');
} else if (responseJSON.cause) {
try {
var cause = JSON.parse(responseJSON.cause);
if (cause.messages) {
messages = cause.messages.join('\n');
}
} catch (e) {
//if we get here, 'cause' is not a json object
messages = responseJSON.cause;
}
}
} else {
messages = jqXHR.responseText;
}
}
if ( messages && messages.length > 0 ) { // RTC189248 - Don't show empty error messages!
glassContext.appController.showErrorMessage(messages, 'Error');
}
};
GlassContextHelper.prototype.showAjaxServiceError = function(glassContext, error) {
this.showAjaxServiceErrorMessage(glassContext, error.jqXHR);
};
/*
@glassContext - glassContext
@str - the message
@options - an options jsonObject to pass to glass's showToast
*/
GlassContextHelper.prototype.displayToast = function(glassContext, str, options) {
glassContext.appController.showToast(str, options);
};
/*
* preference - name of the preference setting to get. e.g contentLocale, email, etc
*/
GlassContextHelper.prototype.getUserPreference = function(glassContext, preference) {
return glassContext.getCoreSvc('.UserProfile').preferences[preference];
};
GlassContextHelper.prototype.getContentLocales = function(glassContext) {
return glassContext.getCoreSvc('.Config').getContentLocales();
};
GlassContextHelper.prototype.getLocaleTime = function(glassContext) {
var preferences = glassContext ? glassContext.getCoreSvc('.UserProfile').preferences : {};
return {
timeZone: preferences.timeZoneID || 'America/New_York',
contentLocale: preferences.contentLocale || 'en'
};
};
var _static = {
getInstance: function() {
if (!_singletonInstance) {
_singletonInstance = new GlassContextHelper();
}
return _singletonInstance;
}
};
return _static.getInstance();
});
/*
*+------------------------------------------------------------------------+
*| Licensed Materials - Property of IBM
*| IBM Cognos Products: Content Explorer
*| (C) Copyright IBM Corp. 2018
*|
*| US Government Users Restricted Rights - Use, duplication or disclosure
*| restricted by GSA ADP Schedule Contract with IBM Corp.
*+------------------------------------------------------------------------+
*/
define('bacontentnav/utils/ContentServiceUrls',[], function() {
return {
baseContentServiceURL: 'v1/objects',
basePathURL: 'v1/path?path=',
baseSearchPathURL: 'v1/search_path?searchPath=',
baseUserProfileServiceURL: 'v1/users',
baseNamespaceServiceURL: 'v1/namespaces',
getMyFoldersURL: function() {
return this.baseContentServiceURL + '/.my_folders';
},
getMyFoldersContentURL: function() {
return this.getMyFoldersURL() + '/items';
},
getOtherUsersFoldersURL: function() {
return this.baseContentServiceURL + '/.users';
},
getBaseNamespaceURL: function() {
return this.baseNamespaceServiceURL;
},
getPublicFoldersURL: function() {
return this.baseContentServiceURL + '/.public_folders';
},
getPublicFoldersContentURL: function() {
return this.getPublicFoldersURL() + '/items';
},
getRootPublicFolderName: function() {
return null;
},
getRootMyFolderName: function() {
return null;
},
getMRUURL: function() {
return this.baseUserProfileServiceURL + '/~/mrus';
},
getBaseObjectsURL: function() {
return this.baseContentServiceURL;
},
getBasePathURL: function() {
return this.basePathURL;
},
getBaseSearchPathURL: function() {
return this.baseSearchPathURL;
},
getDefaultUploadLocationURL: function() {
return this.baseUserProfileServiceURL + '/_tilde_/user_profile_settings?fields=fileUpload_location';
}
};
});
/*
*+------------------------------------------------------------------------+
*| Licensed Materials - Property of IBM
*|
*| IBM Cognos Products: ba-content-nav
*|
*| (C) Copyright IBM Corp. 2015,2022
*|
*| US Government Users Restricted Rights - Use, duplication or disclosure
*| restricted by GSA ADP Schedule Contract with IBM Corp.
*+------------------------------------------------------------------------+
*/
// jshint maxdepth:5
define('bacontentnav/utils/ContentStoreObject',[
'underscore',
'../nls/StringResource',
'../lib/@waca/core-client/js/core-client/utils/DateTimeUtils',
'./GlassContextHelper',
'./ContentServiceUrls'
], function(_, StringResource, DateTimeUtils, GlassContextHelper, ContentServiceUrls) {
'use strict';
var _singletonInstance = null;
var ContentStoreObject = function() {
if (ContentStoreObject.prototype._singletonInstance) {
return ContentStoreObject.prototype._singletonInstance;
}
this.ID = 'id';
this.TYPE = 'type';
this.DEFAULT_NAME = 'defaultName';
this.MODIFICATION_TIME = 'modificationTime';
this.SEARCH_PATH = 'searchPath';
this.TENANT_NAME = 'tenantName';
this.TENANT_ID = 'tenantID';
this.CREATION_TIME = 'creationTime';
this.OWNER = 'owner';
this.META = '_meta';
this.LINKS = 'links';
this.URL = 'url';
this.selfURL = 'selfUrl';
this.SELF = 'self';
this.ITEMS = 'items';
this.ICON = 'iconURI';
this.DEFAULT_TOOLTIP = 'defaultScreenTip';
this.MODELS = 'models';
this.DEFAULT_DESCRIPTION = 'defaultDescription';
this.ANCESTORS = 'ancestors';
this.DEFAULT_PORTAL_ACTION = 'defaultPortalAction';
this.RUN_AS_OWNER = 'runAsOwner';
this.RUN_WITH_OWNER_CAPABILITIES = 'runWithOwnerCapabilities';
this.RUN_AS_USER = 'runAsUser';
this.HIDDEN = 'hidden';
this.DISABLED = 'disabled';
this.MIME_TYPE = 'mimeType';
this.OPTIONS = 'options';
this.PERMISSIONS = 'permissions';
this.SCHEMAINFO = 'schemaInfo';
this.POLICIES = 'policies';
this.ACQUIRED = 'acquired';
this.HISTORY = 'history';
this.DATA_DESCRIPTOR = 'dataDescriptor';
this.BASE = 'base';
this.METADATA_MODEL_PACKAGE = 'metadataModelPackage';
this.MODULE = 'module';
this.TAGS = 'tags';
this.REFERENCES = 'references';
this.SURNAME='surname';
this.GIVENNAME='givenName';
// for histories and history details
this.HISTORIES = 'histories';
this.VERSIONS = 'versions';
this.DETAILS = 'details';
this.REQUESTED_TIME = 'requestedExecutionTime';
this.EXECUTION_TIME = 'actualExecutionTime';
this.COMPLETION_TIME = 'actualCompletionTime';
this.STATUS = 'status';
this.OUTPUT = 'output';
this.OUTPUTS = 'outputs';
this.MESSAGES = 'messages';
this.MESSAGES_DETAIL = 'detail';
this.MESSAGES_SEVERITY = 'severity';
this.REQUEST_ARGUMENTS = 'requestArguments';
this.PARAMETERS = 'parameters';
this.EXECUTION_PROMPT = 'executionPrompt';
// for report outputs
this.BURSTKEY = 'burstKey';
this.FORMAT = 'format';
this.LOCALE = 'locale';
this.CONTENT = 'content';
this.RUN_IN_ADVANCED_VIEWER = 'runInAdvancedViewer';
this.OPTION_OUTPUT_FORMAT = 'outputFormat';
this.OPTION_OUTPUT_LOCALE = 'outputLocale';
this.OPTION_ACCESSIBILITY_FEATURES = 'http://developer.cognos.com/ceba/constants/systemOptionEnum#accessibilityFeatures';
this.OPTION_PROMPT = 'prompt';
this.OPTION_HTML_ROWS_PER_PAGE = 'verticalElements';
this.OPTION_SELECTION_BASED_FEATURES = 'selectionBasedFeatures';
this.OPTION_ENABLE_ALLOW_NOTIFICATION = 'allowNotification';
this.OPTION_ENABLE_USER_FEATURE_SAVED_OUTPUT = 'advancedOutput';
this.EFFECTIVE_USER_CAPABILITIES = 'effectiveUserCapabilities';
ContentStoreObject.prototype._singletonInstance = this;
// private functions
this._getMetaLinksURL = function(oData, target) {
var linksTarget = oData[this.META] && oData[this.META][this.LINKS] && oData[this.META][this.LINKS][target];
return linksTarget && linksTarget[this.URL] || null;
};
this._getBaseType = function(oData) {
var base = this.getBase(oData);
return base && this.getType(base) || null;
};
this._getFormatedDateTime = function(oData, formated, formatLength, fieldKey, includeTime) {
var time = oData[fieldKey] || null;
if (formated && time) {
var timeLocale = (this.glassContext) ? GlassContextHelper.getLocaleTime(this.glassContext) : {};
time = includeTime ? DateTimeUtils.formatDateTime(time, formatLength, timeLocale) : DateTimeUtils.formatDate(time, formatLength, timeLocale);
}
return time;
};
};
ContentStoreObject.prototype.setGlassContext = function(glassContext) {
this.glassContext = glassContext;
};
ContentStoreObject.prototype.setContentService = function(contentService) {
console.warn('ContentStoreObject.setContentService method is deprectated; Use ContentStoreObject.setGlassContext');
if ( contentService && contentService.glassContext) {
this.glassContext = contentService.glassContext;
}
};
/**
Takes a list of objects and returns a list of their ids
**/
ContentStoreObject.prototype.getObjectListIds = function(objects) {
var ids = [];
objects.forEach(function(obj) {
if (obj.id) {
ids.push(obj.id);
}
});
return ids;
};
ContentStoreObject.prototype.isPoliciesAcquired = function(oData) {
return oData[this.META] && oData[this.META][this.SCHEMAINFO] && oData[this.META][this.SCHEMAINFO][this.POLICIES] && oData[this.META][this.SCHEMAINFO][this.POLICIES][this.ACQUIRED];
};
ContentStoreObject.prototype.getObjectId = function(oData) {
return oData.id || '';
};
ContentStoreObject.prototype.getSearchPath = function(oData) {
return oData.searchPath || '';
};
ContentStoreObject.prototype.isTeamContent = function(oData) {
return oData && oData.type === 'content';
};
/**
returns the object type from the JSON response
@return {string} or null
**/
ContentStoreObject.prototype.getType = function(oData) {
return oData && oData[this.TYPE] || null;
};
/**
returns the object icon from the JSON response
@return {string} or null
**/
ContentStoreObject.prototype.getIcon = function(oData) {
return oData[this.ICON] || null;
};
/**
returns the object default tooltip from the JSON response
@return {string} or null
**/
ContentStoreObject.prototype.getTooltip = function(oData) {
return oData[this.DEFAULT_TOOLTIP] || null;
};
/**
returns the object tags from the JSON response
@return {array} or null
**/
ContentStoreObject.prototype.getTags = function(oData) {
return oData[this.TAGS] || null;
};
/**
Will return the base object type.
- If the object is not a reportView, then the object type will be returned
- If the object is a view and the base type is available then it will be returned
- If the object is a view and the base type is not available, then we will query for it
@returns a promise that will resolve with the type of the base object
**/
ContentStoreObject.prototype.getBaseObjectType = function(oData) {
var type = this.getType(oData);
if (type && /view$/.test(type.toLowerCase()) ) {
// If we already have the base type available, simply return it
var baseType = this._getBaseType(oData);
if (baseType) {
return Promise.resolve(baseType);
} else {
// If this is a report, we need to query the base type
var selfUrl = this.getSelfLink(oData);
return this.glassContext.getCoreSvc('.Ajax').ajax({
'url': selfUrl,
'type': 'GET',
'dataType': 'json',
'data': {
'fields': 'base.type'
}
}).then(function(response) {
var data = response && response.data && response.data.data;
var base = this.getBase(data[0]);
// We've queried for the information, might as well place it in the oData that was passed in
oData.base = [base];
return this.getType(base);
}.bind(this));
}
} else {
return Promise.resolve(type);
}
};
//TODO: is this a WA-specific test? if yes, remove
ContentStoreObject.prototype._isUserFolder = function(oData) {
// Need to check for length of 1 since as we drill into User Folders, ancestor[0] is still UserFolder.
if (oData.ancestors && oData.ancestors.length === 1) {
return !!(oData.ancestors[0] && (oData.ancestors[0].id === '.other_users_folders'));
} else {
return false;
}
};
// TODO: is this a WA-specific test? if yes, remove
ContentStoreObject.prototype._getUserFolderName = function(oData) {
return oData.createdBy && oData.createdBy.defaultName || '';
};
/**
Returns the child link from the JSON response
@return {string} or null
**/
ContentStoreObject.prototype.getItemsLink = function(oData) {
var type = oData.type;
if (type === 'namespace') {
return 'v1/namespaces/' + oData.id + '/items';
} else if (type === 'namespaceFolder') {
return 'v1/namespaces/' + oData.id + '/items?page=0|0&sorting=defaultName|asc';
} else if (type === 'agentDefinition' || this._isUserFolder(oData)) {
// content-service does not support getItemsLink for agentDefinition yet
var selfLink = this._getMetaLinksURL(oData, this.SELF);
if (selfLink) {
return selfLink + '/items';
}
}
return this._getMetaLinksURL(oData, this.ITEMS); // returns null if not found
};
/**
Returns the child link from the JSON response
@return {string} or null
**/
ContentStoreObject.prototype.getSelfLink = function(oData) {
return this._getMetaLinksURL(oData, this.SELF) || oData[this.selfURL] || 'v1/objects/' + oData[this.ID];
};
/**
* Returns the histories from the JSON response
* @return {promise}
*/
ContentStoreObject.prototype.getHistories = function(oData, fields) {
var historyLink = this._getMetaLinksURL(oData, this.HISTORIES);
if (historyLink) {
return this.glassContext.getCoreSvc('.Ajax').ajax({
dataType: 'json',
type: 'GET',
url: historyLink,
data: {
fields: fields
}
}).then(function(response) {
var data = response.data;
var responseData = data.data && data.data.length > 0 ? data.data : false;
return responseData;
});
} else {
return Promise.resolve(false);
}
};
/**
* Returns the versions from the JSON response
* @return {promise}
*/
ContentStoreObject.prototype.getVersions = function(oData, fields) {
var versionsLink = this.getVersionsLink(oData);
if (versionsLink) {
return this.glassContext.getCoreSvc('.Ajax').ajax({
dataType: 'json',
type: 'GET',
url: versionsLink,
data: {
fields: fields
}
}).then(function(response) {
var data = response.data;
var responseData = data.data && data.data.length > 0 ? data.data : false;
return responseData;
});
} else {
return Promise.resolve(false);
}
};
/**
Returns the versions link from the JSON response
@return {string} or null
**/
ContentStoreObject.prototype.getVersionsLink = function(oData) {
return this._getMetaLinksURL(oData, this.VERSIONS);
};
/**
Returns the details link from the JSON response
@return {string} or null
**/
ContentStoreObject.prototype.getDetailsLink = function(oData) {
return this._getMetaLinksURL(oData, this.DETAILS);
};
/**
Returns the output's report version self link from the JSON response
@return {string} or null
**/
ContentStoreObject.prototype.getOutputsLink = function(oData) {
var output = oData[this.OUTPUT] && oData[this.OUTPUT][0];
return output && this._getMetaLinksURL(output, this.OUTPUTS) || null;
};
/**
Returns the output's report version self link from the JSON response
@return {string} or null
**/
ContentStoreObject.prototype.getVersionLink = function(oData) {
var output = oData[this.OUTPUT] && oData[this.OUTPUT][0];
return output && this.getSelfLink(output) || null;
};
/**
Returns the output content link from the JSON response
@return {string} or null
**/
ContentStoreObject.prototype.getOutputContentLink = function(oData) {
return this._getMetaLinksURL(oData, this.CONTENT);
};
/**
Returns the models link from the JSON response
@return {string} or null
**/
ContentStoreObject.prototype.getModelsLink = function(oData) {
return this._getMetaLinksURL(oData, this.MODELS);
};
/**
Returns the saved report's options list from the JSON response
@return {string} or null
**/
ContentStoreObject.prototype.getDetailsReportVersionOptions = function(oData) {
return oData[this.REQUEST_ARGUMENTS] && oData[this.REQUEST_ARGUMENTS][this.OPTIONS] || null;
};
/**
Returns the saved report's options list from the JSON response
@return {string} or null
**/
ContentStoreObject.prototype.getDetailsReportVersionParameters = function(oData) {
return oData[this.REQUEST_ARGUMENTS] && oData[this.REQUEST_ARGUMENTS][this.PARAMETERS] || null;
};
/**
@return {string} - the owner name
**/
ContentStoreObject.prototype.getOwnerName = function(oData) {
if (!oData || !oData[this.OWNER]) {
return StringResource.get('unknown');
}
if (!$.isArray(oData[this.OWNER])) {
return oData[this.OWNER];
} else if (oData[this.OWNER][0] && oData[this.OWNER][0][this.DEFAULT_NAME]) {
// check if the givenName, surName, and userName are available, otherwise display the defaultName
if((oData[this.GIVENNAME] && oData[this.SURNAME]) && (oData[this.OWNER][0][this.DEFAULT_NAME] === oData.defaultName)){
return oData[this.GIVENNAME] + ' ' + oData[this.SURNAME];
} else{
return oData[this.OWNER][0][this.DEFAULT_NAME];
}
}
return StringResource.get('unknown');
};
/**
@return {string} - the object name
**/
ContentStoreObject.prototype.getObjectName = function(oData) {
if (!oData || !oData.defaultName) {
return StringResource.get('unknown');
}
return oData.defaultName;
};
/**
@return {string} or null - the owner ID
**/
ContentStoreObject.prototype.getOwnerId = function(oData) {
if (!oData[this.OWNER] || oData[this.OWNER].length < 1) {
return null;
}
return oData[this.OWNER][0] && oData[this.OWNER][0][this.ID] || null;
};
/**
@return {string} or null - the owner self link
**/
ContentStoreObject.prototype.getOwnerSelfLink = function(oData) {
return (oData[this.OWNER] && oData[this.OWNER].length > 0) ? this.getSelfLink(oData[this.OWNER][0]) : null;
};
/**
@return {boolean} - returns true if the current user is the owner of the item
**/
ContentStoreObject.prototype.isOwner = function(oData) {
var oDataOwnerId = this.getOwnerId(oData);
return !!(oDataOwnerId && oDataOwnerId === this.glassContext.getCoreSvc('.UserProfile').preferences.id);
};
/**
Returns the requested time from the JSON reponse
@formated {boolean} - should the response be formated
@formatLength {string} - if the response is to be formated, then specify the length of the formar (short|medium|long)
**/
ContentStoreObject.prototype.getRequestedTime = function(oData, formated, formatLength) {
return this._getFormatedDateTime(oData, formated, formatLength, this.REQUESTED_TIME, true);
};
/**
Returns report's actual execution time from the JSON reponse
@formated {boolean} - should the response be formated
@formatLength {string} - if the response is to be formated, then specify the length of the formar (short|medium|long)
**/
ContentStoreObject.prototype.getExecutionTime = function(oData, formated, formatLength) {
return this._getFormatedDateTime(oData, formated, formatLength, this.EXECUTION_TIME, true);
};
/**
Returns report's actual completion time from the JSON reponse
@formated {boolean} - should the response be formated
@formatLength {string} - if the response is to be formated, then specify the length of the formar (short|medium|long)
**/
ContentStoreObject.prototype.getCompletionTime = function(oData, formated, formatLength) {
return this._getFormatedDateTime(oData, formated, formatLength, this.COMPLETION_TIME, true);
};
/**
Returns the creation date (no time) from the JSON reponse. Used for backwards compatibility.
@formated {boolean} - should the response be formated
@formatLength {string} - if the response is to be formated, then specify the length of the formar (short|medium|long)
**/
ContentStoreObject.prototype.getCreationTime = function(oData, formated, formatLength) {
return this._getFormatedDateTime(oData, formated, formatLength, this.CREATION_TIME, false);
};
/**
Returns the creation time from the JSON reponse
@formated {boolean} - should the response be formated
@formatLength {string} - if the response is to be formated, then specify the length of the formar (short|medium|long)
@includeTime {boolean} - should the formated response include the time
**/
ContentStoreObject.prototype.getCreationDate = function(oData, formated, formatLength, includeTime) {
return this._getFormatedDateTime(oData, formated, formatLength, this.CREATION_TIME, includeTime);
};
/**
Returns the modification time from the JSON reponse
@formated {boolean} - should the response be formated
@formatLength {string} - if the response is to be formated, then specify the length of the formar (short|medium|long)
**/
ContentStoreObject.prototype.getModificationTime = function(oData, formated, formatLength, includeTime) {
return this._getFormatedDateTime(oData, formated, formatLength, this.MODIFICATION_TIME, includeTime);
};
ContentStoreObject.prototype.getRunHistoryConfig = function(oData) {
return this._getRetentionPropertyInfo('history', oData);
};
ContentStoreObject.prototype.getReportOutputVersionsConfig = function(oData) {
return this._getRetentionPropertyInfo('reportVersion', oData);
};
ContentStoreObject.prototype._getRetentionPropertyInfo = function(propertyName, oData) {
if (!oData.retentions) {
return null;
}
var length = oData.retentions.length;
for (var i = 0; i < length; i += 1) {
if (oData.retentions[i].objectClass === propertyName) {
return oData.retentions[i];
}
}
return null;
};
ContentStoreObject.prototype.getLocation = function(oData, appendDefaultName) {
var ancestors = this.getAncestors(oData);
if (!ancestors) {
return null;
}
var ancestorNames = [];
ancestors.forEach(function(ancestor) {
ancestorNames.push(ancestor.defaultName);
});
if (appendDefaultName && this.getName(oData)) {
ancestorNames.push(this.getName(oData));
}
return ancestorNames.join(' > ');
};
ContentStoreObject.prototype.getName = function(oData) {
return oData[this.DEFAULT_NAME];
};
ContentStoreObject.prototype.hasBase = function(oData) {
// search results return base as a 'reference'
return this.getBase(oData) || (oData[this.REFERENCES] && oData[this.REFERENCES][0]);
};
ContentStoreObject.prototype.getBase = function(oData) {
return oData[this.BASE] && oData[this.BASE][0] || null;
};
ContentStoreObject.prototype.getPermissionsAndBasePermissions = function (oData, fetch, refresh) {
if (fetch) {
if (!refresh && oData[this.PERMISSIONS] && this.getBasePermissions(oData)) {
return Promise.resolve({
permissions: oData[this.PERMISSIONS],
base: oData[this.BASE]
});
} else {
return this.glassContext.getCoreSvc('.Ajax').ajax({
'url': this.getSelfLink(oData) + '?fields=permissions,base.permissions',
'dataType': 'json',
'type': 'GET'
})
.then(function(response) {
var data = response.data;
return {
permissions: data.data[0].permissions,
base: data.data[0].base
};
});
}
} else {
if (oData) {
return {
permissions: oData[this.PERMISSIONS],
base: oData[this.BASE]
};
}
return null;
}
};
ContentStoreObject.prototype.getPermissionsOwnerIdAndBasePermissions = function (oData, fetch, refresh) {
if (fetch) {
if (!refresh && oData[this.PERMISSIONS] && this.getOwnerId(oData) && this.getBasePermissions(oData)) {
return Promise.resolve({
permissions: oData[this.PERMISSIONS],
owner: oData[this.OWNER],
base: oData[this.BASE]
});
} else {
return this.glassContext.getCoreSvc('.Ajax').ajax({
'url': this.getSelfLink(oData) + '?fields=permissions,owner.id,base.permissions',
'dataType': 'json',
'type': 'GET'
})
.then(function(response) {
var data = response.data;
return {
permissions: data.data[0].permissions,
owner: data.data[0].owner,
base: data.data[0].base
};
});
}
} else {
if (oData) {
return {
permissions: oData[this.PERMISSIONS],
owner: oData[this.OWNER],
base: oData[this.BASE]
};
}
return null;
}
};
ContentStoreObject.prototype.getPermissionsAndMetadataModelPackageEffectiveUserCapabilities = function (oData, fetch) {
if (fetch) {
if (oData[this.PERMISSIONS] && this.getMetadataModelPackageEffectiveUserCapabilities(oData)) {
return Promise.resolve({
permissions: oData[this.PERMISSIONS],
metadataModelPackage: oData[this.METADATA_MODEL_PACKAGE]
});
} else {
return this.glassContext.getCoreSvc('.Ajax').ajax({
'url': this.getSelfLink(oData) + '?fields=permissions,metadataModelPackage.effectiveUserCapabilities',
'dataType': 'json',
'type': 'GET'
})
.then(function(response) {
var data = response.data;
return {
permissions: data.data[0].permissions,
metadataModelPackage: data.data[0].metadataModelPackage
};
});
}
} else {
if (oData) {
return {
permissions: oData[this.PERMISSIONS],
metadataModelPackage: oData[this.METADATA_MODEL_PACKAGE]
};
}
return null;
}
};
ContentStoreObject.prototype.getPermissionsOwnerIdAndMetadataModelPackageEffectiveUserCapabilities = function (oData, fetch) {
if (fetch) {
if (oData[this.PERMISSIONS] && this.getOwnerId(oData) && this.getMetadataModelPackageEffectiveUserCapabilities(oData)) {
return Promise.resolve({
permissions: oData[this.PERMISSIONS],
owner: oData[this.OWNER],
metadataModelPackage: oData[this.METADATA_MODEL_PACKAGE]
});
} else {
return this.glassContext.getCoreSvc('.Ajax').ajax({
'url': this.getSelfLink(oData) + '?fields=permissions,owner.id,metadataModelPackage.effectiveUserCapabilities',
'dataType': 'json',
'type': 'GET'
})
.then(function(response) {
var data = response.data;
return {
permissions: data.data[0].permissions,
owner: data.data[0].owner,
metadataModelPackage: data.data[0].metadataModelPackage
};
});
}
} else {
if (oData) {
return {
permissions: oData[this.PERMISSIONS],
owner: oData[this.OWNER],
metadataModelPackage: oData[this.METADATA_MODEL_PACKAGE]
};
}
return null;
}
};
ContentStoreObject.prototype.getPermissionsAndCapabilities = function (oData, fetch) {
if (fetch) {
if (oData[this.PERMISSIONS] && oData[this.EFFECTIVE_USER_CAPABILITIES]) {
return Promise.resolve({
permissions: oData[this.PERMISSIONS],
effectiveUserCapabilities: oData[this.EFFECTIVE_USER_CAPABILITIES]
});
} else {
return this.glassContext.getCoreSvc('.Ajax').ajax({
'url': this.getSelfLink(oData) + '?fields=permissions,effectiveUserCapabilities',
'dataType': 'json',
'type': 'GET'
})
.then(function(response) {
var data = response.data;
return {
permissions: data.data[0].permissions,
effectiveUserCapabilities: data.data[0].effectiveUserCapabilities
};
});
}
} else {
if (oData) {
return {
permissions: oData[this.PERMISSIONS],
effectiveUserCapabilities: oData[this.EFFECTIVE_USER_CAPABILITIES]
};
}
return null;
}
};
ContentStoreObject.prototype.getPermissionsOwnerIdAndCapabilities = function (oData, fetch) {
if (fetch) {
if (oData[this.PERMISSIONS] && this.getOwnerId(oData) && oData[this.EFFECTIVE_USER_CAPABILITIES]) {
return Promise.resolve({
permissions: oData[this.PERMISSIONS],
owner: oData[this.OWNER],
effectiveUserCapabilities: oData[this.EFFECTIVE_USER_CAPABILITIES]
});
} else {
return this.glassContext.getCoreSvc('.Ajax').ajax({
'url': this.getSelfLink(oData) + '?fields=permissions,owner.id,effectiveUserCapabilities',
'dataType': 'json',
'type': 'GET'
})
.then(function(response) {
var data = response.data;
return {
permissions: data.data[0].permissions,
owner: data.data[0].owner,
effectiveUserCapabilities: data.data[0].effectiveUserCapabilities
};
});
}
} else {
if (oData) {
return {
permissions: oData[this.PERMISSIONS],
owner: oData[this.OWNER],
effectiveUserCapabilities: oData[this.EFFECTIVE_USER_CAPABILITIES]
};
}
return null;
}
};
ContentStoreObject.prototype.getPermissions = function(oData, fetch) {
if (fetch) {
if (oData[this.PERMISSIONS]) {
return Promise.resolve(oData[this.PERMISSIONS]);
} else {
return this.glassContext.getCoreSvc('.Ajax').ajax({
'url': this.getSelfLink(oData) + '?fields=permissions',
'dataType': 'json',
'type': 'GET'
})
.then(function(response) {
var data = response.data;
return data.data[0].permissions;
});
}
} else {
return oData ? oData[this.PERMISSIONS] : null;
}
};
ContentStoreObject.prototype.getDefaultPortalAction = function(oData, fetch) {
if (fetch) {
if (oData[this.DEFAULT_PORTAL_ACTION]) {
return Promise.resolve(oData[this.DEFAULT_PORTAL_ACTION]);
} else {
return this.glassContext.getCoreSvc('.Ajax').ajax({
url: this.getSelfLink(oData) + '?fields=defaultPortalAction',
dataType: 'json',
type: 'GET'
})
.then(function(response) {
var data = response.data;
return data.data[0].defaultPortalAction;
});
}
} else {
return oData ? oData[this.DEFAULT_PORTAL_ACTION] : null;
}
};
ContentStoreObject.prototype.getTargetDefaultPortalAction = function(oData, fetch) {
if (fetch) {
if (oData[this.DEFAULT_PORTAL_ACTION]) {
return Promise.resolve(oData[this.DEFAULT_PORTAL_ACTION]);
} else {
return this.glassContext.getCoreSvc('.Ajax').ajax({
url: this.getSelfLink(oData) + '?fields=target.defaultPortalAction',
dataType: 'json',
type: 'GET'
})
.then(function(response) {
var data = response.data;
return data.data[0].target[0].defaultPortalAction;
});
}
} else {
return oData ? oData[this.DEFAULT_PORTAL_ACTION] : null;
}
};
ContentStoreObject.prototype.getTargetFileNameFromSearchPath = function(searchPath) {
if (searchPath){
var splitPath = searchPath.split('/');
if (splitPath.length > 0) {
splitPath = splitPath[splitPath.length -1].split('\'');
return splitPath[1];
}
}
return null;
};
ContentStoreObject.prototype.getTargetSearchPath = function(oData, fetch) {
if (fetch) {
if (oData.target && oData.target.length && oData.target[0].searchPath) {
return Promise.resolve(oData.target[0]);
}
return this.glassContext.getCoreSvc('.Ajax').ajax({
url: this.getSelfLink(oData) + '?fields=target.searchPath',
dataType: 'json',
type: 'GET'
})
.then(function(response) {
var data = response.data;
if (data.data && data.data.length && data.data[0].target && data.data[0].target.length) {
return data.data[0].target[0];
}
});
} else {
if (oData && oData.target && oData.target.length) {
return oData.target[0];
}
}
return null;
};
ContentStoreObject.prototype.hasPermissions = function(oData, permissionsArray) {
var oPermArray = this.getPermissions(oData);
if (!oPermArray) {
return false;
}
return _.intersection(oPermArray, permissionsArray).length === permissionsArray.length;
};
/**
* Returns true if the given asset has the given tag
* @return {boolean}
*/
ContentStoreObject.prototype.hasTag = function(oData, tag) {
return !!(oData[this.TAGS] && oData[this.TAGS].indexOf(tag) !== -1);
};
ContentStoreObject.prototype.getDescription = function(oData) {
var description = oData[this.DEFAULT_DESCRIPTION];
if (_.isEmpty(description)) {
var base = this.getBase(oData);
if (base) {
description = base[this.DEFAULT_DESCRIPTION];
}
}
return description;
};
ContentStoreObject.prototype.getReportRetentions = function(oData) {
if (oData.retentions === null || $.isEmptyObject(oData.retentions)) {
oData.retentions = [];
}
return oData.retentions;
};
ContentStoreObject.prototype.getOptions = function(oData) {
if (oData[this.OPTIONS] === null || $.isEmptyObject(oData[this.OPTIONS])) {
oData[this.OPTIONS] = [];
}
return oData[this.OPTIONS];
};
ContentStoreObject.prototype.getOption = function(oData, name) {
var options = this.getOptions(oData);
if (options) {
for (var i = 0; i < options.length; i = i + 1) {
if (options[i].name === name) {
if (options[i].value instanceof Array) {
return options[i].value[0];
}
return options[i].value;
}
}
}
return null;
};
ContentStoreObject.prototype.getRunAsOwner = function(oData) {
return oData[this.RUN_AS_OWNER] || false;
};
ContentStoreObject.prototype.getRunWithOwnerCapabilities = function(oData) {
return oData[this.RUN_WITH_OWNER_CAPABILITIES] || false;
};
/**
* Returns the ContentStoreObject associated with the report property
*/
ContentStoreObject.prototype.getRunAsOwnerValue = function(oData) {
var runAsOwnerValue = this.getRunWithOwnerCapabilities(oData) ? this.RUN_WITH_OWNER_CAPABILITIES : this.RUN_AS_USER;
runAsOwnerValue = this.getRunAsOwner(oData) ? this.RUN_AS_OWNER : runAsOwnerValue;
return runAsOwnerValue;
};
ContentStoreObject.prototype.getStatus = function(oData) {
return oData[this.STATUS] || false;
};
ContentStoreObject.prototype.getMessages = function(oData) {
return oData[this.MESSAGES] || false;
};
ContentStoreObject.prototype.getMessageDetail = function(oData) {
return oData[this.MESSAGES_DETAIL] || false;
};
ContentStoreObject.prototype.getMessageSeverity = function(oData) {
return oData[this.MESSAGES_SEVERITY] || false;
};
ContentStoreObject.prototype.getFormat = function(oData) {
return oData[this.FORMAT] || false;
};
ContentStoreObject.prototype.getLocale = function(oData) {
return oData[this.LOCALE] || false;
};
ContentStoreObject.prototype.getBurstKey = function(oData) {
return oData[this.BURSTKEY] || false;
};
ContentStoreObject.prototype.getHidden = function(oData) {
var hidden = oData[this.HIDDEN] ? oData[this.HIDDEN].toString() : 'false';
return hidden.toLowerCase() === 'true';
};
ContentStoreObject.prototype.getDisabled = function(oData) {
var disabled = oData[this.DISABLED] ? oData[this.DISABLED].toString() : 'false';
var isTargetDisabled = this.isTargetDisabled(oData);
return disabled.toLowerCase() === 'true' || isTargetDisabled;
};
ContentStoreObject.prototype.isTargetDisabled = function(oData) {
if (oData.target && oData.target.length && oData.target[0]) {
return oData.target[0][this.DISABLED];
}
return false;
};
ContentStoreObject.prototype.getAncestors = function(oData) {
if (!oData[this.ANCESTORS] || oData[this.ANCESTORS].length === 0) {
return null;
}
// We hide the fact that My content is My Folders, so trim all those ancestors
var rootAncestor = oData[this.ANCESTORS][0];
if (rootAncestor.type) {
var rootType = rootAncestor.type.toLowerCase();
if (rootType === 'directory' && rootAncestor.id !== '.my_folders') {
do {
rootAncestor = oData[this.ANCESTORS].shift();
} while (oData[this.ANCESTORS].length > 0 && oData[this.ANCESTORS][0].type !== 'folder');
oData[this.ANCESTORS][0] = (this.getRootMyFoldersAncestors());
} else if (rootType === 'content') {
oData[this.ANCESTORS][0] = (this.getRootPublicFoldersAncestor());
}
}
return oData[this.ANCESTORS];
};
ContentStoreObject.prototype.ancestorsEqual = function(ancestor1, ancestor2) {
if (!ancestor1 || !ancestor2) {
return false;
}
if (ancestor1.length !== ancestor2.length) {
return false;
}
for (var i = 0; i < ancestor1.length; i = i + 1) {
if (ancestor1[i].id !== ancestor2[i].id) {
return false;
}
}
return true;
};
ContentStoreObject.prototype.getHistoryConfig = function(oData) {
return oData[this.HISTORY] && JSON.parse(oData[this.HISTORY]);
};
ContentStoreObject.prototype.getDataDescriptor = function(oData) {
return oData && oData.dataDescriptor || {};
};
ContentStoreObject.prototype.buildAncestorEntry = function(oData) {
var ancestorEntry = {};
ancestorEntry[this.ID] = oData[this.ID];
if (this._isUserFolder(oData)) {
ancestorEntry[this.DEFAULT_NAME] = this._getUserFolderName(oData);
} else {
ancestorEntry[this.DEFAULT_NAME] = oData[this.DEFAULT_NAME];
}
if (oData[this.META]) {
ancestorEntry[this.META] = oData[this.META];
} else {
// Mostly for search
var selfLink = this.getSelfLink(oData);
var url = this.getItemsLink(oData);
if (!url) {
url = selfLink + '/items';
}
ancestorEntry[this.META] = this._buildMetaSection(url, selfLink);
}
ancestorEntry[this.TYPE] = oData[this.TYPE];
ancestorEntry[this.PERMISSIONS] = oData[this.PERMISSIONS];
return ancestorEntry;
};
ContentStoreObject.prototype.buildAncestorTree = function(oData) {
var ancestors = [];
if (oData[this.ANCESTORS]) {
_.each(this.getAncestors(oData), function(ancestor) {
ancestors.push(this.buildAncestorEntry(ancestor));
}.bind(this));
ancestors.push(this.buildAncestorEntry(oData));
}
return ancestors;
};
ContentStoreObject.prototype._buildMetaSection = function(url, selfUrl) {
var items = {};
items[this.MIME_TYPE] = 'application/json';
items[this.URL] = url;
var self = {};
self[this.MIME_TYPE] = 'application/json';
self[this.URL] = selfUrl;
var links = {};
links[this.ITEMS] = items;
links[this.SELF] = self;
var meta = {};
meta[this.LINKS] = links;
return meta;
};
ContentStoreObject.prototype.getRootPublicFoldersAncestor = function() {
var rootPublicFolderName = ContentServiceUrls.getRootPublicFolderName();
var publicFolderUrl = ContentServiceUrls.getPublicFoldersURL();
var ancestorEntry = {};
ancestorEntry[this.ID] = '.public_folders';
ancestorEntry[this.DEFAULT_NAME] = rootPublicFolderName ? rootPublicFolderName : StringResource.get('teamContent');
ancestorEntry[this.META] = this._buildMetaSection(publicFolderUrl + '/items', publicFolderUrl);
ancestorEntry[this.TYPE] = 'content';
return ancestorEntry;
};
ContentStoreObject.prototype.getRootMyFoldersAncestors = function() {
var rootMyFoldersName = ContentServiceUrls.getRootMyFolderName();
var myFoldersUrl = ContentServiceUrls.getMyFoldersURL();
var ancestorEntry = {};
ancestorEntry[this.ID] = '.my_folders';
ancestorEntry[this.DEFAULT_NAME] = rootMyFoldersName ? rootMyFoldersName : StringResource.get('myContent');
ancestorEntry[this.META] = this._buildMetaSection(myFoldersUrl + '/items', myFoldersUrl);
ancestorEntry[this.TYPE] = 'directory';
return ancestorEntry;
};
ContentStoreObject.prototype.getRootOtherUsersFoldersAncestors = function(options) {
var ancestorEntry = {};
ancestorEntry[this.ID] = '.other_users_folders';
ancestorEntry[this.DEFAULT_NAME] = options.defaultName || '';
var url = ContentServiceUrls.getOtherUsersFoldersURL();
ancestorEntry[this.META] = this._buildMetaSection(url + '/items', url);
ancestorEntry[this.TYPE] = 'folder';
return ancestorEntry;
};
ContentStoreObject.prototype.getRootNamespacesAncestors = function() {
var baseNamespaceUrl = ContentServiceUrls.getBaseNamespaceURL();
var ancestorEntry = {};
ancestorEntry[this.ID] = '.directory';
ancestorEntry[this.DEFAULT_NAME] = StringResource.get('directory');
ancestorEntry[this.META] = this._buildMetaSection(baseNamespaceUrl, baseNamespaceUrl);
ancestorEntry[this.TYPE] = 'directory';
return ancestorEntry;
};
ContentStoreObject.prototype.getExecutionPrompt = function(oData) {
return (oData[this.EXECUTION_PROMPT]!==undefined) ? oData[this.EXECUTION_PROMPT] : true;
};
ContentStoreObject.prototype.getOptionValue = function(oData, optionName, defaultValue) {
var foundOption = _.find(oData.options, function(option) {
return (option.name === optionName);
});
return foundOption === undefined? defaultValue : foundOption.value;
};
ContentStoreObject.prototype.getParameters = function(oData) {
return oData[this.PARAMETERS] || [];
};
ContentStoreObject.prototype.getAllowNotification = function(oData){
return oData[this.OPTION_ENABLE_ALLOW_NOTIFICATION] || null;
};
ContentStoreObject.prototype.getPromptsDisplayValues = function(parameters, forWrapText) {
var i;
var values = [];
if (parameters) {
for (i = 0; i < parameters.length; i = i + 1) {
var value = parameters[i].value;
var displayValue = '';
for (var j = 0; j < value.length; j = j + 1) {
if (j === 0) {
displayValue = displayValue + this.buildPromptsDisplayValues(value[j]);
} else {
if (forWrapText) {
displayValue = displayValue + ', ' + this.buildPromptsDisplayValues(value[j]);
} else {
displayValue = displayValue + ',' + this.buildPromptsDisplayValues(value[j]);
}
}
}
values.push({
'name': parameters[i].name,
'display': displayValue
});
}
}
return values;
};
ContentStoreObject.prototype.buildPromptsDisplayValues = function(value) {
var displayValue;
var use = value.use ? value.use : null;
if (value.type === 'simpleParmValueItem') {
displayValue = ((typeof value.display === 'undefined') || (value.display === '')) ? use : value.display;
} else if (value.type === 'boundRangeParmValueItem') {
if (value.start || value.end) {
displayValue = StringResource.get('between');
if (value.start) {
displayValue += ' ';
displayValue += ((typeof value.start.display === 'undefined') || (value.start.display === '')) ? value.start.use : value.start.display;
displayValue += ' ';
} else {
displayValue += ' ';
}
displayValue += StringResource.get('and');
if (value.end) {
displayValue += ' ';
displayValue += ((typeof value.end.display === 'undefined') || (value.end.display === '')) ? value.end.use : value.end.display;
}
}
} else if (value.type === 'unboundedEndRangeParmValueItem') {
if (value.start) {
var upperboundValue = ((typeof value.start.display === 'undefined') || (value.start.display === '')) ? value.start.use : value.start.display;
displayValue = StringResource.get('greaterOrEqual', {
'upperboundValue' : upperboundValue
});
}
} else if (value.type === 'unboundedStartRangeParmValueItem') {
if (value.end) {
var lowerboundValue = ((typeof value.end.display === 'undefined') || (value.end.display === '')) ? value.end.use : value.end.display;
displayValue = StringResource.get('lessOrEqual', {
'lowerboundValue' : lowerboundValue
});
}
}
return displayValue;
};
ContentStoreObject.prototype.getModule = function(oData) {
return oData[this.MODULE] && oData[this.MODULE][0] || null;
};
ContentStoreObject.prototype.getMetadataModelPackage = function(oData) {
return oData[this.METADATA_MODEL_PACKAGE] && oData[this.METADATA_MODEL_PACKAGE][0] || null;
};
ContentStoreObject.prototype.getBaseMetadataModelPackage = function(oData) {
var baseMetaDataModelPackage = oData[this.BASE] && oData[this.BASE][0] && oData[this.BASE][0][this.METADATA_MODEL_PACKAGE];
return baseMetaDataModelPackage && baseMetaDataModelPackage[0] || null;
};
ContentStoreObject.prototype.getBasePermissions = function (oData) {
if (oData[this.BASE] && oData[this.BASE][0] && oData[this.BASE][0][this.PERMISSIONS]) {
return oData[this.BASE][0][this.PERMISSIONS];
}
return null;
};
ContentStoreObject.prototype.getMetadataModelPackageEffectiveUserCapabilities = function (oData) {
if (oData[this.METADATA_MODEL_PACKAGE] && oData[this.METADATA_MODEL_PACKAGE][0] && oData[this.METADATA_MODEL_PACKAGE][0][this.EFFECTIVE_USER_CAPABILITIES]) {
return oData[this.METADATA_MODEL_PACKAGE][0][this.EFFECTIVE_USER_CAPABILITIES];
}
return null;
};
ContentStoreObject.prototype.getBaseModule = function(oData) {
var baseModule = oData[this.BASE] && oData[this.BASE][0] && oData[this.BASE][0][this.MODULE];
return baseModule && baseModule[0] || null;
};
ContentStoreObject.prototype.getRunInAdvancedViewer = function(oData) {
return !!oData[this.RUN_IN_ADVANCED_VIEWER];
};
ContentStoreObject.prototype.getEffectiveUserCapabilities = function(oData, fetch) {
if (fetch) {
if (oData[this.EFFECTIVE_USER_CAPABILITIES]) {
return Promise.resolve(oData[this.EFFECTIVE_USER_CAPABILITIES]);
} else {
return this.glassContext.getCoreSvc('.Ajax').ajax({
'url': this.getSelfLink(oData) + '?fields=effectiveUserCapabilities',
'dataType': 'json',
'type': 'GET'
}).then(function(response) {
var data = response.data;
oData[this.EFFECTIVE_USER_CAPABILITIES] = data.data[0].effectiveUserCapabilities;
return oData[this.EFFECTIVE_USER_CAPABILITIES];
}.bind(this));
}
} else {
return oData ? oData[this.EFFECTIVE_USER_CAPABILITIES] : null;
}
};
ContentStoreObject.prototype.hasCapabilities = function (oData, capabilitiesArray) {
var oCapabilitiesArray = this.getEffectiveUserCapabilities(oData);
if (!oCapabilitiesArray) {
return false;
}
return _.intersection(oCapabilitiesArray, capabilitiesArray).length === capabilitiesArray.length;
};
ContentStoreObject.prototype.canBurst = function(oData) {
var base = this.getBase(oData);
return oData.canBurst || (base && base.canBurst);
};
var _static = {
getInstance: function() {
if (!_singletonInstance) {
_singletonInstance = new ContentStoreObject();
}
return _singletonInstance;
}
};
return _static.getInstance();
});
!function(a,s){if("object"==typeof exports&&"object"==typeof module)module.exports=s(require("@ba-ui-toolkit/ba-graphics/dist/illustrations-js/ba-graphics-icons-commons.js"));else if("function"==typeof define&&define.amd)define('bacontentnav/lib/@ba-ui-toolkit/ba-graphics/dist/illustrations-js/no-detail_128',["@ba-ui-toolkit/ba-graphics/dist/illustrations-js/ba-graphics-icons-commons.js"],s);else{var t=s("object"==typeof exports?require("@ba-ui-toolkit/ba-graphics/dist/illustrations-js/ba-graphics-icons-commons.js"):a["@ba-ui-toolkit/ba-graphics/dist/illustrations-js/ba-graphics-icons-commons.js"]);for(var c in t)("object"==typeof exports?exports:a)[c]=t[c]}}("undefined"!=typeof self?self:this,function(a){return webpackJsonPBaGraphics([68],{"3865314c5959606874d4":function(s,t){s.exports=a},"81b6137299c348072845":function(a,s,t){"use strict";var c=t("9689a9c94ae38b47fa2c"),i=t.n(c),h=t("9ce58a7deea14f49ef01"),r=t.n(h),l=new i.a({id:"no-detail_128_v7",use:"no-detail_128_v7-usage",viewBox:"0 0 200 200",content:'