<?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>Document API - How to correctly update existing documents programmatically?</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=119953741" />
  <subtitle>Document API - How to correctly update existing documents programmatically?</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=119953741</id>
  <updated>2026-06-20T10:36:52Z</updated>
  <dc:date>2026-06-20T10:36:52Z</dc:date>
  <entry>
    <title>RE: Document API - How to correctly update existing documents programmatica</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119966647" />
    <author>
      <name>Fabian Witthaus</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119966647</id>
    <updated>2020-09-18T07:53:29Z</updated>
    <published>2020-09-18T07:53:29Z</published>
    <summary type="html">Thank you. With DLAppService.updateFileEntry(...) it works :-)</summary>
    <dc:creator>Fabian Witthaus</dc:creator>
    <dc:date>2020-09-18T07:53:29Z</dc:date>
  </entry>
  <entry>
    <title>RE: Document API - How to correctly update existing documents programmatica</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119963918" />
    <author>
      <name>Mohammed Yasin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119963918</id>
    <updated>2020-09-17T09:18:13Z</updated>
    <published>2020-09-17T09:18:13Z</published>
    <summary type="html">Not redundant , all have there own uses DlFileEntrylocalservice  api are for DLFileEntry Entity , DLApp Services should be used for  document and media.&lt;br /&gt;You can go refer below links for more information&lt;br /&gt;&lt;a href="https://help.liferay.com/hc/en-us/articles/360019952312-Getting-Started-with-the-Documents-and-Media-API"&gt;https://help.liferay.com/hc/en-us/articles/360019952312-Getting-Started-with-the-Documents-and-Media-API&lt;/a&gt;&lt;br /&gt;&lt;a href="https://help.liferay.com/hc/en-us/articles/360019952332-Creating-Files-Folders-and-Shortcuts"&gt;https://help.liferay.com/hc/en-us/articles/360019952332-Creating-Files-Folders-and-Shortcuts&lt;/a&gt;&lt;br /&gt;&lt;a href="https://help.liferay.com/hc/en-us/articles/360020197211-Creating-Files-"&gt;https://help.liferay.com/hc/en-us/articles/360020197211-Creating-Files-&lt;/a&gt;&lt;br /&gt;&lt;a href="https://help.liferay.com/hc/en-us/articles/360019952432-Updating-Files"&gt;https://help.liferay.com/hc/en-us/articles/360019952432-Updating-Files&lt;/a&gt;</summary>
    <dc:creator>Mohammed Yasin</dc:creator>
    <dc:date>2020-09-17T09:18:13Z</dc:date>
  </entry>
  <entry>
    <title>RE: Document API - How to correctly update existing documents programmatica</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119961426" />
    <author>
      <name>Fabian Witthaus</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119961426</id>
    <updated>2020-09-17T07:57:18Z</updated>
    <published>2020-09-17T07:57:18Z</published>
    <summary type="html">Thanks for the reply. So are all these services redundant?</summary>
    <dc:creator>Fabian Witthaus</dc:creator>
    <dc:date>2020-09-17T07:57:18Z</dc:date>
  </entry>
  <entry>
    <title>RE: Document API - How to correctly update existing documents programmatica</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119954111" />
    <author>
      <name>Mohammed Yasin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119954111</id>
    <updated>2020-09-16T11:20:25Z</updated>
    <published>2020-09-16T11:20:25Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi,&lt;br&gt;Try using DlAppLocalService or DlAppService instead of DlFileEntryLocalService&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;DLAppLocalService.updateFileEntry(userId, fileEntryId, sourceFileName, mimeType title, description, changeLog DLVersionNumberIncrease.MINOR, file, serviceContext);  &lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;&amp;amp;nbsp;DLAppService.updateFileEntry(fileEntryId, sourceFileName, mimeType, title, description, changeLog DLVersionNumberIncrease.MINOR, file, serviceContext);  &lt;/code&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Mohammed Yasin</dc:creator>
    <dc:date>2020-09-16T11:20:25Z</dc:date>
  </entry>
  <entry>
    <title>Document API - How to correctly update existing documents programmatically?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119953740" />
    <author>
      <name>Fabian Witthaus</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119953740</id>
    <updated>2020-09-16T10:36:48Z</updated>
    <published>2020-09-16T10:36:48Z</published>
    <summary type="html">I have to develop a portlet for uploading new documents and updating existing ones with Liferay 7.3-ga1. Creating new documents and deleting works fine but I have a problem with updating existing ones.&lt;br /&gt;&lt;br /&gt;For the update process I use dLFileEntryService.updateFileEntry(...) and dLFileEntryService.updateStatus(...) .&lt;br /&gt;&lt;br /&gt;updatedEntry = dLFileEntryService.updateFileEntry(...);&lt;br /&gt;...&lt;br /&gt;dLFileEntryService.updateStatus(&lt;br /&gt;user,&lt;br /&gt;updatedFileEntry.getFileVersionId(),&lt;br /&gt;WorkflowConstants.STATUS_APPROVED,&lt;br /&gt;ServiceContextFactory.getInstance(DLFolder.class.getName(), request),&lt;br /&gt;new HashMap&amp;lt;&amp;gt;());   // ? Docs say workflowContext&lt;br /&gt;&lt;br /&gt;If I look as admin into &amp;#39;documents and media&amp;#39; the new version of the document is displayed there (version counter increases), but still has the status &amp;#39;draft&amp;#39; and not &amp;#39;approved&amp;#39;. As result the new version is (of course) not shown in my portlet but still the former.&lt;br /&gt;&lt;br /&gt;I have no idea why the status is not set correctly. I&amp;#39;m new to this API and took over the work from a more experienced colleague who left the company so I&amp;#39;m a bit lost here. So help is appreciated.</summary>
    <dc:creator>Fabian Witthaus</dc:creator>
    <dc:date>2020-09-16T10:36:48Z</dc:date>
  </entry>
</feed>
