DataContextFilter filter= DataContextFilter.getInstance();
filter.setContext(userCache.getContext());
list=filter.filter(list);
Tree tree = ts.getTree(className, list);
StringBuffer buffer = new StringBuffer();
if (!GenericValidator.isBlankOrNull(selectMode))
selectModeInt = Integer.parseInt(selectMode);
if (rootId == null || rootId.equals("null"))
ts.generateWholeTree(tree, buffer, selectModeInt, functionUrl);
else {
Object root = BeanUtil.getEmptyObject(className);
Class clazz = BeanUtil.getClass(className);
String primaryKeyName = BeanUtil.getPrimaryKeyName(clazz);
BeanUtil.setFieldValue(root, primaryKeyName, new Long(rootId));
Object emptyNode = BeanUtil.getEmptyObject(root.getClass());
BeanUtil.setFieldValue(emptyNode, tree.getDisplayProperty(),
"空");
if (selectModeInt == Const.TREE_SELECT_LEAF_RETURN
|| selectModeInt == Const.TREE_SELECT_NODE_RETURN) {
ts.generateSingleNode(emptyNode, tree, 2, 1, buffer,
selectModeInt, functionUrl);