Re: [xwiki-users] Fight with ActivityStreamPluginApi

2015-03-24 Thread Thomas Mortagne
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-xw...@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 ListActivityEvent 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@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users



-- 
Thomas Mortagne
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Fight with ActivityStreamPluginApi

2015-03-24 Thread Thomas Mortagne
On Tue, Mar 24, 2015 at 5:22 PM, Pascal BASTIEN pbasnews-xw...@yahoo.fr wrote:
 Your method seem to complex (for me).
 Thanks anyway  :-)
 Do you mean $xwiki.activitystream. API is broken?

I don't remember talking about the activity stream API :) I don't
really know it well enough to give advices on it.

 I tested it on fresh jetty xwiki 6.4.3 and  
 $xwiki.activitystream.getEventsForUser show nothing.
 And, if I use true on
 $xwiki.activitystream.getEventsForUser(XWiki.Admin, true, 1500, 0))
 (filter - if true, group the matched events by priority)
 I obtain this error:
 Caused by: com.xpn.xwiki.plugin.activitystream.api.ActivityStreamException: 
 Error number 3223 in 3: Error number 3223 in 3: Exception while searching 
 documents with sql select act from ActivityEventImpl as act, 
 ActivityEventImpl as act2  where act.eventId=act2.eventId and  (act.hidden  
 true or act.hidden is null) and act.user=XWiki.Admin group by act.requestId 
 having (act.priority)=max(act2.priority) order by act.date desc



 
 En date de : Mar 24.3.15, Thomas Mortagne thomas.morta...@xwiki.com a écrit 
 :

  Objet: Re: [xwiki-users] Fight with ActivityStreamPluginApi
  À: Pascal BASTIEN pbasnews-xw...@yahoo.fr, XWiki Users 
 users@xwiki.org
  Date: Mardi 24 mars 2015, 17h07

  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-xw...@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 ListActivityEvent
  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@xwiki.org
   http://lists.xwiki.org/mailman/listinfo/users



  --
  Thomas
  Mortagne



-- 
Thomas Mortagne
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


[xwiki-users] Fight with ActivityStreamPluginApi

2015-03-24 Thread Pascal BASTIEN
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 ListActivityEvent 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@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users