Tuesday 2 June 2015

OAF: EL (Expression Language)


Prior to Release 12.2, EL support was referred to as SPEL (Simplest Possible Expression Language) support, which included a subset of the currently supported EL types and EL-supporting properties.
You could find more details of SPEL in my other blog: OAF: Spel Binding

The below details are from the OA Framework Developer's Guide 12.2.3 : Oracle Application Framework Developer's Guide Release 12.2.3 (Doc ID 1593765.1)

EL Types
${oa.<ViewInstance>.<ViewAttr>}
Evaluates to <ViewInstance>.getAttribute("<ViewAttr>").
${oa.current.<ViewAttr>}
Evaluates to <ViewInstance_attached_to_the_bean>.getAttribute("<ViewAttr>").
${oa.encrypt.<ViewInstance>.<ViewAttr>}
Returns the encrypted value of the <ViewInstance>.getAttribute("<ViewAttr>") statement.
${oa.FunctionSecurity.<FunctionName>}
Returns true or false depending on whether FunctionName is granted to the current user.
${oa.request.<paramName>}
Evaluates to pageContext.getParameter("<paramName>").
${oa.session.<paramName>}
Evaluates to pageContext.getSessionValue("<paramName>").
${oa.sessiondirect.<paramName>}
Evaluates to pageContext.getSessionValueDirect("<paramName>").
${oa.txn.<paramName>}
Evaluates to pageContext.getTransactionValue("<paramName>").
${oa.txntrans.<paramName>}
Evaluates to pageContext.getTransactionTransientValue("<paramName>").
${oa.pageContext.<methodName>}
Evaluates to pageContext.<methodName>().
Note: Only public methods without parameters may be invoked using this EL syntax.
${oa.class.<className>.<methodName>}
Invokes the method in the specified class.
Notes:
• Provide <className> as a fully qualified class name.
• The class must have a no-argument (zero argument) constructor.
• Only public methods without parameters may be invoked using this EL expression.

Usage Notes:
  • Use oa.boolean.false or oa.boolean.true to represent Boolean.FALSE or Boolean.TRUE, respectively.
  • For the negation or ! (NOT) operator, use oa.boolean.false, as in the example,  ${oa.session.isItemRendered == oa.boolean.false}.
  • For an EL expression:
    • You may only specify a static numeric value.
    • Use ${oa.text.<TEXT>} to represent a string.
    • Use oa.boolean.false or oa.boolean.true to represent a Boolean.
Sample Usage:

  • ${oa.session.param1 == oa.request.param1}
  • ${oa.session.paramLength + ( oa.request.fieldLength * 2 ) }
  • ${oa.session.isItemRendered == oa.boolean.false}

Combining Static Text with EL
Use the syntax ${oa.text.<TEXT>} to prepend or append static text to an EL expression.

Usage Notes
  • Warning: If you append static text to an EL expression, be aware that the static text will not get translated and the order of the text may vary depending on the language.
  • You may append text to an EL expression in any order, as shown in these examples, where ${EL} represents any valid EL type:
    • ${oa.text.<TEXT>} + ${EL}
    • ${EL} + ${oa.text.<TEXT>} + ${EL}
Sample Usage
  • ${oa.text.Welcome Mr.} + ${oa.EmpVO.Empname}

Feel free to point out if anything is missing/wrong in this blog.

No comments:

Post a Comment