ExpressionConverter Class

com.bea.p13n.content.adapter
ExpressionConverter Class

public class ExpressionConverter

    extends Object

A utility class for converting a new CM expression object tree into an old DocumentManager expression object tree.


Hierarchy
Object
  ExpressionConverter

Constructor Summary

ExpressionConverter()

 

Method Summary

public static Expression
convert(Expression newExpr, boolean pathIsId, boolean pathStartsWithSlash)
Convert a new CM-expression tree of objects to an old document expression tree of objects.
public static void
fixExpression(Expression expr, boolean pathIsId, boolean pathStartsWithSlash)
Update any comparisons in the expression tree that need to be different to work against old document.
public static SortCriteria[]
fixSortCriteria(SortCriteria[] orig)
Update any references in the sorting to things that work in old document spi.
 
Methods from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
   

Constructor Detail

ExpressionConverter

public ExpressionConverter()
 

Method Detail

convert(Expression, boolean, boolean) Method

public static Expression convert(Expression newExpr, 
                                 boolean pathIsId, 
                                 boolean pathStartsWithSlash)
throws IllegalArgumentException
Convert a new CM-expression tree of objects to an old document expression tree of objects.

Parameters

newExpr
the new style CM expression tree.
pathIsId
is the path actually the identifier in the ContentManager?
pathStartsWithSlash
do paths in the ContentManager starts with /

Returns

the old style expression tree.

Exceptions

IllegalArgumentException

fixExpression(Expression, boolean, boolean) Method

public static void fixExpression(Expression expr, 
                                 boolean pathIsId, 
                                 boolean pathStartsWithSlash)
throws IllegalArgumentException
Update any comparisons in the expression tree that need to be different to work against old document.

Update any comparisons to 'path' in the old style expression tree. This will switch them to compare to either 'identifier' or 'name' based upon pathIsId. Additionally, it might trim a leading / from the rhs of the comparison based upon pathStartsWithSlash.

Update a comparison to 'createdBy' to 'author'.

Update a comparison to 'createDate' or 'createdDate' to 'creationDate'.

Update a comparison to 'fileSize' to 'size'.

Update a comparison to 'fileName' to 'name'.

Parameters

expr
the old style CM expression tree.
pathIsId
is the path actually the identifier in the ContentManager?
pathStartsWithSlash
do paths in the ContentManager starts with /

Exceptions

IllegalArgumentException

fixSortCriteria(SortCriteria[]) Method

public static SortCriteria[] fixSortCriteria(SortCriteria[] orig)
Update any references in the sorting to things that work in old document spi.

Update a reference to 'path' to 'identifier'.

Update a reference to 'createdBy' to 'author'.

Update a reference to 'createDate' or 'createdDate' to 'creationDate'.

Update a reference to 'fileSize' to 'size'.

Update a reference to 'fileName' to 'name'.