<?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>Error after update. Velocity.</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121159822" />
  <subtitle>Error after update. Velocity.</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121159822</id>
  <updated>2026-04-03T21:02:41Z</updated>
  <dc:date>2026-04-03T21:02:41Z</dc:date>
  <entry>
    <title>RE: Error after update. Velocity.</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121162369" />
    <author>
      <name>ildar sl</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121162369</id>
    <updated>2021-09-22T15:35:02Z</updated>
    <published>2021-09-22T15:35:02Z</published>
    <summary type="html">&lt;pre&gt;
&lt;code class="language-java"&gt;Calendar startDate = Calendar.getInstance();
startDate.add(Calendar.MONTH, -8);
Calendar endDate = Calendar.getInstance();
endDate.add(Calendar.MONTH, -1);
System.out.println(startDate.getTime());
System.out.println(endDate.getTime());
DynamicQuery dynamicQuery2 = 
			DynamicQueryFactoryUtil.forClass(AssetEntry.class, PortalClassLoaderUtil.getClassLoader());
dynamicQuery2.add(PropertyFactoryUtil.forName(&amp;quot;groupId&amp;quot;).eq(themeDisplay.getScopeGroupId()));
dynamicQuery2.add(RestrictionsFactoryUtil.between(&amp;quot;createDate&amp;quot;, startDate.getTime(),endDate.getTime()));
dynamicQuery2.addOrder(OrderFactoryUtil.asc(&amp;quot;createDate&amp;quot;));&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Remained only assetEntryQuery.setAnyCategoryIds([getterUtil.getLong(categoryId.getData())])&lt;/p&gt;</summary>
    <dc:creator>ildar sl</dc:creator>
    <dc:date>2021-09-22T15:35:02Z</dc:date>
  </entry>
  <entry>
    <title>RE: Error after update. Velocity.</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121161113" />
    <author>
      <name>ildar sl</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121161113</id>
    <updated>2021-09-22T08:41:39Z</updated>
    <published>2021-09-22T08:41:39Z</published>
    <summary type="html">&lt;pre&gt;
&lt;code class="language-java"&gt;&amp;lt;#assign
	assetEntryLocalService = serviceLocator.findService(&amp;quot;com.liferay.portlet.asset.service.AssetEntryLocalService&amp;quot;)
	assetEntryQuery = objectUtil('com.liferay.portlet.asset.service.persistence.AssetEntryQuery')

	V = assetEntryQuery.setAttribute(&amp;quot;isNews&amp;quot;, true)
	V = assetEntryQuery.setAttribute('startDate', startDate?date)
	V = assetEntryQuery.setAttribute('endDate', endDate?date)
	V = assetEntryQuery.setAnyCategoryIds([getterUtil.getLong(categoryId.getData())])
	V = assetEntryQuery.setOrderByCol1('expirationDate')
	V = assetEntryQuery.setOrderByType1('ASC')
	V = assetEntryQuery.setOrderByCol2('title')
	V = assetEntryQuery.setOrderByType2('ASC')
	
	eventCount = assetEntryLocalService.getEntriesCount(assetEntryQuery)
	entries = assetEntryLocalService.getEntries(assetEntryQuery)
/&amp;gt;	&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;it almost works like that. But date limitation doesn't work&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>ildar sl</dc:creator>
    <dc:date>2021-09-22T08:41:39Z</dc:date>
  </entry>
  <entry>
    <title>Error after update. Velocity.</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121159821" />
    <author>
      <name>ildar sl</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121159821</id>
    <updated>2021-10-04T17:04:43Z</updated>
    <published>2021-09-21T14:07:35Z</published>
    <summary type="html">&lt;p&gt;Hi!&lt;/p&gt;
&lt;pre&gt;
&lt;code class="language-java"&gt;    #set($assetEntryLocalService = $serviceLocator.findService(&amp;quot;com.liferay.portlet.asset.service.AssetEntryLocalService&amp;quot;))

    #set($assetEntryQuery = $portal.getClass().forName('com.liferay.portlet.asset.service.persistence.AssetEntryQuery').newInstance())
	
    #set($V = $assetEntryQuery.setAttribute(&amp;quot;isNews&amp;quot;, true))
    #set($V = $assetEntryQuery.setAttribute('startDate', $startDate))
    #set($V = $assetEntryQuery.setAttribute('endDate', $endDate))
    #set($V = $assetEntryQuery.setAnyCategoryIds($getterUtil.getLong($categoryId.getData())))
    #set($V = $assetEntryQuery.setOrderByCol1('expirationDate'))
    #set($V = $assetEntryQuery.setOrderByType1('ASC'))
    #set($V = $assetEntryQuery.setOrderByCol2('title'))
    #set($V = $assetEntryQuery.setOrderByType2('ASC'))

    #set($eventCount = $assetEntryLocalService.getEntriesCount($assetEntryQuery))
    #set($entries = $assetEntryLocalService.getEntries($assetEntryQuery))



	${entries.size()}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;This piece of code worked in Liferay 6.2 GA3&lt;br /&gt; But he doesn't
  want to work in 6.2 GA6 in any way, after updating the version&lt;br /&gt;
  Will not throw errors. It just writes the name of the variable &amp;quot;$
  {entries.size ()}&amp;quot; in the browser.&lt;/p&gt;
&lt;p&gt;
  &lt;br /&gt; Any ideas please?&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>ildar sl</dc:creator>
    <dc:date>2021-09-21T14:07:35Z</dc:date>
  </entry>
</feed>
