Exemple #1
0
		internal TableRefBinding(QueryScope queryScope, TableBinding tableBinding, string name)
		{
			_scope = queryScope;
			_name = name;
			_definition = tableBinding;
			CreateColumnRefs();
		}
Exemple #2
0
        private Search OrgViewSearch(Search search)
        {
            ObjectTypes types;

            if (search == null || search.Query == null || search.Query.QueryScope == null)
            {
                types = IncludeFolders ? ObjectTypes.AllIncFolders : ObjectTypes.AllExcFolders;
            }
            else
            {
                types = IncludeFolders
                            ? search.Query.QueryScope.ObjectTypes
                            : (search.Query.QueryScope.ObjectTypes & ~ObjectTypes.Folder);
            }

            QueryScope scope = new QueryScope(types);

            QueryFilter filter;

            if (search == null || search.Query == null || search.Query.QueryFilter == null)
            {
                filter = Query;
            }
            else if (Query == null)
            {
                filter = search.Query.QueryFilter;
            }
            else
            {
                filter = new GroupQuery(new[] { search.Query.QueryFilter, Query }, GroupQuery.GroupQueryType.And);
            }

            return(new Search(new Query(scope, filter), Grouping, false, "", null, null, new Sort[] { }));
        }
Exemple #3
0
        public TResult Dispatch <TResult>(IAPIQuery <TResult> query, QueryScope queryScope)
        {
            var sw           = Stopwatch.StartNew();
            var queryContext = new QueryContext();

            queryContext.CurrentQuery = query;
            queryContext.QueryScope   = queryScope;
            using (var childContainer = iocContainer.Clone())
            {
                childContainer.Register(queryContext);
                try
                {
                    OnDispatching(queryContext);
                    var handler = handlers.FindHandler(query.GetType());
                    var result  = (TResult)handler.Execute(ResolveParameters(handler, query, childContainer));
                    OnDispatched(queryContext);
                    // TODO: logging and other instrumentation
                    sw.Stop();
                    return(result);
                }
                catch (Exception e)
                {
                    OnDispatched(queryContext, e);
                    sw.Stop();
                    // TODO: logging
                    throw;
                }
            }
        }
Exemple #4
0
 internal TableRefBinding(QueryScope queryScope, TableBinding tableBinding, string name)
 {
     _scope      = queryScope;
     _name       = name;
     _definition = tableBinding;
     CreateColumnRefs();
 }
Exemple #5
0
		private ICollection<AggregateExpression> GetAggregateDependencies(QueryScope associatedScope)
		{
			AggregateList associatedAggregateExpressions;
			if (_aggregateDependencies.TryGetValue(associatedScope, out associatedAggregateExpressions))
				return associatedAggregateExpressions.Values;

			return null;
		}
Exemple #6
0
 private Search EverythingInFolders()
 {
     QueryScope scope = new QueryScope(ObjectTypes.AllIncFolders);
     QueryFilter filter = new NullQuery<Folder>(PropertyNames.folder, false);
     Query q = new Query(scope, filter);
     Grouping grouping = new FolderGrouping((Grouping)null);
     return new Search(q, grouping, false, "", null, false);
 }
Exemple #7
0
 private Search EverythingInFolders()
 {
     QueryScope scope = new QueryScope(ObjectTypes.AllIncFolders);
     QueryFilter filter = new NullQuery<Folder>(PropertyNames.folder, false);
     Query q = new Query(scope, filter);
     Grouping grouping = new FolderGrouping((Grouping)null);
     return new Search(q, grouping, false, "", null, false);
 }
Exemple #8
0
        public Query(QueryScope scope, QueryFilter filter)
        {
            if (scope == null)
                this.scope = new QueryScope(ObjectTypes.AllExcFolders);
            else
                this.scope = scope;

            this.filter = filter;  // null is OK
        }
Exemple #9
0
        TResult[] IDirectorySession.Find <TResult>(ADObjectId rootId, QueryScope scope, QueryFilter filter, SortBy sortBy, int maxResults)
        {
            IEnumerable <IConfigurable> source = ((IConfigDataProvider)this).Find <TResult>(filter, rootId, false, sortBy);

            if (maxResults > 0)
            {
                source = source.Take(maxResults);
            }
            return(source.Cast <TResult>().ToArray <TResult>());
        }
Exemple #10
0
 public Query(XmlNode node)
 {
     foreach (XmlNode child in node.ChildNodes)
     {
         if (child.NodeType != XmlNodeType.Element)
             continue;
         else if (child.Name == "QueryScope")
             this.scope = new QueryScope(child);
         else
             this.filter = (QueryFilter)SearchMarshalling.FromXmlNode(child);
     }
 }
 public void Populate(Search search)
 {
     ClearItems();
     if (search != null && search.Query != null)
     {
         scope = search.Query.QueryScope;
     }
     else
     {
         scope = null;
     }
     search.PopulateAdapters(this);
 }
Exemple #12
0
 protected ADGenericReader(IDirectorySession session, ADObjectId rootId, QueryScope scope, SortBy sortBy)
 {
     this.session           = session;
     this.rootId            = rootId;
     this.scope             = scope;
     this.lcid              = session.Lcid;
     this.sortBy            = sortBy;
     this.directoryControls = new DirectoryControlCollection();
     this.directoryControls.Add(new ExtendedDNControl(ExtendedDNFlag.StandardString));
     if (this.sortBy != null)
     {
         this.AddSortControl();
     }
 }
Exemple #13
0
        // Do we want this grouping type, based on the search-for?
        private bool WantGroupingType(GroupingType gt)
        {
            QueryScope scope = (searcher == null ? null : searcher.QueryScope);

            if (scope == null)
            {
                return(true);
            }
            if (scope.WantType(ObjectTypes.Folder))
            {
                return(false);  // searching for folder forbids all grouping types (we add group by folder back in separately)
            }
            return(scope.WantAnyOf(gt.AppliesTo));
        }
Exemple #14
0
        /// <summary>
        /// This method will set scope attribute in query
        /// </summary>
        /// <param name="camlQuery">CamlQuery</param>
        /// <param name="scope">Scope option</param>
        public static void SetViewAttribute(this CamlQuery camlQuery, QueryScope scope)
        {
            //if Query ViewXml is Empty then create View root Node
            if (string.IsNullOrEmpty(camlQuery.ViewXml))
                camlQuery.ViewXml = VIEW_QUERY;

            //Load ViewXml
            XmlDocument xmlDoc = LoadViewXml(camlQuery.ViewXml);

            //Add scope attribute to root element
            XmlElement viewNode =(XmlElement)GetXmlNodeByXPath(VIEW_XPATH, xmlDoc);
            if (viewNode != null)
                viewNode.SetAttribute("Scope", scope.ToString());

            //Update ViewXml
            UpdateCamlQuery(camlQuery, xmlDoc);
        }
 /// <summary>
 /// The get executor.
 /// </summary>
 /// <param name="queryScope">
 /// The query scope.
 /// </param>
 /// <returns>
 /// The <see cref="BaseQueryExecutor"/>.
 /// </returns>
 public BaseQueryExecutor GetExecutor(QueryScope queryScope)
 {
     switch (queryScope)
     {
         case QueryScope.Instance:
             return new InstanceScopeQueryExecutor(
                 this.instance, this.executeQueryItemFunction);
         case QueryScope.Database:
             return new DatabaseScopeQueryExecutor(
                 this.instance, this.executeQueryItemFunction, this.executeSqlFunction);
         case QueryScope.InstanceGroup:
             return new InstanceGroupScopeQueryExecutor(
                 this.instance, this.executeQueryItemFunction, this.executeSqlFunction);
         default:
             throw new ArgumentOutOfRangeException();
     }
 }
Exemple #16
0
		private void AddAggregateDependency(QueryScope associatedScope, AggregateExpression aggregateExpression)
		{
			if (associatedScope == null)
			{
				AggregateList currentUnscopedAggregateList = _unscopedAggregateExpressionStack.Peek();
				currentUnscopedAggregateList.Add(aggregateExpression);
			}
			else
			{
				AggregateList associatedAggregateExpressions;
				if (!_aggregateDependencies.TryGetValue(associatedScope, out associatedAggregateExpressions))
				{
					associatedAggregateExpressions = new AggregateList();
					_aggregateDependencies.Add(associatedScope, associatedAggregateExpressions);
				}

				associatedAggregateExpressions.Add(aggregateExpression);
			}
		}
Exemple #17
0
        /// <summary>
        /// The get executor.
        /// </summary>
        /// <param name="queryScope">
        /// The query scope.
        /// </param>
        /// <returns>
        /// The <see cref="BaseQueryExecutor"/>.
        /// </returns>
        public BaseQueryExecutor GetExecutor(QueryScope queryScope)
        {
            switch (queryScope)
            {
            case QueryScope.Instance:
                return(new InstanceScopeQueryExecutor(
                           this.instance, this.executeQueryItemFunction));

            case QueryScope.Database:
                return(new DatabaseScopeQueryExecutor(
                           this.instance, this.executeQueryItemFunction, this.executeSqlFunction));

            case QueryScope.InstanceGroup:
                return(new InstanceGroupScopeQueryExecutor(
                           this.instance, this.executeQueryItemFunction, this.executeSqlFunction));

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Exemple #18
0
        private void SetFromScope(QueryScope value)
        {
            // Can we represent it by one of the fixed types?
            bool bDone = searchForComboButton.SelectItem <ObjectTypes>(
                delegate(ObjectTypes types)
            {
                return(types == value.ObjectTypes);
            }
                );

            // If not, set it to "Custom..."
            if (!bDone)
            {
                bDone = searchForComboButton.SelectItem <ObjectTypes>(
                    delegate(ObjectTypes types)
                {
                    return(types == CUSTOM);
                }
                    );
            }
        }
 public TADWrapperObject[] Find <TADWrapperObject>(ADObjectId rootId, QueryScope scope, QueryFilter filter, SortBy sortBy, int maxResults) where TADWrapperObject : class, IADObjectCommon
 {
     if (typeof(TADWrapperObject).Equals(typeof(IADDatabase)))
     {
         IADDatabase[] array = (IADDatabase[])this.FindInternal <TADWrapperObject, MiniDatabase>(rootId, scope, filter, sortBy, maxResults, ADDatabaseWrapper.PropertiesNeededForDatabase);
         if (array != null)
         {
             foreach (IADDatabase iaddatabase in array)
             {
                 ((ADDatabaseWrapper)iaddatabase).FinishConstructionFromMiniDatabase(this.m_session);
             }
         }
         return((TADWrapperObject[])array);
     }
     if (typeof(TADWrapperObject).Equals(typeof(IADDatabaseCopy)))
     {
         return(this.FindInternal <TADWrapperObject, DatabaseCopy>(rootId, scope, filter, sortBy, maxResults, null));
     }
     if (typeof(TADWrapperObject).Equals(typeof(IADServer)))
     {
         return(this.FindInternal <TADWrapperObject, MiniServer>(rootId, scope, filter, sortBy, maxResults, ADServerWrapper.PropertiesNeededForServer));
     }
     if (typeof(TADWrapperObject).Equals(typeof(IADDatabaseAvailabilityGroup)))
     {
         return(this.FindInternal <TADWrapperObject, DatabaseAvailabilityGroup>(rootId, scope, filter, sortBy, maxResults, null));
     }
     if (typeof(TADWrapperObject).Equals(typeof(IADClientAccessArray)))
     {
         return(this.FindInternal <TADWrapperObject, ClientAccessArray>(rootId, scope, QueryFilter.AndTogether(new QueryFilter[]
         {
             filter,
             ClientAccessArray.PriorTo15ExchangeObjectVersionFilter
         }), sortBy, maxResults, null));
     }
     ExAssert.RetailAssert(false, "Unhandled type '{0}' !", new object[]
     {
         typeof(TADWrapperObject).FullName
     });
     return(null);
 }
        /// <summary>
        /// This method will set scope attribute in query
        /// </summary>
        /// <param name="camlQuery">CamlQuery</param>
        /// <param name="scope">Scope option</param>
        public static void SetViewAttribute(this CamlQuery camlQuery, QueryScope scope)
        {
            //if Query ViewXml is Empty then create View root Node
            if (string.IsNullOrEmpty(camlQuery.ViewXml))
            {
                camlQuery.ViewXml = VIEW_QUERY;
            }

            //Load ViewXml
            XmlDocument xmlDoc = LoadViewXml(camlQuery.ViewXml);

            //Add scope attribute to root element
            XmlElement viewNode = (XmlElement)GetXmlNodeByXPath(VIEW_XPATH, xmlDoc);

            if (viewNode != null)
            {
                viewNode.SetAttribute("Scope", scope.ToString());
            }

            //Update ViewXml
            UpdateCamlQuery(camlQuery, xmlDoc);
        }
        public override int GetHashCode()
        {
            int hash = 1;

            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (QueryScope != global::Google.Cloud.Firestore.Admin.V1.Index.Types.QueryScope.Unspecified)
            {
                hash ^= QueryScope.GetHashCode();
            }
            hash ^= fields_.GetHashCode();
            if (State != global::Google.Cloud.Firestore.Admin.V1.Index.Types.State.Unspecified)
            {
                hash ^= State.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
        public override int GetHashCode()
        {
            int hash = 1;

            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (QueryScope != 0)
            {
                hash ^= QueryScope.GetHashCode();
            }
            hash ^= fields_.GetHashCode();
            if (State != 0)
            {
                hash ^= State.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
 // Token: 0x06001390 RID: 5008 RVA: 0x0005EAF8 File Offset: 0x0005CCF8
 ADPagedReader <TEntry> IRecipientSession.FindPagedMiniRecipient <TEntry>(ADObjectId rootId, QueryScope scope, QueryFilter filter, SortBy sortBy, int pageSize, IEnumerable <PropertyDefinition> properties)
 {
     return(base.InvokeWithAPILogging <ADPagedReader <TEntry> >(() => this.GetCompositeRecipientSession().FindPagedMiniRecipient <TEntry>(rootId, scope, filter, sortBy, pageSize, properties), "FindPagedMiniRecipient"));
 }
 public void Visit(QueryScope node)
 {
 }
Exemple #25
0
		private bool QueryHasAggregates(QueryScope queryScope)
		{
			if (_unscopedAggregateExpressionStack.Peek().Values.Count > 0)
				return true;

			AggregateList queryAggregateList;
			if (_aggregateDependencies.TryGetValue(queryScope, out queryAggregateList) &&
				queryAggregateList.Values.Count > 0)
				return true;

			return false;
		}
Exemple #26
0
        private Search OrgViewSearch(Search search)
        {
            ObjectTypes types;

            if (search == null || search.Query == null || search.Query.QueryScope == null)
            {
                types = IncludeFolders ? ObjectTypes.AllIncFolders : ObjectTypes.AllExcFolders;
            }
            else
            {
                types = IncludeFolders
                            ? search.Query.QueryScope.ObjectTypes
                            : (search.Query.QueryScope.ObjectTypes & ~ObjectTypes.Folder);
            }

            QueryScope scope = new QueryScope(types);
            
            QueryFilter filter;

            if (search == null || search.Query == null || search.Query.QueryFilter == null)
                filter = Query;
            else if (Query == null)
                filter = search.Query.QueryFilter;
            else
                filter = new GroupQuery(new[] { search.Query.QueryFilter, Query }, GroupQuery.GroupQueryType.And);

            return new Search(new Query(scope, filter), Grouping, false, "", null, null, new Sort[] { });
        }
 // Token: 0x0600136B RID: 4971 RVA: 0x0005DBF0 File Offset: 0x0005BDF0
 ADUser[] IRecipientSession.FindADUser(ADObjectId rootId, QueryScope scope, QueryFilter filter, SortBy sortBy, int maxResults)
 {
     return(base.InvokeWithAPILogging <ADUser[]>(() => this.GetCompositeRecipientSession().FindADUser(rootId, scope, filter, sortBy, maxResults), "FindADUser"));
 }
Exemple #28
0
        public IEnumerable <RecipientWrapper> FindPilotUsersADRawEntry(ADObjectId rootId, QueryScope scope, QueryFilter filter, SortBy sortBy, int pageSize, IEnumerable <PropertyDefinition> properties)
        {
            ADPagedReader <ADRawEntry> pagedReader = this.anchorAdProvider.FindPagedADRawEntry(rootId, scope, filter, sortBy, pageSize, properties);

            foreach (ADRawEntry adRawEntry in pagedReader)
            {
                RecipientWrapper wrappedRecipient = new RecipientWrapper(adRawEntry.Id, RequestStatus.None, null, RequestFlags.None, RecipientType.UserMailbox, RecipientTypeDetails.None);
                yield return(wrappedRecipient);
            }
            yield break;
        }
Exemple #29
0
 private QueryScope PushNewScope(QueryScope queryScope)
 {
     if (queryScope == null)
         queryScope = new QueryScope(CurrentScope);
     PushScope(queryScope);
     return queryScope;
 }
Exemple #30
0
        private void SetFromScope(QueryScope value)
        {
            // Can we represent it by one of the fixed types?
            bool bDone = searchForComboButton.SelectItem<ObjectTypes>(
                delegate(ObjectTypes types)
                {
                    return (types == value.ObjectTypes);
                }
            );

            // If not, set it to "Custom..."
            if (!bDone)
                bDone = searchForComboButton.SelectItem<ObjectTypes>(
                    delegate(ObjectTypes types)
                    {
                        return (types == CUSTOM);
                    }
                );
        }
Exemple #31
0
 private void PushScope(QueryScope queryScope)
 {
     _queryScopes.Push(queryScope);
 }
Exemple #32
0
 internal override T[] Find <T>(QueryFilter filter, MapiObjectId root, QueryScope scope, SortBy sort, int maximumResultsSize)
 {
     return(new List <T>(this.FindPaged <T>(filter, root, scope, sort, 0, maximumResultsSize)).ToArray());
 }
Exemple #33
0
 public void BlankSearch()
 {
     QueryScope = new QueryScope(ObjectTypes.None);
     OnQueryChanged();
 }
		public TableRelationMemberContext(SourceLocation sourceLocation, Identifier remainingPart, Scope scope, QueryScope queryScope)
			: base(sourceLocation, remainingPart)
		{
			_scope = scope;
			_queryScope = queryScope;
		}
 // Token: 0x06001391 RID: 5009 RVA: 0x0005EB94 File Offset: 0x0005CD94
 ADRawEntry[] IRecipientSession.FindRecipient(ADObjectId rootId, QueryScope scope, QueryFilter filter, SortBy sortBy, int maxResults, IEnumerable <PropertyDefinition> properties)
 {
     return(base.InvokeWithAPILogging <ADRawEntry[]>(() => this.GetCompositeRecipientSession().FindRecipient(rootId, scope, filter, sortBy, maxResults, properties), "FindRecipient"));
 }
Exemple #36
0
 public void BlankSearch()
 {
     QueryScope = new QueryScope(ObjectTypes.None);
     OnQueryChanged();
 }
 // Token: 0x06001369 RID: 4969 RVA: 0x0005DAF8 File Offset: 0x0005BCF8
 ADRawEntry[] IRecipientSession.FindADRawEntryByUsnRange(ADObjectId root, long startUsn, long endUsn, int sizeLimit, IEnumerable <PropertyDefinition> properties, QueryScope scope, QueryFilter additionalFilter)
 {
     return(base.InvokeWithAPILogging <ADRawEntry[]>(() => this.GetCompositeRecipientSession().FindADRawEntryByUsnRange(root, startUsn, endUsn, sizeLimit, properties, scope, additionalFilter), "FindADRawEntryByUsnRange"));
 }
Exemple #38
0
        public override QueryNode VisitCommonTableExpressionQuery(CommonTableExpressionQuery query)
        {
            QueryScope queryScope = new QueryScope(null);
            PushNewScope(queryScope);
            try
            {
                foreach (CommonTableExpression commonTableExpression in query.CommonTableExpressions)
                {
                    CommonTableBinding[] existingCommonTables = queryScope.FindCommonTable(commonTableExpression.TableName);
                    if (existingCommonTables != null && existingCommonTables.Length > 0)
                    {
                        ErrorReporter.CteHasDuplicateTableName(commonTableExpression.TableName);
                        break;
                    }

                    // Check if CTE is recursive.
                    bool recursive = IsRecursive(commonTableExpression.QueryDeclaration, commonTableExpression.TableName);

                    if (!recursive)
                    {
                        commonTableExpression.QueryDeclaration = VisitQuery(commonTableExpression.QueryDeclaration);
                        ValidateColumnNames(commonTableExpression.QueryDeclaration.GetColumns(), commonTableExpression);

                        if (ErrorReporter.ErrorsSeen)
                            return query;

                        commonTableExpression.CommonTableBinding = queryScope.DeclareCommonTableExpression(commonTableExpression.TableName, commonTableExpression.QueryDeclaration);
                    }
                    else
                    {
                        // If recursive, we must check the structure. The structure is as follows:
                        //
                        //    {One or more anchor members}
                        //    UNION ALL
                        //    {One or more recursive members}

                        BinaryQuery unionAllQuery = commonTableExpression.QueryDeclaration as BinaryQuery;
                        if (unionAllQuery == null || unionAllQuery.Op != BinaryQueryOperator.UnionAll)
                        {
                            ErrorReporter.CteDoesNotHaveUnionAll(commonTableExpression.TableName);
                            break;
                        }

                        List<QueryNode> recursiveMembers = AstUtil.FlattenBinaryQuery(unionAllQuery);
                        List<QueryNode> anchorMembers = new List<QueryNode>();
                        foreach (QueryNode queryNode in recursiveMembers)
                        {
                            if (!IsRecursive(queryNode, commonTableExpression.TableName))
                                anchorMembers.Add(queryNode);
                            else
                                break;
                        }
                        recursiveMembers.RemoveRange(0, anchorMembers.Count);
                        QueryNode anchorMember = AstUtil.CombineQueries(anchorMembers, BinaryQueryOperator.UnionAll);

                        if (anchorMembers.Count == 0)
                        {
                            ErrorReporter.CteDoesNotHaveAnchorMember(commonTableExpression.TableName);
                            return query;
                        }

                        // Resolve anchor member and use it to construct a common table definition.
                        anchorMember = VisitQuery(anchorMember);

                        // Check that all columns have aliases.
                        ValidateColumnNames(anchorMember.GetColumns(), commonTableExpression);

                        if (ErrorReporter.ErrorsSeen)
                            return query;

                        commonTableExpression.CommonTableBinding = queryScope.DeclareCommonTableExpression(commonTableExpression.TableName, anchorMember);
                        SelectColumn[] anchorColumns = anchorMember.GetColumns();

                        // Now resolve all recursive members and add them to the common table definition.
                        for (int i = 0; i < recursiveMembers.Count; i++)
                        {
                            recursiveMembers[i] = VisitQuery(recursiveMembers[i]);

                            // Make sure the column count and data type match.
                            // NOTE: Due to the recursive nature there is no implicit conversion support for the UNION ALL
                            //       in common table expressions. Instead, the types must match exactly.
                            SelectColumn[] recursiveColumns = recursiveMembers[i].GetColumns();
                            if (recursiveColumns.Length != anchorColumns.Length)
                                ErrorReporter.DifferentExpressionCountInBinaryQuery();
                            else
                            {
                                for (int columnIndex = 0; columnIndex < anchorColumns.Length; columnIndex++)
                                {
                                    Type anchorColumnType = anchorColumns[columnIndex].Expression.ExpressionType;
                                    Type recursiveColumnType = recursiveColumns[columnIndex].Expression.ExpressionType;
                                    if (recursiveColumnType != null && recursiveColumnType != anchorColumnType)
                                        ErrorReporter.CteHasTypeMismatchBetweenAnchorAndRecursivePart(anchorColumns[columnIndex].Alias, commonTableExpression.TableName);
                                }
                            }
                        }
                        commonTableExpression.CommonTableBinding.RecursiveMembers = recursiveMembers.ToArray();
                    }
                }

                if (ErrorReporter.ErrorsSeen)
                    return query;

                query.Input = VisitQuery(query.Input);
            }
            finally
            {
                PopScope();
            }
            return query;
        }
Exemple #39
0
 public virtual void Visit(QueryScope node)
 {
 }
Exemple #40
0
 public ADPagedReader <TResult> FindPaged <TResult>(ADObjectId rootId, QueryScope scope, QueryFilter filter, SortBy sortBy, int pageSize) where TResult : ADConfigurationObject, new()
 {
     return(base.FindPaged <TResult>(rootId, scope, filter, sortBy, pageSize, null));
 }
Exemple #41
0
 public virtual void Visit(QueryScope node)
 {
     node.Accept(Visitor);
 }
        private static Search OrgViewSearch(Search search, bool includeFolders, // normally exclude folders even if in search: CA-27260
            QueryFilter addFilter, Grouping grouping)
        {
            QueryFilter filter;
            ObjectTypes types;

            if (search == null || search.Query == null || search.Query.QueryScope == null)
            {
                types = includeFolders ? ObjectTypes.AllIncFolders : ObjectTypes.AllExcFolders;
            }
            else
            {
                types = includeFolders ? search.Query.QueryScope.ObjectTypes : (search.Query.QueryScope.ObjectTypes & ~ObjectTypes.Folder);
            }

            QueryScope scope = new QueryScope(types);

            if (search == null || search.Query == null || search.Query.QueryFilter == null)
                filter = addFilter;
            else if (addFilter == null)
                filter = search.Query.QueryFilter;
            else
                filter = new GroupQuery(new QueryFilter[] { search.Query.QueryFilter, addFilter }, GroupQuery.GroupQueryType.And);

            return new Search(new Query(scope, filter), grouping, false, "", null, null, new Sort[] { });
        }
Exemple #43
0
 public void PushQueryScope(QueryScope queryScope)
 {
     _queryScopeStack.Push(queryScope);
 }
 public TableRelationMemberContext(SourceLocation sourceLocation, Identifier remainingPart, Scope scope, QueryScope queryScope)
     : base(sourceLocation, remainingPart)
 {
     _scope      = scope;
     _queryScope = queryScope;
 }
 public void Visit(QueryScope node)
 {
     node.Accept(_visitor);
 }
 // Token: 0x0600138F RID: 5007 RVA: 0x0005EA64 File Offset: 0x0005CC64
 ADPagedReader <ADRecipient> IRecipientSession.FindPaged(ADObjectId rootId, QueryScope scope, QueryFilter filter, SortBy sortBy, int pageSize)
 {
     return(base.InvokeWithAPILogging <ADPagedReader <ADRecipient> >(() => this.GetCompositeRecipientSession().FindPaged(rootId, scope, filter, sortBy, pageSize), "FindPaged"));
 }
Exemple #47
0
 // Token: 0x060006F2 RID: 1778 RVA: 0x00025440 File Offset: 0x00023640
 private ADVlvPagedReader(ADObjectId addressBook, IDirectorySession session, ADObjectId rootId, QueryScope scope, QueryFilter filter, SortBy sortBy, bool includeBookmarkObject, bool searchForward, int pageSize, int offset, string target, IEnumerable <PropertyDefinition> properties) : base(session, rootId, scope, filter, sortBy, pageSize, properties, false)
 {
     if (addressBook != null)
     {
         filter = new AndFilter(new QueryFilter[]
         {
             new ComparisonFilter(ComparisonOperator.Equal, ADRecipientSchema.AddressListMembership, addressBook),
             new ExistsFilter(ADRecipientSchema.DisplayName)
         });
         base.LdapFilter  = LdapFilterBuilder.LdapFilterFromQueryFilter(filter, false, base.Session.SessionSettings.PartitionSoftLinkMode, base.Session.SessionSettings.IsTenantScoped);
         base.UseNullRoot = true;
     }
     this.searchForward         = searchForward;
     this.includeBookmarkObject = includeBookmarkObject;
     this.offSet = offset;
     if (this.offSet == 2147483647)
     {
         this.offSet = 0;
     }
     this.vlvRequestControl = new VlvRequestControl(0, 0, target);
     base.DirectoryControls.Add(this.vlvRequestControl);
 }
 public void Populate(Search search)
 {
     ClearItems();
     if (search != null && search.Query != null)
         scope = search.Query.QueryScope;
     else
         scope = null;
     search.PopulateAdapters(this);
 }
Exemple #49
0
        internal override IEnumerable <T> FindPaged <T>(QueryFilter filter, MapiObjectId root, QueryScope scope, SortBy sort, int pageSize, int maximumResultsSize)
        {
            MailboxResourceMonitorEntry.< > c__DisplayClass1 <T> CS$ < > 8__locals1 = new MailboxResourceMonitorEntry.< > c__DisplayClass1 <T>();
            CS$ < > 8__locals1.< > 4__this = this;
            if (!base.GetType().IsAssignableFrom(typeof(T)))
            {
                throw new ArgumentException("T");
            }
            CS$ < > 8__locals1.databaseId = (root as DatabaseId);
            if (null == CS$ < > 8__locals1.databaseId)
            {
                throw new NotSupportedException(Strings.ExceptionIdentityTypeInvalid);
            }
            if (QueryScope.SubTree != scope)
            {
                throw new ArgumentException("scope");
            }
            if (sort != null)
            {
                throw new ArgumentException("sort");
            }
            if (0 > maximumResultsSize)
            {
                throw new ArgumentException("maximumResultsSize");
            }
            if (base.MapiSession == null)
            {
                throw new MapiInvalidOperationException(Strings.ExceptionSessionNull);
            }
            base.EnableDisposeTracking();
            PropTag[] tagsToRead;
            using (MailboxResourceMonitorEntry mailboxResourceMonitorEntry2 = (MailboxResourceMonitorEntry)((object)((default(T) == null) ? Activator.CreateInstance <T>() : default(T))))
            {
                tagsToRead = mailboxResourceMonitorEntry2.GetPropertyTagsToRead();
            }
            if (tagsToRead == null || tagsToRead.Length == 0)
            {
                tagsToRead = new PropTag[]
                {
                    PropTag.UserGuid,
                    PropTag.EmailAddress
                };
            }
            PropValue[][] entries = null;
            base.MapiSession.InvokeWithWrappedException(delegate()
            {
                entries = CS$ < > 8__locals1.< > 4__this.MapiSession.Administration.GetResourceMonitorDigest(CS$ < > 8__locals1.databaseId.Guid, tagsToRead);
            }, Strings.ExceptionFindObject(typeof(T).Name, (null == root) ? Strings.ConstantNull : root.ToString()), CS$ < > 8__locals1.databaseId);
            int resultSize = entries.Length;

            if (0 < maximumResultsSize && maximumResultsSize < resultSize)
            {
                resultSize = maximumResultsSize;
            }
            foreach (PropValue[] entry in entries)
            {
                MailboxResourceMonitorEntry mailboxResourceMonitorEntry = (MailboxResourceMonitorEntry)((object)((default(T) == null) ? Activator.CreateInstance <T>() : default(T)));
                try
                {
                    mailboxResourceMonitorEntry.Instantiate(entry);
                    mailboxResourceMonitorEntry.MapiSession = base.MapiSession;
                    if (mailboxResourceMonitorEntry[MapiPropertyDefinitions.MailboxGuid] != null)
                    {
                        mailboxResourceMonitorEntry.Identity = new MailboxId(CS$ < > 8__locals1.databaseId, (Guid)mailboxResourceMonitorEntry[MapiPropertyDefinitions.MailboxGuid]);
                    }
                    mailboxResourceMonitorEntry.UpdateIdentity(mailboxResourceMonitorEntry.UpdateIdentityFlagsForFinding);
                    mailboxResourceMonitorEntry.OriginatingServer = Fqdn.Parse(mailboxResourceMonitorEntry.MapiSession.ServerName);
                    mailboxResourceMonitorEntry.ResetChangeTracking(true);
                }
                finally
                {
                    mailboxResourceMonitorEntry.Dispose();
                }
                yield return((T)((object)mailboxResourceMonitorEntry));
            }
            yield break;
            yield break;
        }
Exemple #50
0
		private bool IsOuterScope(QueryScope scope)
		{
            return !_queryScopeStack.Contains(scope);
		}