Oshyn Home Page
  • expertise
    • Overview
    • Contact Us |
    • Latest work: www.miramax.com
  • solutions
    • Overview
    • Content Management
      • Choosing a CMS
      • Site Migration
      • Sitecore Consulting
      • EPiServer CMS Consulting
      • Jahia Integration
      • Legacy CMS Solutions
      • Drupal Development
      • Common Issues
      • Training
    • Web Strategy
    • Mobile Platforms
    • Social Media
    • E-commerce
    • Portals & Collaboration
    • SOA
    • Contact Us |
    • Latest work: www.miramax.com
  • work
    • Overview
    • Client Quotes
    • Contact Us |
    • Latest work: www.websense.com
  • resources
    • Overview
    • News & Events
    • Newsletters
    • Blog
    • White Papers
    • Success Stories
    • Press Kit
    • Contact Us |
    • Latest work: www.disneydvd.com
  • partners
    • Overview
    • Agency Partner Program
    • Technology Partners
    • Contact Us |
    • Latest work: www.nea.org
  • company
    • Overview
    • Contact
    • Careers
    • Leadership Team
    • News & Events
    • Social Responsibility
    • Contact Us |
    • Latest work: www.icon4x4.com
  • Tweet
Monday, September 19, 2011  /   Daniel Ovalle Daniel Ovalle
Author Page
close

Daniel Ovalle


Daniel is a Technical Team Lead at Oshyn.

Using MVEL Expression Language with OpenText Technology

While recently working on an OpenText Web Solutions (formally RedDot) project for a client, I came across the common issue of retrieving user attributes that are stored on several different data repositories. Many organizations face this issue due to the fact that their user repository configurations are usually a product of several years of different technology implementations. To address this issue requires the implementation of complex criteria logic to evaluate user attributes and segment users into groups to grant access to specific CMS content.

To address the need of complex criteria logic, it is common practice to use a synchronization process to link all of the user’s information for different situations (i.e. login, update user information forms, business logic events, etc.).

In order to achieve this, we need to provide a solution that applies different criteria logic that evaluates the eligibility of a user for different contents of the CMS. For example:

Say the CMS content is a list of product promotions targeted to different groups of users. Each promotion has eligibility criteria logic match with the user attributes to decide if the promotion should be displayed or not.

Promotion

User attributes criteria

A

user age between 18 and 24 years and member_code equals to  ‘O’ or ‘P’ or ‘Q’

B

user birthday was no more than 10 days before today and

no more than 15 days after today and

member_code could be ‘H’, or ‘J’ or ‘K’

 

All the user attributes are stored on different data repositories (databases) and are accessed using standard database connections. So if we want to use standard dynaments to accomplish the criteria expressions, a lot of XML content is needed.

Here is a sample of a dynament used to get user attributes from a data repository and into a dynament to build a criteria logic evaluation:

<!-- Get User attribute - SQL -->

<rde-dm:rdb

  alias="repoX"

  mode="query"

  rde-id="1"

  item-tag="row"

  sql="SELECT ATTRIBUTE_X, ATTRIBUTE_Y FROM TABLE

  WHERE USER_ID = [#request:userid#]" />

 

<!-- Get output into request attributes - XPATH -->

<rde-dm:attribute

  mode="write"

  attribute="request:user_attributeX"

  op="set"

  value="[#xpath:rde-node('1')/row/ATTRIBUTEX/text()#]" />

 

… a XPATH should follow for each user attribute.

 

 

This is common on dynaments; the maintenance of the XML content becomes a cumbersome task. Looking at the amount of criteria logic implemented on different dynaments (XML content) for the project, we can see that a lot of similar logic will be created for the XLM content.

Using MVEL Expressions Language

With so much criteria logic needing to be created for this project, it is easy to see the advantage of using a service like MVEL that can make building criteria logic (expressions) easier.

The objective of this sample is to offer a Boolean expression evaluator for users attributes based expressions using MVEL language.

First, we selected to build a web service to implement the MVEL expressions evaluator logic and the code to access all of the user attributes data sources.

Here is the architecture diagram for the implementation:

The specific tasks into the WebService are:

  1. Get the user’s attributes from all the existent repositories. This is done using a SQL sentence query for each of the data repositories. This query should return only one record for a specific user.
  2. Replace the user attributes field names on the provided Boolean MVEL expression using the user attributes fields values extracted from the data repositories. In this step, the WebService verifies the embedded cache for specific user attributes values, if possible, it uses cache values, and otherwise it retrieves values from the data repositories and stores those values into the cache.
  3. Evaluates the MVEL expression and returns the Boolean result.

Now we can see one example of the dynaments that can be used into the project to run criteria logic expression over user attributes:

  <!-- MVEL expression to evaluate the user birthday attribute. -->

  <rde-dm:attribute attribute="request:expression" mode="write"

  value="BIRTHDATE != null || BIRTHDATE <= fn.date('2999-12-31')"/>

 

  <!-- Includes the MVEL dynament -->

  <rde-dm:include content="dynaments/sample/mvel.xml"/>

 

  <!-- DEBUG -->

  <rde-dm:attribute attribute="request:mvelout" mode="read"/>

 

In the sample dynament content, we can identify the following:

  1. We build a request attribute “expression” to store the string value with the MVEL language expression.
  2. This expression uses the user “BIRTHDATE” parameter and verifies the value of the parameter to be different than NULL.
  3. Then compares the value of the “BIRTHDATE” parameter against the result of a function “fn.date(String date)” that returns a Date value from the String representation on a date using the “YYYY-MM-DD” format.
  4. Finally evaluates the result of the two previous results using the logic operator “||” OR.
  5. Includes the dynament that execute the request to the MVEL WebService using the “request:expression” and the current session user data.
  6. The result of the WebService is stored into a request attribute “request:mvelout”, so this attribute can be used on the dynaments project logic.

Implementing the Criteria Logic

Once the WebService is implemented and the connectors and prepared envelopes configured, we can start using the MVEL to build our criteria expressions.

First we build the MVEL expression for each promotion:

Promotion

User attributes criteria

A

fn.age(BIRTHDATE) <= 18 && fn.age(BIRTHDATE) >= && MEMBERCODE ~= ‘[OPQ]’

B

fn.birthday(BIRTHDATE) < fn.date(fn.today(),10) && fn.birthday(BIRTHDATE) > fn.date(fn.today(), -15) && MEMBERCODE ~= ‘[HJK]’

 

It’s important to note that on MVEL we can add custom functions implementing a simple approach described on the MVEL documentation page (http://mvel.codehaus.org/), this is the case for our fn.age(), fn.date() and fn.birthday() functions.

Now to accomplish the objective to build as many criteria expressions as needed, we can use a database table or a configuration file to store the MVEL expressions and assign an ID so we can retrieve the expression content using a dynament.

Our implementation uses the following relational design to bind the promotions and the specific MVEL criteria expressions to be evaluated:

 

On the previous design the MVEL expressions are stored into the PROMOTION_GROUP.CRITERIA_EXPRE field.

The PROMOTION_GROUP.GROUPID binds a specific promotion to a specific criteria expression.

When you need to implement criteria logic using XML based content (dynaments) or something different than a programming language the use of MVEL expression language is a great tool.

Externalizing business logic into web services has been proven as a good practice for RedDot Live Server implementations, and enables the organizations to reuse this logic outside the LiveServer domain.

Trackback Link
http://oshyn.com/BlogRetrieve.aspx?BlogID=1907&PostID=205936&A=Trackback
Trackbacks
Post has no trackbacks.

Pages: Previous Next

TwitterFacebookLinkedIn
ajax rotator

Blog Authors

Christian Burne   Christian Burne  
Subscribe Subscribe Subscribe Subscribe Subscribe
OTHER CATEGORIES
  • ALL

  • General

  • Web Content Management

  • Sitecore CMS

  • Open Text

  • Jahia

  • Drupal

  • EpiServer

  • SOA

  • Social Media and Mobile

  • Software Development

  • Visit Bloggers Profiles

RELATED POSTS
  • Quick intro to Glass Sitecore Mapper
  • What is the purpose of Sitecore’s “sc:VisitorIdentification” tag?
  • Creating Custom Strategies in Sitecore DMS Multivariate Tests
  • Automated Content Migration Part 3: Managing your CMS during a website redesign
  • Sitecore database deployment to Amazon RDS SQL
  • Redesigning your Sitecore Site with Siteport
  • GeoIP Inner Workings in Sitecore DMS
  • Automated Content Migration Part 2: Completing a CMS Upgrade
  • 5 Don'ts for Selecting a CMS/WCM
  • Can you do CXM with RedDot?

WHITE PAPERS

    Web Content Management, Social Media, Content: Three Kings for Your Website Web Content Management, Social Media, Content: Three Kings for Your Website (846 KB)
    Companies pursuing online marketing success, including Social Media, can increase the power of their online presence with right strategy and technology to maximize online visibility and engagement. Download this FREE white paper on the WCM, Social Media, and Content triad.

    Drupal Performance Tuning Drupal Performance Tuning (1213 KB)
    In this Free White Paper Oshyn evaluates Drupal Performance Tuning, sharing the results of testing response time and Requests Per Second (RPS) that a server can hold before the response rate becomes unacceptable. In this paper you will learn about optimizing performance of a website through changes to settings and the server.

    Enterprise Drupal: Social Media, Mobile, and Rich Media in your Website Enterprise Drupal: Social Media, Mobile, and Rich Media in your Website (1015 KB)
    In this free WCM white paper, Oshyn examines advanced Drupal capabilities: Multisite Environment, Access Control and Security, Enhanced User Profiles, Custom Breadcrumbs, Mobile Support, Podcasts, Advanced Multimedia, Locations and Maps, Internationalization and Locale based content, Events and Scheduled Tasks, Rules Actions and E-Commerce Solutions.

    Drupal Multilingual Drupal Multilingual (636 KB)
    There are several multilingual installation methods for Drupal. In this free white paper Oshyn evaluates and recommends several methods of using Drupal Open Source CMS to manage websites in multiple languages.

    Drupal Social Media Drupal Social Media (1297 KB)
    Looking for an Open Source CMS to for “Social Media Optimization” of your website? Download this free white paper, “Drupal and Social Media”, to learn about the extensive Social Media this Open Source CMS offers to create a dynamic and engaging website and online community.

    Drupal Multisite Options Drupal Multisite Options (427 KB)
    There are several multisite installation methods for Drupal. In this free white paper Oshyn evaluates and recommends several methods of using Drupal Open Source CMS to manage multiple sites.

    Open Source CMS: Is It Right for your Organization Open Source CMS: Is It Right for your Organization (496 KB)
    In this free white paper, “Open Source CMS: Is It Right for your Organization?” we share an in-depth look at the pros and cons of using Open Source Content Management Systems (CMS) or Open Source Web Content Management (WCM) platforms. Oshyn helps clients select CMS/WCM solutions based on the specific requirements of each client.

    Affiliate Content Sharing in a CMS/WCM World Affiliate Content Sharing in a CMS/WCM World (273 KB)
    The Content Editors at your company have created GREAT content! Now how do you share it? In this Free white paper learn several methods for using a Content Syndication tool to automatically repurpose content and how Content Sharing can generate business value.

    Sitecore and Social Media - An Interactive Web Content Management Platform Sitecore and Social Media - An Interactive Web Content Management Platform (898 KB)
    Social Media has revolutionized how people interact with business. In this white paper Oshyn’s Lead Sitecore Developer, Prasanth Nittala, discusses key points from the perspectives of marketing and Web development that make Sitecore a compelling choice for engaging in Social Media via your website. This Sitecore white paper draws from Oshyn’s expertise as a certified Sitecore partner, helping organizations understand the distinct capabilities offered by Sitecore CMS.

    The Business Case for Leveraging Open Text Web Solutions Delivery Manager The Business Case for Leveraging Open Text Web Solutions Delivery Manager (451 KB)
    This free white paper explores the evolving needs of small and medium size businesses and explains how the Open Text Web Solutions Delivery Manager (formerly RedDot LiveServer) can help businesses build their brand, reputation, and client base. This white paper examines strategies, key points and tips to leverage the features available in Open Text Web Solutions (RedDot CMS) to achieve an impactful user experience and to maximize visitor engagement through a reliable and powerful implementation.

    Open Text Best Practices: Part One Open Text Best Practices: Part One (763 KB)
    Authored by Oshyn Senior Consultant, Adaeze Okorie, this free CMS white paper draws from Oshyn’s vast experience as an Open Text Certified Partner, in helping organizations define strategies to meet business goals while implementing Open Text Web Solutions (RedDot CMS). Specifically in this free white paper Adaeze Okorie discusses strategies, key points and tips to leverage the features available in Open Text Web Solutions (RedDot CMS) to achieve an effective, reliable and robust implementation.

    Improving the ROI of Business Software: Service Oriented Architecture from a Business Perspective Improving the ROI of Business Software: Service Oriented Architecture from a Business Perspective (398 KB)
    Software selection and technology decision making should no longer be left to the IT department alone. By gaining an understanding of Service-Oriented Architecture, business people outside of the IT department will be better positioned to maximize the ROI of the company's technology platforms. Download this free white paper to learn more.

    Getting Over Social Media Marketing Paralysis for B2B Getting Over Social Media Marketing Paralysis for B2B (2254 KB)
    Many companies are well aware that Social Media has become critically important to engaging audiences and promoting online "presence" while some wonder how to approach their C-level executives and prove that it is not all hype. With so many ways to engage in Social Media, how can they get buy-in and begin execution with so many different venues and tools available? Staying on the sidelines and becoming a latecomer might make it more difficult to create a convincing "social" presence. Put the ove

    Performance Tuning Open Text Web Solutions Management Server and Delivery Server Performance Tuning Open Text Web Solutions Management Server and Delivery Server (235 KB)
    If you've made an investment in Open Text Web Solutions (formerly RedDot) Web Content Management products, you’ve undoubtedly experienced performance issues. While every CMS requires tuning, Open Text Web Solutions - RedDot is especially susceptible to mis-configuration and poor performance as the out-of-the-box installation comes untuned and ready for Development Environments only. In this FREE white paper we share performance tuning expertise as an Open Text Certified Partner that has optimize

    The Business Case for Leveraging Open Text Web Solutions Within Higher Education The Business Case for Leveraging Open Text Web Solutions Within Higher Education (430 KB)
    Academic institutions have a long reputation for being slower to adopt new technologies for their audiences. However, many schools are taking serious steps in improving the online experience they are providing. This white paper explores the unique needs of the higher education market, applying new tools & trends and specifically how the Open Text Web Solutions’ Delivery Manager (formerly known as RedDot LiveServer) can be leveraged to achieve those goals.

    SEO Best Practices within a Content Management System SEO Best Practices within a Content Management System (712 KB)
    In this free white paper, we share Search Engine Optimization (SEO) tips and best practices to follow when implementing a Content Management System (CMS). Certain features and functionality will help your content editors make website changes faster while minimizing the risk of human error. Download this free white paper to learn strategies to improve search engine rankings.

    Best Practices for Sitecore CMS Best Practices for Sitecore CMS (1121 KB)
    Sitecore CMS is an extensive Web Content Management (WCM) platform for the mid-market. It offers reduced IT expenditures, a streamlined content lifecycle, and a return of content control to the subject matter experts. The newest incarnation of Sitecore CMS version 6.0 is a mature product that incorporates standard social media components such as wikis, blogs, RSS syndication and “e-mail a friend” features.

    Optimizing SEO in your CMS (WCM) Optimizing SEO in your CMS (WCM) (3108 KB)
    Oshyn's Christian Burne spoke in depth about SEO in CMS at the Gilbane San Francisco Conference on June 3rd, 2009. Christian discussed the pressues of keyword competition and how the CMS can add tremendous power to climbing Google SERPs and other search engine rankings. The presentation was later part of a featured article on CMSWire. We've made the presentation available in PDF format. Download now to learn more about strategies for using your CMS to optimize SEO.

    The Best CMS for You: Tips on How to Select Your Next CMS The Best CMS for You: Tips on How to Select Your Next CMS (909 KB)
    As websites continue to grow in size, features and functionality, the visitors to these websites are also becoming more demanding and have higher expectations than ever before. Companies who committed valuable time and resources to web strategies just five years ago are finding they must re-evaluate and explore new options as their content, features and online offerings must keep pace with the constant and rapid movement in the digital marketplace. For many of these companies, there is a strong.

    Oshyn Sample Voluntary Product Accessibility Template (VPAT) Oshyn Sample Voluntary Product Accessibility Template (VPAT) (741 KB)
    Section 508 requires that when federal government and agencies procure, develop, and maintain or use electronic and information technology (EIT), they must ensure that it is accessible and in compliance with Section 508 standards developed by the Architectural and Transportation Barriers Compliance Board (Access Board). Oshyn understands these requirements and has delivered reports like these countless times.

    G SEO Best Practices Guide G SEO Best Practices Guide (349 KB)

    Sitecore CMS Implementation Best Practices Sitecore CMS Implementation Best Practices (481 KB)

    Twitter Facebook LinkedIn Featured in Alltop
    Oshyn, Inc.17785 Center Court Drive N Cerritos, CA 90703    1.888.483.1770 newbusiness@oshyn.com
    2013 Copyright Oshyn. All rights reserved.
    • View Mobile Version
    • Terms of Use
    • Privacy Policy
    • Contact Us
    x
    • Contact Us Oshyn 1.888.483.1770
      Have Oshyn Call Me Have Oshyn call you
      Request Further Information Request further information

      Submit an RFP Submit an RFP