Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: DAViCal: General

Detecting change in calendar events?

 

 

DAViCal general RSS feed   Index | Next | Previous | View Threaded


skeezix at skeleton

Apr 3, 2012, 1:57 PM

Post #1 of 4 (459 views)
Permalink
Detecting change in calendar events?

Hey everyone,

I'm looking for a method by which changes made to a celandar may
have notifications emailed to someone; not event reminders or testing
for reads or syncs, but actual changes against events.

I'm fairly certain something doesn't exist already, but if so..
awesome :) Specifically, I'm thinking that should I (for example) make a
change on my phone that syncs up to my davical instance, it'd be great for
my wife to get an email to remind her to check the Agendav web based
version at her leisure, for instance. Including content of change might be
nice, but really I'm just looking to send 'A change has been made' hints
to interested parties. If kid checks in a change to calendar, we may need
to go look :)

In the event something doesn't yet exist, I'd like to make a quick
hack for the short term as I'm not in a position to help build a more
general solution right now..

If someone knows a query against the DB that emits something along
the lines of a yes/no, or count of the number of changes in the last 24
hours (say), that'd do the trick. I'm quite busy of late so not had time
to go digging through the DB schema or the like :(

I was thinking of something rudimentary along the lines of this
pseudo-query:
> Select count(*) from ...
> where change_date > sysdate - 1day
> OR insert_date > sysdate - 1day

If we can get the text of the entry as well, groovy.

I'll just wrap it up in a brief python script and my needs are
covered :)

But if theres a better way, please let me know :)

(I suppose I coudl try to add a trigger somewhere, but I'm sure
it'd be grossly unnecessary.)

Thank you for any help,

jeff

--
If everyone would put barbecue sauce on their food, there would be no war.

------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
Davical-general mailing list
Davical-general [at] lists
https://lists.sourceforge.net/lists/listinfo/davical-general


andrew at morphoss

Apr 3, 2012, 4:29 PM

Post #2 of 4 (428 views)
Permalink
Re: Detecting change in calendar events? [In reply to]

On Tue, 2012-04-03 at 16:57 -0400, skeezix wrote:
> Hey everyone,
>
> I'm looking for a method by which changes made to a calendar may
> have notifications emailed to someone; not event reminders or testing
> for reads or syncs, but actual changes against events.
>
> I'm fairly certain something doesn't exist already, but if so..
> awesome :) Specifically, I'm thinking that should I (for example) make a
> change on my phone that syncs up to my davical instance, it'd be great for
> my wife to get an email to remind her to check the Agendav web based
> version at her leisure, for instance. Including content of change might be
> nice, but really I'm just looking to send 'A change has been made' hints
> to interested parties. If kid checks in a change to calendar, we may need
> to go look :)

Hi Jeff,

Something does not exist yet, but there is a system-wide hook in place
to catch the event of "something changed to some calendar" which could
be used to trigger an action.


> In the event something doesn't yet exist, I'd like to make a quick
> hack for the short term as I'm not in a position to help build a more
> general solution right now..
>
> If someone knows a query against the DB that emits something along
> the lines of a yes/no, or count of the number of changes in the last 24
> hours (say), that'd do the trick. I'm quite busy of late so not had time
> to go digging through the DB schema or the like :(
>
> I was thinking of something rudimentary along the lines of this
> pseudo-query:
> > Select count(*) from ...
> > where change_date > sysdate - 1day
> > OR insert_date > sysdate - 1day
>
> If we can get the text of the entry as well, groovy.
>
> I'll just wrap it up in a brief python script and my needs are
> covered :)
>
> But if there's a better way, please let me know :)
>
> (I suppose I could try to add a trigger somewhere, but I'm sure
> it'd be grossly unnecessary.)

The way DAViCal allows for this (and other actions happening on event
create / update / delete) is to allow a hook for logging the action.

The function must be called 'log_caldav_action' and needs to take a few
parameters, as described in the wiki here:

http://wiki.davical.org/w/Configuration/hooks/log_caldav_action

You could just define that function in your config.php (if it's *real*
simple) or include a file defining it (probably a better approach).
There's an example of one such on that wiki page.

The reason this is "log" caldav action is because your function should
do it's job as quickly and safely as possible. If it screws up then you
will get error messages and screw up the response to the client, etc,
etc.

Once it has written it's log (or logged to a database table, if that's
what you prefer) then I usually run a process via 'incron' that notices
that the file has changed, move the file somewhere and process it, etc,
etc, to do the more complicated stuff. If you only wanted to see the
notifications every so often (e.g. daily) then a normal cron job would
obviously work better.

Cheers,
Andrew.

--
------------------------------------------------------------------------
andrew (AT) morphoss (DOT) com +64(272)DEBIAN
Life is too short to be taken seriously.
-- Oscar Wilde
------------------------------------------------------------------------
Attachments: signature.asc (0.82 KB)


skeezix at skeleton

Apr 3, 2012, 4:54 PM

Post #3 of 4 (427 views)
Permalink
Re: Detecting change in calendar events? [In reply to]

On Wed, 4 Apr 2012, Andrew McMillan wrote:

# Something does not exist yet, but there is a system-wide hook in place
# to catch the event of "something changed to some calendar" which could
# be used to trigger an action.

Ah, great; that will due nicely :)

# The function must be called 'log_caldav_action' and needs to take a few
# parameters, as described in the wiki here:
# http://wiki.davical.org/w/Configuration/hooks/log_caldav_action

Perfect. Thanks for the pointer, very much appreciated!

# You could just define that function in your config.php (if it's *real*
# simple) or include a file defining it (probably a better approach).
# There's an example of one such on that wiki page.

I'll do similar.. just 'touch' a flag-file or append to the log
and exeunt (with alarums); the mailout and shuffling can be done
externally.

Thanks Andrew,

jeff

--
If everyone would put barbecue sauce on their food, there would be no war.

------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
Davical-general mailing list
Davical-general [at] lists
https://lists.sourceforge.net/lists/listinfo/davical-general


skeezix at skeleton

Apr 3, 2012, 5:07 PM

Post #4 of 4 (429 views)
Permalink
Re: Detecting change in calendar events? [In reply to]

On Wed, 4 Apr 2012, Andrew McMillan wrote:

# The function must be called 'log_caldav_action' and needs to take a few
# parameters, as described in the wiki here:
#
# http://wiki.davical.org/w/Configuration/hooks/log_caldav_action

.... and success!

--
If everyone would put barbecue sauce on their food, there would be no war.

------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
Davical-general mailing list
Davical-general [at] lists
https://lists.sourceforge.net/lists/listinfo/davical-general

DAViCal general RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.