<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: EL Expression for a document&amp;apos;s Parent in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/el-expression-for-a-document-apos-s-parent/m-p/315588#M2589</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;The variable "document" exposed by the layout service has been deprecated, you should use "layoutValue" instead.&lt;/P&gt;
&lt;P&gt;This variable will map the object that the layout binds to.&lt;/P&gt;
&lt;P&gt;In a basic form, the layout will be bound to a document model, so you should be able to use the following syntax:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;documentManager.getDocument(layoutValue.getParentRef()).getParent("Folder") == null ? 'hidden': mode
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If your widget is actually inside a listing, the layout is bound to a PageSelection element, so you can get the wrapped document by calling #getData() on it. In this case, the following expression should work:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;documentManager.getDocument(layoutValue.getData().getParentRef()).getParent("Folder") == null ? 'hidden': mode
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I haven't tested these, please tell if there are issues with them.&lt;/P&gt;
&lt;P&gt;Also see the documentation about &lt;A href="http://doc.nuxeo.com/x/ZoOo"&gt;layout expressions and variables&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Fri, 23 Jan 2015 10:47:56 GMT</pubDate>
    <dc:creator>Anahide_Tchertc</dc:creator>
    <dc:date>2015-01-23T10:47:56Z</dc:date>
    <item>
      <title>EL Expression for a document&amp;apos;s Parent</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/el-expression-for-a-document-apos-s-parent/m-p/315587#M2588</link>
      <description>&lt;P&gt;I'm trying to write an EL expression so I can place it in the Advanced Configurations section where, given a File document type, if the parent of the File is a Folder document type, then I want the "State" and "Workflow" widgets to be hidden. Here's what I've found so far:&lt;/P&gt;
&lt;P&gt;documentManager.getDocument(document.getData().getParentRef()).getParent("Folder") == 'hidden'&lt;/P&gt;
&lt;P&gt;Any ideas for getting this EL expression right? I'm planning on putting this in the Advanced Configuration section in the widget.&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jan 2015 00:47:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/el-expression-for-a-document-apos-s-parent/m-p/315587#M2588</guid>
      <dc:creator>nathan1620_</dc:creator>
      <dc:date>2015-01-23T00:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: EL Expression for a document&amp;apos;s Parent</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/el-expression-for-a-document-apos-s-parent/m-p/315588#M2589</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;The variable "document" exposed by the layout service has been deprecated, you should use "layoutValue" instead.&lt;/P&gt;
&lt;P&gt;This variable will map the object that the layout binds to.&lt;/P&gt;
&lt;P&gt;In a basic form, the layout will be bound to a document model, so you should be able to use the following syntax:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;documentManager.getDocument(layoutValue.getParentRef()).getParent("Folder") == null ? 'hidden': mode
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If your widget is actually inside a listing, the layout is bound to a PageSelection element, so you can get the wrapped document by calling #getData() on it. In this case, the following expression should work:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;documentManager.getDocument(layoutValue.getData().getParentRef()).getParent("Folder") == null ? 'hidden': mode
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I haven't tested these, please tell if there are issues with them.&lt;/P&gt;
&lt;P&gt;Also see the documentation about &lt;A href="http://doc.nuxeo.com/x/ZoOo"&gt;layout expressions and variables&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jan 2015 10:47:56 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/el-expression-for-a-document-apos-s-parent/m-p/315588#M2589</guid>
      <dc:creator>Anahide_Tchertc</dc:creator>
      <dc:date>2015-01-23T10:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: EL Expression for a document&amp;apos;s Parent</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/el-expression-for-a-document-apos-s-parent/m-p/315589#M2590</link>
      <description>&lt;P&gt;I tried both of these and neither of them did anything in the Advanced mode Configuration. They need a #{ } around them right? And I should just be able to copy and paste these expressions?&lt;/P&gt;</description>
      <pubDate>Sat, 24 Jan 2015 00:28:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/el-expression-for-a-document-apos-s-parent/m-p/315589#M2590</guid>
      <dc:creator>nathan1620_</dc:creator>
      <dc:date>2015-01-24T00:28:16Z</dc:date>
    </item>
    <item>
      <title>Re: EL Expression for a document&amp;apos;s Parent</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/el-expression-for-a-document-apos-s-parent/m-p/315590#M2591</link>
      <description>&lt;P&gt;Nevermind, I just used the activation for the whole tab where you can conditionally show it with a parent's pathway, which works out better for me. Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 24 Jan 2015 01:15:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/el-expression-for-a-document-apos-s-parent/m-p/315590#M2591</guid>
      <dc:creator>nathan1620_</dc:creator>
      <dc:date>2015-01-24T01:15:08Z</dc:date>
    </item>
  </channel>
</rss>

