Re: email notification and abstract methods

Kimbro Staken <[email protected]> Sat, 15 Nov 2003 00:02:33 -0700
Newsgroups gmane.comp.web.syncato.general
Message-ID <[email protected]>
> Summary:
> 1. notification to user on new post in blog
> 2. notification to blog's author on comments to blog's record
> 3. notification to user on new comments in specified blog's record
>
> I think possible to find 'common denominator' of this 3 notifications.
>
> Is this have rational?

I was actually only looking for number 2 on this list. That's very  
simple and easy to do. You make a good point with the others, but I'm  
not sure that email is the way to handle that. I had been toying with  
using RSS for it. It would be trivial to have a per post RSS feed for  
the comments as well as a global feed for all comments. Using RSS puts  
control over subscriptions into the hands of the user without having to  
write a management UI. It also means we don't have to store email  
addresses. That may be preferable then having to deal with email. In  
reality we could just implement the RSS and not deal with email at all,  
but I think having notifications to the author is a good thing  
(translation: it's something I personally want to use). :-)

So my feeling on this is RSS for user notifications and email on  
trackbacks and comments for authors only, at least for right now.

On Nov 14, 2003, at 11:19 PM, nemilya wrote:

> About story of sending email notification
>
> I think that for email notification have to be list of subscribed
> users. F.e. 'user-subscribe.xml', with 'id', 'email', 'activated')
> also possible for activation logic additional xml storage
> 'user-activation-code.xml' is needed:
>
> <user-activate-code>
>   <user id="1" code="qweDwerwr23ff"/>
>   ...
> </user-activate-code>

The way you would do this in syncato is to add each user element as a  
separate database entry. id would be assigned by the system and then  
you can specify indexes on the rest.

Obviously this doesn't work as well for the file database as it does  
for DB XML.
>
> Also in 'config.xml' parameter:
>     <allow-subscribe>yes</allow-subscribe>
>
> If this parametr 'yes', on blog's pages will be showen form for  
> subscribe,
> and on new post will be sending notifications.
>
> Usecase 'user subscription'
> 1. on any blog's page user see 'subscribe form', user submit this form
>    with self email address
> 2. in user-subscribe.xml added record from form, with 'activated'='no',
>    also is generated record to user-activation-code.xml (@code)
> 3. to user is send email notification with code
> 4. user take email with url with code, user going to url with code
>   taking answer from user , checking  @code from
>   user-activation-code.xml and if code is ok -
> XPath (not valid):
> user-subscribe.xml/users/user[
>    
> @id=user-activation-code.xml/user-activate-code/ 
> user[@code=$codeFromRequest]/@id
> ]/@activated='yes'
>
> Usecase 'send notification on new post in blog' (on post message to  
> blog):
> 1. for each user's email from 'user-subscribe.xml' (which is activated)
> send notification about new post (with url)
>
> Note: also possible to subscription to posts of specific category.
>
> Implementation:
>
> To Weblog.addPost() after
> if (ping == 1):
>     self.pingWeblogs()
>
> add some like:
> if (emailNotification == 1):
>     self.emailNotification(postID)
>
> method 'emailNotification' implements usecase  'send notification on  
> new post in blog'
>
> Also on comment we dont need to send notifications to subscribed users
> (or needed?).
>
> at Weblog.addPost() there is argument 'ping = 1', which is 0 when is
> added comment (servlets/open/Comment.py):
> method 'respondToPost' is execuded on submit of comment's form,
> calls 'respondToGet',
> in this method the comment is added to xml database:
> self.weblog.addPost(content, 0)
>
>
> Possible we have to send notification to blog's author on comments.
> Possible for this is needed new parameter in config.
>
>
>
>
> About code.
>
> Code is very nice.
>
> One note: BaseDatabase.py is abstract class for manage xml db.
>
> But abstract function are not marked out in code of this class.
> I think it would be clearer for understunding, if add to  
> BaseDatabase.py:

OK, I added these.

>
> def shutdown(self):
>     # abstract
>     pass
>
> def getRecord(self, recordID):
>     # abstract
>     pass
>
> def addRecord(self, record):
>     # abstract
>     pass
>
> def updateRecord(self, recordID, record):
>     # abstract
>     pass
>
> def deleteRecord(self, recordID):
>     # abstract
>     pass
>
> def getPathData(self, xpath):
>     # abstract
>     pass
>
>
> Ilya
>
>
>
>
> -------------------------------------------------------
> This SF. Net email is sponsored by: GoToMyPC
> GoToMyPC is the fast, easy and secure way to access your computer from
> any Web browser or wireless device. Click here to Try it Free!
> https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/ 
> g22lp.tmpl
> _______________________________________________
> Syncato-general mailing list
> Syncato-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/syncato-general
>
>
Kimbro Staken
Software, Consulting and Writing http://www.xmldatabases.org/
Apache Xindice native XML database http://xml.apache.org/xindice
XML:DB Initiative http://www.xmldb.org



-------------------------------------------------------
This SF. Net email is sponsored by: GoToMyPC
GoToMyPC is the fast, easy and secure way to access your computer from
any Web browser or wireless device. Click here to Try it Free!
https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl