<?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 get the document uuid in a adt</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=111028237" />
  <subtitle>How to get the document uuid in a adt</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=111028237</id>
  <updated>2026-04-05T00:45:30Z</updated>
  <dc:date>2026-04-05T00:45:30Z</dc:date>
  <entry>
    <title>RE: How to get the document uuid in a adt</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111054124" />
    <author>
      <name>josu urrutia</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111054124</id>
    <updated>2018-09-27T14:52:25Z</updated>
    <published>2018-09-27T14:52:25Z</published>
    <summary type="html">&lt;p&gt;Hello Minhchau Dang,&lt;/p&gt;
&lt;p&gt;Thank you for your answer, the link you give me help me a lot.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Josu U.&lt;/p&gt;</summary>
    <dc:creator>josu urrutia</dc:creator>
    <dc:date>2018-09-27T14:52:25Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to get the document uuid in a adt</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111046388" />
    <author>
      <name>Minhchau Dang</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111046388</id>
    <updated>2018-09-26T19:57:19Z</updated>
    <published>2018-09-26T19:57:19Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;blockquote&gt;
  &lt;div class="quote-title"&gt;josu urrutia:&lt;/div&gt;
  &lt;div class="quote"&gt;
    &lt;div class="quote-content"&gt;
      &lt;pre&gt;
For "#list" list source: Expected a sequence or collection, but this has evaluated to a string (wrapper: f.t.SimpleScalar):&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;
&lt;p&gt;Based on this error message, it sounds like &lt;code&gt;dlFile&lt;/code&gt; is a
  string, so you can't treat it like a list. Given that, have you tried
  following the blog post on &lt;a href="https://community.liferay.com/blogs/-/blogs/working-with-json-in-freemarker"&gt;Working
    with JSON in Freemarker&lt;/a&gt; to convert your &lt;code&gt;dlFile&lt;/code&gt;
  variable from a string into a JSON object?&lt;/p&gt;
&lt;pre&gt;
&amp;lt;#assign dlFile_hashmap = jsonFactoryUtil.looseDeserializeSafe(dlFile) &amp;gt;
${dlFile_hashmap.uuid}
&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Minhchau Dang</dc:creator>
    <dc:date>2018-09-26T19:57:19Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to get the document uuid in a adt</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111040188" />
    <author>
      <name>josu urrutia</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111040188</id>
    <updated>2018-09-26T09:49:03Z</updated>
    <published>2018-09-26T09:49:03Z</published>
    <summary type="html">&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Thanks for your answer, i have cheeked your code and it works.&lt;/p&gt;
&lt;p&gt;The problem is that im in the develop enviroment and when i migrate
  to the production enviroment it will fail.&lt;/p&gt;
&lt;p&gt;Is there any other solution without hard-codeing?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Josu U.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>josu urrutia</dc:creator>
    <dc:date>2018-09-26T09:49:03Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to get the document uuid in a adt</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111038641" />
    <author>
      <name>Vishal Munjani</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111038641</id>
    <updated>2018-09-26T07:38:24Z</updated>
    <published>2018-09-26T07:38:24Z</published>
    <summary type="html">&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;I have tried below code and it is worked for me.Please check with
  below code.&lt;/p&gt;
&lt;pre&gt;
&amp;lt;#assign dlFile=  {&amp;quot;groupId&amp;quot;:&amp;quot;20127&amp;quot;,&amp;quot;title&amp;quot;:&amp;quot;8a66f5c8-ea38-b0f1-34dd-73447f62b882&amp;quot;,&amp;quot;type&amp;quot;:&amp;quot;document&amp;quot;,&amp;quot;uuid&amp;quot;:&amp;quot;8b418808-4ec6-5100-8169-368fc080611f&amp;quot;}&amp;gt;

${dlFile.uuid}
&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;</summary>
    <dc:creator>Vishal Munjani</dc:creator>
    <dc:date>2018-09-26T07:38:24Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to get the document uuid in a adt</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111031498" />
    <author>
      <name>josu urrutia</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111031498</id>
    <updated>2018-09-25T14:29:17Z</updated>
    <published>2018-09-25T14:29:17Z</published>
    <summary type="html">&lt;p&gt;Hello Vishal Munjani,&lt;/p&gt;
&lt;p&gt;Thanks for your answer but it doesn't work, i still have a problem it
  says me this:&lt;/p&gt;
&lt;pre&gt;
For &amp;quot;#list&amp;quot; list source: Expected a sequence or collection, but this has evaluated to a string (wrapper: f.t.SimpleScalar):&lt;/pre&gt;
&lt;p&gt;I hope u could help me.&lt;/p&gt;
&lt;p&gt;Josu U.&lt;/p&gt;</summary>
    <dc:creator>josu urrutia</dc:creator>
    <dc:date>2018-09-25T14:29:17Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to get the document uuid in a adt</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111029728" />
    <author>
      <name>Vishal Munjani</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111029728</id>
    <updated>2018-09-25T12:24:16Z</updated>
    <published>2018-09-25T12:24:16Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;p&gt;Hello,&lt;/p&gt;
&lt;pre&gt;
{"groupId":"20127","title":"8a66f5c8-ea38-b0f1-34dd-73447f62b882","type":"document","uuid":"8b418808-4ec6-5100-8169-368fc080611f"}&lt;/pre&gt;
&lt;p&gt;If your JSON is like above than you can use below code for fetching uuid.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;&amp;amp;lt;#list dlFile as value&amp;amp;gt; 
     ${value.uuid} 
&amp;amp;lt;/#list&amp;amp;gt; &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Vishal Munjani&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Vishal Munjani</dc:creator>
    <dc:date>2018-09-25T12:24:16Z</dc:date>
  </entry>
  <entry>
    <title>How to get the document uuid in a adt</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111028236" />
    <author>
      <name>josu urrutia</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111028236</id>
    <updated>2018-09-25T09:19:16Z</updated>
    <published>2018-09-25T09:19:16Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I'm trying to show a documents and media PDF in a &lt;a href="https://innoval.zylk.net/en/group/guest/~/control_panel/manage?p_p_id=com_liferay_dynamic_data_mapping_web_portlet_PortletDisplayTemplatePortlet&amp;amp;p_p_lifecycle=0&amp;amp;p_p_state=maximized&amp;amp;p_p_mode=view&amp;amp;_com_liferay_dynamic_data_mapping_web_portlet_PortletDisplayTemplatePortlet_mvcPath=%2Fedit_template.jsp&amp;amp;_com_liferay_dynamic_data_mapping_web_portlet_PortletDisplayTemplatePortlet_groupId=20127&amp;amp;_com_liferay_dynamic_data_mapping_web_portlet_PortletDisplayTemplatePortlet_templateId=41614&amp;amp;_com_liferay_dynamic_data_mapping_web_portlet_PortletDisplayTemplatePortlet_classNameId=0&amp;amp;_com_liferay_dynamic_data_mapping_web_portlet_PortletDisplayTemplatePortlet_classPK=0&amp;amp;_com_liferay_dynamic_data_mapping_web_portlet_PortletDisplayTemplatePortlet_type=display&amp;amp;_com_liferay_dynamic_data_mapping_web_portlet_PortletDisplayTemplatePortlet_structureAvailableFields=_com_liferay_dynamic_data_mapping_web_portlet_PortletDisplayTemplatePortlet_getAvailableFields&amp;amp;p_p_auth=HZ0lcJ9x"&gt;Asset
    Publisher Template&lt;/a&gt; using documents and media structure field and
  the &lt;span&gt;
    &lt;span&gt;URL that i get is this one : &lt;/span&gt;&lt;/span&gt;
  &lt;code&gt;https://innoval.zylk.net/en/web/guest/{ &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;What I'm doing is this:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;lt;#assign dlFile =
  saxReaderUtil.createXPath("dynamic-element[@name='documents']").selectSingleNode(rootElement).getStringValue()
  &amp;gt;&lt;br&gt; &amp;lt;p&amp;gt;&amp;lt;a href="${dlFile}"
  target="_blank" &amp;gt;Download&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;When i print on screen the var dlFile, it shows :&lt;/p&gt;
&lt;p&gt;{"groupId":"20127","title":"8a66f5c8-ea38-b0f1-34dd-73447f62b882","type":"document","uuid":"8b418808-4ec6-5100-8169-368fc080611f"}&lt;/p&gt;
&lt;p&gt;How can i get the uuid value?&lt;/p&gt;
&lt;p&gt;I have tried to use the ?split,&amp;nbsp; a list like this:&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;&amp;lt;span&amp;gt;&amp;amp;lt;#&amp;lt;/span&amp;gt;&amp;lt;span&amp;gt;list dlFile as&amp;lt;/span&amp;gt;&amp;lt;span&amp;gt; value&amp;lt;/span&amp;gt;&amp;lt;span&amp;gt;&amp;amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span&amp;gt; 
    &amp;lt;/span&amp;gt;&amp;lt;span&amp;gt; $&amp;lt;/span&amp;gt;&amp;lt;span&amp;gt;{&amp;lt;/span&amp;gt;&amp;lt;span&amp;gt;value&amp;lt;/span&amp;gt;&amp;lt;span&amp;gt;}&amp;lt;/span&amp;gt;&amp;lt;span&amp;gt; 
&amp;lt;/span&amp;gt;&amp;lt;span&amp;gt;&amp;amp;lt;/#&amp;lt;/span&amp;gt;&amp;lt;span&amp;gt;list&amp;lt;/span&amp;gt;&amp;lt;span&amp;gt;&amp;amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span&amp;gt; &amp;lt;/span&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But they doesn't work&lt;/p&gt;
&lt;p&gt;Could someone help me??&lt;/p&gt;
&lt;p&gt;I hope u can help me..&lt;/p&gt;
&lt;p&gt;Lots of thanks.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>josu urrutia</dc:creator>
    <dc:date>2018-09-25T09:19:16Z</dc:date>
  </entry>
</feed>
