cancel
Showing results for 
Search instead for 
Did you mean: 

EL Expression for a document's Parent

nathan1620_
Confirmed Champ
Confirmed Champ

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:

documentManager.getDocument(document.getData().getParentRef()).getParent("Folder") == 'hidden'

Any ideas for getting this EL expression right? I'm planning on putting this in the Advanced Configuration section in the widget.

Thanks!

3 REPLIES 3

Anahide_Tchertc
Elite Collaborator
Elite Collaborator

Hi,

The variable "document" exposed by the layout service has been deprecated, you should use "layoutValue" instead.

This variable will map the object that the layout binds to.

In a basic form, the layout will be bound to a document model, so you should be able to use the following syntax:

documentManager.getDocument(layoutValue.getParentRef()).getParent("Folder") == null ? 'hidden': mode

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:

documentManager.getDocument(layoutValue.getData().getParentRef()).getParent("Folder") == null ? 'hidden': mode

I haven't tested these, please tell if there are issues with them.

Also see the documentation about layout expressions and variables.

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?

nathan1620_
Confirmed Champ
Confirmed Champ

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!

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.