Get pages where a document has been used

Hi All,

I want to retrieve a document based on search key and need to find all the pages where this document is being used. I tried with fluent search, it gives me the document with the search and on search result page i also get the page link where this document is used(through <@hst.link var=“link” hippobean=item />).

However, if the same document is used for two pages, it still just return one result. For my requirement it should return me 2 results and with their link for page. Can you please help, how could i achieve this?

Also, is there a way to get the page in my searchComponent itself(java class).

Thanks
Rahul

use HstLinkCreator.createAll() method

It worked. Thanks a lot.

Rahul

Hi Machak,

I want to capture the pages where a document has been used, but at the time when the document gets published. How can i get that please suggest. I get requestContext null in CMS module.

Thanks
Rahul

see this thread:

You need to get hold of HST request, so, you’ll need to call some REST service which will handle this for you.

Thanks Machak.

I can get this working in case of document publish, where I can get UUID and path of the document published. But can you suggest me how do can I get the url(sitemap) of page being published through channel-manager? For event category “channel-manager” and event action “publishMount”.

You can use HstLinkCreator for that too, see create methods which take path (string) as an argument

But this event does not gives me the path of the page which has been published. Can you please tell me how do i get the path from the event?

Thanks
Rahul

you have UUID of the document, so you can get the (JCR) Node, use methods which create URL based on that, also listed in HstLinkCreator

I am not talking here about document publish. I am talking about page publish through channel manager.

Thanks
Rahul

There are channel manager events on this page: https://documentation.bloomreach.com/library/concepts/channels/overview-of-channel-manager-events-and-response-mechanisms.html

well, you are publishing the channel and a page. So, only way would be to loop through all pages on that channel, event itself has no data about changed/published pages.