Hi Everyone,
If you want to find blogs as per the tag name in Liferay 6 the code is here :
If you want to find blogs as per the tag name in Liferay 6 the code is here :
public List findBlogsByTagName(String[] tagNames){
long[] anyTagIds = AssetTagLocalServiceUtil.getTagIds(themeDisplay.getScopeGroupId(),tagNames);
AssetEntryQuery assetEntryQuery = new AssetEntryQuery();
assetEntryQuery.setAnyTagIds(anyTagIds);
ListassetEntryList = AssetEntryLocalServiceUtil.getEntries(assetEntryQuery);
List blogList =new ArrayList();
try{
for(AssetEntry ae : assetEntryList)
{
BlogsEntry blogEntryObj = BlogsEntryLocalServiceUtil.getBlogsEntry(ae.getClassPK());
blogList.add(blogEntryObj);
}
}catch(Exception e){
e.printStackTrace();
}
return blogList;
}