示例#1
0
 // TODO: Could we lose the constraint information in Container from doing this as ContainerBase?
 public SsisContainer(SequenceTask container, SSISEmitterContext context)
     : base(container, context)
 {
     this._logicalContainer = container;
     if (this.Name != null && this.ParentContainer != null)
     {
         if (this.ParentContainer.Executables.Contains(Name))
         {
             if (this.ParentContainer.Executables[Name] is DTS.IDTSSequence)
             {
                 _SSISContainer = (DTS.Sequence) this.ParentContainer.Executables[Name];
             }
         }
         else
         {
             DTS.Sequence sequence = (DTS.Sequence)context.SSISSequence.AppendExecutable("STOCK:Sequence");
             sequence.Name  = this.Name;
             _SSISContainer = sequence;
         }
     }
     else if (container is Package)
     {
         // Do Nothing
     }
     else
     {
         MessageEngine.Global.Trace(Severity.Error, new ArgumentException("parentContainer cannot be null"), "parentContainer cannot be null");
     }
 }
示例#2
0
 // TODO: Could we lose the constraint information in Container from doing this as ContainerBase?
 public SsisContainer(SequenceTask container, SSISEmitterContext context)
     : base(container, context)
 {
     this._logicalContainer = container;
     if (this.Name != null && this.ParentContainer != null)
     {
         if (this.ParentContainer.Executables.Contains(Name))
         {
             if (this.ParentContainer.Executables[Name] is DTS.IDTSSequence)
             {
                 _SSISContainer = (DTS.Sequence)this.ParentContainer.Executables[Name];
             }
         }
         else
         {
             DTS.Sequence sequence = (DTS.Sequence)context.SSISSequence.AppendExecutable("STOCK:Sequence");
             sequence.Name = this.Name;
             _SSISContainer = sequence;
         }
     }
     else if (container is Package)
     {
         // Do Nothing
     }
     else
     {
         MessageEngine.Global.Trace(Severity.Error, new ArgumentException("parentContainer cannot be null"), "parentContainer cannot be null");
     }
 }
示例#3
0
 public SsisOleDbDestination(Transformation t, SSISEmitterContext context) : base(t, context)
 {
     Destination destination = (Destination)_transformation;
     _component.Name = t.Name;
     SetupComponentProperties();
     InitializeConnection(destination.Connection);
 }
示例#4
0
 public void EmitPatterns(SSISEmitterContext context)
 {
     foreach (IR.Task.Task task in this._logicalContainer.Tasks)
     {
         // TODO: No need to preserve context?
         context.InstantiateEmitter(task, context).Emit();
     }
 }
示例#5
0
 public void EmitPatterns(SSISEmitterContext context)
 {
     foreach (IR.Task.Task task in this._logicalContainer.Tasks)
     {
         // TODO: No need to preserve context?
         context.InstantiateEmitter(task, context).Emit();
     }
 }
示例#6
0
        public SsisOleDbDestination(Transformation t, SSISEmitterContext context) : base(t, context)
        {
            Destination destination = (Destination)_transformation;

            _component.Name = t.Name;
            SetupComponentProperties();
            InitializeConnection(destination.Connection);
        }
示例#7
0
        public SsisPackage(Package logicalPackage, SSISEmitterContext context) : base(logicalPackage, context)
        {
            _DTSApplication  = new DTS.Application();
            _DTSPackage      = new DTS.Package();
            _DTSPackage.Name = Name.Replace(".", "_").Replace("[", " ").Replace("]", " ");
            _projectManager  = new SsisProject(this);

            CurrentPackage = this;
        }
示例#8
0
        public SsisPipelineTask(PipelineTask objETL, SSISEmitterContext context)
            : base(objETL, context)
        {
            _logicalETL = objETL;

            _guid = Guid.NewGuid();
            // TODO: Do this for everything
            _message       = MessageEngine.Create(String.Format(System.Globalization.CultureInfo.InvariantCulture, "__SSIS2008Emitter:SSISDataFlow {0}", _guid.ToString()));
            _componentList = new List <SsisComponent>();
        }
示例#9
0
        public SsisPipelineTask(PipelineTask objETL, SSISEmitterContext context)
            : base(objETL, context)
        {
            _logicalETL = objETL;

            _guid = Guid.NewGuid();
            // TODO: Do this for everything
            _message = MessageEngine.Create(String.Format(System.Globalization.CultureInfo.InvariantCulture, "__SSIS2008Emitter:SSISDataFlow {0}", _guid.ToString()));
            _componentList = new List<SsisComponent>();
        }
示例#10
0
        public SsisSourceComponent(Transformation t, SSISEmitterContext context)
            : base(t, context)
        {
            OLEDBSource source = (OLEDBSource)t;

            InitializeConnection(source.Connection);
            SetOutputName(source.OutputPath);

            SetComponentProperties(source);
            SetParameterMapping(source.ParameterMappings, SsisPackage.CurrentPackage.DTSPackage.Variables);

            Validate();
        }
示例#11
0
        public SSISEmitterContext Emit(LogicalObject obj, SSISEmitterContext context)
        {
            Type ssisEmitterType;

            if (_pluginLoader.PluginTypesByAttribute.TryGetValue(new PhysicalIRMappingAttribute(obj.GetType()), out ssisEmitterType))
            {
                ConstructorInfo constructor = ssisEmitterType.GetConstructor(new Type[] { obj.GetType(), context.GetType() });
                ISSISEmitter    objEmitter  = (ISSISEmitter)constructor.Invoke(new object[] { obj, context });

                return(objEmitter.Emit());
            }
            else
            {
                _message.Trace(Severity.Warning, Resources.SSISObjectEmitterNotFound, obj.GetType());

                return(context);
            }
        }
示例#12
0
        public override SSISEmitterContext Emit()
        {
            this.UnSave();
            this.Save();

            SSISEmitterContext newContext = null;

            try
            {
                Package logicalPackage = (Package)_logicalContainer;
                this.DTSPackage.Variables.Add("_vulcanPackageRepositoryDirectory", false, "User", OutputBaseDirectory);

                foreach (ConnectionConfiguration connection in logicalPackage.ConnectionConfigurationList)
                {
                    this.AddConfiguration(connection.Name);
                    SsisConnection s = new SsisConnection(connection);
                }

                foreach (PackageConfiguration config in logicalPackage.PackageConfigurationList)
                {
                    this.AddConfiguration(config.Name);
                }

                foreach (Variable variable in logicalPackage.VariableList)
                {
                    SsisVariable s = new SsisVariable(variable);
                }

                this.Reload();

                newContext = new SSISEmitterContext(this, new SsisSequence(this.DTSPackage, _logicalContainer), _context.PluginLoader);
                this.DTSPackage.TransactionOption = (Microsoft.SqlServer.Dts.Runtime.DTSTransactionOption)
                                                    Enum.Parse(typeof(Microsoft.SqlServer.Dts.Runtime.DTSTransactionOption), this.LogicalPackage.TransactionMode);
                EmitPatterns(newContext);
                this.Save();
            }
            catch (Exception e)
            {
                this.Save();
                MessageEngine.Global.Trace(Severity.Error, e, e.Message);
            }

            return(newContext);
        }
示例#13
0
        public virtual SSISEmitterContext Emit()
        {
            SSISEmitterContext newContext = _context.NewParentSequence(new SsisSequence(this.SequenceContainer, this._logicalContainer));

            this.DTSSequenceContainer.TransactionOption = (Microsoft.SqlServer.Dts.Runtime.DTSTransactionOption)
                                                          Enum.Parse(typeof(Microsoft.SqlServer.Dts.Runtime.DTSTransactionOption), this._logicalContainer.TransactionMode);

            //TODO: Hardcode the IsolationLevel to ReadCommitted. This will be changed to be customizable.
            this.DTSSequenceContainer.IsolationLevel = System.Data.IsolationLevel.ReadCommitted;

            foreach (Variable variable in _logicalContainer.VariableList)
            {
                SsisVariable s = new SsisVariable(variable, newContext);
            }

            EmitPatterns(newContext);

            return(newContext);
        }
示例#14
0
        public SSISEmitterContext Emit()
        {
            MessageEngine.Global.Trace(Severity.Notification, Resources.EmittingETL, _logicalETL.Name);

            _dataFlowTask = (DTS.TaskHost)Context.SSISSequence.AppendExecutable("STOCK:PipelineTask");
            _dataFlowTask.Properties["DelayValidation"].SetValue(_dataFlowTask, _logicalETL.DelayValidation);
            _dataFlowTask.Properties["IsolationLevel"].SetValue(_dataFlowTask, _logicalETL.IsolationLevel);

            _dataFlowTask.Name = _logicalETL.Name;

            this.NewDataFlow();

            SSISEmitterContext dataFlowContext = _context.AddDataFlow(this);

            foreach (Transformation t in _logicalETL.Transformations)
            {
                dataFlowContext.InstantiateEmitter(t, dataFlowContext).Emit();
            }
            return(_context);
        }
示例#15
0
        public SsisComponent(Transformation transformation, SSISEmitterContext context)
        {
            if (!context.HasSSISDataFlowTask)
            {
                // TODO: Message.Trace(Severity.Error)
            }

            _transformation = transformation;
            _dataFlowTask = context.SSISDataFlowTask;
            _context = context;

            _component = _dataFlowTask.NewComponentMetaData();
            _component.ComponentClassID = ClassID;

            _instance = _component.Instantiate();
            _instance.ProvideComponentProperties();

            _component.Name = _transformation.Name;
            _component.ValidateExternalMetadata = transformation.ValidateExternalMetadata;
        }
示例#16
0
        public SsisComponent(Transformation transformation, SSISEmitterContext context)
        {
            if (!context.HasSSISDataFlowTask)
            {
                // TODO: Message.Trace(Severity.Error)
            }

            _transformation = transformation;
            _dataFlowTask   = context.SSISDataFlowTask;
            _context        = context;

            _component = _dataFlowTask.NewComponentMetaData();
            _component.ComponentClassID = ClassID;

            _instance = _component.Instantiate();
            _instance.ProvideComponentProperties();

            _component.Name = _transformation.Name;
            _component.ValidateExternalMetadata = transformation.ValidateExternalMetadata;
        }
示例#17
0
        public SsisSqlTask(SqlTask obj, SSISEmitterContext context) : base(obj, context)
        {
            _logicalExecuteSQL = obj;
            _sqlTask = (DTS.TaskHost)Context.SSISSequence.AppendExecutable("STOCK:SQLTask");

            if (!string.IsNullOrEmpty(_logicalExecuteSQL.Name))
            {
                _name = _logicalExecuteSQL.Name;
            }

            _sqlTask.Name = Name + Guid.NewGuid().ToString();
            _sqlTask.Description = Description;

            SetProperty("Connection", _logicalExecuteSQL.Connection);
            SetProperty("IsolationLevel", _logicalExecuteSQL.IsolationLevel);

            switch (_logicalExecuteSQL.Type.ToUpper(System.Globalization.CultureInfo.InvariantCulture))
            {
                case "EXPRESSION": SSISTask.SqlStatementSourceType = DTSTasks.ExecuteSQLTask.SqlStatementSourceType.DirectInput; break;
                default: //case "FILE":
                    SSISTask.SqlStatementSourceType = DTSTasks.ExecuteSQLTask.SqlStatementSourceType.FileConnection; break;
            }
        }
示例#18
0
        public SsisSqlTask(SqlTask obj, SSISEmitterContext context) : base(obj, context)
        {
            _logicalExecuteSQL = obj;
            _sqlTask           = (DTS.TaskHost)Context.SSISSequence.AppendExecutable("STOCK:SQLTask");

            if (!string.IsNullOrEmpty(_logicalExecuteSQL.Name))
            {
                _name = _logicalExecuteSQL.Name;
            }

            _sqlTask.Name        = Name + Guid.NewGuid().ToString();
            _sqlTask.Description = Description;

            SetProperty("Connection", _logicalExecuteSQL.Connection);
            SetProperty("IsolationLevel", _logicalExecuteSQL.IsolationLevel);

            switch (_logicalExecuteSQL.Type.ToUpper(System.Globalization.CultureInfo.InvariantCulture))
            {
            case "EXPRESSION": SSISTask.SqlStatementSourceType = DTSTasks.ExecuteSQLTask.SqlStatementSourceType.DirectInput; break;

            default:     //case "FILE":
                SSISTask.SqlStatementSourceType = DTSTasks.ExecuteSQLTask.SqlStatementSourceType.FileConnection; break;
            }
        }
示例#19
0
 public SsisVariable(string name, object value, SSISEmitterContext context) : this(name, value, (DTS.DtsContainer)context.ParentContainer) { }
示例#20
0
 public SsisOleDbCommandComponent(Transformation t, SSISEmitterContext context) : base(t, context)
 {
     InitializeConnection(((OLEDBCommand)_transformation).Connection);
     SetOutputName(_transformation.OutputPath);
     SetupComponentProperties();
 }
示例#21
0
 protected SsisTaskEmitter(LogicalObject obj, SSISEmitterContext context)
 {
     _name = obj.Name;
     _description = obj.Name;
     _context = context;
 }
示例#22
0
 public SsisTermLookupComponent(Transformation t, SSISEmitterContext context) : base(t, context)
 {
     InitializeConnection(((TermLookup)_transformation).Connection);
     SetOutputName(_transformation.OutputPath);
     SetComponentProperties();
 }
示例#23
0
 public SsisTermLookupComponent(Transformation t, SSISEmitterContext context) : base(t, context)
 {
     InitializeConnection(((TermLookup)_transformation).Connection);
     SetOutputName(_transformation.OutputPath);
     SetComponentProperties();
 }
示例#24
0
        public override SSISEmitterContext Emit()
        {
            this.UnSave();
            this.Save();

            SSISEmitterContext newContext = null;

            try
            {
                Package logicalPackage = (Package)_logicalContainer;
                this.DTSPackage.Variables.Add("_vulcanPackageRepositoryDirectory", false, "User", OutputBaseDirectory);

                foreach (ConnectionConfiguration connection in logicalPackage.ConnectionConfigurationList)
                {
                    this.AddConfiguration(connection.Name);
                    SsisConnection s = new SsisConnection(connection);
                }

                foreach (PackageConfiguration config in logicalPackage.PackageConfigurationList)
                {
                    this.AddConfiguration(config.Name);
                }

                foreach (Variable variable in logicalPackage.VariableList)
                {
                    SsisVariable s = new SsisVariable(variable);
                }

                this.Reload();

                newContext = new SSISEmitterContext(this, new SsisSequence(this.DTSPackage, _logicalContainer), _context.PluginLoader);
                this.DTSPackage.TransactionOption = (Microsoft.SqlServer.Dts.Runtime.DTSTransactionOption)
                    Enum.Parse(typeof(Microsoft.SqlServer.Dts.Runtime.DTSTransactionOption), this.LogicalPackage.TransactionMode);
                EmitPatterns(newContext);
                this.Save();

            }
            catch (Exception e)
            {
                this.Save();
                MessageEngine.Global.Trace(Severity.Error, e, e.Message);
            }

            return newContext;
        }
示例#25
0
 public SsisExecutePackage(ExecutePackageTask execPackage, SSISEmitterContext context)
     : base(execPackage, context)
 {
     _execPackageTaskHost = (DTS.TaskHost)Context.SSISSequence.AppendExecutable("STOCK:ExecutePackageTask");
     Initialize(execPackage);
 }
示例#26
0
 public SsisVariable(Variable variable, SSISEmitterContext context) : this(variable.Name, variable.Value, (DTS.DtsContainer)context.ParentContainer)
 {
 }
示例#27
0
 public SsisVariable(string name, object value, SSISEmitterContext context) : this(name, value, (DTS.DtsContainer)context.ParentContainer)
 {
 }
示例#28
0
 protected SsisTaskEmitter(LogicalObject obj, SSISEmitterContext context)
 {
     _name        = obj.Name;
     _description = obj.Name;
     _context     = context;
 }
示例#29
0
 public SsisDerivedColumnsComponent(Transformation t, SSISEmitterContext context) : base(t, context)
 {
     SetOutputName(_transformation.OutputPath);
 }
示例#30
0
 public SsisConnectionConfiguration(ConnectionConfiguration connection, SSISEmitterContext context)
 {
     this._name = connection.Name;
     this._connectionString = connection.ConnectionString;
     this._context = context;
 }
示例#31
0
 public SsisConnectionConfiguration(ConnectionConfiguration connection, SSISEmitterContext context)
 {
     this._name             = connection.Name;
     this._connectionString = connection.ConnectionString;
     this._context          = context;
 }
 public SsisConditionalSplitComponent(Transformation t, SSISEmitterContext context) : base(t, context)
 {
 }
示例#33
0
 public SsisVariable(Variable variable, SSISEmitterContext context) : this(variable.Name, variable.Value, (DTS.DtsContainer)context.ParentContainer) { }
示例#34
0
 public SsisOleDbCommandComponent(Transformation t, SSISEmitterContext context) : base(t, context)
 {
     InitializeConnection(((OLEDBCommand)_transformation).Connection);
     SetOutputName(_transformation.OutputPath);
     SetupComponentProperties();
 }
 public SsisConditionalSplitComponent(Transformation t, SSISEmitterContext context) : base(t, context)
 {
 }
示例#36
0
 public SsisExecutePackage(ExecutePackageTask execPackage, SSISEmitterContext context)
     : base(execPackage, context)
 {
     _execPackageTaskHost = (DTS.TaskHost)Context.SSISSequence.AppendExecutable("STOCK:ExecutePackageTask");
     Initialize(execPackage);
 }
示例#37
0
        public SsisPackage(Package logicalPackage, SSISEmitterContext context) : base (logicalPackage, context)
        {
            _DTSApplication = new DTS.Application();
            _DTSPackage = new DTS.Package();
            _DTSPackage.Name = Name.Replace(".", "_").Replace("[", " ").Replace("]", " ");
            _projectManager = new SsisProject(this);

            CurrentPackage = this;
        }
示例#38
0
 public SsisDerivedColumnsComponent(Transformation t, SSISEmitterContext context) : base(t, context)
 {
     SetOutputName(_transformation.OutputPath);
 }
示例#39
0
 public SsisUnionAllComponent(Transformation transformation, SSISEmitterContext context) : base(transformation, context)
 {
     SetOutputName(_transformation.OutputPath);
 }
示例#40
0
 public SsisUnionAllComponent(Transformation transformation, SSISEmitterContext context) : base(transformation, context)
 {
     SetOutputName(_transformation.OutputPath);
 }