Forums de discussion

How to get the wiki nodeId of a wiki on the same page

thumbnail
Christian Ochsenkühn, modifié il y a 8 années.

How to get the wiki nodeId of a wiki on the same page

New Member Publications: 2 Date d'inscription: 07/01/15 Publications récentes
Hi @all,

I try to get the wiki nodeId of a wiki on the same page as my portlet.

List<portlet> portlets = themeDisplay.getLayoutTypePortlet().getPortlets();
for(Portlet portlet : portlets) {
		if("36".equals(portlet.getPortletId())) {

		}
}</portlet>


With this code I am able to find the proper portlet. But I am not sure how to find the WikiNode in this portlet.
Is this even possible?


Thank you for your help.
Regards
Christian
thumbnail
Amos Fong, modifié il y a 8 années.

RE: How to get the wiki nodeId of a wiki on the same page

Liferay Legend Publications: 2047 Date d'inscription: 07/10/08 Publications récentes
Hi Christian,

You can use this method and pass themeDisplay.getScopeGroupId().

https://docs.liferay.com/portal/6.2/javadocs/com/liferay/portlet/wiki/service/WikiNodeLocalServiceUtil.html#getNodes(long, int)
thumbnail
Christian Ochsenkühn, modifié il y a 8 années.

RE: How to get the wiki nodeId of a wiki on the same page

New Member Publications: 2 Date d'inscription: 07/01/15 Publications récentes
Hi Amos,
thank you for your help.

Unfortunately this got me the wrong node. But I could solve the issue with the following instead:
I use your mentioned method:
https://docs.liferay.com/portal/6.2/javadocs/com/liferay/portlet/wiki/service/WikiNodeLocalServiceUtil.html#getNodes(long)

and pass themeDisplay.getLayout().getScopeGroup().getPrimaryKey()