cancel
Showing results for 
Search instead for 
Did you mean: 

Tab enablement : Document path DOES NOT start with...

Guian_
Confirmed Champ
Confirmed Champ

HI guys !

I've played around with custom tabs and their enablements and I wonder if there is a way to enable a tab only if the document path does not start with a given path.

which is the perfect negation for the existing parameter "Document path starts with".

Any idea ?

I've try to set an EL expression for the tab enablement such as :

#{not fn:startsWith(currentDocument.ecm.pathAsString, '/default-domain/workspaces/myWorkspace/')}

it doesn't work, I'm not sure about the 'fn:startsWith' call... is there a doc of available function for EL expressions in this context ? and is this a good approach for this problem ?

1 ACCEPTED ANSWER

Alain_ESCAFFRE
Star Contributor
Star Contributor

You can try to put this in the Custom EL Expression field:

#{!currentDocument.getPathAsString().startsWith("/default-domain/workspaces/myWorkspace/")}

View answer in original post

3 REPLIES 3

Alain_ESCAFFRE
Star Contributor
Star Contributor

You can try to put this in the Custom EL Expression field:

#{!currentDocument.getPathAsString().startsWith("/default-domain/workspaces/myWorkspace/")}

Works perfectly after adding the # at the beginning of the EL Expression 😉 thanks!

It was there but @aescaffre formatted his answer badly. I edited it.