📄 logicaltreeview.java
字号:
/*
* OPIAM Suite
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package opiam.admin.faare.service.services.views.plugins;
import opiam.admin.faare.MessageUtil;
import opiam.admin.faare.SearchResult;
import opiam.admin.faare.config.javabeans.JBLevel;
import opiam.admin.faare.config.javabeans.JBLevelRessource;
import opiam.admin.faare.config.javabeans.JBLink;
import opiam.admin.faare.config.javabeans.JBObjectView;
import opiam.admin.faare.config.javabeans.JBRessource;
import opiam.admin.faare.config.javabeans.JBViewDef;
import opiam.admin.faare.persistence.LdapObjectFilter;
import opiam.admin.faare.persistence.LdapUtil;
import opiam.admin.faare.persistence.javabeans.JBTop;
import opiam.admin.faare.service.UserContext;
import opiam.admin.faare.service.javabeans.Criteria;
import opiam.admin.faare.service.javabeans.SearchArgument;
import opiam.admin.faare.service.services.SortService;
import opiam.admin.faare.service.services.StandardService;
import opiam.admin.faare.service.services.acl.AclsService;
import opiam.admin.faare.service.services.views.JBAlpha;
import opiam.admin.faare.service.services.views.JBGroup;
import opiam.admin.faare.service.services.views.JBTreeNode;
import opiam.admin.faare.service.services.views.JBVirtual;
import opiam.admin.faare.service.services.views.TreeView;
import opiam.admin.faare.service.services.views.ViewGenerator;
import netscape.ldap.LDAPConnection;
import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
/**
* View plugin allowing to generate the logical views.<br>
* To use this plugin, you must declare it in the view configuration in the
* <i>views.xml</i> file.
*
* Example:
* <code><viewdef name="Hierarchy" label="Hierarchical view"</code>
* <code> dynamic="false" </code>
* <code> plugin="opiam.admin.faare.service.services.views.plugins.LogicalTreeView"</code>
* <code> expandUrl="" icon=""></code>
*
*/
public class LogicalTreeView implements TreeView
{
/** Instance of the logger. */
private static Logger _logger = Logger.getLogger(LogicalTreeView.class);
/** Definition of the view. */
private JBViewDef jbViewDef;
/** User context. */
private UserContext userContext;
/**
* Creates a new LogicalTreeView object.
*/
public LogicalTreeView()
{
}
/**
* Gets the user context.
*
* @return The user context.
*/
public UserContext getUserContext()
{
return userContext;
}
/**
* Gets the definition of the view.
*
* @return The object representing the view definition.
*/
public JBViewDef getJBViewDef()
{
return jbViewDef;
}
/**
* Sets the definition of the view.
*
* @param ajbViewDef View definition to set.
*/
public void setJBViewDef(JBViewDef ajbViewDef)
{
this.jbViewDef = ajbViewDef;
}
/**
* Sets the user context.
*
* @param auserContext UserContext to set.
*/
public void setUserContext(UserContext auserContext)
{
this.userContext = auserContext;
}
/**
* Gets the root node of the view.
*
* @return The root node.
*/
public JBTreeNode getRoot()
{
_logger.debug("GETROOT");
JBTreeNode jbTreeNode = new JBTreeNode();
jbTreeNode.setIcon(jbViewDef.getIcon());
jbTreeNode.setLabel(jbViewDef.getLabel());
return jbTreeNode;
}
/**
* Gets the children (list of JBTreeNode objects) of the given node.
*
* @param jbTreeNode Node on which JBTop objects have to be created.
* @param level Current view level.
*
* @return The list of JBTreeNode objects.
*/
public List getChildrenByJBTreeNode(JBTreeNode jbTreeNode, int level)
{
//DW/2629/BeginPatch
return getChildrenByJBTreeNode(jbTreeNode, level, false);
}
/**
* Gets the children (list of JBTreeNode objects) of the given node.
*
* @param jbTreeNode Node on which JBTop objects have to be created.
* @param level Current view level.
* @param recur If true, called recursively.
*
* @return The list of JBTreeNode objects.
*/
public List getChildrenByJBTreeNode(JBTreeNode jbTreeNode, int level,
boolean recur)
{
//DW/2629/EndPatch
_logger.debug("getChildrenByJBTreeNode level : " + level);
List returnedList = new ArrayList();
try
{
/* Liste des objectView rattach閟
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -