<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Controlling Asset Publisher Pagination</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=85712673" />
  <subtitle>Controlling Asset Publisher Pagination</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=85712673</id>
  <updated>2026-04-05T23:48:30Z</updated>
  <dc:date>2026-04-05T23:48:30Z</dc:date>
  <entry>
    <title>RE: Controlling Asset Publisher Pagination</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118749311" />
    <author>
      <name>Nikita Laitinen</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118749311</id>
    <updated>2020-03-16T14:14:43Z</updated>
    <published>2020-03-16T14:14:43Z</published>
    <summary type="html">Hi! Could you tell me which way you&amp;#39;ve decided to use?</summary>
    <dc:creator>Nikita Laitinen</dc:creator>
    <dc:date>2020-03-16T14:14:43Z</dc:date>
  </entry>
  <entry>
    <title>RE: Controlling Asset Publisher Pagination</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=86354711" />
    <author>
      <name>abdul hakim muzani</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=86354711</id>
    <updated>2017-02-22T08:59:06Z</updated>
    <published>2017-02-22T08:59:06Z</published>
    <summary type="html">Thank you for your response Kailash Yadav. But i decided to go in different way</summary>
    <dc:creator>abdul hakim muzani</dc:creator>
    <dc:date>2017-02-22T08:59:06Z</dc:date>
  </entry>
  <entry>
    <title>RE: Controlling Asset Publisher Pagination</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=85866671" />
    <author>
      <name>Kailash Yadav</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=85866671</id>
    <updated>2017-02-10T06:50:47Z</updated>
    <published>2017-02-10T06:50:47Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;You can remove view permission from web contents for guest/user roles. Only visible for owner.&lt;br&gt;Also you can try following code in hook, not sure it will work or not..&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;SearchContext searchContext = SearchContextFactory.getInstance(request);
searchContext.setUserId(userId);
Hits hits = AssetUtil.search(searchContext , assetEntryQuery, start, end);&lt;/code&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Kailash Yadav</dc:creator>
    <dc:date>2017-02-10T06:50:47Z</dc:date>
  </entry>
  <entry>
    <title>RE: Controlling Asset Publisher Pagination</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=85782431" />
    <author>
      <name>abdul hakim muzani</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=85782431</id>
    <updated>2017-02-08T13:08:58Z</updated>
    <published>2017-02-08T13:08:58Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;In hook, in view_dynamic_list.jspf, i found this line :&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;Hits hits = AssetUtil.search(request, assetEntryQuery, start, end);
total = hits.getLength();
searchContainer.setTotal(total);
results = AssetUtil.getAssetEntries(hits);&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;The code above, controls which and how many shown for each pagination page. So doing the userId check on result, and the total value still don't give whats desired.&lt;br&gt;&lt;br&gt;To complicate things, i also have requirement to check a custom field value in each article. &lt;br&gt;&lt;br&gt;So what i need now is to control the assetEntryQuery. How can i use assetEntryQuery to look for certain userId and get custom field from each asset entry?&lt;br&gt;&lt;br&gt;Please help.&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>abdul hakim muzani</dc:creator>
    <dc:date>2017-02-08T13:08:58Z</dc:date>
  </entry>
  <entry>
    <title>Controlling Asset Publisher Pagination</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=85712672" />
    <author>
      <name>abdul hakim muzani</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=85712672</id>
    <updated>2017-02-07T08:05:55Z</updated>
    <published>2017-02-07T08:05:55Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hey all,&lt;br&gt;&lt;br&gt;So i have an asset publisher, that loads a list of web contents with certain template. I also have a requirement to only list items if the item's userId equals to the logged in userId.&lt;br&gt;&lt;br&gt;What i did so far is to check those user ids inside the asset entry loop, in application display template (freemarker)&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;&amp;amp;lt;#list entries as entry &amp;amp;gt;
    ..... 
    &amp;amp;lt;#if userId == articleUserId&amp;amp;gt;
         ......
    &amp;lt;!--#if--&amp;gt;
&amp;lt;!--#list--&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;This however, does not bode well with pagination. When the asset publisher loads the designated web contents, it also set the total items variable. So my pagination becomes incorrect.&lt;br&gt;&lt;br&gt;For example :&lt;br&gt;Let's say i have 30 items loaded by asset publisher, and i set pagination to 10 per page. But the contents that satisfy the userId == articleUserId criteria, is only 3. This will make the asset publisher only show 3 items, but the pagination buttons are there. So when i clicked next, it only shows empty list.&lt;br&gt;&lt;br&gt;So how do i control the pagination? Is there a better way to filter listed items?&lt;br&gt;If i need to hook it, is there a way that my hook will only work to this particular asset publisher?&lt;br&gt;&lt;br&gt;Thanks in Advance,&lt;br&gt;&lt;br&gt;Abdul Hakim Muzani&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>abdul hakim muzani</dc:creator>
    <dc:date>2017-02-07T08:05:55Z</dc:date>
  </entry>
</feed>
