GetPortalPath() public method

public GetPortalPath ( string objectADPath ) : string
objectADPath string
return string
示例#1
0
        /// <summary>
        /// Gets portal info for given LDAP path. If resulting SyncInfo object's SyncTreeFound is false, no other properties are filled.
        /// </summary>
        /// <param name="ldapPath">The LDAP path of the object, ie. CN=MyGroup,OU=MyOrg,DC=Nativ,DC=local</param>
        /// <returns></returns>
        public SyncInfo GetSyncInfo(string ldapPath)
        {
            SyncInfo result = new SyncInfo();

            SyncTree syncTree = null;

            foreach (SyncTree sTree in _syncTrees)
            {
                if (sTree.ContainsADPath(ldapPath))
                {
                    syncTree = sTree;
                }
            }

            if (syncTree == null)
            {
                return(result);
            }

            result.SyncTreeFound       = true;
            result.SyncTreeADPath      = syncTree.ADPath;
            result.SyncTreePortalPath  = syncTree.PortalPath;
            result.SyncTreeADIPAddress = syncTree.IPAddress;
            result.TargetPortalPath    = syncTree.GetPortalPath(ldapPath);
            result.PortalNodeExists    = string.IsNullOrEmpty(result.TargetPortalPath) ? false : Node.Exists(result.TargetPortalPath);
            var parentPath = syncTree.GetPortalParentPath(ldapPath);

            result.PortalParentExists = string.IsNullOrEmpty(parentPath) ? false : Node.Exists(parentPath);

            return(result);
        }