Creatio development guide
PDF
This documentation is valid for Creatio version 7.11.0. We recommend using the newest version of Creatio documentation.

PortalMessagePublisherExtensions mixin. Portal messages in SectionActionDashboard

Glossary Item Box

Introduction

A mixin is a class designed to extend the functions of other classes. Mixins are separately created classes with additional functionality. Learn more about mixins in the “Mixins. The "mixins" property article.

The PortalMessagePublisherExtensions mixin is used for the extension of the SectionActionDashboard schema (and its derived schemas). It allows you to extend the configuration of the SectionActionDashboard tabs with the PortalMessageTab portal message tab and add the corresponding Portal message portal. The mixin is implemented in the PortalMessagePublisher package and is available in the ServiceEnterprise product (or in the bundles that include this product).

Methods

Name Description
extendTabsConfig(config) : Object

Extends the configuration of the SectionActionDashboard tabs with the PortalMessageTab portal messages tab.

Returns the augmented object (Object) of the SectionActionDashboard tab configuration.

The config parameter (Object) – SectionActionDashboard tab configuration object.

extendSectionPublishers(publishers) : Array

Adds a portal channel (Portal) to the message publisher collection.

Returns the augmented collection of message publishers (Array).

The publishers (Array) parameter is the collection of message publishers.

Use case

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*/
    };
});

 

© bpm'online 2002-2018.

Did you find this information useful?

How can we improve it?