eZ Community » Forums » General » Browser notification message
expandshrink

Browser notification message

Browser notification message

Friday 27 February 2015 3:31:10 pm - 6 replies

Hi,
Is it possible to add notifiication message (ex. jquery growl) on some content actions?
I would like to add notification when user saves object on the frontend. I'm using legacy code 2014.11.
Thank you

Friday 27 February 2015 6:03:42 pm

Hello Sebastian,

While I think your idea is interesting ... I personally always loved my osx / linux growl messages.

I think this would be complicated to implement.

I think this because in eZ Publish (Legacy, To My Knowledge) there is no notice that a publish operation has been completed successfully on the user siteaccess, only on error, instead you are redirected back to the view of the modified page with no hint at all that you were editing / publishing previously.

You could create a custom workflow event triggered to run each time after a content object is published which sets a custom session variable and then add additional javascript to query a custom module view to return additional information on the published content object to display via growl js library on page load and or query this custom module view at regular timed intervals to simulate push style notifications based on the custom http or session variable information (hint use an array as this would need to provide for multiple concurrent messages as the use case is more complicated that 1on1 string use).

You may or may not wish this workflow event to be user specific. You could make this a custom ini setting option to make the workflow event more flexible (though if you use php sessions for temp storage the variable would already be user specific, on this aspect i'm not certain of the best answer offhand).

I also found this tool which seemed related / interesting: https://pusher.com/tutorials/html5_realtime_push_notifications

It seems like a lot of work for very little real benefits but perhaps you have a real need that goes beyond the default eZ Publish model. 

I hope this helps!

Cheers,
Heath

Modified on Saturday 28 February 2015 3:11:53 am by // Heath

Saturday 28 February 2015 1:04:04 am

Hi Heath,
Thank you for your detailed explanation and good advices.
Cheers

Saturday 28 February 2015 7:45:04 pm

Hello Sebastian,

Your very welcome. I'm happy to help you.

I wanted to make one last suggestion, after some thought I think it would be best to avoid use of the php session layer entirely and instead use eZPersistentObject for storage within the database. This would provide for a couple of important use cases: multiple messages, multi-user messages, workflow based delayed publishing support and more (I ran out of ideas for a second).

If you do create a solution, would you consider sharing it on GitHub and linking this thread to your solution?

I would love to review it, try it out and perhaps other people with this need would also like to try it out.

I hope this helps!

Cheers,
Heath

Sunday 15 March 2015 1:37:31 pm

Hi Sebastian.

Since you're using 2014.11, if your frontend is based on Symfony2 and not Legacy fallback, you're very fortunate: there are plenty of ways to do what you're asking for.

I'm not the most knowledgeable when it comes to frontend, but a quick search for symfony2 flashbag jquery growl came up with "Notification messages for JSON responses with jQuery and Symfony2". This should cover the whole chain up to the browser.

Now all you need to do is hook into the SignalSlot layer. You can find a publishing SignalSlot example in our Recommendation Bundle. Covering signals from legacy is unfortunately not that simple... in this same bundle, we use a custom search engine, but it's not the thinest integration ever.

Sunday 31 May 2015 5:38:32 pm

Hello Sebastian,

I am posting a reply to this thread again because i found out recently that in the new PlatformUI a solution is appears to be provided for this need by default. I found this preview video just the other day and got excited to share it with you: https://www.youtube.com/watch?v=fdoRhYnykz4

So it seems that a solution everyone can use will be part of the new symfony based admin when it is released.

I also stumbled upon this interesting solution while doing some more research on the subject which might be even more useful to leverage in the future with PlatformUI:

http://jolicode.com/blog/desktop-notification-in-php

I hope this helps! Best wishes

Cheers,
Heath

Sunday 07 June 2015 5:33:37 pm

Hi.
@Bertrand & @Heath:
Thank you guys for the feedback.

I'm using only legacy code for now. So, I'll be able to implement mentioned functionallity only with symfony2 implementation. I hope that I'll try that in the near future.

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from