掲示板

Programmatically identify number of users accessing a liferay page

thumbnail
7年前 に Amith . によって更新されました。

Programmatically identify number of users accessing a liferay page

New Member 投稿: 8 参加年月日: 13/09/10 最新の投稿
Hi,

I am wondering is there any way in liferay to programmatically identify the number of people (liferay user or guest) viewing a particular liferay public or private page?

I need to restrict page access if current page view count is greater than 100.

Any suggestion would help.
thumbnail
7年前 に Milen Dyankov によって更新されました。

RE: Programmatically identify number of users accessing a liferay page

Expert 投稿: 310 参加年月日: 12/10/30 最新の投稿
IMHO, you need to refine your requirements. Right now what I understand is that if 100 people open a page and keep it open whole day/week no one else will be able to see the page during that period. Is that really what you are looking for?
thumbnail
7年前 に Amith . によって更新されました。

RE: Programmatically identify number of users accessing a liferay page

New Member 投稿: 8 参加年月日: 13/09/10 最新の投稿
Yes, you are right. I am looking for something like what you understood.
thumbnail
7年前 に Milen Dyankov によって更新されました。

RE: Programmatically identify number of users accessing a liferay page

Expert 投稿: 310 参加年月日: 12/10/30 最新の投稿
First thing I need to say is I hope you are aware you will be opening your server to DoS attacks by doing this.

You need :
  • something that tells you the page is still being displayed on some screen. You may need to use Javascript on the page to periodically call the server to let it know the page is still open.
  • something on the server side that will receive those calls and increase a counter per page. You can use ServiceBuilder to create own service with persistence or you can store the data in page's custom attributes
  • something on the server side that will periodically check and reduce counters for any page view that was not updated in defined time period. You can use Liferay's scheduler for that.