Posts

Showing posts with the label assetentry

Retrieving/getting the JournalArticle from the Tag

Whenever we create the JournalArticle we add tag. Sometimes it is required to get the "Article" from the tag, so how can we do that. Here is the code, String tagName = "cricket"; AssetTag assetTag = AssetTagLocalServiceUtil.getTag(themeDisplay.getScopeGroupId(),tagName); AssetEntryQuery assetEntryQuery = new AssetEntryQuery(); assetEntryQuery.setAllTagIds(new long []{assetTag.getTagId()}); List<journalarticle> journalArticleList = null; List<assetentry> assetEntryList = AssetEntryLocalServiceUtil.getEntries(assetEntryQuery); for(AssetEntry assetEntry : assetEntryList) { try { JournalArticleResource journalArticleResource = JournalArticleResourceLocalServiceUtil .getJournalArticleResource(assetEntry .getClassPK()); JournalArticle journalArticle = JournalArticleLocalServiceUtil.getArticle(groupId,journalArticleResource.getArticleId()); jou...

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 = ne...