<?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>How to access DLURLHelper in a Fragment</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=122333470" />
  <subtitle>How to access DLURLHelper in a Fragment</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=122333470</id>
  <updated>2026-04-06T03:34:31Z</updated>
  <dc:date>2026-04-06T03:34:31Z</dc:date>
  <entry>
    <title>RE: How to access DLURLHelper in a Fragment</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=122334558" />
    <author>
      <name>Olaf Kock</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=122334558</id>
    <updated>2024-01-11T10:54:31Z</updated>
    <published>2024-01-11T10:54:30Z</published>
    <summary type="html">&lt;p&gt;serviceLocator is not available by default - for a good reason: Security.&lt;/p&gt;
&lt;p&gt;Anybody with access to serviceLocator can effectively bypass all
  authentication checks by calling unauthenticated services. There is a
  way to enable it, but it's a galactically bad idea unless you're the
  only editor on your system and want to go the comfortable insecure route.&lt;/p&gt;
&lt;p&gt;You might want to look into TemplateContextContributors that can make
  certain elements available to your freemarker scripts - but be very
  careful about the ones that you choose.&lt;/p&gt;</summary>
    <dc:creator>Olaf Kock</dc:creator>
    <dc:date>2024-01-11T10:54:30Z</dc:date>
  </entry>
  <entry>
    <title>How to access DLURLHelper in a Fragment</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=122333469" />
    <author>
      <name>Gurgen Grigoryan</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=122333469</id>
    <updated>2024-01-11T10:51:38Z</updated>
    <published>2024-01-10T21:09:23Z</published>
    <summary type="html">&lt;p&gt;Hello everyone,&lt;/p&gt;
&lt;p&gt;I am working on a custom fragment that is using the itemSelector in
  the configuration.&lt;/p&gt;
&lt;p&gt;My goal is once the user selects their item from the documents and
  media folder, I and retrieve the file URL.&lt;/p&gt;
&lt;p&gt;However when I try: &lt;/p&gt;
&lt;pre&gt;
&lt;code class="language-javascript"&gt;${serviceLocator.findService(&amp;quot;com.liferay.document.library.util.DLURLHelper&amp;quot;)}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I get the following error:&lt;/p&gt;
&lt;pre&gt;
&lt;code class="language-java"&gt;The following has evaluated to null or missing:
==&amp;gt; serviceLocator.findService(&amp;quot;com.liferay.document.library.util.DLURLHelper&amp;quot;) &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Based on the documentation it should work: https://docs.liferay.com/dxp/portal/7.4-latest/javadocs/portal-kernel/com/liferay/document/library/kernel/util/DLUtil.html&lt;/p&gt;</summary>
    <dc:creator>Gurgen Grigoryan</dc:creator>
    <dc:date>2024-01-10T21:09:23Z</dc:date>
  </entry>
</feed>
