How to set Action Order variable using EL?

Hi,

I have a presumably simple question.

I'd like to set the Action Order value (under Listing and_Views / Content Views / MySearchContentView / Enablement) using an EL which will be based on a conditional.

Specifically, #{currentUser.isMemberOf('someGroup') ? this.setActionOrder(-1000) : this.setActionOrder(1000)}.

This would be done in the “Custom EL expressions” text area.

I'm new to EL but very familiar with Java, what would be the proper way to do this? The closest thing I've come upon can be found here: http://community.nuxeo.com/api/nuxeo/release-7.2/javadoc/org/nuxeo/search/ui/seam/SearchUIActions.html

Thank you,

Yousuf

0 votes

1 answers

879 views

ANSWER

I belive I may have found it: setOrder(int value) http://community.nuxeo.com/api/nuxeo/release-7.2/javadoc/org/nuxeo/ecm/platform/actions/Action.html

Possibly: #{currentUser.isMemberOf('somGroup') ? webActionsBean.currentSubTabAction.order(-1000) : webActionsBean.currentSubTabAction.order(1000)}

03/17/2016



Hi Yousuf,

in the Action Extension Point descriptor you can find order attribute as integer, no EL managing. I think, your changes of any Action order value in WebActions will be only in Event Context of Seam. An idea, if you need change the action with a stateful order, you should change the action into ActionService descriptor (that it is the Registry after deploy action contribution), because the action is always cloned from descriptor definition from service. I think getActions() and getActionRegstry() may be an available methods to get and update.

Hope helps!

Regards, VS!

1 votes



Thank you, Victor.

Seems logical, I'll have to try it out and get back to you.

Thanks again for your help!

-Yousuf

03/29/2016