Foros de discusión
How to search journal article by tag?
willard largueza macay, modificado hace 13 años.
How to search journal article by tag?
New Member Mensajes: 9 Fecha de incorporación: 14/01/10 Mensajes recientes
Hello Web..
How to search journal article by tag?
thanks..
How to search journal article by tag?
thanks..
willard largueza macay, modificado hace 13 años.
RE: How to search journal article by tag?
New Member Mensajes: 9 Fecha de incorporación: 14/01/10 Mensajes recientes
anybody? please...
willard largueza macay, modificado hace 13 años.
RE: How to search journal article by tag?
New Member Mensajes: 9 Fecha de incorporación: 14/01/10 Mensajes recientes
found some solution..
ThemeDisplay themeDisplay= (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
long groupId= themeDisplay.getPortletGroupId();
String tag="hello";
PortletURL portletURL = renderResponse.createRenderURL();
long classNameId = PortalUtil.getClassNameId(JournalArticle.class.getName());
long[] entryIds = TagsEntryLocalServiceUtil.getEntryIds(groupId, new String[] {tag});
long[] notEntryIds = new long[0];
//SearchContainer searchContainer = new SearchContainer(renderRequest, null, null, searchContainer.DEFAULT_CUR_PARAM, SearchContainer.DEFAULT_DELTA, portletURL, null, null);
List results = new ArrayList();
if(entryIds.length>0) {
List<tagsasset> assets = TagsAssetLocalServiceUtil.getAssets(groupId, new long[] {classNameId}, entryIds, notEntryIds, false, false, 0, 4);
for (TagsAsset asset : assets) {
long classPK = asset.getClassPK();
String arid = String.valueOf(classPK-2);
JournalArticle article = JournalArticleLocalServiceUtil.getArticle(groupId, arid);
results.add(article);
}
}
out.println(results.size() + "<br>");
out.println(results.get(0));
</tagsasset>
Walter Muñoz, modificado hace 12 años.
RE: How to search journal article by tag?
New Member Mensajes: 4 Fecha de incorporación: 31/05/11 Mensajes recienteswillard largueza macay:
found some solution..ThemeDisplay themeDisplay= (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY); long groupId= themeDisplay.getPortletGroupId(); String tag="hello"; PortletURL portletURL = renderResponse.createRenderURL(); long classNameId = PortalUtil.getClassNameId(JournalArticle.class.getName()); long[] entryIds = TagsEntryLocalServiceUtil.getEntryIds(groupId, new String[] {tag}); long[] notEntryIds = new long[0]; //SearchContainer searchContainer = new SearchContainer(renderRequest, null, null, searchContainer.DEFAULT_CUR_PARAM, SearchContainer.DEFAULT_DELTA, portletURL, null, null); List results = new ArrayList(); if(entryIds.length>0) { List<tagsasset> assets = TagsAssetLocalServiceUtil.getAssets(groupId, new long[] {classNameId}, entryIds, notEntryIds, false, false, 0, 4); for (TagsAsset asset : assets) { long classPK = asset.getClassPK(); String arid = String.valueOf(classPK-2); JournalArticle article = JournalArticleLocalServiceUtil.getArticle(groupId, arid); results.add(article); } } out.println(results.size() + "<br>"); out.println(results.get(0)); </tagsasset>
hi, do you know how to get the tags assossiated to a journal article?