<?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 library actions in a scheduler task</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=120657662" />
  <subtitle>Document library actions in a scheduler task</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=120657662</id>
  <updated>2026-04-19T07:57:14Z</updated>
  <dc:date>2026-04-19T07:57:14Z</dc:date>
  <entry>
    <title>RE: Document library actions in a scheduler task</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120697674" />
    <author>
      <name>Sonia Castro</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120697674</id>
    <updated>2021-03-29T16:48:48Z</updated>
    <published>2021-03-29T11:24:26Z</published>
    <summary type="html">&lt;p&gt;I'm not sending a Message and I think that I can't do it.&lt;/p&gt;
&lt;p&gt;My Scheduler is defined in liferay-portlet.xml:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-html"&gt;&amp;lt;scheduler-entry&amp;gt;
    &amp;lt;scheduler-description&amp;gt;
        My scheduler to delete files
    &amp;lt;/scheduler-description&amp;gt;
    &amp;lt;scheduler-event-listener-class&amp;gt;com.example.MyScheduler&amp;lt;/scheduler-event-listener-class&amp;gt;
    &amp;lt;trigger&amp;gt;
        &amp;lt;simple&amp;gt;
            &amp;lt;property-key&amp;gt;10&amp;lt;/property-key&amp;gt;
            &amp;lt;time-unit&amp;gt;minute&amp;lt;/time-unit&amp;gt;
        &amp;lt;/simple&amp;gt;
    &amp;lt;/trigger&amp;gt;
&amp;lt;/scheduler-entry&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To send the message, I would have to create it dynamically, right?&lt;/p&gt;
&lt;p&gt;I want to avoid a programmatically scheduler, because I need to start
  the scheduler without user interaction.&lt;/p&gt;</summary>
    <dc:creator>Sonia Castro</dc:creator>
    <dc:date>2021-03-29T11:24:26Z</dc:date>
  </entry>
  <entry>
    <title>RE: RE: Document library actions in a scheduler task</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120693352" />
    <author>
      <name>Sushil Patidar</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120693352</id>
    <updated>2021-03-24T12:54:30Z</updated>
    <published>2021-03-24T12:54:30Z</published>
    <summary type="html">&lt;p&gt;Hi &lt;/p&gt;
&lt;p&gt;While sending message. In the message payload, it need to be sent .&lt;/p&gt;
&lt;p&gt;How you are sending the message.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Sushil&lt;/p&gt;</summary>
    <dc:creator>Sushil Patidar</dc:creator>
    <dc:date>2021-03-24T12:54:30Z</dc:date>
  </entry>
  <entry>
    <title>RE: Document library actions in a scheduler task</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120693010" />
    <author>
      <name>Sushil Patidar</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120693010</id>
    <updated>2021-03-23T15:27:54Z</updated>
    <published>2021-03-23T15:27:54Z</published>
    <summary type="html">&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Check if you can pass the repositoryid in the message itself.&lt;/p&gt;
&lt;p&gt;Hope it helps&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Sushil&lt;/p&gt;</summary>
    <dc:creator>Sushil Patidar</dc:creator>
    <dc:date>2021-03-23T15:27:54Z</dc:date>
  </entry>
  <entry>
    <title>RE: Document library actions in a scheduler task</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120685951" />
    <author>
      <name>Sonia Castro</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120685951</id>
    <updated>2021-03-18T18:55:50Z</updated>
    <published>2021-03-18T17:28:15Z</published>
    <summary type="html">&lt;p&gt;Thanks for the hint but I don't find any method that fits my
  requirements in other services.&lt;/p&gt;
&lt;p&gt;I need to list files inside a folder and I only have the folder name
  and the parentFolderID.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Sonia Castro</dc:creator>
    <dc:date>2021-03-18T17:28:15Z</dc:date>
  </entry>
  <entry>
    <title>RE: Document library actions in a scheduler task</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120683951" />
    <author>
      <name>Vilmos Papp</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120683951</id>
    <updated>2021-03-12T15:16:47Z</updated>
    <published>2021-03-12T15:16:47Z</published>
    <summary type="html">&lt;p&gt;You coud use other service util, or  service reference like DLFileEntryLocalServiceUtil:&lt;/p&gt;
&lt;p&gt;
  &lt;a href="https://github.com/vilmospapp/liferay-portal/blob/master/portal-kernel/src/com/liferay/document/library/kernel/service/DLFileEntryLocalServiceUtil.java#L703"&gt;https://github.com/vilmospapp/liferay-portal/blob/master/portal-kernel/src/com/liferay/document/library/kernel/service/DLFileEntryLocalServiceUtil.java#L703&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;There a methods with folderId without repositoryId, you can choose
  the one that meets your expectations.&lt;/p&gt;</summary>
    <dc:creator>Vilmos Papp</dc:creator>
    <dc:date>2021-03-12T15:16:47Z</dc:date>
  </entry>
  <entry>
    <title>Document library actions in a scheduler task</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120657661" />
    <author>
      <name>Sonia Castro</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120657661</id>
    <updated>2021-03-03T11:06:55Z</updated>
    <published>2021-03-03T10:25:23Z</published>
    <summary type="html">&lt;p&gt;I need to list document library files and delete some ones periodically.&lt;/p&gt;
&lt;p&gt;I have a class that implements MessageListener to run this task, but
  the scheduler class does not have a request and I don't know how can I
  get the repositorId without it.&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-java"&gt;public class MyScheduler implements MessageListener {

    @Override
    public void receive(Message message) throws MessageListenerException {

       ...
       Long parentFolderId = DLFolderConstants.DEFAULT_PARENT_FOLDER_ID;
       Folder folder = DLAppServiceUtil.getFolder(repositoryId, parentFolderId, folderName);
       List&amp;lt;FileEntry&amp;gt; fileEntries = DLAppServiceUtil.getFileEntries(repositoryId, folder.getFolderId());
       ...

    }
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Is there any way to get repositoryid ?&lt;/p&gt;
&lt;p&gt;Any alternative to run document library actions in sheduler task?&lt;/p&gt;</summary>
    <dc:creator>Sonia Castro</dc:creator>
    <dc:date>2021-03-03T10:25:23Z</dc:date>
  </entry>
</feed>
