<?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>Create folders and sub folders from portlet component</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121174504" />
  <subtitle>Create folders and sub folders from portlet component</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121174504</id>
  <updated>2026-04-04T08:02:03Z</updated>
  <dc:date>2026-04-04T08:02:03Z</dc:date>
  <entry>
    <title>RE: Create folders and sub folders from portlet component</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121184540" />
    <author>
      <name>Olaf Kock</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121184540</id>
    <updated>2021-10-05T07:36:07Z</updated>
    <published>2021-10-05T07:36:07Z</published>
    <summary type="html">&lt;p&gt;Please don't crosspost. I've deleted your other, identical post.
  Here's what I originally answered there:&lt;/p&gt;
&lt;div class="c-mt-2"&gt;
  &lt;div class="questions-article-body-121184506"&gt;
    &lt;div&gt;
      &lt;p&gt;Document Library is the place where binary data goes. Web
        Content is a specific type of content that has nothing to do
        with binary (or other) uploaded files.&lt;/p&gt;
      &lt;p&gt;I can't imagine any business requirement where the storage
        place is specified. I can imagine a &lt;em&gt;presentation&lt;/em&gt;
        requirement, but that has nothing to do with the storage
        location of documents.&lt;/p&gt;
      &lt;p&gt;In other words: You didn't find anything because there's no
        way. You also wouldn't try to buy groceries in the electronics
        store just because somebody told you so. This is comparable.&lt;/p&gt;
      &lt;p&gt;If you let us know about the underlying business problem that
        you're trying to solve, we might generate ideas how to
        design/implement. Just make sure they're business language, not
        implementation details.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</summary>
    <dc:creator>Olaf Kock</dc:creator>
    <dc:date>2021-10-05T07:36:07Z</dc:date>
  </entry>
  <entry>
    <title>RE: Create folders and sub folders from portlet component</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121177388" />
    <author>
      <name>Abdul Kareem</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121177388</id>
    <updated>2021-10-01T12:47:21Z</updated>
    <published>2021-10-01T12:47:21Z</published>
    <summary type="html">&lt;p&gt;Hi Shiva,&lt;/p&gt;
&lt;p&gt;Firstly decide whether you want to create folders under Web content
  or Documents and Media library.&lt;/p&gt;
&lt;p&gt;If under web content use :&lt;/p&gt;
&lt;p&gt;@Reference&lt;br /&gt;     private JournalFolderLocalService journalFolderLocalService;&lt;/p&gt;
&lt;p&gt;JournalFolder journalFolder =
  journalFolderLocalService.addFolder(themeDisplay.getUserId(),
  groupId, &lt;br /&gt;                             parentFolderId,
  folderName, &amp;quot;&amp;quot;, serviceContext);&lt;/p&gt;
&lt;p&gt;If under Documents and Media then use :&lt;/p&gt;
&lt;p&gt;DLFolderLocalServiceUtil.addFolder(userId, groupId, &lt;br /&gt;           
                           repositoryId, mountPoint, parentFolderId,
  name, description, hidden, serviceContext)&lt;/p&gt;</summary>
    <dc:creator>Abdul Kareem</dc:creator>
    <dc:date>2021-10-01T12:47:21Z</dc:date>
  </entry>
  <entry>
    <title>Create folders and sub folders from portlet component</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121174503" />
    <author>
      <name>shiva xc</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121174503</id>
    <updated>2021-09-29T16:17:51Z</updated>
    <published>2021-09-29T16:07:29Z</published>
    <summary type="html">&lt;p&gt;Hello Liferay Community,&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;liferay-ce-portal-7.3.3-ga4&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;I have a requirement to read excel data and put it under web content
  and sort them into different folders and subfolders. How to do achieve this?&lt;/p&gt;
&lt;p&gt;All I found is creating files and folders under Documents and Media library&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;
    &lt;a href="https://help.liferay.com/hc/en-us/articles/360029045451-Creating-Files-Folders-and-Shortcuts"&gt;https://help.liferay.com/hc/en-us/articles/360029045451-Creating-Files-Folders-and-Shortcuts&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;
    &lt;a href="https://help.liferay.com/hc/en-us/articles/360028725672-Creating-Folders"&gt;https://help.liferay.com/hc/en-us/articles/360028725672-Creating-Folders&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;Follow these steps to create a folder with the &lt;code&gt;DLAppService&lt;/code&gt; method &lt;code&gt;addFolder&lt;/code&gt;:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Get a reference to &lt;code&gt;DLAppService&lt;/code&gt;:&lt;/p&gt;
    &lt;pre&gt;
&lt;code&gt;@Reference
private DLAppService _dlAppService;
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Get the data needed to populate
      the &lt;code&gt;addFolder&lt;/code&gt; method’s arguments. Since it’s common
      to create a folder with data submitted by the end user, you can
      extract the data from the request. This example does so
        via &lt;code&gt;javax.portlet.ActionRequest&lt;/code&gt; and &lt;a href="https://docs.liferay.com/dxp/portal/7.2-latest/javadocs/portal-kernel/com/liferay/portal/kernel/util/ParamUtil.html"&gt;&lt;code&gt;ParamUtil&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;
    &lt;pre&gt;
&lt;code&gt;long repositoryId = ParamUtil.getLong(actionRequest, &amp;quot;repositoryId&amp;quot;);
long parentFolderId = ParamUtil.getLong(actionRequest, &amp;quot;parentFolderId&amp;quot;);
String name = ParamUtil.getString(actionRequest, &amp;quot;name&amp;quot;);
String description = ParamUtil.getString(actionRequest, &amp;quot;description&amp;quot;);

ServiceContext serviceContext = ServiceContextFactory.getInstance(
            DLFolder.class.getName(), actionRequest);
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Call the service reference’s &lt;code&gt;addFolder&lt;/code&gt; method with
      the data from the previous step:&lt;/p&gt;
    &lt;pre&gt;
&lt;code&gt;Folder folder = _dlAppService.addFolder(
                        repositoryId, parentFolderId, name, description, 
                        serviceContext);
&lt;/code&gt;&lt;/pre&gt;
    &lt;p&gt;The method returns a &lt;code&gt;Folder&lt;/code&gt; object, which this
      example sets to a variable for later use. Note, however, that you
      don’t have to do this.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Please let me know or guide me on how to solve this problem.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Thanks in advance.&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt; A Liferay Beginner&lt;/p&gt;</summary>
    <dc:creator>shiva xc</dc:creator>
    <dc:date>2021-09-29T16:07:29Z</dc:date>
  </entry>
</feed>
