Foren

Retrieve WIKI Node ID from search results

Jan Tošovský, geändert vor 12 Jahren.

Retrieve WIKI Node ID from search results

Liferay Master Beiträge: 566 Beitrittsdatum: 22.07.10 Neueste Beiträge
Hello Everyone,

is there any way how to retrieve WIKI Node ID from xml returned by search results? I can get the title but to access the corresponding WikiPage object I need also Node ID info to which WIKI that page belongs. Here is the XML result of that search.

<entry>
      <liferay:groupid xmlns:liferay="http://liferay.com/spec/liferay-search/1.0/">19</liferay:groupid>
      <liferay:scopegroupid xmlns:liferay="http://liferay.com/spec/liferay-search/1.0/">19</liferay:scopegroupid>
      <liferay:entryclassname xmlns:liferay="http://liferay.com/spec/liferay-search/1.0/">com.liferay.portlet.wiki.model.WikiPage</liferay:entryclassname>
      <liferay:entryclasspk xmlns:liferay="http://liferay.com/spec/liferay-search/1.0/">10420</liferay:entryclasspk>
      <title>&lt;![CDATA[FrontPage]]&gt;</title>
      <link href="http://localhost:8080/web/guest/home/-/wiki/10418/FrontPage/maximized?p_p_auth=PGC2UOOc">
      <id>urn:uuid:30c3b053-5be1-43a2-8cb0-ce384ed64ca3</id>
      <updated>2011-08-12T10:56:34GMT</updated>
      <summary>Hello world....</summary>
      <tags></tags>
      <ratings>0.0</ratings>
      <relevance:score>0.061941828578710556</relevance:score>
   </entry>


Any idea?

Regards,
Jan
Jan Tošovský, geändert vor 12 Jahren.

RE: Retrieve WIKI Node ID from search results

Liferay Master Beiträge: 566 Beitrittsdatum: 22.07.10 Neueste Beiträge
I've found the Wiki node ID = 10418 so it could be parsed from that URL element. This node ID seems to be plid. Can this value be retrieved more straightforward way using the provided entryClassPK value?
Jan Tošovský, geändert vor 12 Jahren.

RE: Retrieve WIKI Node ID from search results (Antwort)

Liferay Master Beiträge: 566 Beitrittsdatum: 22.07.10 Neueste Beiträge
What I need is Wiki Page object and as I've just found it can be obtained directly even without that node ID :-)

Long pk = Long.parseLong(el.elementText("entryClassPK"));
WikiPage wikiPage = WikiPageLocalServiceUtil.getPage(pk);