Skip to main content
Version: 8.1

Example of using the PortalMessagePublisherExtensions mixin

Level: advanced
Example

Using the PortalMessagePublisherExtensions mixin.

Example implementation

CaseSectionActionsDashboard
define("CaseSectionActionsDashboard", ["PortalMessagePublisherExtensions"], function() {
return {
mixins: {
/**
* @class PortalMessagePublisherExtensions extends tabs and publishers configs.
*/
PortalMessagePublisherExtensions: "Terrasoft.PortalMessagePublisherExtensions"
},
methods: {
/**
* @inheritdoc Terrasoft.SectionActionsDashboard#getExtendedConfig
* @overridden
*/
getExtendedConfig: function() {
// Getting the tab configuration object from the parent method.
var config = this.callParent(arguments);
// Calling the mixin method, adding a portal tab configuration.
this.mixins.PortalMessagePublisherExtensions.extendTabsConfig.call(this, config)
// Returns the extended configuration object.
return config;
},

/**
* @inheritdoc Terrasoft.SectionActionsDashboard#getSectionPublishers
* @overridden
*/
getSectionPublishers: function() {
// Getting a collection of message publishers from the parent method.
var publishers = this.callParent(arguments);
// Calling the mixin method, adding a portal channel.
this.mixins.PortalMessagePublisherExtensions.extendSectionPublishers.call(this, publishers);
// Returns the extended collection of message publishers.
return publishers;
}
},
diff: /**SCHEMA_DIFF*/[
{
"operation": "insert",
"name": "PortalMessageTab",
"parentName": "Tabs",
"propertyName": "tabs",
"values": {
"items": []
}
},
{
"operation": "insert",
"name": "PortalMessageTabContainer",
"parentName": "PortalMessageTab",
"propertyName": "items",
"values": {
"itemType": this.Terrasoft.ViewItemType.CONTAINER,
"classes": {
"wrapClassName": ["portal-message-content"]
},
"items": []
}
},
{
"operation": "insert",
"name": "PortalMessageModule",
"parentName": "PortalMessageTab",
"propertyName": "items",
"values": {
"classes": {
"wrapClassName": ["portal-message-module", "message-module"]
},
"itemType": this.Terrasoft.ViewItemType.MODULE,
"moduleName": "PortalMessagePublisherModule",
"afterrender": {
"bindTo": "onMessageModuleRendered"
},
"afterrerender": {
"bindTo": "onMessageModuleRendered"
}
}
}
]/**SCHEMA_DIFF*/
};
});