Inheritance: Expression
Beispiel #1
0
        public void TypeExpression_Constructor_PropertySetAndExactMacth()
        {
            NodeType set = new SchemaEditor().CreateNodeType(null, "set");

            TypeExpression target = new TypeExpression(set, true);

            //TypeExpressionAccessor acc = new TypeExpressionAccessor(target);
            Assert.IsTrue(Object.ReferenceEquals(target.NodeType, set), "#1");
            Assert.IsTrue(target.ExactMatch == true, "#2");
        }
Beispiel #2
0
 private Query CompileTypeExpressionNode(TypeExpression expression)
 {
     //<##>
     //if (expression.ExactMatch)
     //    return new TermQuery(new Term(LucObject.FieldName.NodeTypeId, ValueFormatter.Format(DataType.Int, expression.NodeType.Id)[0]));
     //return new TermQuery(new Term(LucObject.FieldName.TypeIs, expression.NodeType.NodeTypePath.ToLower()));
     if (expression.ExactMatch)
         return new TermQuery(new Term(LucObject.FieldName.Type, expression.NodeType.Name));
     return new TermQuery(new Term(LucObject.FieldName.TypeIs, expression.NodeType.Name));
     //<##>
 }
Beispiel #3
0
        public static IEnumerable<Node> GetContainerUsers(Node container)
        {
            var query = new NodeQuery();
            ExpressionList expressionList = new ExpressionList(ChainOperator.And);

            // nodetype
            TypeExpression typeExpression = new TypeExpression(Common.GetNodeType(ADObjectType.User));
            expressionList.Add(typeExpression);

            // from container as root
            StringExpression pathExpression = new StringExpression(StringAttribute.Path, StringOperator.StartsWith, container.Path);
            expressionList.Add(pathExpression);

            query.Add(expressionList);

            var result = query.Execute();
            return result.Nodes;
        }