Another simpler (depending from where you stand, it's certainly
cleaner at least) possibility is to make activity stream ignore
whatever you are planning to do by indicating it that you are going to
are subtask of another one (for example when you import a XAR you
don't get the document in the activity stream). This is done by
sending an event implementing org.observation.event.BeginFoldEvent
(and then send a corresponding EndFoldEvent when you are done). But
it's not the kind of thing you can do in velocity since you need to
create two new events and send them.
On Tue, Mar 24, 2015 at 4:11 PM, Pascal BASTIEN <pbasnews-xwiki(a)yahoo.fr> wrote:
Hello,
A user want to rename lot of page in Xwiki and I don't want this op displayed on
WebHome Activity Stream.
Then, I found these API to use:
http://tiny.cc/2fb0vx
public void deleteActivityEvent(ActivityEvent event)
Delete the passed event form the database.
and
http://tiny.cc/gkb0vx
public List<ActivityEvent> getEventsForUser(String streamName,
String user,
boolean filter,
int nb,
int start)
throws ActivityStreamException
Return the latest events recorded for the given stream name and the given user.
Unfortunaly, my code return only old activity events (probably some old events before my
Xwiki upgrade ... I guess?). I obtain this
XWiki.MyUser - 2014/09/24 13:27 - 2014-09-24 13:27:44.0 - update - 20
MySpace.MyPage - 2014/09/22 17:14 - 2014-09-22 17:14:17.0 - deleteAttachment - 20
BacASable.Tableau filtré - 2014/09/19 15:37 - 2014-09-19 15:37:31.0 - update - 20
Here my code:
{{velocity}}
#set ($MonStream=$xwiki.activitystream.getStreamName("Encyclopédie"))
#foreach ($MonEvent in $xwiki.activitystream.getEventsForUser($MonStream,
"XWiki.christianchambon", false, 1500, 0))
1. $MonEvent.getPage() - $MonEvent.getDisplayDate() - $MonEvent.getDate() -
$MonEvent.getType() - $MonEvent.getPriority()
#end
{{/velocity}}
With this, it is the same thing :#foreach ($MonEvent in
$xwiki.activitystream.getEventsForUser("XWiki.christianchambon", false, 1500,
0)): only old events :-(
Activity stream working well on my Xwiki WebHome
Thxs for any helps
Pascal B
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users