Re: [xwiki-users] User activity log

2015-06-04 Thread easkr
Finally set up registration into *activitystream_events* table by creating a
page with groovy as source and calling it from footer.vm

*CALL FROM footer.vm:*

#set($g=$xwiki.parseGroovyFromPage(UserActivity.ViewEventRegistrationMacro))
#set($s=$g.log($xwiki,$doc))
$s


*PAGE SOURCE OF ViewEventRegistrationMacro PAGE:*

 import java.util.Date;
 import com.xpn.xwiki.plugin.activitystream.impl.ActivityStreamImpl;
 import com.xpn.xwiki.plugin.activitystream.impl.ActivityEventImpl;
 import com.xpn.xwiki.plugin.activitystream.api.ActivityEventPriority;

class ViewEventRegistrationMacro
{
  String log(xwiki,doc)
  {
 def xcontext=doc.getXWikiContext();
 def action=;
 try { action=xcontext.getContext().action } catch(e) {}
  def ast=new ActivityStreamImpl();
  def event = new ActivityEventImpl();
  event.setStream();
  event.setPage(doc.getFullName());
  event.setDate(new Date());
  event.setPriority(ActivityEventPriority.NOTIFICATION);
  event.setType(view);
  event.setTitle();
  event.setBody();
  event.setVersion(doc.getVersion());
  event.setUser(xcontext.getLocalUser());
  event.setHidden(false);
  event.setParam1(xcontext.getContext().toString());
  ast.addActivityEvent(event, doc.getDocument(), xcontext);


return div style='font-size: 8px; color: rgb(204, 204, 204);'View
stat is on/div;
  }
}




--
View this message in context: 
http://xwiki.475771.n2.nabble.com/User-activity-log-tp7594888p7594978.html
Sent from the XWiki- Users mailing list archive at Nabble.com.
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] User activity log

2015-05-19 Thread vinc...@massol.net

On 19 May 2015 at 13:30:32, Яковлев Павел Владимирович 
(yakovle...@sovcombank.ru(mailto:yakovle...@sovcombank.ru)) wrote:

  
 Vincent,
  
  
 Unfortunately as I see this extension does not collect info which pages where 
 visited by which user( 

Indeed

 Business task is like this: to know which required instructions this guy or 
 that guy have read

You could do that by having some web server (apache for ex) in front of xwiki 
and then checking the access logs. You’d need to ensure to log the username 
from the cookie for example (for ex using 
http://httpd.apache.org/docs/2.2/mod/mod_log_config.html).

Alternatively (and better IMO), you can have some custom sheet with a checkbox 
that the user has to click to signify he’s read the page (since viewing the 
page doesn’t mean he’s read it!).

Hope it helps,
-Vincent

 From: Vincent Massol [mailto:vmas...@gmail.com] On Behalf Of 
 vinc...@massol.net
 Sent: Tuesday, May 19, 2015 2:23 PM
 To: XWiki Users
 Cc: Яковлев Павел Владимирович
 Subject: Re: [xwiki-users] User activity log
  
  
  
  
  
  
  
 Hi,
  
  
  
  
  
 On 19 May 2015 at 13:15:55, Яковлев Павел Владимирович 
 (yakovle...@sovcombank.ru(mailto:yakovle...@sovcombank.ru))(mailto:yakovle...@sovcombank.ru(mailto:yakovle...@sovcombank.ru)))
  wrote:
  
  Hi all!
 
  Our organization have Xwiki set up and working. Some pages are business 
  instructions.
 
  Now management asked for report: who viewed which instructions and when.
 
  We have authorization required to view those pages, so Xwiki always know 
  login name.
 
  Is there way set up some log of visits by user and page?
 
  Better if without setting up dev tools and changing code!
 
  A text file or table in DB will be enough as log
 
  Thanks all who will reply/
  
  
  
  
  
  
 Maybe 
 http://extensions.xwiki.org/xwiki/bin/view/Extension/Statistics+Application 
 would help you?
  
  
  
  
  
  
  
 Thanks
  
  
  
 -Vincent
  
  
  
  
  
  
  
  
  



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


Re: [xwiki-users] User activity log

2015-05-19 Thread Mahomed Hussein
Hi

I had also asked for something like this when we first started using XWiki. 
Unfortunately the answer I also got was that it wasn't possible.

Have a look at the thread for some useful info that was given - 
http://lists.xwiki.org/pipermail/users/2015-March/030119.html

Vincent's idea of having a check-sheet attached to each document would be an 
ideal setup. But this will no doubt require some development. I'd love to give 
it a try but not enough time or knowledge of velocity/groovy/java to implement 
this.

As I see it, to be useful, the checkbox would have to meet these criteria (in 
case anyone feels like giving it a try LOL)

- Be able to specify users/groups that need to read/accept the document
- The person reading should only have access to check their own box next to 
their name
- When they check the box, it should store a date/time stamp and become 
read-only.

Sounds simple but I doubt it is very easy to implement.


Kind regards,

Mahomed




-Original Message-
From: users [mailto:users-boun...@xwiki.org] On Behalf Of vinc...@massol.net
Sent: 19 May 2015 12:36
To: XWiki Users
Subject: Re: [xwiki-users] User activity log


On 19 May 2015 at 13:30:32, Яковлев Павел Владимирович 
(yakovle...@sovcombank.ru(mailto:yakovle...@sovcombank.ru)) wrote:


 Vincent,


 Unfortunately as I see this extension does not collect info which pages where 
 visited by which user(

Indeed

 Business task is like this: to know which required instructions this guy or 
 that guy have read

You could do that by having some web server (apache for ex) in front of xwiki 
and then checking the access logs. You’d need to ensure to log the username 
from the cookie for example (for ex using 
http://httpd.apache.org/docs/2.2/mod/mod_log_config.html).

Alternatively (and better IMO), you can have some custom sheet with a checkbox 
that the user has to click to signify he’s read the page (since viewing the 
page doesn’t mean he’s read it!).

Hope it helps,
-Vincent

 From: Vincent Massol [mailto:vmas...@gmail.com] On Behalf Of 
 vinc...@massol.net
 Sent: Tuesday, May 19, 2015 2:23 PM
 To: XWiki Users
 Cc: Яковлев Павел Владимирович
 Subject: Re: [xwiki-users] User activity log







 Hi,





 On 19 May 2015 at 13:15:55, Яковлев Павел Владимирович 
 (yakovle...@sovcombank.ru(mailto:yakovle...@sovcombank.ru))(mailto:yakovle...@sovcombank.ru(mailto:yakovle...@sovcombank.ru)))
  wrote:

  Hi all!
 
  Our organization have Xwiki set up and working. Some pages are business 
  instructions.
 
  Now management asked for report: who viewed which instructions and when.
 
  We have authorization required to view those pages, so Xwiki always know 
  login name.
 
  Is there way set up some log of visits by user and page?
 
  Better if without setting up dev tools and changing code!
 
  A text file or table in DB will be enough as log
 
  Thanks all who will reply/






 Maybe 
 http://extensions.xwiki.org/xwiki/bin/view/Extension/Statistics+Application 
 would help you?







 Thanks



 -Vincent












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


Re: [xwiki-users] User activity log

2015-05-19 Thread Яковлев Павел Владимирович
Vincent, thanks so far for ideas, we will investigate them

I see great activitystream_events table there...
Can you have a quick look - is it easy to write there ase_type=view   
record each time page viewed?
May be you can find or make a kind of flag to enable it?


-Original Message-
From: Vincent Massol [mailto:vmas...@gmail.com] On Behalf Of vinc...@massol.net
Sent: Tuesday, May 19, 2015 2:36 PM
To: XWiki Users
Cc: Яковлев Павел Владимирович
Subject: RE: [xwiki-users] User activity log


On 19 May 2015 at 13:30:32, Яковлев Павел Владимирович 
(yakovle...@sovcombank.ru(mailto:yakovle...@sovcombank.ru)) wrote:

  
 Vincent,
  
  
 Unfortunately as I see this extension does not collect info which pages where 
 visited by which user( 

Indeed

 Business task is like this: to know which required instructions this guy or 
 that guy have read

You could do that by having some web server (apache for ex) in front of xwiki 
and then checking the access logs. You’d need to ensure to log the username 
from the cookie for example (for ex using 
http://httpd.apache.org/docs/2.2/mod/mod_log_config.html).

Alternatively (and better IMO), you can have some custom sheet with a checkbox 
that the user has to click to signify he’s read the page (since viewing the 
page doesn’t mean he’s read it!).

Hope it helps,
-Vincent

 From: Vincent Massol [mailto:vmas...@gmail.com] On Behalf Of 
 vinc...@massol.net
 Sent: Tuesday, May 19, 2015 2:23 PM
 To: XWiki Users
 Cc: Яковлев Павел Владимирович
 Subject: Re: [xwiki-users] User activity log
  
  
  
  
  
  
  
 Hi,
  
  
  
  
  
 On 19 May 2015 at 13:15:55, Яковлев Павел Владимирович 
 (yakovle...@sovcombank.ru(mailto:yakovle...@sovcombank.ru))(mailto:yakovle...@sovcombank.ru(mailto:yakovle...@sovcombank.ru)))
  wrote:
  
  Hi all!
 
  Our organization have Xwiki set up and working. Some pages are business 
  instructions.
 
  Now management asked for report: who viewed which instructions and when.
 
  We have authorization required to view those pages, so Xwiki always know 
  login name.
 
  Is there way set up some log of visits by user and page?
 
  Better if without setting up dev tools and changing code!
 
  A text file or table in DB will be enough as log
 
  Thanks all who will reply/
  
  
  
  
  
  
 Maybe 
 http://extensions.xwiki.org/xwiki/bin/view/Extension/Statistics+Application 
 would help you?
  
  
  
  
  
  
  
 Thanks
  
  
  
 -Vincent
  
  
  
  
  
  
  
  
  



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