Ejemplo n.º 1
0
 public ISInput(ISPipelineComponent parentComponent, int inputIndex = 0)
 {
     ParentComponent = parentComponent;
     if (ParentComponent.ComponentMetaData.InputCollection.Count > 0)
     {
         Input = ParentComponent.GetInputFromIndex(inputIndex);
     }
 }
Ejemplo n.º 2
0
 public ISOutputColumn(ISPipelineComponent parentComponent, string outputName, string outputColumnname,
                       RowDisposition errorRowDisposition,
                       RowDisposition truncationRowDisposition)
     : this(parentComponent, outputName, outputColumnname)
 {
     OutputColumn.ErrorRowDisposition      = DtsUtility.EnumAToEnumB <RowDisposition, DTSRowDisposition>(errorRowDisposition);
     OutputColumn.TruncationRowDisposition = DtsUtility.EnumAToEnumB <RowDisposition, DTSRowDisposition>(truncationRowDisposition);
 }
Ejemplo n.º 3
0
        //private List<ISExternalMetadataColumn> _externalMetadataColumnCollection = new List<ISExternalMetadataColumn>();
        //public List<ISExternalMetadataColumn> ExternalMetadataColumnCollection
        //{
        //    get
        //    {
        //        _externalMetadataColumnCollection.Clear();
        //        foreach (IDTSExternalMetadataColumn100 emc in ExternalMetadataColumnCollection_m)
        //        {
        //            _externalMetadataColumnCollection.Add(new ISExternalMetadataColumn(emc));
        //        }
        //        return _externalMetadataColumnCollection;
        //    }
        //}

        #endregion

        #region ColumnCollection

        //public List<ISOutputColumn> ColumnCollection
        //{
        //    get
        //    {
        //        List<ISOutputColumn> _outputColumns = new List<ISOutputColumn>();
        //        foreach (IDTSOutputColumn100 col in Output.OutputColumnCollection)
        //        {
        //            _outputColumns.Add(new ISOutputColumn(ParentComponent, Output.Name, col.Name));
        //        }
        //        return _outputColumns;
        //    }
        //    set
        //    {

        //    }
        //}

        #endregion

        #endregion

        #region ctor

        public ISOutput(ISPipelineComponent parentComponent, int outputIndex = 0)
        {
            ParentComponent = parentComponent;
            if (ParentComponent.ComponentMetaData.OutputCollection.Count > 0)
            {
                Output = ParentComponent.GetOutputFromIndex(outputIndex);
            }
        }
Ejemplo n.º 4
0
 public ISExternalMetadataColumn(ISPipelineComponent parentComponent, string inputOrOutputName, string externalColumnName, bool relatedToInput, string associateWithColumnWithName)
     : this(parentComponent, inputOrOutputName, externalColumnName, relatedToInput)
 {
     if (relatedToInput)
     {
         AssociateWithInputColumn(associateWithColumnWithName);
     }
     else
     {
         AssociateWithOutputColumn(associateWithColumnWithName);
     }
 }
Ejemplo n.º 5
0
 public ISExternalMetadataColumn(ISPipelineComponent parentComponent, string inputOrOutputName, string externalColumnName, bool relatedToInput)
 {
     ParentComponent = parentComponent;
     if (relatedToInput)
     {
         InitForInput(inputOrOutputName, externalColumnName);
     }
     else
     {
         InitForOutput(inputOrOutputName, externalColumnName);
     }
 }
Ejemplo n.º 6
0
        public ISAdoNetDestinationComponent(ISDataFlowTask parentDataFlowTask, string componentName,
                                            ISPipelineComponent sourceComponent,
                                            string sourceOutputName = "") :
            this(parentDataFlowTask, componentName)
        {
            if (String.IsNullOrEmpty(sourceOutputName))
            {
                ConnectToAnotherPipelineComponent(sourceComponent.Name);
            }
            else
            {
                ConnectToAnotherPipelineComponent(sourceComponent.Name, sourceOutputName);
            }

            InitDefaults();
        }
Ejemplo n.º 7
0
        /// <summary>
        /// First check if an Output with the given name exists on the Component.
        ///     If it exists, then assign that output to the Output property
        ///     If it does not exist:
        ///         Check if more outputs can be added or not.
        ///         If more outputs can be added, then add a new output
        ///         If more outputs cannot be added, then assign the first (non error ) output in the component's collection to the Output property
        /// </summary>
        /// <param name="parentComponent"></param>
        /// <param name="name"></param>
        public ISOutput(ISPipelineComponent parentComponent, string name, int referenceOutputIndex = 0, InsertPlacement beforeOrAfter = InsertPlacement.IP_BEFORE)
        {
            ParentComponent = parentComponent;

            bool outputExists = false;

            for (int i = 0; i < ParentComponent.ComponentMetaData.OutputCollection.Count; i++)
            {
                if (ParentComponent.ComponentMetaData.OutputCollection[i].Name == name)
                {
                    Output       = ParentComponent.ComponentMetaData.OutputCollection[i];
                    outputExists = true;
                }
            }

            //  check if more outputs can be added
            int existingOutputCount = parentComponent.ComponentMetaData.OutputCollection.Count;

            if (ParentComponent._numberOfOutputsAllowed == -1)
            {
                if (!(outputExists))
                {
                    Output = parentComponent.DesignTimeComponent.InsertOutput(DtsUtility.EnumAToEnumB <InsertPlacement, DTSInsertPlacement>(beforeOrAfter), ParentComponent.GetOutputFromIndex(referenceOutputIndex).ID);
                    Name   = name;
                }
            }
            else
            {
                if (existingOutputCount < parentComponent._numberOfOutputsAllowed)
                {
                    if (!(outputExists))
                    {
                        Output = parentComponent.DesignTimeComponent.InsertOutput(DTSInsertPlacement.IP_BEFORE, ParentComponent.GetOutputFromIndex(referenceOutputIndex).ID);
                        Name   = name;
                    }
                }
                else
                {
                    if (!outputExists)
                    {
                        Console.WriteLine("WARN::: Only {1} output(s) are allowed. A new output with the name '{0}' cannot be added. Therefore, the name '{0}' is assigned to the first non error output in the collection", name, existingOutputCount.ToString());
                        Output = parentComponent.ComponentMetaData.OutputCollection[0];
                        Name   = name;
                    }
                }
            }
        }
Ejemplo n.º 8
0
        public ISInput(ISPipelineComponent parentComponent, string inputName)
        {
            ParentComponent = parentComponent;

            bool inputExists = false;

            for (int i = 0; i < ParentComponent.ComponentMetaData.InputCollection.Count; i++)
            {
                if (ParentComponent.ComponentMetaData.InputCollection[i].Name == inputName)
                {
                    inputExists = true;
                    Input       = ParentComponent.ComponentMetaData.InputCollection[i];
                }
            }
            if (!(inputExists))
            {
                //Input = ParentComponent.AddInput("after", ParentComponent.GetInputFromIndex(0).Name);
                Input      = ParentComponent.DesignTimeComponent.InsertInput(DtsUtility.EnumAToEnumB <InsertPlacement, DTSInsertPlacement>(InsertPlacement.IP_AFTER), ParentComponent.GetInputFromIndex(ParentComponent.InputCollection_m.Count - 1).ID);
                Input.Name = inputName;
            }
        }
Ejemplo n.º 9
0
        public ISOutputColumn(ISPipelineComponent parentComponent, string outputName, string outputColumnname)
        {
            ParentComponent = parentComponent;
            Output          = ParentComponent.GetOutputFromName(outputName);

            bool colExists = false;

            for (int c = 0; c < Output.OutputColumnCollection.Count; c++)
            {
                if (Output.OutputColumnCollection[c].Name == outputColumnname)
                {
                    colExists    = true;
                    OutputColumn = Output.OutputColumnCollection[c];
                }
            }

            if (colExists == false)
            {
                OutputColumn      = ParentComponent.ComponentMetaData.OutputCollection[outputName].OutputColumnCollection.New();
                OutputColumn.Name = outputColumnname;
            }
        }
Ejemplo n.º 10
0
        public ISInputColumn(ISPipelineComponent parentComponent, string inputName, string inputColumnName, UsageType usageType)
        {
            ParentComponent = parentComponent;
            _inputName      = inputName;

            bool columnAddedToInput = true;

            foreach (IDTSVirtualInputColumn100 vc in Input.GetVirtualInput().VirtualInputColumnCollection)
            {
                if (vc.Name == inputColumnName)
                {
                    if (vc.UsageType == DTSUsageType.UT_IGNORED)
                    {
                        // this will expose the inputColumn in the InputColumnCollection; otherwise, the inputColumn wont be available in InputColumnCollection
                        columnAddedToInput = false;
                    }
                    else
                    {
                        if (vc.UsageType == DTSUsageType.UT_READWRITE)
                        {
                            usageType = UsageType.UT_READWRITE;
                        }
                        for (int c = 0; c < Input.InputColumnCollection.Count; c++)
                        {
                            if (Input.InputColumnCollection[c].LineageID == vc.LineageID) // the input column might be renamed...therefore match on lineage ids
                            {
                                // if a match is found, assign that input column to our variable.
                                InputColumn = Input.InputColumnCollection[c];
                            }
                        }
                    }
                }
            }
            if (!(columnAddedToInput))
            {
                InputColumn = ParentComponent.SetInputColumnDTSUsageType(Input, inputColumnName, usageType);
            }
        }
Ejemplo n.º 11
0
 public ISLookupComponent(ISDataFlowTask parentDataFlowTask, string componentName, ISPipelineComponent sourceComponent,
                          string sourceOutputName = "") :
     this(parentDataFlowTask, componentName)
 {
     //  After adding hte derived column transformation, connect it to a prevoius component
     if (String.IsNullOrEmpty(sourceOutputName))
     {
         ConnectToAnotherPipelineComponent(sourceComponent.Name);
     }
     else
     {
         ConnectToAnotherPipelineComponent(sourceComponent.Name, sourceOutputName);
     }
 }
Ejemplo n.º 12
0
 public void ConnectToAnotherPipelineComponent(ISPipelineComponent sourceComponent, ISOutput sourceComponentOutput, int inputIndex = 0)
 {
     ConnectToAnotherPipelineComponent(sourceComponent.Name, sourceComponentOutput.Name, inputIndex);
 }
Ejemplo n.º 13
0
 /// <summary>
 /// A ctor that accepts a parent data fllow, a name for the component and the previous component (and output) to which this is connected
 /// </summary>
 public ISScriptComponent(ISDataFlowTask parentDataFlowTask, string componentname, ISPipelineComponent sourceComponent, ISOutput sourceOutput, int thisComponentInput = 0) :
     this(parentDataFlowTask, componentname)
 {
     if (sourceOutput != null)
     {
         ConnectToAnotherPipelineComponent(sourceComponent.Name, sourceOutput.Name, thisComponentInput);
     }
     else
     {
         ConnectToAnotherPipelineComponent(sourceComponent.Name, sourceComponent.GetOutputFromIndex(0).Name, thisComponentInput);
     }
 }
Ejemplo n.º 14
0
 public ISConditionalSplitComponent(ISDataFlowTask parentDataFlowTask, string componentName,
                                    ISPipelineComponent sourceComponent,
                                    ISOutput sourceOutput) :
     this(parentDataFlowTask, componentName, sourceComponent, sourceOutput.Name)
 {
 }
Ejemplo n.º 15
0
 public ISConditionalSplitComponent(ISDataFlowTask parentDataFlowTask, string componentName, ISPipelineComponent sourceComponent,
                                    string sourceOutputName = "") :
     this(parentDataFlowTask, componentName)
 {
     //  After adding the transformation, connect it to a previous component
     if (String.IsNullOrEmpty(sourceOutputName))
     {
         ConnectToAnotherPipelineComponent(sourceComponent.Name);
     }
     else
     {
         ConnectToAnotherPipelineComponent(sourceComponent.Name, sourceOutputName);
     }
 }
Ejemplo n.º 16
0
 public ISInputColumn(ISPipelineComponent parentComponent, string inputName, string inputColumnName, UsageType usageType, RowDisposition errorRowDisposition, RowDisposition truncationRowDisposition)
     : this(parentComponent, inputName, inputColumnName, usageType)
 {
     ErrorRowDisposition      = errorRowDisposition;
     TruncationRowDisposition = truncationRowDisposition;
 }
Ejemplo n.º 17
0
        /// <summary>
        /// an extended ctor that also connects to another component
        /// </summary>
        /// <param name="parentDataFlowTask"></param>
        /// <param name="componentName"></param>
        /// <param name="sourceComponent"></param>
        /// <param name="sourceOutputName"></param>
        public ISSortComponent(ISDataFlowTask parentDataFlowTask, string componentName, ISPipelineComponent sourceComponent,
                               string sourceOutputName = "") :
            this(parentDataFlowTask, componentName)
        {
            //  After adding hte derived column transformation, connect it to a prevoius component
            if (String.IsNullOrEmpty(sourceOutputName))
            {
                ConnectToAnotherPipelineComponent(sourceComponent.Name);
            }
            else
            {
                ConnectToAnotherPipelineComponent(sourceComponent.Name, sourceOutputName);
            }

            // set all usage to READONLY for all;
            string[] viCols = new string[_input.GetVirtualInput().VirtualInputColumnCollection.Count];
            for (int i = 0; i < viCols.Length; i++)
            {
                ISInputColumn ic = new ISInputColumn(this, _input.Name, _input.GetVirtualInput().VirtualInputColumnCollection[i].Name, UsageType.UT_READONLY, RowDisposition.RD_NotUsed, RowDisposition.RD_NotUsed);
                SetCustomPropertyToInputColumn(_input, GetInputColumn(_input.Name, ic.Name), "NewComparisonFlags", 0);
                SetCustomPropertyToInputColumn(_input, GetInputColumn(_input.Name, ic.Name), "NewSortKeyPosition", 0);
            }

            /*foreach (IDTSVirtualInputColumn100 vc in _input.GetVirtualInput().VirtualInputColumnCollection)
             * {
             *  Console.WriteLine("Working on " + vc.Name);
             *  ISInputColumn ic = new ISInputColumn(this, _input.Name, vc.Name, UsageType.UT_READONLY, RowDisposition.RD_NotUsed, RowDisposition.RD_NotUsed);
             *  SetCustomPropertyToInputColumn(_input, GetInputColumn(_input.Name, ic.Name), "NewComparisonFlags", 0);
             *  SetCustomPropertyToInputColumn(_input, GetInputColumn(_input.Name, ic.Name), "NewSortKeyPosition", 0);
             * }*/
        }