Notification Center for Joomla

410 views
Skip to first unread message

Júlio Pontes

unread,
Dec 8, 2011, 6:17:26 PM12/8/11
to Joomla! Platform Development
I just had lot of code developed here, but decided to refactoring and
share the idea with you, maybe will be interresting for platform.

The idea is create a notification center like iOS for Joomla!, but
first we need to start with basic.
Register activity from extensions.

I´ve thinked in 2 ways of doing this:

a) Create a activity definition for every extension.
1) Build a XML with definition of activites
2) Create a "notification" plugin that map/register actions in
current scope
b) Dispatch a plugin beforeExecute a task in JController, execute
method. (change in JController)
1) Here we can build a genericly notification using "Application
name", "current user", "date time", "task". But if we need specific
information from task we need to "map" this data and register bofore
save

Ex.: Júlio has created a new banner "title of banner here" 20 secs ago

For create this notification we need a little bit more information.
Before save this information we need to recover specify some arguments
that can be used on your string.

In my example, I´ve decided to use this notation:

PLG_NOTIFICATION_BANNER_SAVE="{myinfo} has created a new banner:
{title}"

in pt-BR we can change use {VAR} in diff case that is better for
understand.

PLG_NOTIFICATION_BANNER_SAVE="o baner {title} foi criado por {myinfo}"

I guess using {VAR} is better because in others languages people can
decide where the var goes in.

Ps.: In my extension I´ve implented 1st idea. If anyone has interrest
to see the project its on github. But I´ll refectoring using J!
codestyle. https://github.com/juliopontes/joomla-notification-center

Waiting for feedback.

Cheers,

Nicholas K. Dionysopoulos

unread,
Dec 8, 2011, 6:22:38 PM12/8/11
to joomla-de...@googlegroups.com
Hi Julio,

You are up to something very good. For years, people say that Joomla! is missing an audit trail for back-end actions. What you are proposing would better be made into an audit trail component. Creating a status module which can display the last 10 actions is easy after that. But the audit trail feature would kick some serious ass!  More so if each audit trail item stores, in separate fields, the component name, a component area and an ID, along with user ID and timestamp. This would allow, for example, com_content to show every single edit made to a specific article. Or com_categories show each and every edit made to a category. That would be amazingly helpful in a multi-author or multi-administrator environment :)

-- 
Nicholas K. Dionysopoulos
Lead Developer, AkeebaBackup.com

Júlio Pontes

unread,
Dec 8, 2011, 6:23:38 PM12/8/11
to Joomla! Platform Development
Just adding a preview of visual like iOS notifications:

http://jsfiddle.net/Wgyqq/5/

On Dec 8, 9:22 pm, "Nicholas K. Dionysopoulos" <nikosd...@gmail.com>
wrote:

> > codestyle.https://github.com/juliopontes/joomla-notification-center
>
> > Waiting for feedback.
>
> > Cheers,

brian teeman

unread,
Dec 8, 2011, 6:37:21 PM12/8/11
to joomla-de...@googlegroups.com
Isn't this the same thing as Activity Log from adminpraise.com or scout from dioscouri ?? 

Júlio Pontes

unread,
Dec 8, 2011, 6:44:19 PM12/8/11
to Joomla! Platform Development
I think no Brian, because adminprise solution has not support 3rd
extensions. I guess adminprise not have a "multilingue" activites. (I
dont know). Else I guess this solution "will be" more interactive,
pushing notification in real time.

Júlio Pontes

unread,
Dec 8, 2011, 6:45:51 PM12/8/11
to Joomla! Platform Development
here is a example of using 1st implementation idea: Create plugins for
notifications.

https://github.com/juliopontes/joomla-notification-center/blob/master/plugins/notification/banners/banners.php

brian teeman

unread,
Dec 8, 2011, 7:05:13 PM12/8/11
to joomla-de...@googlegroups.com
Actually they both do have support for extensions just not many. /me doesnt like to re-invent the wheel unless it is rounder

Janich

unread,
Dec 8, 2011, 7:54:00 PM12/8/11
to Joomla! Platform Development
I agree with Nicholas. This is very much needed for Joomla to get in
to corporations/companies where auditlogs/ a good history is needed
for documentation, rules, safety or law.The logs/error.php is simply
too ... basic.
Anyway, Brian is right too. This is something that _can_ be achieved
with extensions, and Ill just give a brief example hereof:I used Scout
from Dioscouri to do something similar to this some time ago. We
simply needed a history for our frontline supporters, who were in
another department.But instead of keeping it to only actions, we took
it a step further and made our own plugins for Scout that could show
the exact information changed.
The log would say "User XXX changed profile YYY" and the details would
be "email(o...@email.com >> n...@email.com)". Everything were linked
together so an adminstrator could easily search on everything a
specific user had done.I dont think its possible to store all data
this detailed, but for some parts it is very relevant (ie profiles).
After a few weeks we had several mio. entries in the database (which
slowed down the component tremendously), so we had to find a plan for
archiving and clearing the older actions (needed due to law and
company rules).Cron were the solution here, but can we depend on using
that in the platform?
Ok, perhaps we stored too much, but this were essential in this case.
What Im trying to say is, it needs good attention and careful
planning, but indeed, if the platform had some base platform to store
this kind of log, I think it would be a good step in the right
direction.

On Dec 9, 1:05 am, brian teeman <jooml...@googlemail.com> wrote:>
Actually they both do have support for extensions just not many. /me
doesnt> like to re-invent the wheel unless it is rounder

Júlio Pontes

unread,
Dec 8, 2011, 8:19:43 PM12/8/11
to joomla-de...@googlegroups.com
Some points,

1) we can use a com_messages for display activities, so we dont need to create a new extension for list data.
2) My implementation it just a idea for test if "its possible".

Andrew Eddie

unread,
Dec 8, 2011, 10:27:34 PM12/8/11
to joomla-de...@googlegroups.com
The way I've done this at work is using "push" instead of "pull". The
code pushes activities to a stream, rather than the application trying
to guess what's going on. It's much more efficient.

My thoughts are we can already achieve this with by using JLog. See
http://developer.joomla.org/manual/ch01s04.html

Going a bit further, you could craft an activity logger for JLog which
has a bit more information and store key metrics in a JSON string.

Anyway, that's how I've solved it so far. There's already an
onBeforeExecute and onAfterExecute in JWeb as well.

Regards,
Andrew Eddie
http://learn.theartofjoomla.com - training videos for Joomla 1.7 developers

Matt Thomas

unread,
Dec 8, 2011, 8:27:46 PM12/8/11
to joomla-de...@googlegroups.com
Very cool!

How does this compare to LOGman?

Best,

Matt Thomas
Founder betweenbrain
Phone: 203.632.9322
Twitter: @betweenbrain

Elin Waring

unread,
Dec 9, 2011, 4:41:07 AM12/9/11
to joomla-de...@googlegroups.com
I think it's great that there are extensions, but the fact is that none of those teams have offered to put their products into the core. If any of those teams wants to make a fork with that intention they can and it would be awesome, but in the meantime if this is something that should be in the core (open question) and we have JLog, don't discourage anyone from working to achieve that.

Elin

Hannes Papenberg

unread,
Dec 9, 2011, 6:09:26 AM12/9/11
to joomla-de...@googlegroups.com
I, too, would rather see this being part of JLog, maybe a logging level
or something. Purely in terms of style: I'd like to see us use growl
style notifications in the backend for all sorts of messages. That would
be especially usefull when making stuff like publishing an item
ajaxified. You click the icon, the item is published, and the response
is parsed into a growl box that shortly after disappears. It would solve
the problem of notifying the user when writing an ajaxified extension.

Hannes

Júlio Pontes

unread,
Dec 9, 2011, 7:01:03 AM12/9/11
to Joomla! Platform Development
Hi guys,

The reason of refactoring is to use JLog, when I made first version, I
just started to think a solution to works. Maybe now its not the best
solution. I'll start to think on refactoring using JLog and if we need
a component to display historical activities, in my opinion we can
extend com_messages. I like the idea of creat a growl box like
http://www.coldfiredesigns.com/2010/?p=1

I agreed with you guys, my extension has lot of unecessary code, we
can clean a lot and use JLog. I'll plan a refactoring and take a look
on JWeb like Andrew told.

On 9 dez, 08:09, Hannes Papenberg <hackwa...@googlemail.com> wrote:
> I, too, would rather see this being part of JLog, maybe a logging level
> or something. Purely in terms of style: I'd like to see us use growl
> style notifications in the backend for all sorts of messages. That would
> be especially usefull when making stuff like publishing an item
> ajaxified. You click the icon, the item is published, and the response
> is parsed into a growl box that shortly after disappears. It would solve
> the problem of notifying the user when writing an ajaxified extension.
>
> Hannes
>
> Am 09.12.2011 04:27, schrieb Andrew Eddie:
>
>
>
>
>
>
>
> > The way I've done this at work is using "push" instead of "pull".  The
> > code pushes activities to a stream, rather than the application trying
> > to guess what's going on.  It's much more efficient.
>
> > My thoughts are we can already achieve this with by using JLog.  See
> >http://developer.joomla.org/manual/ch01s04.html
>
> > Going a bit further, you could craft an activity logger for JLog which
> > has a bit more information and store key metrics in a JSON string.
>
> > Anyway, that's how I've solved it so far.  There's already an
> > onBeforeExecute and onAfterExecute in JWeb as well.
>
> > Regards,
> > Andrew Eddie

> >http://learn.theartofjoomla.com- training videos for Joomla 1.7 developers

Júlio Pontes

unread,
Dec 12, 2011, 9:57:13 AM12/12/11
to Joomla! Platform Development
Hi guys,

just another point. I guess will need a way to "disable/enable"
notification. Will use JLog, its easy to implement in any extension,
but need a control of logging. So, I´ve thinked some like ACL does.
All extensions implement ACL só in component parameters we have a
"permissions" tab. We need to think in same way and create a
"Notifications" tab, to people can disable, enable notifications types
like: new items, edit items, etc.

What do you think?

On Dec 9, 10:01 am, Júlio Pontes <juliopfn...@gmail.com> wrote:
> Hi guys,
>
> The reason of refactoring is to use JLog, when I made first version, I
> just started to think a solution to works. Maybe now its not the best
> solution. I'll start to think on refactoring using JLog and if we need
> a component to display historical activities, in my opinion we can

> extend com_messages. I like the idea of creat a growl box likehttp://www.coldfiredesigns.com/2010/?p=1


>
> I agreed with you guys, my extension has lot of unecessary code, we
> can clean a lot and use JLog. I'll plan a refactoring and take a look
> on JWeb like Andrew told.
>
> On 9 dez, 08:09, Hannes Papenberg <hackwa...@googlemail.com> wrote:
>
>
>
>
>
>
>
> > I, too, would rather see this being part of JLog, maybe a logging level
> > or something. Purely in terms of style: I'd like to see us use growl
> > style notifications in the backend for all sorts of messages. That would
> > be especially usefull when making stuff like publishing an item
> > ajaxified. You click the icon, the item is published, and the response
> > is parsed into a growl box that shortly after disappears. It would solve
> > the problem of notifying the user when writing an ajaxified extension.
>
> > Hannes
>
> > Am 09.12.2011 04:27, schrieb Andrew Eddie:
>
> > > The way I've done this at work is using "push" instead of "pull".  The
> > > code pushes activities to a stream, rather than the application trying
> > > to guess what's going on.  It's much more efficient.
>
> > > My thoughts are we can already achieve this with by using JLog.  See
> > >http://developer.joomla.org/manual/ch01s04.html
>
> > > Going a bit further, you could craft an activity logger for JLog which
> > > has a bit more information and store key metrics in a JSON string.
>
> > > Anyway, that's how I've solved it so far.  There's already an
> > > onBeforeExecute and onAfterExecute in JWeb as well.
>
> > > Regards,
> > > Andrew Eddie

> > >http://learn.theartofjoomla.com-training videos for Joomla 1.7 developers

Júlio Pontes

unread,
Dec 12, 2011, 7:03:40 PM12/12/11
to Joomla! Platform Development
Joomla! Notification Center

You get all kinds of notifications on Joomla! CMS. With this new
feature, you can keep track of them all in one convenient location.

ACL Notification Permissions

People need to know who can have permissions to be notified. So I´ve
start to think on default settings for 3rd extensions dev. that need
to implement notifications in your extension.
<?xml version="1.0" encoding="utf-8" ?>
<access component="com_content">
<section name="component">
<!-- enable notification -->
<action name="core.notify" title="JACTION_NOTIFY_COMPONENT"
description="JACTION_NOTIFY_COMPONENT_DESC" />
<!-- default notification enable -->
<action name="core.notify.unpublish"
title="JACTION_NOTIFY_UNPUBLISH"
description="JACTION_NOTIFY_UNPUBLISH_DESC" />
<!-- default notification enable -->
<action name="core.notify.publish" title="JACTION_NOTIFY_PUBLISH"
description="JACTION_NOTIFY_PUBLISH_DESC" />
<!-- default notification enable -->
<action name="core.notify.delete" title="JACTION_NOTIFY_DELETE"
description="JACTION_NOTIFY_DELETE_DESC" />
</section>
<section name="category">
<!-- enable notification for categories -->
<action name="core.notify" title="COM_CATEGORIES_NOTIFY"
description="COM_CATEGORIES_NOTIFY_DESC" />
<!-- notify when save category -->
<action name="core.notify.save" title="COM_CATEGORIES_NOTIFY_SAVE"
description="COM_CATEGORIES_NOTIFY_SAVE_DESC" />
<!-- notify when unpublish category -->
<action name="core.notify.unpublish"
title="COM_CATEGORIES_NOTIFY_UNPUBLISH"
description="COM_CATEGORIES_NOTIFY_DELETE" />
<!-- notify when publish category -->
<action name="core.notify.publish"
title="COM_CATEGORIES_NOTIFY_PUBLISH"
description="COM_CATEGORIES_NOTIFY_DELETE" />
<!-- notify when delete category -->
<action name="core.notify.delete"
title="COM_CATEGORIES_NOTIFY_DELETE"
description="COM_CATEGORIES_NOTIFY_DELETE" />
</section>
<section name="article">
<!-- enable notification -->
<action name="core.notify" title="COM_CONTENT_NOTIFY_ARTICLE"
description="COM_CONTENT_NOTIFY_ARTICLE_DESC" />
<!-- notify when save article -->
<action name="core.notify.save"
title="COM_CONTENT_NOTIFY_SAVE_ARTICLE"
description="COM_CONTENT_NOTIFY_SAVE_ARTICLE_DESC" />
</section>
</access>

I found a great example in jquery, but when you have lot of "growl"
messages, its better to display like TweetDeck alert does.

http://www.plumtheory.com/demos/notification-center/light/

Realtime Notifications

This is a important decision we have 2 ways that I know for doing
this. We can use http://nodejs.org or http://www.ape-project.org/ in
my opinion nodejs its better.

> > > >http://learn.theartofjoomla.com-trainingvideos for Joomla 1.7 developers

Elin Waring

unread,
Dec 13, 2011, 10:32:33 AM12/13/11
to joomla-de...@googlegroups.com
I think it's probably not right to use the permissions ACL for this at least not in this exact way of creating a ton of new actions.   This is for a few reasons, some practical and some about really how acl works.

So, permissions are about actions on assets. A component is an asset, as is a category and if tracked, an item in a category.  
An action is something like create, delete, edit, edit.state.he
In fact you are not creating permission to notify. Notification is happening. What you are doing is saying who that notification should go to or who should see it. So one thought might be that is really about SEEING not doing as we separate the concepts in the Joomla ACL implementation if you are talking about something like who has access.So I would think you might  want to think about handling that with an access level which has so much less over head and also works much more  linearly  (you don't have to start doing factorials to see the possibilities, it is just yes or no). Just let people assign VAL to a particular component's  different types of notifications.

On the other hand with a backend notification UI you would possibly want to use the normal ACL permissions such as access to give groups access to the notification center,  delete to manage the actual notifications themselves etc. There is where you would want to possibly have sections so that perhaps some users are able to do delete some history and others are able to delete other history. So in other words you may want to simplify and let the permissions for notifications fall back on the same core vocabulary as everything else, allow inheritance so right off the top you would with the core default permissions just have admin and super admin access and delete and edit etc rather than having to go set values for all these other ones. I think it would be much more parsimonious and also just plain easier to manage and better for performance not to have to add all those extra JSON strings to check.


Just some thoughts.  Really cool work.

Elin

Júlio Pontes

unread,
Dec 14, 2011, 6:00:46 PM12/14/11
to joomla-de...@googlegroups.com
Thanks Elin :)

You´re right. I will work on some ideas and give feedback here.

Júlio Pontes

unread,
Dec 18, 2011, 2:39:16 PM12/18/11
to Joomla! Platform Development
Working on Notification Center I made some JS to increment bubble.

http://twitpic.com/7ulqto

I'm working on extension but I've some questions. I've think on create
another xml file like access.xml but for notification config.
- Notifications will have custom options by controller/actions. Ex.:
Articles.publish, Article.save, articles.delete, etc.
- Notification can be viewed for custom groups
- Notification can have custom config for extension necessities (Some
fields: Sound, Alert Style, Show items)

To made this I decide to have a "notification.xml" on your extension
folder. if this file not exists I can get default form on
com_notificationcenter extension.

What do you think about this?

iOS Examples photos:
http://gigaom2.files.wordpress.com/2011/10/ios-5-notification-settings-cropped.png
howto.cnet.com/i/tim/
2011/09/27/5_iOS_5_Notification_Center_362x272.png

Júlio Pontes

unread,
Dec 18, 2011, 2:41:30 PM12/18/11
to Joomla! Platform Development
Just another question:

Extensions not have an icon, so I've think on put extension icon on notify.xml but I guess is better on manifest.xml.

What do you think?
Reply all
Reply to author
Forward
0 new messages