<?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>Need to update an artifact version in Document media Portlet</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121166437" />
  <subtitle>Need to update an artifact version in Document media Portlet</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121166437</id>
  <updated>2026-04-07T18:28:41Z</updated>
  <dc:date>2026-04-07T18:28:41Z</dc:date>
  <entry>
    <title>Need to update an artifact version in Document media Portlet</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121166436" />
    <author>
      <name>Kevin Matthews</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121166436</id>
    <updated>2021-10-04T17:12:37Z</updated>
    <published>2021-09-24T16:02:05Z</published>
    <summary type="html">&lt;p&gt;hello, I would like to update document version in the document and
  media portlet. My documents store in the db using the dbstore
  configuration in my portal-exr.properties file. I have  the following
  code below. The version gets updated correctlly in the version tab in
  the document portlet but if I try to prgamatically
    &lt;em&gt;_dLFileEntryLocalService.getFileAsStream(fe.getFileEntryId(),
  fe.getVersion())&lt;/em&gt;; fetch that same document I get an exception &lt;/p&gt;
&lt;p&gt;

  &lt;em&gt;&amp;quot;com.liferay.document.library.kernel.exception.NoSuchFileException:
    {companyId=20102, repositoryId=20125, fileName=2897, version=2.0,
    cause=com.liferay.document.library.content.exception.NoSuchContentException:
    No DLContent exists with the key {companyId=20102,
    repositoryId=20125, path=2897, version=2.0}}&amp;quot;  &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The reason I get this acception it seems the documents that are
  stored in the DLContent table doesnt get the updated version number.
  Can someone tell me proper way to programmatically update a list
  of assets versions in the document portlet and also updating the
  version column of the DLContent table? It seems I can not autowire or
  inject DLContentLocalService interface as its not in the Liferay
  7.2 com.liferay.document.library.kernel.service package&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;fe = _dLFileEntryLocalService.getFileEntry(groupId, folderId,
  searchAssetName(title, fl_list));&lt;br /&gt;                 fev =
  _dLFileVersionLocalService.getFileVersion(fe.getFileEntryId(),
  fe.getVersion());&lt;br /&gt;            &lt;br /&gt;                 if
  (fe.getVersion() != version) {&lt;br /&gt;                   
   fe.setVersion(version);&lt;br /&gt;                   
   fev.setVersion(version);&lt;br /&gt;                   
   _dLFileEntryLocalService.updateDLFileEntry(fe);&lt;br /&gt;               
       _dLFileVersionLocalService.updateDLFileVersion(fev);&lt;br /&gt;       
           &lt;br /&gt;                     &lt;br /&gt;                     &lt;br /&gt;
                  }&lt;/p&gt;</summary>
    <dc:creator>Kevin Matthews</dc:creator>
    <dc:date>2021-09-24T16:02:05Z</dc:date>
  </entry>
</feed>
