Skip to main content

Samo-comments

Header

Level: Beginner

Keywords: comments, collaboration platform, discussion, communication, answer, reply

The result: module for adding comments in entity Information Detail

How to implement samo-comments module?

1. LIDS metadata

If we want to be able to add comments to specific existing SAMO Entity, at first, we need to allow and define and configure the LIDS collaboration extension.

To define the LIDS collaboration extension, we need to create the create collaboration.xml in \lids-as\extensions folder. In order to be able to use this extension for specific features, we must add them to corresponding tags (<ber:subscriptionConfiguration>, <ber:commentConfiguration>).

define collaboration extension - LIDS collaboration.xml example
<?xml version="1.0" encoding="utf-8"?>
<ber:collaboration xmlns:ber="http://www.berit.com/ber" xmlns:xlink="http://www.w3.org/1999/xlink">
<ber:version>
<ber:metadata>1</ber:metadata>
<ber:minClient>5140</ber:minClient>
<ber:minAS>12601</ber:minAS>
</ber:version>
<ber:subscription>
<ber:notification>
<ber:email>
<ber:smtpHostName>smtp.intranet.local</ber:smtpHostName>
<ber:smtpPort>25</ber:smtpPort>
<ber:senderEmailAddress>SAMO@asseco-ce.com</ber:senderEmailAddress>
</ber:email>
</ber:notification>
<ber:subscriptionConfigurations>
<ber:subscriptionConfiguration>
<ber:featureTypes>
<ber:featureTypeRef id="ft_defDefect*" />
<ber:featureTypeRef id="ft_example" />
</ber:featureTypes>
<ber:defaultEvents>
<ber:event>commentCreated</ber:event>
</ber:defaultEvents>
<ber:autoSubscriptions>
<ber:autoSubscription>
<ber:onEvents>
<ber:event>featureCreated</ber:event>
</ber:onEvents>
<ber:subscribeToEvents>
<ber:event>featureUpdated</ber:event>
<ber:event>commentCreated</ber:event>
<ber:event>commentUpdated</ber:event>
</ber:subscribeToEvents>
</ber:autoSubscription>
<ber:autoSubscription>
<ber:onEvents>
<ber:event>commentCreated</ber:event>
</ber:onEvents>
<ber:subscribeToEvents>
<ber:event>commentCreated</ber:event>
<ber:event>commentUpdated</ber:event>
</ber:subscribeToEvents>
</ber:autoSubscription>
</ber:autoSubscriptions>
</ber:subscriptionConfiguration>
</ber:subscriptionConfigurations>
</ber:subscription>
<ber:commentConfigurations>
<ber:commentConfiguration>
<ber:featureTypes>
<ber:featureTypeRef id="ft_defDefect*" />
<ber:featureTypeRef id="ft_example" />
</ber:featureTypes>
</ber:commentConfiguration>
</ber:commentConfigurations>
</ber:collaboration>

2. SAMO metadata

Now we can include samo-comments module in the Information detail of chosen entity. In this case the configuration options are pretty straightforward. Following example contains only required properties, all options are available in Dynamic-App Module Catalog.

samo-comments - configuration example
{
"detail" : {
"default" : {
"sections" : [
{
"icon": "cbu-icons:comments",
"module": {
"title": "Comments",
"type": "component:entity-modules/collaboration/comments/samo-comments"
}
}
]
}
}
}

There is another module related to samo-comments, called samo-subscriptions. This module enables configuration of notifications, which are being sent after certain events (e.g. adding new comment, updating feature) occur.

samo-subscriptions - configuration example
{
"icon": "icons:visibility",
"collapsed": false,
"module": {
"type": "component:entity-modules/collaboration/subscriptions/samo-subscriptions",
"events": [
"featureUpdated",
"commentCreated"
]
}
}