Relation between Tag cloud and Blogs in liferay


If we place tagcloud and blogs portlet in one page .When we click on the tagcloud automatically blogs portlet is rendering the tagged entries.

So, how does it works?

Open the portlet-custom.xml search with the "148" here 148 refers to portlet name.
 At end of the portlet tag you will find the "<supported-public-render-parameter>tag</supported-public-render-parameter> ".

Also search with "33" none other than blogs portlet. You will find the following line "<supported-public-render-parameter>tag</supported-public-render-parameter>".

Then how does it works in blogs?

 Open the view.jsp(html/portlet/blogs folder). you will find the below line
             String assetTagName = ParamUtil.getString(request, "tag"); where it is retrieving the tagname when we click on the tag.

Following lines will do lot of things for retrieving the entries.

   AssetEntryQuery assetEntryQuery = new AssetEntryQuery(BlogsEntry.class.getName(), searchContainer);


total = AssetEntryServiceUtil.getEntriesCount(assetEntryQuery);
results = AssetEntryServiceUtil.getEntries(assetEntryQuery);

Also In view.jsp their are including the view_entries.jspf file. This file will reterive the individual entries to display the blogs.

In that file if we look into below file it is retreving the each blog entry to display.

entry = BlogsEntryLocalServiceUtil.getEntry(assetEntry.getClassPK());

Here there are reterving the blog by classNameId of the assestEntry.

If we look into DB my blog stores as entryId with "  53002".

Hit the following query

  1.    SELECT * FROM test.assetentry where classPK= '53002'; 


You can observe the title column having the same title which as blog entryId of "53002".

Also,
 
  Go to the className table search for the name "com.liferay.portlet.bookmarks.model.BookmarksEntry" and in my DB it shows

classNameId             Value
10008                       com.liferay.portlet.bookmarks.model.BookmarksEntry.

Also we hit the below query to see the how many entry query added for blogsEntry.

    2.    SELECT * FROM test.assetentry where classNameId = "10007"

If we need to find at backend how their are related

        After hitting the first query , we get the entries with the classpk, get the entryId column value for my DB it is "53004" and hit the following URL.

   3.   SELECT * FROM test .assetentries_assettags a where entryId= "53004";

       We will get one or more entries which we have tagged to the entries.

       Get anyone of the tagId to see the name of the tag we have asociated.Here i am getting the tagId as "109508". Hit the below query to see the entries and look into the name of the column to see the tagname.

            SELECT * FROM test.assettag a where tagId = '109508';

Thats it Now we now how blogs and tags are related.



Comments

  1. Very Cool in the Relation between Tag cloud and Blogs in liferay of scholarship essay writing help

    ReplyDelete
  2. Wonderful article liferaytutorial.Thank you for your posting best custom essay writing service

    ReplyDelete
  3. I recently came across your blog and have been following it. I'm very impressed. You're truly well informed and very intelligent. You've been able to write in a way people can understand easily. I'm saving this for future use.
    liferay training in hyderabad

    ReplyDelete
  4. I needs to spend some time learning much more or understanding more.
    Thanks for magnificent information I was looking for this information for my mission.

    ReplyDelete
  5. Interesting article to read, best article on this topic, ever read. I always searching this kind of blog. visit this site for this kind of more articles. Thank you so much.

    ReplyDelete
  6. I am glad for the opportunity the blogger has created for us to learn and understand about such critical subjects and this has indeed become a motivation to me. I believe that the blogger will be pleased to share with us such nice content in the future. I have found this forum to be very useful and captivating. Dissertation Reviewing Help

    ReplyDelete

Post a Comment

Popular posts from this blog

Theme display in javascript

How to know which liferay version we are using

Opening portlet in popup