留言板

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

thumbnail
Christian Ochsenkühn,修改在8 年前。

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

New Member 帖子: 2 加入日期: 15-1-7 最近的帖子
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,修改在8 年前。

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

Liferay Legend 帖子: 2047 加入日期: 08-10-7 最近的帖子
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,修改在8 年前。

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

New Member 帖子: 2 加入日期: 15-1-7 最近的帖子
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()