Groovin’ with ADF

Another great feature of ADF is the addition of Groovy scripting to the ADF framework. The Tech Preview for ADF 11.0.0.0 includes version 1.0 of Groovy. Groovy scripts can be used in all the different tiers of the application, from performing validation on the presentation layer to doing foreign key checks on the Entity layer.

Steve Muench’s blog has a post with tips and tricks for ADF 11g and one section is devoted to the use of Groovy script in ADF. In it he makes mention of some of the more useful keywords and names available to you via Groovy expressions in ADF.

Some useful expressions:

#{securityContext.userName} : Get the user’s name from the Security Context

#{bindings.permissionInfo['PageAPageDef'].allowsView} : Determine if a user has permission to view a page

#{controllerContext.currentViewPort.exceptionData.message} : Display the message from the current exception.

There is also a handy expression builder that can be brought up wherever you can input an expression as an argument to a property.

Additional information on the Groovy scripting language can be found on the Groovy homepage.

Leave a reply

You must be logged in to post a comment.