Exemplo n.º 1
0
        public static void LowerPackage(AstNode astNode, LoweringContext context)
        {
            var astPackage = astNode as AstTask.AstPackageNode;

            if (astPackage != null)
            {
                if (astPackage.Emit)
                {
                    var p = new Package(astPackage);
                    context.ParentObject.Children.Add(p);
                    context = new TaskLoweringContext(p);
                    LowerConnection(astPackage.LogConnection, context);
                    LowerChildren(astPackage, context);
                    LowerEventHandlers(astPackage, p, context);
                }
                else
                {
                    MessageEngine.Trace(
                        astPackage,
                        Severity.Debug,
                        "D_S008",
                        "Skipped Lowering of Package {0} because Emit was {1}",
                        astPackage.Name,
                        astPackage.Emit);
                }
            }
        }
Exemplo n.º 2
0
        public static void CreateAndRegister(AstNode astNode, LoweringContext context)
        {
            var astQuerySourceNode = astNode as AstQuerySourceNode;
            if (astQuerySourceNode != null)
            {
                var oleDBSource = new OleDBSource(context, astNode) { _oleDBConnection = new OleDBConnection(astQuerySourceNode.Connection) };

                // Note: vsabella: workaround for different behavior regarding expressions for OLEDB sources 
                // versus how it works in Lookups.
                if (astQuerySourceNode.Query.QueryType == QueryType.Expression)
                {
                    // Variable name has to be only alphanumeric, more restrictive than astQuerySource Name
                    string varName = "__" + System.Guid.NewGuid().ToString("N");
                    var variable = new Variable(varName);
                    oleDBSource.SqlCommandVarName = "User::" + varName;

                    variable.TypeCode = System.TypeCode.String;
                    variable.EvaluateAsExpression = true;
                    variable.ValueString = astQuerySourceNode.Query.Body;
                    context.ParentObject.Children.Add(variable);
                }
                else
                {
                    foreach (AstVariableParameterMappingNode paramNode in astQuerySourceNode.Query.Parameters)
                    {
                        var variable = new Variable(paramNode.Variable);
                        oleDBSource._paramDictionary[paramNode.Name] = variable;
                        context.ParentObject.Children.Add(variable);
                    }
                }

                context.ParentObject.Children.Add(oleDBSource._oleDBConnection);
                context.ParentObject.Children.Add(oleDBSource);
            }
        }
Exemplo n.º 3
0
        public SSISEmitterException(AstNode node, Exception e) : base(string.Empty, e)
        {
            _node = node;

            if (node == null)
            {
                _errorMessage = base.Message;
            }
            else if (node is AstNamedNode)
            {
                SetMessages(((AstNamedNode)node).Name, GetTagName(node.BoundXElement));
            }
            else if (node.ReferenceableName != null)
            {
                SetMessages(node.ReferenceableName, GetTagName(node.BoundXElement));
                Source = node.ReferenceableName;
            }
            else if (node.ParentASTNode != null && node.ParentASTNode.ReferenceableName != null)
            {
                SetMessages(node.ParentASTNode.ReferenceableName, GetTagName(node.ParentASTNode.BoundXElement));
            }
            else
            {
                _errorMessage = base.Message;
            }
        }
Exemplo n.º 4
0
        public ValidationItem(Severity severity, string recommendation, AstNode astNode, string message, params object[] formatParmeters)
        {
            _severity = severity;
            _recommendation = recommendation;
            _astNode = astNode;

            this._message = String.Format("{0}: {1}: {2}", severity, String.Format(message, formatParmeters));
        }
Exemplo n.º 5
0
 public void Push(AstNode astNode)
 {
     if (IsScopeBoundary(astNode))
     {
         this._ScopeTracker.Push(astNode);
     }
     this._PathTracker.Push(astNode);
 }
Exemplo n.º 6
0
 public static void CreateAndRegister(AstNode astNode, LoweringContext context)
 {
     var astDestination = astNode as AstDestinationNode;
     if (astDestination != null)
     {
         var oleDBDestination = new OleDBDestination(context, astNode) { _oleDBConnection = new OleDBConnection(astDestination.Table.Connection) };
         context.ParentObject.Children.Add(oleDBDestination._oleDBConnection);
         context.ParentObject.Children.Add(oleDBDestination);
     }
 }
Exemplo n.º 7
0
 public static void CreateAndRegister(AstNode astNode, LoweringContext context)
 {
     var astTermLookupNode = astNode as AstTermLookupNode;
     if (astTermLookupNode != null)
     {
         var termLookup = new TermLookup(context, astNode) { _oleDBConnection = new OleDBConnection(astTermLookupNode.Connection) };
         context.ParentObject.Children.Add(termLookup._oleDBConnection);
         context.ParentObject.Children.Add(termLookup);
     }
 }
Exemplo n.º 8
0
 public static void CreateAndRegister(AstNode astNode, LoweringContext context)
 {
     var astSlowlyChangingDimensionNode = astNode as AstSlowlyChangingDimensionNode;
     if (astSlowlyChangingDimensionNode != null)
     {
         var slowlyChangingDimension = new SlowlyChangingDimension(context, astNode) { _oleDBConnection = new OleDBConnection(astSlowlyChangingDimensionNode.Connection) };
         context.ParentObject.Children.Add(slowlyChangingDimension._oleDBConnection);
         context.ParentObject.Children.Add(slowlyChangingDimension);
     }
 }
Exemplo n.º 9
0
 public static void LowerExecutePackage(AstNode astNode, LoweringContext context)
 {
     var astTask = astNode as AstExecutePackageTaskNode;
     if (astTask != null)
     {
         var ep = new ExecutePackageTask(astTask);
         context.ParentObject.Children.Add(ep);
         ContainerLoweringEngine.LowerEventHandlers(astTask, ep, context);
     }
 }
Exemplo n.º 10
0
 public static void CreateAndRegister(AstNode astNode, LoweringContext context)
 {
     var astOleDBCommandNode = astNode as AstOleDBCommandNode;
     if (astOleDBCommandNode != null)
     {
         var oleDBCommand = new OleDBCommand(context, astNode) { _oleDBConnection = new OleDBConnection(astOleDBCommandNode.Connection) };
         context.ParentObject.Children.Add(oleDBCommand._oleDBConnection);
         context.ParentObject.Children.Add(oleDBCommand);
     }
 }
Exemplo n.º 11
0
 public static void Lower(AstNode node, LoweringContext context)
 {
     Type nodeType = node.GetType();
     if (LoweringDictionary.ContainsKey(nodeType))
     {
         foreach (AstLoweringHandler handler in LoweringDictionary[nodeType])
         {
             handler(node, context);
         }
     }
 }
Exemplo n.º 12
0
 public static void LowerSqlTask(AstNode astNode, LoweringContext context)
 {
     var astTask  = astNode as AstExecuteSqlTaskNode;
     if (astTask != null)
     {
         var s = new SqlTask(astTask);
         ContainerLoweringEngine.LowerConnection(astTask.Connection, context);
         context.ParentObject.Children.Add(s);
         ContainerLoweringEngine.LowerEventHandlers(astTask, s, context);
     }
 }
Exemplo n.º 13
0
        public static void LowerDataflow(AstNode astNode, LoweringContext context)
        {
            var astDataflow = astNode as AstEtlRootNode;
            if (astDataflow != null)
            {
                var dft = new DataflowTask(astDataflow);
                context.ParentObject.Children.Add(dft);

                var dflc = new DataflowLoweringContext(dft);
                LowerTransformations(astDataflow, dflc);
                ContainerLoweringEngine.LowerEventHandlers(astDataflow, dft, context);
            }
        }
Exemplo n.º 14
0
        public static void LowerForLoop(AstNode astNode, LoweringContext context)
        {
            var astContainer = astNode as AstTask.AstForLoopContainerTaskNode;

            if (astContainer != null)
            {
                var forLoop = new PhysicalTask.ForLoop(astContainer);
                context.ParentObject.Children.Add(forLoop);
                LowerConnection(astContainer.LogConnection, context);

                context = new TaskLoweringContext(forLoop);
                LowerChildren(astContainer, context);
                LowerEventHandlers(astContainer, forLoop, context);
            }
        }
Exemplo n.º 15
0
        public static void LowerContainer(AstNode astNode, LoweringContext context)
        {
            var astContainer = astNode as AstTask.AstContainerTaskNode;

            if (astContainer != null)
            {
                var seq = new PhysicalTask.Sequence(astContainer);
                context.ParentObject.Children.Add(seq);
                LowerConnection(astContainer.LogConnection, context);

                context = new TaskLoweringContext(seq);
                LowerChildren(astContainer, context);
                LowerEventHandlers(astContainer, seq, context);
            }
        }
Exemplo n.º 16
0
        public static void Trace(AstNode astNode, Severity severity, string errorCode, string message, params object[] formatParameters)
        {
            if (astNode != null && astNode.BimlFile != null && astNode.BoundXObject != null && astNode.BoundXObject.XObject != null)
            {
                string filename = astNode.BimlFile.Name;
                int line = ((System.Xml.IXmlLineInfo)astNode.BoundXObject.XObject).LineNumber;
                int offset = ((System.Xml.IXmlLineInfo)astNode.BoundXObject.XObject).LinePosition;

                Trace(filename, line, offset, severity, errorCode, null, message, formatParameters);
            }
            else
            {
                Trace(null, -1, -1, severity, errorCode, null, message, formatParameters);
            }
        }
Exemplo n.º 17
0
Arquivo: Union.cs Projeto: japj/vulcan
        public Union(LoweringContext context, AstNode astNode)
            : base(context, astNode as AstTransformationNode)
        {
            _astUnionAllNode = astNode as AstUnionAllNode;

            if (_astUnionAllNode != null)
            {
                int i = 0;
                foreach (AstDataflowMappedInputPathNode ip in _astUnionAllNode.InputPaths)
                {
                    BindingList.Add(new MappedBinding(_astUnionAllNode.Name, ip.OutputPath.Transformation.Name, ip.OutputPath.SsisName, i, ip.Mappings));
                    i++;
                }
            }
        }
Exemplo n.º 18
0
 public OleDBDestination(LoweringContext context, AstNode astNode) : base(context, astNode as AstTransformationNode)
 {
     _astDestination = astNode as AstDestinationNode;
     RegisterInputBinding(_astDestination);
 }
Exemplo n.º 19
0
 public SlowlyChangingDimension(LoweringContext context, AstNode astNode) : base(context, astNode as AstTransformationNode)
 {
     _astSlowlyChangingDimensionNode = astNode as AstSlowlyChangingDimensionNode;
     RegisterInputBinding(_astSlowlyChangingDimensionNode);
 }
Exemplo n.º 20
0
 public static void LowerRowCount(AstNode astNode, LoweringContext context)
 {
     RowCount.CreateAndRegister(astNode, context);
 }
Exemplo n.º 21
0
 public static void LowerOleDBCommand(AstNode astNode, LoweringContext context)
 {
     OleDBCommand.CreateAndRegister(astNode, context);
 }
Exemplo n.º 22
0
 public static void LowerOleDBSource(AstNode astNode, LoweringContext context)
 {
     OleDBSource.CreateAndRegister(astNode, context);
 }
Exemplo n.º 23
0
Arquivo: Union.cs Projeto: japj/vulcan
 public static void CreateAndRegister(AstNode astNode, LoweringContext context)
 {
     context.ParentObject.Children.Add(new Union(context, astNode));
 }
Exemplo n.º 24
0
 public DerivedColumns(LoweringContext context, AstNode astNode)
     : base(context, astNode as AstTransformationNode)
 {
     _astDerivedColumnListNode = astNode as AstDerivedColumnListNode;
     RegisterInputBinding(_astDerivedColumnListNode);
 }
Exemplo n.º 25
0
 public RowCount(LoweringContext context, AstNode astNode)
     : base(context, astNode as AstTransformationNode)
 {
     _astRowCountNode = astNode as AstRowCountNode;
     RegisterInputBinding(_astRowCountNode);
 }
Exemplo n.º 26
0
 public static void CreateAndRegister(AstNode astNode, LoweringContext context)
 {
     context.ParentObject.Children.Add((new DerivedColumns(context, astNode)));
 }
Exemplo n.º 27
0
 public ConditionalSplit(LoweringContext context, AstNode astNode) : base(context, astNode as AstTransformationNode)
 {
     _astConditionalSplitNode = astNode as AstConditionalSplitNode;
     RegisterInputBinding(_astConditionalSplitNode);
 }
Exemplo n.º 28
0
 public static void CreateAndRegister(AstNode astNode, LoweringContext context)
 {
     context.ParentObject.Children.Add((new ConditionalSplit(context, astNode)));
 }
Exemplo n.º 29
0
 public OleDBSource(LoweringContext context, AstNode astNode) : base(context, astNode as AstTransformationNode)
 {
     _paramDictionary = new Dictionary<string, Variable>();
     _astQuerySourceNode = astNode as AstQuerySourceNode;
 }
Exemplo n.º 30
0
 public TermLookup(LoweringContext context, AstNode astNode) : base(context, astNode as AstTransformationNode)
 {
     _astTermLookupNode = astNode as AstTermLookupNode;
     RegisterInputBinding(_astTermLookupNode);
 }