Ploneboars. Access to Comment text

3 messages Options
Embed this post
Permalink
Alexander A. BORODIN () Ploneboars. Access to Comment text
Reply Threaded More More options
Print post
Permalink
(This post was updated on )
Hello All.
I 'm trying to implement e-mail notification for new messages in ploneboard forum.
I use this one http://plone.org/documentation/how-to/send-announcements/#1202153645
And have following code:

# get this comment object
theComment = state_change.object
theComment_id = theComment.getId()
theComment_url = theComment.absolute_url()

# details about the human creator of the new comment
creator = theComment.Creator()
member = context.portal_membership.getMemberById(creator)
creator = {'member':member,
'id':member.getId(),
'fullname':member.getProperty('fullname', 'Fullname missing')
}
creatorName= creator['fullname']
creatorID= creator['id']

But I've face the same problem.
Ploneboard.Comment.getText() returns empty string.
Ploneboard.Comment.Description() returns empty string tool.

In portal_catalog the Comment has a valid description.

What am I wrong?

Thanks in Advance,
Allender
Alexander A. BORODIN () Re: Ploneboars. Access to Comment text
Reply Threaded More More options
Print post
Permalink
It seems, that I tring to get text too early.
because code:
res = context.portal_catalog( object_provides='Products.Ploneboard.interfaces.IComment',
                              sort_on='created', sort_order='reverse', sort_limit=1,
                              path='/site/forum/forum_9/89736038' )

print res[0].getObject().getText()

works perfectly in simple python spript.

Any ideas?
Alexander A. BORODIN () Re: Ploneboars. Access to Comment text
Reply Threaded More More options
Print post
Permalink
In reply to this post by Alexander A. BORODIN
the second way is sending e-mails in customized add_comment_script from ploneboard skin.
But I think, if we have a huge list of subscribed members it would influence on speed of posting new Comment. It's a bad.

Is it possible to create other thead for email notifications from python scrypts?