Message between users

Is it possible to exchange message between the logged-in users (between two users or a group of users) of application based on CUBA-PLATFORM?

1 Like

Hi,

yes it is. I did that a while ago as an example:

It is in raw form, but if you have any ideas on how to improve it, we can make it a application component, so that you can just add it as a dependency and use it.

Bye
Mario

Thanks for sharing your sample app. I couldn’t open the messageService file though.

Did you use any thread or timer to refresh the message to the user mail button?

Hi,

what do you mean by you could not open the service file? If you have trouble you can take a look at the github browser: https://github.com/mariodavid/cuba-example-user-messaging/blob/master/modules/global/src/com/company/ceum/service/MessageService.java

No, i didn’t update the mail button badge. This should definitely be done. Probably with the same idea which is used for “Application folders”, so basically using a timer.

Actually the example goes a little bit beyond that. It is about the fact that not only users can mail users, but the system might mail a user too. This is more like a notification where a “customer got created” etc. The entity reference will be stored in the message as well, giving the user the ability to get a message with the context of an entity.

The example contains some stuff i would do differently in the meantime. I’ll probably create an app component which allows to communicate between users and which has some kind of notification system.

If you have any ideas around that topic, you can share it here…

Bye

Hi Mario
That will be good if this can be turned into an app component.

I have similar ideas to implement inside an application I am working on. I already have used badge (Vaadin Overlays) in my application to indicate the messages unread! When the user receives a message the timer is helping update the badge with number of notifications. I am using 2 badges for now to classify, first one is just a pure message from other users (sent/received) and 2nd one is notifications from the app system e.g. an invoice is waiting for your approval! First is done and will work on 2nd badge -wondering if there is any way we can link it with BPM work-flow!! Any ideas?

Now I shall also work on drilling down the notifications to respective Entity where the action is awaiting for the user or this might be just information for the user to have a look. By clicking the displayed list (may be in a table) the system will take the user directly to the expected action!

Hi, I’m currently working on the same thing in my app, but in my case the system should send messages to users as well. Hope it will be implemented in platform by default someday))

Found system notifications, sorry. Now can you provide some info, how to add this sample to my project? and add a sticker to a button is user has unread messages?

Hi Ivan
Do you mean how to add sticker to a button? Did you try Vaadin Overlay addon?
It appears like the image attached in my app.

badge

looks like what i need. can you provide me some more info about how to do it, please?

Hi, first of all thank you for that module, can you, please tell me, how to make CUBA create me ServiceBeans that have extensions *.groovy, but not *.java?
When i try to do it manually, by renaming an automatically created file from java to groovy, compiler writes that it expects EOF, but found a package operator… What am i doing wrong?
When i set the Language in CUBA Studio as groovy - i get java.lang.UnsupportedOperationException: Node is NOT_FOUND.
I’m currently using CUBA on an offline machine, maybe i should get online and download something?

Hi,

in fact i extracted this as an application component that you can use out of the box:

Regarding your question: Probably, you just need to enable Groovy for your CUBA application. You can do that through studio: Groovy support checkbox on the Project properties > Advanced. After that, when creating a service via studio it will ask you what language you prefer.

Bye