Server-side expression evaluator APIs and customization

You can customize functionality of this module by defining your own expression evaluator bean. Typically you create a DefaultEXPEvaluator instance, and inject the variable-resolver and function-mapper implementations into it. To create your own expression evaluator bean:
  1. Create a custom OSGi bundle.

  2. Configure the Spring context for the bundle.

  3. Ensure the EXM and JSP-EL classes are imported into the bundle’s manifest. These packages are required for Expression Manager:
    • com.adobe.exm.exception

    • com.adobe.exm.expeval

    • javax.servlet.jsp.el

  4. "In the Spring context, define a bean which is an instance of the com.adobe.exm.expeval.DefaultEXPEvaluator class or some custom extension of it. Then configure it with a variable resolver and function mapper as follows:
    <bean id="<expevaluator_id> " class="com.adobe.exm.expeval.DefaultEXPEvaluator" > 
        <lookup-method name="createVariableResolver" bean="<variable_resolver_bean_id>"/> 
        <property name="functionMapper" ref="<function_mapper_bean_id>"/> 
    </bean>
  5. Ensure that the variable resolver is an instance of a class which implements the com.adobe.exm.expeval.EXPVariableResolver interface. The Expression Manager building block provides a simple map-based implementation which is probably unsuitable for all but the most trivial of use-cases. However, the Data Dictionary building block provides a more mature variable-resolver implementation which can be used in use-cases where the values of variables are drawn from properties of Data Dictionary instances.

  6. The function mapper bean must be an instance of a class which implements the javax.servlet.jsp.el.FunctionMapper interface. The Expression Manager building block provides a function-mapper implementation (exposed as an OSGi service) which aggregates custom functions exported by other bundles deployed in the same CRX container using auto-discovery. To use this function-mapper implementation, import it as a Spring bean using BluePrint as follows:
    <bp:reference id="<function_mapper_bean_id>" 
        interface="javax.servlet.jsp.el.FunctionMapper" 
        filter="(exm.function.mapper.id=lc.exm.compositeFunctionMapper)"/>
  7. Inject the expression evaluator bean into your own custom bean and use it for expression evaluation using one of the evaluate*() APIs.

// Ethnio survey code removed