© 2005 BEA Systems, Inc.

com.bea.p13n.content.adapter
Class ExpressionConverter

java.lang.Object
  extended bycom.bea.p13n.content.adapter.ExpressionConverter

public class ExpressionConverter
extends Object

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


Constructor Summary
ExpressionConverter()
           
 
Method Summary
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.
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.
static SortCriteria[] fixSortCriteria(SortCriteria[] orig)
          Update any references in the sorting to things that work in old document spi.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionConverter

public ExpressionConverter()
Method Detail

convert

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.
Throws:
IllegalArgumentException

fixExpression

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 /
Throws:
IllegalArgumentException

fixSortCriteria

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'.


© 2005 BEA Systems, Inc.

Copyright © 2005 BEA Systems, Inc. All Rights Reserved