//A column under a <Node> (or <View>) element is either a declaration (build meta data only) or defines an entry in the parent's ViewColumnNode
            public void BuildNodeValue(ViewTable.Builder.BuildingData buildingData, ViewTable vTable, ViewTable.Builder.Node node, long row, ViewTable parentViewTable, Operation.ExpressionParsingContext expressionParsingContext, ref Database.MetaColumn metaColum)
            {
                BuildOrUpdateDeclaration(buildingData, vTable, ref metaColum, expressionParsingContext);

                //If the parent's node data type is Node
                if (node.parent != null && node.parent.data.type == ViewTable.Builder.Node.Data.DataType.Node)
                {
                    // this column is an entry in the parent's column
                    var option = new Operation.Expression.ParseIdentifierOption(buildingData.Schema, parentViewTable, true, true, metaColum != null ? metaColum.Type.scriptingType : null, expressionParsingContext);
                    option.formatError = (string s, Operation.Expression.ParseIdentifierOption opt) =>
                    {
                        return(FormatErrorContextInfo(buildingData.Schema, parentViewTable) + " : " + s);
                    };
                    Operation.Expression expression = Operation.Expression.ParseIdentifier(value, option);

                    //if the meta column does not have a type defined yet, define it as the expression's type.
                    if (metaColum.Type.scriptingType == null)
                    {
                        DataMatchMethod matchMethod = expression.type == typeof(string) ? DataMatchMethod.AsString : DataMatchMethod.AsNumber;
                        metaColum.Type = new MetaType()
                        {
                            scriptingType = expression.type, comparisonMethod = matchMethod
                        };
                    }
                    ViewColumnNode.IViewColumnNode column = BuildOrGetColumnNode(parentViewTable, metaColum, name, expressionParsingContext);
                    column.SetEntry(row, expression, m_MetaLink);
                }
            }
示例#2
0
 // Set a Node value to the merged result of it's sub entries
 public static void BuildNodeValueDefault(ViewTable.Builder.Node node, long row, ViewSchema vs, Database.Schema baseSchema, ViewTable parentViewTable, Operation.ExpressionParsingContext expressionParsingContext, Database.MetaColumn metaColumn)
 {
     //set the entry for merge column
     if (metaColumn.DefaultMergeAlgorithm != null && metaColumn.Type != null)
     {
         ViewColumnNode.IViewColumnNode column     = BuildOrGetColumnNode(parentViewTable, metaColumn, metaColumn.Name, expressionParsingContext);
         Operation.Expression           expression = Operation.ColumnCreator.CreateTypedExpressionColumnMerge(metaColumn.Type, parentViewTable, row, column.GetColumn(), metaColumn);
         column.SetEntry(row, expression, null);
     }
 }
示例#3
0
            //A column under a <Node> (or <View>) element is either a declaration (build meta data only) or defines an entry in the parent's ViewColumnNode
            public void BuildNodeValue(ViewTable.Builder.Node node, long row, ViewSchema vs, Database.Schema baseSchema, ViewTable parentViewTable, Operation.ExpressionParsingContext expressionParsingContext, ref Database.MetaColumn metaColum)
            {
                BuildOrUpdateDeclaration(ref metaColum);

                //If the parent's node data type is Node
                if (node.parent != null && node.parent.data.type == ViewTable.Builder.Node.Data.DataType.Node)
                {
                    // this column is an entry in the parent's column
                    var option = new Operation.Expression.ParseIdentifierOption(vs, parentViewTable, true, true, metaColum != null ? metaColum.Type : null, expressionParsingContext);
                    option.formatError = (string s, Operation.Expression.ParseIdentifierOption opt) =>
                    {
                        return(FormatErrorContextInfo(vs, parentViewTable) + " : " + s);
                    };
                    Operation.Expression expression = Operation.Expression.ParseIdentifier(value, option);

                    //if the meta column does not have a type defined yet, define it as the expression's type.
                    if (metaColum.Type == null)
                    {
                        metaColum.Type = expression.type;
                    }
                    ViewColumnNode.IViewColumnNode column = BuildOrGetColumnNode(parentViewTable, metaColum, name, expressionParsingContext);
                    column.SetEntry(row, expression, m_MetaLink);
                }
            }