propertiesBundle.js 64 KB

12345678910
  1. /**
  2. * IBM Confidential OCO Source Materials IBM Business Platform: Content Apps
  3. * (C) Copyright IBM Corp. 2016, 2018
  4. *
  5. * The source code for this program is not published or otherwise divested of
  6. * its trade secrets, irrespective of what has been deposited with the U.S.
  7. * Copyright Office
  8. */
  9. define("bi/content_apps/common/ui/permissions/Policy",[],function(){"use strict";function o(e,t,i,n){if(!(this instanceof o))throw new TypeError("Policy constructor cannot be called as a function.");this.permissions=[{name:"read",access:"grant"},{name:"traverse",access:"grant"}],this.securityObject={defaultName:e,id:t,type:i,searchPath:n}}return o.prototype={constructor:o},o}),define("text!bi/content_apps/common/policyfacets.json",[],function(){return'{\n\t"copyright": "Licensed Materials - Property of IBM. IBM Cognos Products: BI Cloud(C) Copyright IBM Corp.2014, 2017. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.",\n\t"facets": {\n "accounts": "account",\n "groups": "group",\n "roles": "role"\n\t},\n\t"columns": []\n}'}),define("bi/content_apps/common/PolicyPropertyView",["bacontentnav/common/ContentListPageView","bi/content_apps/common/ui/permissions/Policy","text!./policyfacets.json","bi/content_apps/nls/StringResource","bacontentnav/lib/@waca/core-client/js/core-client/ui/properties/CheckBox","bacontentnav/utils/ContentStoreObject","bi/commons/ui/Button","bacontentnav/utils/PolicyHelper","bacontentnav/common/ui/BreadcrumbDropDown","bacontentnav/utils/GlassContextHelper","bacontentnav/lib/@waca/core-client/js/core-client/ui/properties/PropertyUIControl","underscore"],function(e,c,t,o,i,s,n,r,a,l,p,u){"use strict";var d=e.extend({init:function(e){this.itemURL=e.itemURL,this.showUnavailablePolicies=!1,d.inherited("init",this,arguments),u.extend(this,e),this.addURLParameters({schemaInfo:"true",fields:"surname,givenName,userName,defaultName,policies.defaultName,policies.id,policies.ancestors,permissions"}),this.contentListFacets=JSON.parse(t).facets},getPoliciesData:function(){return Promise.resolve(this.permissionsData)},_canModifyPolicies:function(e){this.canModifyPolicies=void 0===e?s.hasPermissions(this.oData.data[0],["setPolicy"])&&!s.isPoliciesAcquired(this.oData.data[0]):e},_getObject:function(){var e=this.getURLParameters(),i=this._getDefaultRequestURL();$.each(e,function(e,t){i===this.itemURL?i+="?":i+="&",i+=e+"="+t}.bind(this));var t={dataType:"json",type:"GET",data:{},url:i,cache:!1};return this.glassContext.getCoreSvc(".Ajax").ajax(t).then(function(e){return e&&e.data})},_setOData:function(e){var t=[];this.rejectedPolicies=[],e.data[0].policies&&(e.data[0].policies.forEach(function(e){"nil"===e.securityObject.type?this.rejectedPolicies.push(e):t.push(e)}.bind(this)),e.data[0].policies=t),this.oData=e},_showHideAddMemberButton:function(e){var t="0";e&&this.canModifyPolicies?this.contentBar.itemMap.add.show():(this.contentBar.itemMap.add.hide(),t="-1"),$(this.contentBar.itemMap.add.el).find("button").attr("tabindex",t)},_updateUIForEdit:function(){var e=s.isTeamContent(this.oData.data[0]),t=this.getListControl();if(this.applyToChildren=this._oPropertyUIControl.getProperty("applyToAllChildren"),e)this.contentBar.itemMap.add&&this._showHideAddMemberButton(!0);else{var i=this._oPropertyUIControl.getProperty("overrideParent").isChecked();this._canModifyPolicies(i),i?this.applyToChildren.enable():(t._clearRows(),this.multiselectBar.hide(),this.contentBar.show(),this.applyToChildren.uncheck(),this.applyToChildren.disable()),t.multiSelect=i,this.$el.removeClass("policyCanNotModify"),this.canModifyPolicies&&i||this.$el.addClass("policyCanNotModify"),this.contentBar.itemMap.add&&this._showHideAddMemberButton(i)}},render:function(){return this._getObject().then(function(e){return this._setOData(e),this.permissionsData={},this.permissionsData.data=e.data[0].policies?e.data[0].policies:[],this._canModifyPolicies(),d.inherited("render",this,arguments).then(function(){return this._updateUIForEdit(),Promise.resolve()}.bind(this))}.bind(this))},_overrideParentChanged:function(){this._updateUIForEdit(),this._enableApplyItems()},renderContent:function(){this.$el.addClass("policies"),this.$contentBars=this.$el.children().detach();var e=[];return this.rejectedPolicies&&0<this.rejectedPolicies.length&&e.push({type:"SingleLineLinks",name:"hidePolicies",items:[{align:"left",items:[{type:"text",class:"versionStatusText",value:o.get("missingPolicies"),svgIcon:"common-warning"}]}]},{type:"CheckBox",name:"showUnavailablePolicies",label:o.get("showUnavailablePolicies"),controlOnLeft:!0,checked:this.showUnavailablePolicies,onChange:this._toggleShowUnavailablePolicies.bind(this)}),s.isTeamContent(this.oData.data[0])||e.push({type:"CheckBox",name:"overrideParent",label:o.get("overrideParentPermissions"),controlOnLeft:!0,checked:!s.isPoliciesAcquired(this.oData.data[0]),onChange:this._overrideParentChanged.bind(this)}),e.push({module:"bi/content_apps/ui/RenderCallback",renderCallback:this._renderListControl.bind(this)},{type:"CheckBox",name:"applyToAllChildren",label:o.get("applyToAllChildren"),controlOnLeft:!0,onChange:this._enableApplyItems.bind(this)},{type:"Footer",items:[{type:"Button",label:o.get("applyLabel"),onSelect:this._onApplyClick.bind(this),primary:!0},{type:"Button",label:o.get("cancel"),onSelect:this._onCancelClick.bind(this),primary:!1}]}),this._oPropertyUIControl=new p({el:this.$el,glassContext:this.glassContext,items:e}),this._oPropertyUIControl.render().then(function(){var e;return e=this._getFooter()._oPropertyUIControl.getProperties(),this.applyButton=e[0],this.applyButton.disable(),Promise.resolve()}.bind(this))},_getFooter:function(){var t;return this._oPropertyUIControl.getProperties().forEach(function(e){"Footer"===e.type&&(t=e)}),t},_renderListControl:function(e){var t=$("<div></div>");return $(e).append(t),t.append(this.$contentBars),this.renderContentList({el:t,columns:this._getColumnSpecification(),$container:this.$el.closest(".propertiesUIControlPageView"),minHeight:50,url:this.url||this._getDefaultRequestURL()})},_onCancelClick:function(){this.slideout.hide()},_onApplyClick:function(){var t={};t.policies=this.oData.data[0].policies,t.type=this.oData.data[0].type;var e=this._oPropertyUIControl.getProperty("overrideParent"),i=!e||e.isChecked();i?(this.rejectedPolicies&&0<this.rejectedPolicies.length&&this.rejectedPolicies.forEach(function(e){t.policies.push(e)}),t.policies.forEach(function(e){var t=e.securityObject;t.searchPath='storeID("'+t.id+'")'})):t.policies=[],this.applyToChildren.isChecked()&&(t._meta={schemaInfo:{policies:{applyUpdateToDescendants:!0}}});var n=JSON.stringify(t),o={headers:{Accept:"application/json","Content-Type":"application/json"},type:"PUT",url:s.getSelfLink(this.oData.data[0]),data:n};return this.applyButton.disable(),this._sendRequest(o).then(function(t){if(i)return this._updateUIForEdit(),Promise.resolve(t);this._getObject().then(function(e){return this._setOData(e),this.permissionsData={},this.permissionsData.data=e.data[0].policies?e.data[0].policies:[],this._canModifyPolicies(),this.refresh(this.itemURL),this._updateUIForEdit(),Promise.resolve(t)}.bind(this))}.bind(this))},_sendRequest:function(e,t){return t=t||function(){return Promise.resolve()},this.glassContext.getCoreSvc(".Ajax").ajax(e).then(t.bind(this)).catch(function(e){return l.showAjaxServiceError(this.glassContext,e),Promise.reject(e)}.bind(this))},_getDefaultRequestURL:function(){return this.itemURL},_getModuleName:function(){return"bi/content_apps/common/ui/PolicyPropertyView"},getFilterSpec:function(){return[{name:"allContent",label:o.get("allGenericItems"),value:"allContent"},{name:"accounts",label:o.get("policyFilterAccounts"),value:"account"},{name:"groups",label:o.get("policyFilterGroups"),value:"group"},{name:"roles",label:o.get("policyFilterRoles"),value:"role"}]},_getFilterItems:function(e,t,i,n){return u.map(e,function(e){return{name:t+e.name,icon:"wft_checkmark",label:e.label,checked:e.value===i,action:function(){n(e.name)}}})},contentbarItems:function(){var e="POLICY_FILTER_",t=window.localStorage.getItem("filterString_"+this.stateId)||"",i=this.getFilterSpec(),n=this._getFilterItems(i,e,t,this._filter.bind(this));return[{name:"nameLabel",position:"leading",style:"nameLabel",module:"bacontentnav/common/ui/contentbar_components/HiddenLabel",label:o.get("policiesTableLable")},{name:e+"typeMenu",label:o.get("type"),hcLabel:!1,position:"trailing",supportCustomCollapse:!0,showTitle:!1,updateLabel:!0,icon:"common-filter",bSVG:!0,module:"bacontentnav/common/ui/contentbar_components/ToggleMenuBar",items:n},{name:"add",position:"trailing",displayLabel:!1,label:o.get("policesAddMemberButtonLabel"),module:"bacontentnav/common/ui/contentbar_components/Button",className:"addNewFolder",supportCustomCollapse:!0,icon:"common-add",hiddenOnRender:!0,_handleClick:function(){this._openAddMembersSlideout()}.bind(this)}]},getListControlOptions:function(){return{ajaxProp:"data",emptyFolderString:o.get("emptyPolicyList"),showEmptyNewFolderButton:!1,getJSONDataCallback:this.getPoliciesData.bind(this),url:"",multiSelect:this.canModifyPolicies,rightClickContextMenu:!1}},getDefaultSort:function(){return[1,"asc"]},_isDuplicate:function(e,t){var i=!1;return e.forEach(function(e){if(e.securityObject.id===t)return!(i=!0)}),i},removeSelection:function(){setTimeout(function(){var e=this._oPropertyUIControl.getProperty("overrideParent");if(null===e||e.isChecked()){var i=this.getListControl().getSelectedObjects(),t=u.reject(this.oData.data[0].policies,function(t){return u.find(i,function(e){return t.securityObject.defaultName===e.securityObject.defaultName})});this.getListControl().removeSelectedRows(),(this.oData.data[0].policies=t)&&0<t.length?(this._enableApplyItems(),this.setFocus()):this._disableApplyItems()}}.bind(this),100)},addSelection:function(e){var t,r=0,a=0,i=this.getListControl().getDatatable(),l=i.api(),p=i.fnGetData();e.forEach(function(e){var t=e.id,i=e.type,n=e.defaultName,o=this._isDuplicate(p,t);if(r+=1,!o&&"namespaceFolder"!==i){a+=1;var s=new c(n,t,i);l.row.add(s).draw(!0),null!==this.oData.data[0].policies||(this.oData.data[0].policies=[]),this.oData.data[0].policies.push(s)}}.bind(this)),t=1===a?o.get("toastItemsWereAddedSingular",{noOfItems:a}):0===a&&1===r?o.get("toastItemsAlreadyAddedSingular"):0===a&&1<r?o.get("toastItemsAlreadyAdded"):o.get("toastItemsWereAdded",{noOfItems:a}),this.glassContext.appController.showToast(t),this._enableApplyItems()},_openAddMembersSlideout:function(e){this.glassContext.appController.showSlideOut({parent:this.slideout,width:"450",content:{module:"bi/admin/account/slideout/SecurityObjectSelectorPane",parentView:this,objectInfo:e,title:o.get("selectAccountGroupOrRole"),allowedSelectionTypes:["group","role","account","namespace"],multiSelectCallback:this.addSelection.bind(this)}})},_birdBeakMenuItems:function(){return[{label:o.get("permissionRead"),icon:"",onSelect:function(){var e=this.getListControl();e&&this._updatePermission(r.simplePermEnum.read,e.getSelectedObjects(),e.getSelectedRows())}.bind(this)},{label:o.get("permissionRun"),icon:"",onSelect:function(){var e=this.getListControl();e&&this._updatePermission(r.simplePermEnum.run,e.getSelectedObjects(),e.getSelectedRows())}.bind(this)},{label:o.get("permissionWrite"),icon:"",onSelect:function(){var e=this.getListControl();e&&this._updatePermission(r.simplePermEnum.write,e.getSelectedObjects(),e.getSelectedRows())}.bind(this)},{label:o.get("permissionFull"),icon:"",onSelect:function(){var e=this.getListControl();e&&this._updatePermission(r.simplePermEnum.full,e.getSelectedObjects(),e.getSelectedRows())}.bind(this)}]},_updatePermission:function(t,e,i){var n=0;e.forEach(function(e){e.permissions=r.clonePermissionArray(t),i[n]&&this.getListControl().updateCell(e,i[n],2),n+=1}.bind(this)),this.applyButton.enable()},_getColumnSpecification:function(){var e=[];e.push({type:"Icon",getDataFn:function(e){return"nil"===e.securityObject[s.TYPE]?"unknown":e.securityObject[s.TYPE]}});var t=[];return t.push({type:"Text",scope:"row",label:o.get("name"),getDataFn:function(e){if(void 0===e.securityObject[s.DEFAULT_NAME])return o.get("unavailable");var t=this.oData.data[0];return this._getUserName(t,e)}.bind(this)}),t.push({type:"Text",getDataFn:function(e){return this._getPath(e)}.bind(this)}),e.push({type:"MultipleProperties",items:t}),e.push({type:"MultipleProperties",orientation:"horizontal",weight:10,items:[{type:"Permission",clickCallback:this._openPolicyDetailSlideoutView.bind(this)},{type:"BirdBeakMenu",name:o.get("permissionSetAccess"),menuItems:this._birdBeakMenuItems()}]}),e.push({type:"ClickableIcon",name:o.get("policesRemove"),icon:"common-remove-delete",clickCallback:this.removeSelection.bind(this),a11yLabel:o.get("removeSelectedItem")}),e},_adjustWidth:function(){this.$el.addClass("pageview-small")},_refreshTable:function(){var e=this.getListControl().getSelectedRows();if(0<e.length){var t=this.getListControl().getSelectedObjects();this.getListControl().updateCell(t[0],e[0],2)}},_getUserName:function(e,t){return e.userName&&e.givenName&&e.surname&&u.escape(e.defaultName)===u.escape(t.securityObject[s.DEFAULT_NAME])?e.givenName+" "+e.surname+" ("+e.userName+")":!e.userName||e.givenName&&e.surname||u.escape(e.defaultName)!==u.escape(t.securityObject[s.DEFAULT_NAME])?u.escape(t.securityObject[s.DEFAULT_NAME]):u.escape(t.securityObject[s.DEFAULT_NAME])+" ("+e.userName+")"},_getPath:function(e){var t="";if(e.securityObject[s.ANCESTORS]&&e.securityObject[s.ANCESTORS].length){var i=e.securityObject[s.ANCESTORS];i.shift();for(var n=0;n<i.length;n++)t+=""===t?"":" > ",t+=i[n].defaultName}return t},_openPolicyDetailSlideoutView:function(e){this.slideout.addChild({width:"400",onHide:this._refreshTable.bind(this),enableTabLooping:!0,content:{module:"bi/content_apps/common/PolicyDetailsView",enableParentApplyButton:function(){this.applyButton.enable()}.bind(this),objectInformation:e,ownerData:this.oData.data[0],canModify:this.canModifyPolicies}})},getListControl:function(){return this._listControl},_showUnavailablePolicies:function(){var t=this.getListControl().getDatatable().api();this.rejectedPolicies.forEach(function(e){this.oData.data[0].policies.push(e),t.row.add(e).draw(!0)}.bind(this)),this.rejectedPolicies=[]},_hideUnavailablePolicies:function(){var t=[],i=0,n=[];this.oData.data[0].policies.forEach(function(e){"nil"===e.securityObject.type?(this.rejectedPolicies.push(e),n.push(i)):t.push(e),i+=1}.bind(this)),this.getListControl().removeIndexRows(n),this.oData.data[0].policies=t},_toggleShowUnavailablePolicies:function(){this._oPropertyUIControl.getProperty("showUnavailablePolicies").isChecked()?this._showUnavailablePolicies():this._hideUnavailablePolicies(),this.showUnavailablePolicies=!this.showUnavailablePolicies},_createMultiSelectBar:function(){return d.inherited("_createMultiSelectBar",this,arguments).then(function(){var t=this.$el.find(".multiselectbar .policyMulSel");return this.msddMenu=new a({dropDownMenuSpec:{title:o.get("permissionSetAccess"),id:"birdBeakIdms",label:"BirdBeakMS",items:this._birdBeakMenuItems(),actionElement:t[0],ddMenuPlacement:"bottom"}}),this.msddMenu.render().then(function(e){t.append(e)}),Promise.resolve(this)}.bind(this))},_multiselectbarItems:function(){return Promise.resolve([{name:"SetLabel",position:"leading",module:"../../lib/gemini/app/ui/toolbar_components/Label",label:"Set",style:"policyMultiSelectLabel"},{name:"birdBeakButton",position:"leading",displayLabel:!1,label:o.get("permissionSetAccess"),icon:"common-titan-arrow-down",module:"./contentbar_components/Button",className:"policyMulSel"},{position:"leading",type:"Separator"},{name:"removeButton",position:"leading",displayLabel:!1,label:o.get("removeSelectedItem"),icon:"common-remove-delete",module:"./contentbar_components/Button",className:"policyMulSel",action:this.removeSelection.bind(this)},{name:"selectedLabel",position:"center",label:o.get("selected"),module:"../../lib/gemini/app/ui/toolbar_components/Label",style:"selectedLabel"},{name:"cancelButton",position:"trailing",label:o.get("cancel"),text:o.get("cancel"),labelOnly:!0,module:"./contentbar_components/Button",className:"cancelButton",_handleClick:function(){this._listControl._clearRows(),this.multiselectBar.hide(),this.contentBar.show()}.bind(this)}])},_enableApplyItems:function(){this.applyToChildren.enable(),this.applyButton.enable()},_disableApplyItems:function(){this.applyToChildren.disable(),this.applyButton.disable()}});return d}),define("bi/content_apps/PropertiesPermissionsTab",["q","bi/glass/app/ContentView","bacontentnav/utils/UIHelper","bacontentnav/lib/@waca/core-client/js/core-client/ui/properties/PropertyUIControl","bi/content_apps/common/PolicyPropertyView","bacontentnav/utils/ContentStoreObject","underscore"],function(e,t,i,n,o,s,r){"use strict";var a=t.extend({init:function(e){a.inherited("init",this,arguments),r.extend(this,e),this.policyView=null},render:function(){return this.policyView=this._getPolicyPropertyView({el:this.$el,id:"policyPropertyView",slideout:this.slideout,glassContext:this.glassContext,itemURL:s.getSelfLink(this.objectInfo)}),this.policyView.render()},_getPolicyPropertyView:function(e){return new o(e)}});return a}),define("bi/content_apps/PropertiesTab",["q","bacontentnav/lib/@waca/core-client/js/core-client/ui/properties/PropertyTabView","bacontentnav/utils/ContentStoreObject","underscore"],function(e,t,i,o){"use strict";var n=t.extend({init:function(e){n.inherited("init",this,arguments),o.extend(this,e)},_setReportOption:function(e,t,i){for(var n=0;n<e.length;n++)if(e[n].name===t.name)return void(i?e.splice(n,1):e[n].value=t.value);i||e.push(t)},_setAdvancedOption:function(e,t,i,n,o){var s={};s.name=t,s.type=i,s.value=n,this._setReportOption(e,s,s.value===o)},_getRetentionValue:function(e){var t=null;return"history"===e?t=i.getRunHistoryConfig(this.objectInfo):"reportVersion"===e&&(t=i.getReportOutputVersionsConfig(this.objectInfo)),t?void 0!==t.maxDuration&&t.maxDuration?parseInt(t.maxDuration.match(/\d+/),10):t.maxObjects:1},_getRetentionUnit:function(e){var t=null;return"history"===e?t=i.getRunHistoryConfig(this.objectInfo):"reportVersion"===e&&(t=i.getReportOutputVersionsConfig(this.objectInfo)),t&&void 0!==t.maxDuration&&t.maxDuration?"D"===t.maxDuration.split(/\d+/)[1]?"days":"months":"occurrences"},_getReportRetentions:function(){return i.getReportRetentions(this.objectInfo)},_setReportRetention:function(e,t,i,n){var o={prop:"creationTime",objectClass:n};if(e)for(var s=0;s<e.length;s++)if(e[s].objectClass===n){o=e[s];break}this._setRetentionValue(o,t,i)},_getModifiedRetentions:function(e,t){var i=this._getReportRetentions(),n=!1;(t.hasOwnProperty("runHistory")||t.hasOwnProperty("runHistoryUnit"))&&(n=!0,this._setReportRetention(i,t.runHistory,t.runHistoryUnit,"history"),delete t.runHistory,delete t.runHistoryUnit),(t.hasOwnProperty("reportVersion")||t.hasOwnProperty("reportVersionUnit"))&&(n=!0,this._setReportRetention(i,t.reportVersion,t.reportVersionUnit,"reportVersion"),delete t.reportVersion,delete t.reportVersionUnit),n&&o.extend(e,{retentions:i})},_setRetentionValue:function(e,t,i){0<=t?i?"occurrences"===i?(e.maxObjects=t,delete e.maxDuration):(e.maxObjects=0,e.maxDuration="P"+t+("days"===i?"D":"M")):e.maxDuration?e.maxDuration=e.maxDuration.replace(/\d+/,t):e.maxObjects=t:i&&("occurrences"===i?e.maxDuration&&(e.maxObjects=parseInt(e.maxDuration.match(/\d+/),10),delete e.maxDuration):e.maxDuration?e.maxDuration=e.maxDuration.replace(/(\w+)(\d+)(\w+)/,"$1$2"+("days"===i?"D":"M")):(e.maxDuration="P"+e.maxObjects+("days"===i?"D":"M"),e.maxObjects=0))}});return n}),define("bi/content_apps/PromptValuesView",["jquery","bi/glass/app/ContentView","bi/content_apps/nls/StringResource","bacontentnav/utils/ContentStoreObject","bacontentnav/lib/@waca/core-client/js/core-client/ui/properties/PropertyUIControl","bi/schedule/views/PromptPickerView","bacontentnav/utils/UIHelper","underscore"],function(e,t,i,n,o,s,r,a){"use strict";var l=t.extend({init:function(e){l.inherited("init",this,arguments),a.extend(this,e),this.showClickables=void 0===this.isEditMode||this.isEditMode},render:function(){var e=[{}];return this.showClickables&&(e=[{type:"text",name:"editPromptValues",value:this._getBannerEditSetText()},{type:"text",value:i.get("clear"),name:"clearPromptValues",clickCallback:function(){this.promptDisplayValues=[],this._getPromptValuesSection().refreshProperties([]),this.clearCallback&&this.clearCallback()}.bind(this)}]),this._oPropertyUIControl=new o({el:this.$el,glassContext:this.glassContext,slideout:this.slideout,items:[{type:"Banner",name:"promptValuesBanner",id:this.viewId,value:i.get("currentValues"),centerLabel:!0,backButton:this.slideout.overlay,editable:!1,readOnly:!0,onClose:function(){this.slideout.hide()}.bind(this),clickables:e},{type:"CollapsibleSection",name:"SectionPromptValues",styleAsSimpleRow:!0,hideSectionTitle:!0,open:!0,items:this._getPromptItems(this.promptDisplayValues)}]}),this._areValueSet()||this._renderEmptyPaneInfoMessage(this.$el),this._oPropertyUIControl.render().then(function(){this._renderPromptPicker()}.bind(this))},_areValueSet:function(){return 0!==this._getPromptItems(this.promptDisplayValues).length},_getBannerEditSetText:function(){var e=this._areValueSet()?"edit":"set";return i.get(e)},_renderEmptyPaneInfoMessage:function(e){r.renderInfoMessage(e,i.get("noPromptsValuesSet"))},_removeEmptyPaneInfoMessage:function(e){e.find("div.contentApps_comingSoon").remove()},_renderPromptPicker:function(){this.promptPicker=new s({$toggler:this.$el.find('div[class^="editPromptValues'+this.viewId+' "]'),reportId:this.parentView&&this.parentView.objectInfo.id,values:this.parameters,useValues:!1!==this.useParameters,glassContext:this.glassContext,onFinish:function(){this._onEditFinish()}.bind(this)}),this.promptPicker.render()},_onEditFinish:function(){this.parameters=this.promptPicker.getParameterValues(),this.promptDisplayValues=n.getPromptsDisplayValues(this.parameters);var e=this._getPromptItems(this.promptDisplayValues);this._getPromptValuesSection().refreshProperties(e),this.editCallback&&this.editCallback(this.parameters),this._removeEmptyPaneInfoMessage(this.$el)},_getPromptValuesSection:function(){return this._oPropertyUIControl.getProperty("SectionPromptValues")},_getPromptItems:function(e){var t=[];if(e)for(var i=0;i<e.length;i+=1){t.push({type:"Separator"});var n=a.escape(e[i].name),o={type:"SingleLineValue",name:n,label:n,value:e[i].display};t.push(o)}return t},setFocus:function(){this._oPropertyUIControl.setFocus("promptValuesBanner")}});return l}),define("bi/content_apps/utils/Utils",[],function(){"use strict";var t=/[<>&]/g,i={"&":"&amp;","<":"&lt;",">":"&gt;"},n=/[<>&'"]/g,o={"&":"&amp;","<":"&lt;",">":"&gt;","'":"&apos;",'"':"&quot;"};return{htmlEncode:function(e){return(e||"").replace(t,function(e){return i[e]})},xmlEncode:function(e){return e||0===e?String(e).replace(n,function(e){return o[e]}):""}}}),define("bi/content_apps/PdfOptionsView",["jquery","underscore","bi/content_apps/nls/StringResource","bi/content_apps/utils/Utils","bacontentnav/lib/@waca/core-client/js/core-client/ui/properties/PropertyPageView","bacontentnav/lib/@waca/core-client/js/core-client/ui/properties/PropertyUIControl","bacontentnav/utils/GlassContextHelper"],function(r,t,a,n,e,i,o){"use strict";var s=e.extend({init:function(e){s.inherited("init",this,arguments),t.extend(this,e)},_getBannerSpec:function(){var e={type:"Banner",name:"pdfOptionsBanner",value:a.get("pdfOptions"),centerLabel:!0,backButton:this.slideout.overlay,editable:!1,readOnly:!0,onClose:function(){var e=this.getModifiedProperties();if(this._validatePasswords(e)){if(this.slideout.hide(),this.closeCallback){var t=this._getFullPdfOptions(this._getOptions(),e);this.closeCallback(t)}}else o.displayToast(this.glassContext,a.get("passwordNotMatched"),{type:"warning"})}.bind(this)};return this.showCancel&&(e.clickables=[{type:"text",value:a.get("cancel"),class:"cancelPdfOptions",clickCallback:function(){this.cancelled=!0,this.slideout.hide(),this.cancelCallback&&this.cancelCallback()}.bind(this)}]),e},render:function(){var e=this._getOption(this._getOptions(),"outputPageOrientation"),t=this._getOption(this._getOptions(),"outputPageDefinition"),i=this._getOption(this._getOptions(),"ownerPassword"),n=this._getPasswordValue(i),o=this._getOption(this._getOptions(),"userPassword"),s=this._getPasswordValue(o);return this.renderPropertyUIControl({el:this.$el,glassContext:this.glassContext,slideout:this.slideout,items:[this._getBannerSpec(),{type:"DropDown",name:"outputPageOrientation",label:a.get("Orientation"),options:[{label:a.get("default"),value:"default",selected:void 0===e},{label:a.get("portrait"),value:"portrait",selected:e&&"portrait"===e.value},{label:a.get("landscape"),value:"landscape",selected:e&&"landscape"===e.value}]},{type:"Separator"},{type:"DropDown",name:"outputPageDefinition",label:a.get("pageSize"),options:[{label:a.get("default"),value:"default",selected:void 0===t},{label:a.get("letter"),value:"/configuration/pageDefinition[@name='Letter']",selected:t&&"/configuration/pageDefinition[@name='Letter']"===t.value},{label:a.get("legal"),value:"/configuration/pageDefinition[@name='Legal']",selected:t&&"/configuration/pageDefinition[@name='Legal']"===t.value},{label:a.get("11x17"),value:"/configuration/pageDefinition[@name='11x17']",selected:t&&"/configuration/pageDefinition[@name='11x17']"===t.value},{label:a.get("A3"),value:"/configuration/pageDefinition[@name='A3']",selected:t&&"/configuration/pageDefinition[@name='A3']"===t.value},{label:a.get("A4"),value:"/configuration/pageDefinition[@name='A4']",selected:t&&"/configuration/pageDefinition[@name='A4']"===t.value},{label:a.get("B4JIS"),value:"/configuration/pageDefinition[@name='B4 JIS']",selected:t&&"/configuration/pageDefinition[@name='B4 JIS']"===t.value},{label:a.get("B5JIS"),value:"/configuration/pageDefinition[@name='B5 JIS']",selected:t&&"/configuration/pageDefinition[@name='B5 JIS']"===t.value}]},{type:"Separator"},{name:"checkboxUserPassword",checked:void 0!==o,label:a.get("requiresPasswordToOpenReport"),type:"CheckBox",onChange:function(e,t){this._passwordCheckOnChange(t,"userPassword","userPasswordConfirm")}.bind(this)},{name:"userPassword",label:a.get("password"),ariaLabel:a.get("requiresPasswordToOpenReport"),value:s,indent:2,editable:!0,disabled:void 0===o,type:"SingleLineValue",multiline:!0,inputType:"password",showEmptyBorder:!0,highlightTextOnFocus:!0},{name:"userPasswordConfirm",label:a.get("confirmPassword"),ariaLabel:a.get("requiresPasswordToOpenReport")+" "+a.get("confirmPassword"),value:s,indent:2,editable:!0,disabled:void 0===o,type:"SingleLineValue",multiline:!0,inputType:"password",showEmptyBorder:!0,highlightTextOnFocus:!0},{type:"Separator"},{name:"checkboxOwnerPassword",checked:void 0!==i,label:a.get("requiresPasswordToAccessOptions"),type:"CheckBox",onChange:function(e,t){this._passwordCheckOnChange(t,"ownerPassword","ownerPasswordConfirm")}.bind(this)},{name:"ownerPassword",label:a.get("password"),ariaLabel:a.get("requiresPasswordToAccessOptions"),value:n,indent:2,editable:!0,disabled:void 0===i,type:"SingleLineValue",multiline:!0,inputType:"password",showEmptyBorder:!0,highlightTextOnFocus:!0},{name:"ownerPasswordConfirm",label:a.get("confirmPassword"),ariaLabel:a.get("requiresPasswordToAccessOptions")+" "+a.get("confirmPassword"),value:n,indent:2,editable:!0,disabled:void 0===i,type:"SingleLineValue",multiline:!0,inputType:"password",showEmptyBorder:!0,highlightTextOnFocus:!0}]})},_getPasswordValue:function(e){var t="";if(!e)return t;if(!this.isEncrypedPassword(e.value)){var i=e.value,n=this._createOption(e.name,e.value);return e.value=n.value,i}if(0<e.value.length){var o=r.parseXML(e.value),s=r(o).find("password");s.text().length?t=s.text():(s=r(o).find("encryptedValue")).text().length&&(t="********")}return t},_passwordCheckOnChange:function(e,t,i){var n=this._oPropertyUIControl.getProperty(t),o=this._oPropertyUIControl.getProperty(i);e?(n.enable(),o.enable()):(n.disable(),n.setValue(""),o.disable(),o.setValue(""))},onClose:function(){if(this._oPropertyUIControl)return this._oPropertyUIControl.onClose()},getModifiedProperties:function(){return this.cancelled?null:this._oPropertyUIControl?this._oPropertyUIControl.getModifiedProperties():null},_validatePasswords:function(e){if(!e)return!0;if((e.userPassword||e.userPasswordConfirm)&&e.userPassword!==e.userPasswordConfirm)return this._oPropertyUIControl.getProperty("userPassword").getHTMLControl().focus(),!1;if((e.ownerPassword||e.ownerPasswordConfirm)&&e.ownerPassword!==e.ownerPasswordConfirm)return this._oPropertyUIControl.getProperty("ownerPassword").getHTMLControl().focus(),!1;if(void 0!==e.checkboxUserPassword){if(e.checkboxUserPassword){if(!e.userPassword||!e.userPasswordConfirm)return!1}else if(e.userPassword||e.userPasswordConfirm)return!1}else if(void 0!==e.userPassword&&!e.userPassword)return!1;if(void 0!==e.checkboxOwnerPassword){if(e.checkboxOwnerPassword){if(!e.ownerPassword||!e.ownerPasswordConfirm)return!1}else if(e.ownerPassword||e.ownerPasswordConfirm)return!1}else if(void 0!==e.ownerPassword&&!e.ownerPassword)return!1;return!0},_setOption:function(e,t,i){for(var n=0;n<e.length;n+=1)if(e[n].name===t.name)return void(i?e.splice(n,1):e[n].value=t.value);i||e.push(t)},_getFullPdfOptions:function(e,t){var i=[];if(e.forEach(function(e){i.push(e)}),t){if(t.outputPageDefinition){var n=this._createOption("outputPageDefinition",t.outputPageDefinition);this._setOption(i,n,"default"===t.outputPageDefinition)}if(t.outputPageOrientation){var o=this._createOption("outputPageOrientation",t.outputPageOrientation);this._setOption(i,o,"default"===t.outputPageOrientation)}if(void 0!==t.userPassword){var s=this._createOption("userPassword",t.userPassword);this._setOption(i,s,0===t.userPassword.length)}if(void 0!==t.ownerPassword){var r=this._createOption("ownerPassword",t.ownerPassword);this._setOption(i,r,0===t.ownerPassword.length)}if(void 0!==t.checkboxOwnerPassword)for(var a=this._getCheckOptions(t.checkboxOwnerPassword),l=0;l<a.length;l+=1)this._setOption(i,a[l],!1)}return i},_getOption:function(e,t){for(var i,n=0;n<e.length;n+=1)if(e[n].name===t){i=e[n];break}return i},_getOptions:function(){return this.pdfOptions||(this.pdfOptions=[]),this.pdfOptions},_getCheckOptions:function(e){return[{name:"allowPrintQuality",type:"pdfOptionPrintQuality",value:e?"none":"lowOrHigh"},{name:"allowModifications",type:"pdfOptionBoolean",value:!e},{name:"allowAnnotations",type:"pdfOptionBoolean",value:!e},{name:"allowFieldCompletion",type:"pdfOptionBoolean",value:!e},{name:"allowAssembly",type:"pdfOptionBoolean",value:!e},{name:"allowContentCopy",type:"pdfOptionBoolean",value:!e},{name:"allowAccessibilitySupport",type:"pdfOptionBoolean",value:!0}]},_canClose:function(){return!0},_createOption:function(e,t){var i;return"outputPageDefinition"===e?i={name:"outputPageDefinition",type:"runOptionString",value:t}:"outputPageOrientation"===e?i={name:"outputPageOrientation",type:"runOptionString",value:t}:"userPassword"===e?i={name:"userPassword",type:"pdfOptionXMLEncodedXML",value:"<credential><password>"+n.xmlEncode(t)+"</password></credential>"}:"ownerPassword"===e&&(i={name:"ownerPassword",type:"pdfOptionXMLEncodedXML",value:"<credential><password>"+n.xmlEncode(t)+"</password></credential>"}),i},remove:function(){this.slideout.overlay||this.onClose()},isEncrypedPassword:function(e){return/<credential><encryptedValue>.*<\/encryptedValue><\/credential>/.test(e)||/<credential><password>.*<\/password><\/credential>/.test(e)},setFocus:function(){this.slideout.overlay?this._oPropertyUIControl.setFocus("pdfOptionsBanner"):this._oPropertyUIControl.setFocus("outputPageOrientation")}});return s}),define("bi/content_apps/authoring/AuthoringHelper",["bacontentnav/utils/ContentStoreObject","bacontentnav/utils/UIHelper"],function(n,o){"use strict";var s={_getFormatIndex:function(e){var t=s._getObjectType(e);return s.SUPPORTED_FORMATS[t]?t:"all"},_getObjectType:function(e){var t=n.getType(e);if("powerPlay8ReportView"===t)return"powerPlay8Report";var i=o.getBaseTypes(t);return i&&0<i.length&&n.getBase(e)&&n.getBase(e).type||t},setReportType:function(e,t){"powerPlay8Report"===s._getObjectType(t)&&(e.reportType="powerPlay8Report")},getSupportedFormats:function(e){return s.SUPPORTED_FORMATS[s._getFormatIndex(e)]},userCanGenerateFormat:function(e,t){var i=s.FORMAT_CAPABILITY_MAP[t];return!i||e.hasCapability(i)},SUPPORTED_FORMATS:{all:["spreadsheetML","xlsxData","PDF","HTML","CSV","XML"],interactiveReport:["HTML"],powerPlay8Report:["PDF"]},FORMAT_CAPABILITY_MAP:{HTML:null,PDF:"canGeneratePDFOutput",spreadsheetML:"canGenerateXLSOutput",xlsxData:"canGenerateXLSOutput",CSV:"canGenerateCSVOutput",XML:"canGenerateXMLOutput"},FORMAT_MESSAGE_KEY_MAP:{HTML:"html",PDF:"pdf",spreadsheetML:"spreadsheetML",xlsxData:"xlsxData",CSV:"csv",XML:"xml"}};return s}),define("bi/content_apps/PropertiesReportTab",["bi/content_apps/PropertiesTab","bi/content_apps/utils/C10Utils","bi/content_apps/nls/StringResource","bacontentnav/utils/ContentStoreObject","bacontentnav/utils/GlassContextHelper","bi/content_apps/PromptValuesView","bi/content_apps/PdfOptionsView","underscore","bi/content_apps/authoring/AuthoringHelper"],function(e,d,s,h,t,i,n,m,o){"use strict";var r=e.extend({ACTION_VIEW:"viewOutput",ACTION_RUN:"run",ACTION_EDIT:"edit",RUNASOWNER:"runAsOwnerRadio",pdfOptionNames:["outputPageDefinition","outputPageOrientation","userPassword","ownerPassword","allowPrintQuality","allowModifications","allowAnnotations","allowFieldCompletion","allowAssembly","allowContentCopy","allowAccessibilitySupport"],init:function(e){r.inherited("init",this,arguments),m.extend(this,e),this._getPdfOptions()},render:function(){return new Promise(function(t){this._id=m.uniqueId("prop_");var i=[],n=[this._getFormatSpec(),{type:"Separator",indent:2}];return-1===this.objectInfo.type.indexOf("powerPlay8Report")&&n.push({name:"setPdfOptions",label:s.get("pdfOptions"),value:s.get("set"),indent:2,type:"SingleLineValue",ellipses:!0,editCallback:function(){this._openPdfOptionsView()}.bind(this)},{type:"Separator",indent:2}),this._getLanguages().then(function(e){return n.push({type:"DropDown",name:h.OPTION_ACCESSIBILITY_FEATURES,label:s.get("enableAccessibilitySupport"),indent:2,options:[{label:s.get("default"),value:null,selected:null===this._getEnableAccessibilitySupport()},{label:s.get("True"),value:!0,selected:!0===this._getEnableAccessibilitySupport()},{label:s.get("False"),value:!1,selected:!1===this._getEnableAccessibilitySupport()}]},{type:"Separator",indent:2},{type:"DropDown",name:h.OPTION_OUTPUT_LOCALE,label:s.get("language"),indent:2,options:e,position:"left",parentEl:this.slideout.$el},{type:"Separator",indent:2}),i.push({name:"package",label:s.get("source"),value:this._getPackageOrModule(),type:"SingleLineValue"}),i.push({name:"promptValues",label:s.get("promptValues"),type:"SectionLabel"}),i.push({name:"executionPrompt",checked:this._getPromptValue(),label:s.get("executionPrompt"),type:"CheckBox"}),i.push({type:"Separator"}),i.push({name:"currentPromptValues",label:s.get("currentValues"),value:this._getPromptValueLabel(),type:"SingleLineValue",ellipses:!0,editCallback:function(){this._openPromptsValuesView()}.bind(this)}),i.push({type:"Separator"}),i.push({type:"CollapsibleSection",label:s.get("reportOptions"),open:!1,name:"reportOptions",items:n}),this._getAdvancedItems().then(function(e){i.push({type:"CollapsibleSection",name:"advancedReportProperties",label:s.get("advancedProperties"),items:e}),this.renderPropertyUIControl({el:this.$el,glassContext:this.glassContext,readOnly:!h.hasPermissions(this.objectInfo,["write"]),items:i}).then(function(){t(this)}.bind(this))}.bind(this))}.bind(this))}.bind(this))},onClose:function(){return this._closePdfOptionView(),void 0===this.getPropertyUIControl()?this.renderPropertyUIControl().then(function(){return this.getPropertyUIControl().onClose()}.bind(this)):this.getPropertyUIControl().onClose()},getModifiedProperties:function(){var e={},t=this.getPropertyUIControl().getModifiedProperties();return this._getModifiedRunAsOwner(e,t),this._getModifiedOptions(e,t),this._getModifiedRetentions(e,t),m.extend(e,t),this.logger.debug("PropertiesReportTab.getModifiedProperties",e),e},_getFormatSpec:function(){var t;if("interactiveReport"===this.objectInfo.type)t={type:"SingleLineLinks",indent:2,items:[{align:"left",items:[{type:"text",value:s.get("format")}]},{align:"right",items:[{type:"text",value:s.get("html")}]}]};else if(d.isPowerPlay(this.objectInfo.type))t={type:"SingleLineLinks",indent:2,items:[{align:"left",items:[{type:"text",value:s.get("format")}]},{align:"right",items:[{type:"text",value:s.get("pdf")}]}]};else{t={type:"DropDown",name:h.OPTION_OUTPUT_FORMAT,label:s.get("format"),indent:2,options:[{label:s.get("default"),value:"",selected:null===this._getOutputFormat()}]},o.getSupportedFormats(this.objectInfo).forEach(function(e){t.options.push({label:s.get(o.FORMAT_MESSAGE_KEY_MAP[e]),value:e,selected:this._getOutputFormat()===e})}.bind(this))}return t},_getAdvancedItems:function(){return new Promise(function(e){var t=[{type:"SingleLineLinks",name:"sectionRunHistory",items:[{align:"left",items:[{labelFor:"runHistory",type:"text",value:s.get("runHistory")}]},{align:"right",items:[{type:"Input",name:"runHistory",ellipses:!1,inputClass:"narrowInput",value:this._getRetentionValue("history"),validator:{isNumber:!0}},{type:"DropDown",name:"runHistoryUnit",ariaLabel:s.get("runHistoryUnits"),options:[{label:s.get("occurrences"),value:"occurrences",selected:"occurrences"===this._getRetentionUnit("history")},{label:s.get("days"),value:"days",selected:"days"===this._getRetentionUnit("history")},{label:s.get("months"),value:"months",selected:"months"===this._getRetentionUnit("history")}]}]}]},{type:"Separator"},{type:"SingleLineLinks",name:"sectionReportVersion",items:[{align:"left",items:[{labelFor:"reportVersion",type:"text",value:s.get("reportOutputVersions")}]},{align:"right",items:[{type:"Input",name:"reportVersion",ellipses:!1,inputClass:"narrowInput",value:this._getRetentionValue("reportVersion"),validator:{isNumber:!0}},{type:"DropDown",name:"reportVersionUnit",ariaLabel:s.get("reportOutputVersionsUnits"),options:[{label:s.get("occurrences"),value:"occurrences",selected:"occurrences"===this._getRetentionUnit("reportVersion")},{label:s.get("days"),value:"days",selected:"days"===this._getRetentionUnit("reportVersion")},{label:s.get("months"),value:"months",selected:"months"===this._getRetentionUnit("reportVersion")}]}]}]}];return this.objectInfo.type&&(t.push({type:"Separator"}),t.push(this._getDefaultActionSpec())),-1===h.getType(this.objectInfo).indexOf("powerPlay8Report")&&(t.push({type:"Separator"},{type:"DropDown",name:"verticalElements",label:s.get("rowsPerPageHtmlReport"),options:[{label:s.get("default"),value:"null",selected:"null"===this._getRowsPerPageHtmlReport()},{label:"4",value:"4",selected:4===this._getRowsPerPageHtmlReport()},{label:"5",value:"5",selected:5===this._getRowsPerPageHtmlReport()},{label:"8",value:"8",selected:8===this._getRowsPerPageHtmlReport()},{label:"10",value:"10",selected:10===this._getRowsPerPageHtmlReport()},{label:"12",value:"12",selected:12===this._getRowsPerPageHtmlReport()},{label:"16",value:"16",selected:16===this._getRowsPerPageHtmlReport()},{label:"20",value:"20",selected:20===this._getRowsPerPageHtmlReport()},{label:"50",value:"50",selected:50===this._getRowsPerPageHtmlReport()},{label:"100",value:"100",selected:100===this._getRowsPerPageHtmlReport()},{label:"200",value:"200",selected:200===this._getRowsPerPageHtmlReport()},{label:"500",value:"500",selected:500===this._getRowsPerPageHtmlReport()},{label:"1000",value:"1000",selected:1e3===this._getRowsPerPageHtmlReport()}]}),t.push({name:"selectionBasedFeatures",label:s.get("selectionBasedFeatures"),checked:h.getOptionValue(this.objectInfo,h.OPTION_SELECTION_BASED_FEATURES,!0),type:"CheckBox"},{name:"allowNotification",label:s.get("allowNotifications"),checked:h.getAllowNotification(this.objectInfo),type:"CheckBox"},{name:"advancedOutput",label:s.get("advancedOutput"),checked:h.getOptionValue(this.objectInfo,h.OPTION_ENABLE_USER_FEATURE_SAVED_OUTPUT,!1),type:"CheckBox"})),"powerPlay8Report"===h.getType(this.objectInfo)&&t.push({type:"Separator"},{name:"powerPlay8ReportTab",type:"SingleLineLinks",items:[{align:"left",items:[{type:"text",value:s.get("powerPlay8Report")}]},{align:"right",items:[{type:"text",value:s.get("SetExternalRespostoryLabel"),clickCallback:this._setPowerPlay8ReportOptions.bind(this)}]}]}),this._getRunAsOwnerInfo().then(function(e){e&&(t.push({type:"Separator"},{name:"runAsOwnerLabel",label:s.get("run"),type:"SectionLabel"}),t.push({type:"RadioButtonGroup",name:this.RUNASOWNER,value:e,ariaLabel:s.get("run"),items:[{label:s.get("runAsUser"),value:h.RUN_AS_USER},{label:s.get("runWithOwnerCapabilities"),value:h.RUN_WITH_OWNER_CAPABILITIES},{label:s.get("runAsOwner",{ownerName:h.getOwnerName(this.objectInfo)}),value:h.RUN_AS_OWNER}]}))}.bind(this),function(){}).finally(function(){e(t)})}.bind(this))},_setPowerPlay8ReportOptions:function(){d.openC10Morphlet(d.morphletMap.propPP8,this.objectInfo.type,this.objectInfo.id)},_getRunAsOwnerInfo:function(){return new Promise(function(t,i){var e=h.getOwnerSelfLink(this.objectInfo);e?this.glassContext.services.ajax.ajax({dataType:"json",type:"GET",url:e+"/items?fields=permissions&types=credential"}).then(function(e){0<e.data.length&&(h.hasPermissions(e.data[0],["execute"])||h.hasPermissions(e.data[0],["read"]))?t(h.getRunAsOwnerValue(this.objectInfo)):i(new Error)}.bind(this)):i(new Error)}.bind(this))},_getOutputFormat:function(){return h.getOption(this.objectInfo,h.OPTION_OUTPUT_FORMAT)},_getOutputLocale:function(){return h.getOption(this.objectInfo,h.OPTION_OUTPUT_LOCALE)},_getEnableAccessibilitySupport:function(){return h.getOption(this.objectInfo,h.OPTION_ACCESSIBILITY_FEATURES)},_getReportOptions:function(){return h.getOptions(this.objectInfo)},_getLanguages:function(){return new Promise(function(i){var n=this._getOutputLocale()?this._getOutputLocale():"",o=[{value:"",label:s.get("default"),selected:""===n}];if(this.glassContext)return t.getContentLocales(this.glassContext).then(function(e){for(var t in e)e.hasOwnProperty(t)&&o.push({value:t,label:e[t],selected:t===n});i(o)});i(o)}.bind(this))},_getPackageOrModule:function(){var e=h.getMetadataModelPackage(this.objectInfo)||h.getModule(this.objectInfo)||h.getBaseMetadataModelPackage(this.objectInfo)||h.getBaseModule(this.objectInfo);return e&&h.getName(e)||s.get("unavailable")},_getModifiedRunAsOwner:function(e,t){var i={},n=!1;if(t.hasOwnProperty(this.RUNASOWNER)){switch(i[h.RUN_AS_OWNER]=!1,i[h.RUN_WITH_OWNER_CAPABILITIES]=!1,t[this.RUNASOWNER]){case h.RUN_WITH_OWNER_CAPABILITIES:i[h.RUN_WITH_OWNER_CAPABILITIES]=!0;break;case h.RUN_AS_OWNER:i[h.RUN_AS_OWNER]=!0}delete t[this.RUNASOWNER],n=!0}n&&m.extend(e,i)},_getModifiedOptions:function(e,t){var i=this._getReportOptions(),n=!1;if(t.hasOwnProperty(h.OPTION_OUTPUT_FORMAT)){var o=t[h.OPTION_OUTPUT_FORMAT];e.executionFormat=o;var s={};s.name=h.OPTION_OUTPUT_FORMAT,s.type="runOptionStringArray",s.value=[o],this._setReportOption(i,s,""===s.value[0]),delete t[h.OPTION_OUTPUT_FORMAT],n=!0}if(t.hasOwnProperty(h.EXECUTION_PROMPT)){var r=d.isPowerPlay(this.objectInfo.type),a={};a.name=h.OPTION_PROMPT,a.type=r?"powerPlay8OptionBoolean":"runOptionBoolean",a.value=!!t.executionPrompt,this._setReportOption(i,a),n=!0}if(t.hasOwnProperty(h.OPTION_SELECTION_BASED_FEATURES)&&(this._setAdvancedOption(i,h.OPTION_SELECTION_BASED_FEATURES,"runOptionBoolean",!!t.selectionBasedFeatures,!0),delete t[h.OPTION_SELECTION_BASED_FEATURES],n=!0),t.hasOwnProperty(h.OPTION_ENABLE_ALLOW_NOTIFICATION)&&(n=!0),t.hasOwnProperty(h.OPTION_ENABLE_USER_FEATURE_SAVED_OUTPUT)&&(this._setAdvancedOption(i,h.OPTION_ENABLE_USER_FEATURE_SAVED_OUTPUT,"runOptionBoolean",!!t.advancedOutput,!1),n=!0),t.hasOwnProperty(h.OPTION_OUTPUT_LOCALE)){var l={},p=t[h.OPTION_OUTPUT_LOCALE];e.executionLocale=p,l.name=h.OPTION_OUTPUT_LOCALE,l.type="runOptionLanguageArray",l.value=[p],this._setReportOption(i,l,""===l.value[0]),delete t[h.OPTION_OUTPUT_LOCALE],n=!0}if(t.hasOwnProperty(h.OPTION_ACCESSIBILITY_FEATURES)){var c={};c.name=h.OPTION_ACCESSIBILITY_FEATURES,c.type="genericOptionBoolean",c.value=t[h.OPTION_ACCESSIBILITY_FEATURES],this._setReportOption(i,c,"null"===c.value||""===c.value),delete t[h.OPTION_ACCESSIBILITY_FEATURES],n=!0}if(t.hasOwnProperty(h.OPTION_HTML_ROWS_PER_PAGE)){var u={};u.name=h.OPTION_HTML_ROWS_PER_PAGE,u.type="runOptionInt",u.value=t[h.OPTION_HTML_ROWS_PER_PAGE],this._setReportOption(i,u,"null"===u.value),delete t[h.OPTION_HTML_ROWS_PER_PAGE],n=!0}this._isPdfOptionsModified(i,this.pdfOptions)&&(n=!0,i=this._getModifiedPdfOptions(i,this.pdfOptions)),n&&m.extend(e,{options:i})},_getParameters:function(){return h.getParameters(this.objectInfo)},_getPromptValueLabel:function(){var e=this._getParameters();return e&&0<e.length?e.length+" "+s.get("numOfPromptValues"):s.get("setValues")},_openPromptsValuesView:function(){d.isPowerPlay(this.objectInfo.type)?d.openC10Morphlet(d.morphletMap.runOptsPP8,this.objectInfo.type,this.objectInfo.id,[{setPrompts:"true"}]):this.glassContext.appController.showSlideOut({label:s.get("promptValues"),position:this.slideout?null:"left",overlay:!0,parent:this.slideout,width:"400",content:{module:i,parentView:this,glassContext:this.glassContext,promptDisplayValues:h.getPromptsDisplayValues(this._getParameters()),parameters:[],useParameters:!1,clearCallback:function(){0<this._getParameters().length&&this._setPrompts()}.bind(this),editCallback:function(e){this._setPrompts(e)}.bind(this)}})},_setPrompts:function(e){var t;t=null==e||0===e.length?(this.objectInfo.parameters=[],{parameters:[],type:"report"}):{parameters:this.objectInfo.parameters=e,type:"report"},this.slideout.contentView._directSave(t),this.getPropertyUIControl().getProperty("currentPromptValues").setValue(this._getPromptValueLabel())},_getRowsPerPageHtmlReport:function(){return h.getOption(this.objectInfo,h.OPTION_HTML_ROWS_PER_PAGE)},_getPdfOptions:function(){return this.pdfOptions||(this.pdfOptions=[],this._getReportOptions().forEach(function(e){if(this._isPdfOption(e)){var t={name:e.name,type:e.type,value:e.value};this.pdfOptions.push(t)}}.bind(this))),this.pdfOptions},_getOption:function(e,t){if(e)for(var i=0;i<e.length;i+=1)if(e[i].name===t)return e[i];return null},_isPdfOptionsModified:function(e,t){if(t)for(var i=0;i<t.length;i+=1){var n=this._getOption(e,t[i].name);if(!n||n.value!==t[i].value)return!0}if(e)for(var o=0;o<e.length;o+=1){var s=e[o];if(this._isPdfOption(s)){var r=this._getOption(t,s.name);if(!r||r.value!==s.value)return!0}}return!1},_getModifiedPdfOptions:function(e,t){for(var i=[],n=0;n<e.length;n+=1)this._isPdfOption(e[n])||-1!==this.pdfOptionNames.indexOf(e[n].name)||i.push(e[n]);return i.concat(t)},_closePdfOptionView:function(){this.pdfOptionView&&this.pdfOptionView.contentView&&(this.pdfOptionView.contentView.onClose(),this.pdfOptionView.hide(),this.pdfOptionView=null)},_openPdfOptionsView:function(){this.pdfOptionView=this.glassContext.appController.showSlideOut({label:s.get("pdfOptions"),position:"left",width:"400",parent:this.slideout,overlay:!0,content:{module:n,parentView:this,pdfOptions:this._getPdfOptions(),glassContext:this.glassContext,showCancel:!1,closeCallback:function(e){e&&(this.pdfOptions=[],m.extend(this.pdfOptions,e))}.bind(this)}})},_isPdfOption:function(e){return!(!e||-1===this.pdfOptionNames.indexOf(e.name))&&(0!==e.name.indexOf("allow")||0===e.type.indexOf("pdfOption"))},_getPowerPlay8OptionPrompt:function(){return h.getOption(this.objectInfo,"prompt")},_getExecutionPrompt:function(){return d.isPowerPlay(this.objectInfo.type)?this._getPowerPlay8OptionPrompt():h.getExecutionPrompt(this.objectInfo)},_getPromptValue:function(){return d.isPowerPlay(this.objectInfo.type)?this._getPowerPlay8OptionPrompt():h.getOptionValue(this.objectInfo,"prompt",!0)},_getDefaultPortalAction:function(){return this.objectInfo.defaultPortalAction},_getDefaultActionSpec:function(){var e=[{label:s.get("viewMostRecentReport"),value:this.ACTION_VIEW,selected:this._getDefaultPortalAction()===this.ACTION_VIEW},{label:s.get("runTheReport"),value:this.ACTION_RUN,selected:this._getDefaultPortalAction()===this.ACTION_RUN}];if(-1===this.objectInfo.type.indexOf("View")){var t=this.objectInfo.type.charAt(0).toUpperCase()+this.objectInfo.type.slice(1);e.push({label:s.get("open"+t),value:this.ACTION_EDIT,selected:this._getDefaultPortalAction()===this.ACTION_EDIT})}return{type:"DropDown",name:"defaultPortalAction",label:s.get("defaultPortalAction"),options:e}}});return r}),define("bi/content_apps/PropertiesC10Tab",["q","bi/content_apps/PropertiesTab","bi/content_apps/utils/C10Utils","bi/content_apps/nls/StringResource","bacontentnav/utils/ContentStoreObject","underscore"],function(e,t,i,n,a,l){"use strict";var o=t.extend({init:function(e){o.inherited("init",this,arguments),l.extend(this,e)},_setPowerPlayReport:function(){i.openC10Morphlet(i.morphletMap.proppowerplay,this.objectInfo.type,this.objectInfo.id)},_setDocumentRetention:function(){i.openC10General(i.propGeneralTitanActionEnum.document,this.objectInfo.type,this.objectInfo.id)},_viewArchivedVersion:function(){i.openC10Morphlet(i.morphletMap.archive,this.objectInfo.type,this.objectInfo.id,[{output_tab:"arch"},{m_name:this.objectInfo.defaultName}])},_viewCurrentVersion:function(){i.openC10Morphlet(i.morphletMap.archive,this.objectInfo.type,this.objectInfo.id,[{output_tab:"current"},{m_name:this.objectInfo.defaultName}])},_getReportOptions:function(){return a.getOptions(this.objectInfo)},_setAgentDefinition:function(){i.openC10Morphlet(i.morphletMap.agent,this.objectInfo.type,this.objectInfo.id)},_setMetricsExportTask:function(){i.openC10Morphlet(i.morphletMap.metricsExport,this.objectInfo.type,this.objectInfo.id)},_setMetricsDatasourceETLTask:function(){i.openC10Morphlet(i.morphletMap.metricsImport,this.objectInfo.type,this.objectInfo.id)},_setMetricsMainteanceTask:function(){i.openC10Morphlet(i.morphletMap.metricsMainTask,this.objectInfo.type,this.objectInfo.id)},_genUILinkToC10:function(e,t,i,n){return{name:e,type:"SingleLineLinks",items:[{align:"left",items:[{type:"text",value:t,name:"text"+e}]},{align:"right",items:[{type:"text",value:i,clickCallback:n,name:"value"+e,ariaLabelledby:"text"+e+" value"+e}]}]}},_genRunHistoryUI:function(){return{type:"SingleLineLinks",name:"sectionRunHistory",items:[{align:"left",items:[{type:"text",value:n.get("runHistory"),labelFor:"runHistory"}]},{align:"right",items:[{type:"Input",name:"runHistory",ellipses:!1,inputClass:"narrowInput",value:this._getRetentionValue("history"),validator:{isNumber:!0}},{type:"DropDown",name:"runHistoryUnit",ariaLabel:n.get("runHistoryUnits"),options:[{label:n.get("occurrences"),value:"occurrences",selected:"occurrences"===this._getRetentionUnit("history")},{label:n.get("days"),value:"days",selected:"days"===this._getRetentionUnit("history")},{label:n.get("months"),value:"months",selected:"months"===this._getRetentionUnit("history")}]}]}]}},_getItems:function(){var e=[];switch(this.objectInfo.type){case"metricsMaintenanceTask":e.push(this._genRunHistoryUI()),e.push({type:"Separator"}),e.push(this._genUILinkToC10("metricsMaintenanceTaskProp",n.get("metricsMaintenanceTask"),n.get("SetExternalRespostoryLabel"),this._setMetricsMainteanceTask.bind(this)));break;case"metricsFileImportTask":e.push(this._genRunHistoryUI()),e.push({type:"Separator"}),e.push(this._genUILinkToC10("metricsDataSourceETLTask",n.get("metricsFileImportTask"),n.get("SetExternalRespostoryLabel"),this._setMetricsDatasourceETLTask.bind(this)));break;case"metricsDataSourceETLTask":e.push(this._genRunHistoryUI()),e.push({type:"Separator"}),e.push(this._genUILinkToC10("metricsDataSourceETLTaskProp",n.get("metricsDataSourceETLTask"),n.get("SetExternalRespostoryLabel"),this._setMetricsDatasourceETLTask.bind(this)));break;case"metricsExportTask":e.push(this._genRunHistoryUI()),e.push({type:"Separator"}),e.push(this._genUILinkToC10("metricsExportTaskProp",n.get("metricsExportTask"),n.get("SetExternalRespostoryLabel"),this._setMetricsExportTask.bind(this)));break;case"planningTask":e.push(this._genRunHistoryUI());break;case"agentDefinition":case"agentDefinitionView":e.push(this._genRunHistoryUI()),e.push({type:"Separator"}),e.push(this._genUILinkToC10("agentDefinitionProp",n.get("agentDefinition"),n.get("SetExternalRespostoryLabel"),this._setAgentDefinition.bind(this)));break;case"powerPlayReport":e.push(this._genUILinkToC10("powerPlay8ReportTab",n.get("powerPlayReport"),n.get("SetExternalRespostoryLabel"),this._setPowerPlayReport.bind(this)));break;case"document":e.push(this._genUILinkToC10("layoutProperty",n.get("DocumentRetention"),n.get("SetExternalRespostoryLabel"),this._setDocumentRetention.bind(this))),e.push(this._genUILinkToC10("viewArchivedVersions",n.get("viewCurrentVersions"),n.get("viewRunHistory"),this._viewCurrentVersion.bind(this))),e.push(this._genUILinkToC10("viewArchivedVersions",n.get("viewArchivedVersions"),n.get("viewRunHistory"),this._viewArchivedVersion.bind(this)))}return e},render:function(){return this._id=l.uniqueId("prop_"),this.renderPropertyUIControl({el:this.$el,glassContext:this.glassContext,readOnly:"document"!==this.objectInfo.type&&!a.hasPermissions(this.objectInfo,["write"]),items:this._getItems()})},_getModifiedOptions:function(e,t){var i=this._getReportOptions(),n=!1;if(t.hasOwnProperty(a.OPTION_OUTPUT_FORMAT)){var o={};o.name=a.OPTION_OUTPUT_FORMAT,o.type="runOptionStringArray",o.value=[t[a.OPTION_OUTPUT_FORMAT]],this._setReportOption(i,o,"Default"===o.value[0]),delete t[a.OPTION_OUTPUT_FORMAT],n=!0}if(t.hasOwnProperty(a.OPTION_OUTPUT_LOCALE)){var s={};s.name=a.OPTION_OUTPUT_LOCALE,s.type="runOptionLanguageArray",s.value=[t[a.OPTION_OUTPUT_LOCALE]],this._setReportOption(i,s,"Default"===s.value[0]),delete t[a.OPTION_OUTPUT_LOCALE],n=!0}if(t.hasOwnProperty(a.OPTION_ACCESSIBILITY_FEATURES)){var r={};r.name=a.OPTION_ACCESSIBILITY_FEATURES,r.type="genericOptionBoolean",r.value=t[a.OPTION_ACCESSIBILITY_FEATURES],this._setReportOption(i,r,"null"===r.value),delete t[a.OPTION_ACCESSIBILITY_FEATURES],n=!0}n&&l.extend(e,{options:i})},getModifiedProperties:function(){var e={},t=this.getPropertyUIControl().getModifiedProperties();return this._getModifiedOptions(e,t),this._getModifiedRetentions(e,t),l.extend(e,t),e}});return o}),define("bi/content_apps/PropertiesCapabilitiesTab",["q","bacontentnav/lib/@waca/core-client/js/core-client/ui/properties/PropertyTabView","bacontentnav/utils/UIHelper","bi/content_apps/utils/C10Utils","bi/content_apps/nls/StringResource","underscore"],function(e,t,i,n,o,s){"use strict";var r=t.extend({init:function(e){r.inherited("init",this,arguments),s.extend(this,e)},_setCapabilities:function(){n.openC10Morphlet(n.morphletMap.capabilities,this.objectInfo.type,this.objectInfo.id)},render:function(){return this._id=s.uniqueId("prop_"),this.renderPropertyUIControl({el:this.$el,glassContext:this.glassContext,items:[{name:"setCapabilities",type:"SingleLineLinks",items:[{align:"left",items:[{type:"text",name:"setCapabilitiesText",value:o.get("capabilities")}]},{align:"right",items:[{type:"text",name:"setCapabilitiesLink",value:o.get("SetCapabilitiesLabel"),clickCallback:this._setCapabilities.bind(this),ariaLabelledby:"setCapabilitiesText setCapabilitiesLink"}]}]}]})}});return r}),define("bi/content_apps/PropertiesJobTab",["bi/content_apps/PropertiesTab","bi/content_apps/nls/StringResource","bacontentnav/utils/ContentStoreObject","underscore"],function(e,i,a,l){"use strict";var t=e.extend({init:function(e){t.inherited("init",this,arguments),l.extend(this,e)},render:function(){this._id=l.uniqueId("prop_");var e=!a.hasPermissions(this.objectInfo,["write"]),t=!a.hasPermissions(this.objectInfo,["traverse"]);return this.renderPropertyUIControl({el:this.$el,glassContext:this.glassContext,items:[{type:"SingleLineLinks",name:"sectionRunHistory",readOnly:e,items:[{align:"left",items:[{type:"text",value:i.get("runHistory"),labelFor:"runHistory"}]},{align:"right",items:[{type:"Input",name:"runHistory",ellipses:!1,inputClass:"narrowInput",value:this._getRetentionValue("history"),validator:{isNumber:!0}},{type:"DropDown",name:"runHistoryUnit",ariaLabel:i.get("runHistoryUnits"),options:[{label:i.get("occurrences"),value:"occurrences",selected:"occurrences"===this._getRetentionUnit("history")},{label:i.get("days"),value:"days",selected:"days"===this._getRetentionUnit("history")},{label:i.get("months"),value:"months",selected:"months"===this._getRetentionUnit("history")}]}]}]},{type:"CollapsibleSection",label:i.get("advancedProperties"),name:"Advanced",items:[{name:"advancedProperties",type:"SingleLineLinks",readOnly:e||t,items:[{align:"left",items:[{type:"text",name:"advancedPropertiesText",value:i.get("jobAdvancedProperties")}]},{align:"right",items:[{type:"text",value:i.get("JobAdvancedSettings"),name:"advancedPropertiesLink",ariaLabelledby:"advancedPropertiesText advancedPropertiesLink",clickCallback:this._setAdvancedProperties.bind(this)}]}]}]}]})},_setAdvancedProperties:function(){var e={id:t.JOB_MGT,content:{objectInfo:this.objectInfo}};this.glassContext.appController.openAppView(t.JOB_MGT,e)},getModifiedProperties:function(){var e={},t=this.getPropertyUIControl().getModifiedProperties();return this._getModifiedOptions(e,t),this._getModifiedRetentions(e,t),l.extend(e,t),e},_getOutputFormat:function(){return a.getOption(this.objectInfo,a.OPTION_OUTPUT_FORMAT)},_getOutputLocale:function(){return a.getOption(this.objectInfo,a.OPTION_OUTPUT_LOCALE)},_getEnableAccessibilitySupport:function(){return a.getOption(this.objectInfo,a.OPTION_ACCESSIBILITY_FEATURES)},_getReportOptions:function(){return a.getOptions(this.objectInfo)},_getModifiedOptions:function(e,t){var i=this._getReportOptions(),n=!1;if(t.hasOwnProperty(a.OPTION_OUTPUT_FORMAT)){var o={};o.name=a.OPTION_OUTPUT_FORMAT,o.type="runOptionStringArray",o.value=[t[a.OPTION_OUTPUT_FORMAT]],this._setReportOption(i,o,"Default"===o.value[0]),delete t[a.OPTION_OUTPUT_FORMAT],n=!0}if(t.hasOwnProperty(a.OPTION_OUTPUT_LOCALE)){var s={};s.name=a.OPTION_OUTPUT_LOCALE,s.type="runOptionLanguageArray",s.value=[t[a.OPTION_OUTPUT_LOCALE]],this._setReportOption(i,s,"Default"===s.value[0]),delete t[a.OPTION_OUTPUT_LOCALE],n=!0}if(t.hasOwnProperty(a.OPTION_ACCESSIBILITY_FEATURES)){var r={};r.name=a.OPTION_ACCESSIBILITY_FEATURES,r.type="genericOptionBoolean",r.value=t[a.OPTION_ACCESSIBILITY_FEATURES],this._setReportOption(i,r,"null"===r.value),delete t[a.OPTION_ACCESSIBILITY_FEATURES],n=!0}n&&l.extend(e,{options:i})}});return t.JOB_MGT="job_mgt",t}),define("text!bi/content_apps/common/templates/PolicyDetail.html",[],function(){return'<div style="padding: 10px">\n\t<div class="policyDetailTitle">{{=it.strings.title}}</div>\n\t<div class="policyHeaderRow">\n\t\t<div class="policyHeaderLeft ellipses">{{=_.escape(it.owner)}}</div>\n\t\t<div class="policyHeaderRight">\n\t\t\t<div class="policyHeaderSeparator" ></div>\n\t\t\t<div class="simplifiedPermission">{{=it.simpliedPolicy}}</div>\n\t\t</div>\n\t</div>\n\t<div class="propertyUIControl policyDetail"> \n\t\t<table class="propertyRow" summary="{{=it.strings.title}}" role="grid" tabindex="0">\n\t\t\t<thead>\n\t\t\t\t<tr style=" position:absolute; left:-9999px">\n\t\t\t\t\t<th scope="col">{{=it.strings.columnLabelAccess}}</th> \n\t\t\t\t\t<th scope="col">{{=it.strings.columnLabelPermission}}</th>\n\t\t\t\t\t<th scope="col">{{=it.strings.columnLabelAction}}</th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\n\t\t\t{{ for(var prop in it.permIcons) { }}\n\t\t\t\t<tr>\n\t\t\t\t\t<td class="permission_{{=prop}}">\n\t\t\t\t\t\t<div title="{{=it.permIcons[prop].tooltip}}" alt="{{=it.permIcons[prop].tooltip}}" role="img" aria-label="{{=it.permIcons[prop].tooltip}}" tabindex="0">\n\t\t\t\t\t\t\t<svg role="presentation" class="svgIcon">\n\t\t\t\t\t\t\t\t<text>{{=it.permIcons[prop].tooltip}}</text>\n\t\t\t\t\t\t\t\t<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{{=it.permIcons[prop].icon}}"></use>\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td scope="row" class="policyDetailLabel" role="gridcell" aria-label="{{=it.permIcons[prop].label}}" tabindex="0">{{=it.permIcons[prop].label}}</td>\n\t\t\t\t\t<td id="{{=prop}}_id">\n\t\t\t\t\t\t{{?it.canModify}}\n\t\t\t\t\t\t<div role="button" class="clickable" aria-haspopup="true" name="{{=prop}}" tabindex="0" id="policyDetailsDropDown" aria-label="{{=it.strings.setAccess}}">\n\t\t\t\t\t\t\t<svg class="svgIcon">\n\t\t\t\t\t\t\t\t<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#common-titan-arrow-down"></use>\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{{?}}\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t{{ } }}\n\t\t\t</tbody>\n\t\t</table>\n\t\t</div>\n</div>\n'}),define("bi/content_apps/common/PolicyDetailsView",["bi/commons/ui/AccessibleView","doT","bacontentnav/common/ui/BreadcrumbDropDown","text!bi/content_apps/common/templates/PolicyDetail.html","bi/content_apps/nls/StringResource","bacontentnav/utils/PolicyHelper","bi/commons/ui/KeyCodes","bi/commons/utils/ContentFormatter","underscore"],function(e,l,i,p,c,u,t,d,a){"use strict";var n=e.extend({init:function(e){this.events={},this.events["keydown #policyDetailsDropDown"]="_handleKeyDown",n.inherited("init",this,arguments),a.extend(this,e)},_refreshPermissionUI:function(t){var e=this.$el.find(".permission_"+t),i=this.$el.find(".simplifiedPermission"),n=this.$el.find("#"+t+"_id");i.text(u.getSimplifiedPermissions(this.objectInformation.permissions)),e.empty();var o=a.find(this.objectInformation.permissions,function(e){return e.name===t}),s=o?o.access:"default",r=$('<div title="'+c.get(s)+'"><svg class="svgIcon"><text>'+s+'</text><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#common-'+s+'_perm"></use></svg></div>');e.append(r),n.children("div").focus()},_updatePermission:function(t,e){if("default"===e){var i=a.reject(this.objectInformation.permissions,function(e){return e.name===t});this.objectInformation.permissions=i}else{var n=a.find(this.objectInformation.permissions,function(e){return e.name===t});n||(n={name:t},this.objectInformation.permissions.push(n)),n.access=e}this._refreshPermissionUI(t),"function"==typeof this.enableParentApplyButton&&this.enableParentApplyButton()},_onMenuSelect:function(e,t){var i=t.children("div").attr("name");this._updatePermission(i,e)},updateRead:function(e){this._updatePermission(u.permissionEnum.r,e)},updateWrite:function(e){this._updatePermission(u.permissionEnum.w,e)},updateExecute:function(e){this._updatePermission(u.permissionEnum.x,e)},updateSetPolicy:function(e){this._updatePermission(u.permissionEnum.sp,e)},updateTraverse:function(e){this._updatePermission(u.permissionEnum.t,e)},getOwnerName:function(){return this.ownerData.givenName&&this.ownerData.surname&&this.objectInformation.securityObject.defaultName===this.ownerData.defaultName?this.ownerData.givenName+" "+this.ownerData.surname:this.objectInformation.securityObject.defaultName},render:function(){var e=this.getOwnerName(),t=["read","write","execute","traverse","setPolicy"],i=u.getIconsForPermissionValues(this.objectInformation.permissions),n=l.template(p)({oData:this.objectInformation,simpliedPolicy:u.getSimplifiedPermissions(this.objectInformation.permissions),permIcons:i,canModify:this.canModify,owner:e,strings:{title:c.get("permissionDetails"),grant:c.get("grant"),deny:c.get("deny"),default:c.get("default"),columnLabelAccess:c.get("permissionDetailsColumnAccess"),columnLabelPermission:c.get("permissionDetailsColumnPermission"),columnLabelAction:c.get("permissionDetailsColumnAction"),setAccess:c.get("permissionSetAccess")}});this.$el.append(n);var o=this.$el.find(".ellipses");$.each(o,function(e,t){d.middleShortenString(t)});for(var s=0;s<t.length;s+=1){var r=t[s]+"_id",a=this.$el.find("#"+r);this._createDropDown(a)}return this.$el.closest(".flyoutPane").attr({"aria-label":c.get("permissionDetails"),role:"region"}),this.$el.find(".propertyRow").focus(),Promise.resolve()},setFocus:function(){var e=this.$el.find("#policyDetailsDropDown");e&&e.focus()},_createDropDown:function(e){var t=[{label:c.get("grant"),icon:"common-grant_perm",onSelect:this._onMenuSelect.bind(this,"grant",e)},{label:c.get("deny"),icon:"common-deny_perm",onSelect:this._onMenuSelect.bind(this,"deny",e)},{label:c.get("default"),icon:"common-default_perm",onSelect:this._onMenuSelect.bind(this,"default",e)}];this.ddMenu=new i({dropDownMenuSpec:{title:c.get("permissionSetAccess"),id:"myId",label:"mylabel",icon:"",items:t,actionElement:e,ddMenuPlacement:"bottom"}}),this.ddMenu.render()},_handleKeyDown:function(e){e.keyCode===t.DOWN_ARROW&&$(e.currentTarget).closest("td").click()}});return n}),define("js/content_apps/propertiesBundle",function(){});