Forums de discussion

Most commented, most viewed journal articles

X Man, modifié il y a 12 années.

Most commented, most viewed journal articles

Junior Member Publications: 41 Date d'inscription: 05/01/12 Publications récentes
Hello

My task is to develop a portlet that will display the latest, most commented and most viewed Journal articles?

So, How can I achieve that?

To get the latest, most commented and most viewed Journal articles:
Do I need to use the dynamic queries? Or I will use service layer of Liferay

Thank you in advance
thumbnail
Tejas Kanani, modifié il y a 12 années.

RE: Most commented, most viewed journal articles

Liferay Master Publications: 654 Date d'inscription: 06/01/09 Publications récentes
Hi X Man,

You can use Asset Publisher portlet for your requirement. Just use Asset type "Web Content" and Order By "View count" and that will list down all the journal articles based on their view counts so far.
X Man, modifié il y a 12 années.

RE: Most commented, most viewed journal articles

Junior Member Publications: 41 Date d'inscription: 05/01/12 Publications récentes
Tejas Kanani, thank you.
But Asset publisher does not get the most commented article, so how can I get them?

Thank you
thumbnail
Tejas Kanani, modifié il y a 12 années.

RE: Most commented, most viewed journal articles

Liferay Master Publications: 654 Date d'inscription: 06/01/09 Publications récentes
Yes. Asset publisher has capability to display comments but it does not have any option to display results sorted by no of comments.
To combine all conditions in one shot, creating a new portlet and get all the articles using custom query is the best option.
thumbnail
Jignesh Vachhani, modifié il y a 12 années.

RE: Most commented, most viewed journal articles

Liferay Master Publications: 803 Date d'inscription: 10/03/08 Publications récentes
Hi

You can go with custom query concept of liferay.
For more details about custom query, you can check http://www.liferaysolution.com/2012/03/custome-query.html
thumbnail
Hitoshi Ozawa, modifié il y a 12 années.

RE: Most commented, most viewed journal articles

Liferay Legend Publications: 7942 Date d'inscription: 24/03/10 Publications récentes
If you want to write you own porlet, here is some information on view count.

http://issues.liferay.com/browse/LPS-723

Comments are stored in a MBMessage which can be accessed by MBMessageLocalServiceImpl.

http://docs.liferay.com/portal/6.0/javadocs/com/liferay/portlet/messageboards/service/impl/MBMessageLocalServiceImpl.html
X Man, modifié il y a 12 années.

RE: Most commented, most viewed journal articles

Junior Member Publications: 41 Date d'inscription: 05/01/12 Publications récentes
Thank you guys.

Jignesh Vachhani, I checked your link:
public List findBooks(String name) throws SystemException {

Session session = null;

session = openSession();

How can I get Session object?

I searched for openSession( ) method, it is in HibernateUtil.openSession() but I did not find this class in liferay 6.1

Thank you
X Man, modifié il y a 12 années.

RE: Most commented, most viewed journal articles

Junior Member Publications: 41 Date d'inscription: 05/01/12 Publications récentes
emoticon
Sorry, Jignesh Vachhani
I did not notice that I will extend BasePersistenceImpl
I will try again.

Thank you
resmi joseph, modifié il y a 11 années.

RE: Most commented, most viewed journal articles

New Member Publications: 18 Date d'inscription: 02/02/11 Publications récentes
How did u get the most commented and most viewed journal article? Is it though custom portlet code ? created any custom table or used mbmessage table?
thumbnail
Jignesh Vachhani, modifié il y a 11 années.

RE: Most commented, most viewed journal articles

Liferay Master Publications: 803 Date d'inscription: 10/03/08 Publications récentes
Reshmi,

we can use custom query and to learn custom query, you can check http://www.liferaysolution.com/2012/03/custome-query.html

Best,
Jignesh
thumbnail
Jitendra Rajput, modifié il y a 9 années.

RE: Most commented, most viewed journal articles

Liferay Master Publications: 875 Date d'inscription: 07/01/11 Publications récentes
For most viewed journal articles you can user Popular Journal Article app available on Liferay market place.