Hi,
The most reasonable definition would be to consider a comment "new" if it
was added between the user's last visit to the page and the current moment
(where by reasonable I mean easy to implement, not so time consuming, and
not object-flooding). There is no API for this (yet), I'm working on
something similar for a site in this period, and it will get in the trunk
soon. You can do this by yourself by using the statistics API.
XWiki has an integrated statistics module, which records page visits. You
can combine page statistics with session statistics to find out when did a
specific user visit a page.
And to answer your other mail, you can use the session statistics to find
out when did the user previously login, and there is an API to list the
changed documents in a given time frame.
Sergiu Dumitriu
On 1/22/07, Vincent Massol <vincent(a)massol.net> wrote:
On Jan 22, 2007, at 6:55 PM, Herwig Brunner wrote:
Hi @ all,
I have the following scenario: User A views a page with 3 comments,
and add's a new comment. Now User B logs in and views the same
page. This User already read the first three comments and now I
want that User B get's some kind of visual hit(orange triangle or
something like that), that a new comment was added since his last
visit.
How should I aproach this Problem?
Any ideas?
Thanks a lot.
This is not something that is currently built in XWiki. Right now the
default way to get notified of new comments is by using RSS feeds or
by using an email notifier plugin to send emails when new comments
are added.
That said you're free to do whatever you want but you'll have to code
it yourself. You'll need to remember what user has seen what, you'll
need to define what "viewing a comment" means, whether the user has
to push a button to signify he has view a comment, etc.
BTW the same applies to pages too.
I'm not sure how you'd hook into xwiki to update the counters when
the user has viewed a page or a comment though, which is why I was
hinting at the button above. In any case, a user may navigate to a
page but without reading it so you'll need to differentiate both
cases and the button makes the most sense I think.
An easy way would be to add a TagClass object to the page with the
name of the user who's marked the page as viewed. Then you could
easily run queries to know what pages have not yet been viewed by a
given user.
To do all this you'll probably need to modify some templates.
Hope it helps,
-Vincent
___________________________________________________________________________
Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son
interface révolutionnaire.
http://fr.mail.yahoo.com
--
You receive this message as a subscriber of the xwiki-users(a)objectweb.orgmailing list.
To unsubscribe: mailto:xwiki-users-unsubscribe@objectweb.org
For general help: mailto:sympa@objectweb.org?subject=help
ObjectWeb mailing lists service home page:
http://www.objectweb.org/wws