public override void ProvideComponentProperties() { IDTSOutput100 output = ComponentMetaData.OutputCollection.New(); output.Name = "BLOB File Inserter Output"; IDTSOutputColumn100 column = output.OutputColumnCollection.New(); column.Name = "FileName"; column.SetDataTypeProperties(DataType.DT_WSTR, 256, 0, 0, 0); column = output.OutputColumnCollection.New(); column.Name = "FileBLOB"; column.SetDataTypeProperties(DataType.DT_IMAGE, 0, 0, 0, 0); IDTSRuntimeConnection100 conn = ComponentMetaData.RuntimeConnectionCollection.New(); conn.Name = "FileConnection"; }
public override void ProvideComponentProperties() { // Reset the component base.RemoveAllInputsOutputsAndCustomProperties(); ComponentMetaData.RuntimeConnectionCollection.RemoveAll(); IDTSInput100 input = ComponentMetaData.InputCollection.New(); input.Name = "Input"; IDTSCustomProperty100 exchangeName = ComponentMetaData.CustomPropertyCollection.New(); exchangeName.Name = "ExchangeName"; exchangeName.Description = "The name of the RabbitMQ exchange to publish messages to"; IDTSRuntimeConnection100 connection = ComponentMetaData.RuntimeConnectionCollection.New(); connection.Name = "RabbitMQ"; connection.ConnectionManagerID = "RabbitMQ"; }
/// <summary> /// Initializes connection used at runtime /// </summary> private void InitRunTimeConnection(IDTSRuntimeConnectionCollection100 connections) { try { IDTSRuntimeConnection100 conMgr = connections[Constants.CONNECTION_MANAGER_NAME_CONFIG]; _configConnection = new OleDbConnection(conMgr.ConnectionManager.ConnectionString); ConnectionManagerId = conMgr.ConnectionManagerID; } catch (Exception) { try { IDTSRuntimeConnection100 conMgr = connections[Constants.CONNECTION_MANAGER_NAME_CONFIG]; _configConnection = (DbConnection)conMgr.ConnectionManager.AcquireConnection(null); ConnectionManagerId = conMgr.ConnectionManagerID; } catch (Exception) { } } }
/// <summary> /// Provides the component properties /// </summary> public override void ProvideComponentProperties() { base.ProvideComponentProperties(); _isagCustomProperties = new IsagCustomProperties(); //set metadata version to DLL version ComponentMetaDataTools.UpdateVersion(this, ComponentMetaData); //Clear out base implmentation this.ComponentMetaData.RuntimeConnectionCollection.RemoveAll(); this.ComponentMetaData.InputCollection.RemoveAll(); this.ComponentMetaData.OutputCollection.RemoveAll(); this.RemoveAllInputsOutputsAndCustomProperties(); ComponentMetaData.UsesDispositions = false; //Input IDTSInput100 input = this.ComponentMetaData.InputCollection.New(); input.Name = Constants.INPUT_NAME; input.ErrorRowDisposition = DTSRowDisposition.RD_NotUsed; //Output IDTSOutput100 output = this.ComponentMetaData.OutputCollection.New(); output.Name = Constants.OUTPUT_NAME; output.SynchronousInputID = input.ID; //Custom Property: Configuration IDTSCustomProperty100 prop = ComponentMetaData.CustomPropertyCollection.New(); prop.Name = Constants.PROP_CONFIG; prop.Value = _isagCustomProperties.SaveToXml(); //new connection manager IDTSRuntimeConnection100 conn = this.ComponentMetaData.RuntimeConnectionCollection.New(); conn.Name = Constants.CONNECTION_MANAGER_NAME; conn.Description = "Connection to SQL Server"; }
/// <summary> /// Provides the component properties /// </summary> public override void ProvideComponentProperties() { base.ProvideComponentProperties(); _IsagCustomProperties = new IsagCustomProperties(); _IsagCustomProperties.SetDefaultValues(); ComponentMetaDataTools.UpdateVersion(this, ComponentMetaData); //Set metadata version to DLL-Version DtsPipelineComponentAttribute componentAttr = (DtsPipelineComponentAttribute)Attribute.GetCustomAttribute(this.GetType(), typeof(DtsPipelineComponentAttribute), false); int binaryVersion = componentAttr.CurrentVersion; ComponentMetaData.Version = binaryVersion; //Clear out base implmentation this.ComponentMetaData.RuntimeConnectionCollection.RemoveAll(); this.ComponentMetaData.InputCollection.RemoveAll(); this.ComponentMetaData.OutputCollection.RemoveAll(); //Input IDTSInput100 input = this.ComponentMetaData.InputCollection.New(); input.Name = Constants.INPUT_NAME; input.Description = Constants.INPUT_NAME; input.HasSideEffects = true; //New connection managers IDTSRuntimeConnection100 conn = this.ComponentMetaData.RuntimeConnectionCollection.New(); conn.Name = Constants.CONNECTION_MANAGER_NAME_MAIN; conn.Description = "Main Connection to SQL Server"; //Custom Properties hinzufügen IDTSCustomProperty100 prop = ComponentMetaData.CustomPropertyCollection.New(); prop.Name = Constants.PROP_CONFIG; _IsagCustomProperties.Save(ComponentMetaData); }
public override void ProvideComponentProperties() { // Reset the component. base.RemoveAllInputsOutputsAndCustomProperties(); ComponentMetaData.RuntimeConnectionCollection.RemoveAll(); IDTSOutput100 output = ComponentMetaData.OutputCollection.New(); output.Name = "Output"; IDTSCustomProperty100 queueName = ComponentMetaData.CustomPropertyCollection.New(); queueName.Name = "QueueName"; queueName.Description = "The name of the RabbitMQ queue to read messages from"; IDTSRuntimeConnection100 connection = ComponentMetaData.RuntimeConnectionCollection.New(); connection.Name = "RabbitMQ"; connection.ConnectionManagerID = "RabbitMQ"; CreateColumns(); }
public override void ProvideComponentProperties() { // Support resetting the component. ComponentMetaData.RuntimeConnectionCollection.RemoveAll(); RemoveAllInputsOutputsAndCustomProperties(); // Add our custom properties AddCustomProperty("ContainerID", "Name of the container where we store the data", string.Empty, true); AddCustomProperty("EntityKind", "Kind of entity to retrieve from the container (parameter for the KindOf() function)", string.Empty, true); AddCustomProperty("Query", "Filter to add to the where clause of the query(optional)", string.Empty, true); AddCustomProperty("PreviewCount", "Number of entities to bring back to determine the column metadata", 1); // Add the main output IDTSOutput100 output = ComponentMetaData.OutputCollection.New(); output.Name = "Output"; output.ExternalMetadataColumnCollection.IsUsed = true; // Add the connection manager. IDTSRuntimeConnection100 connection = ComponentMetaData.RuntimeConnectionCollection.New(); connection.Name = "SSDS Connection"; }
/// <summary> /// Adds component properties to the component metadata. /// </summary> public override void ProvideComponentProperties() { base.ProvideComponentProperties(); // First, we'll clear out everything -- inputs, outputs, and connection managers. this.ComponentMetaData.RuntimeConnectionCollection.RemoveAll(); ComponentMetaData.InputCollection.RemoveAll(); ComponentMetaData.OutputCollection.RemoveAll(); // Create a new input on self. AddNewInput(); // Add a new connection manager entry to the collection. IDTSRuntimeConnection100 connection = this.ComponentMetaData.RuntimeConnectionCollection.New(); connection.Name = Constants.CMName; connection.Description = Localized.CMDescription; // Add the document element name and namespace to the component. AddProperty(Constants.DocumentElementNameProperty, Localized.DocumentElementNameDescription, Localized.DefaultDocumentElementName); AddProperty(Constants.DocumentElementNamespaceProperty, Localized.DocumentElementNamespaceDescription, ""); }
public override void ProvideComponentProperties() { //clear base implementations base.RemoveAllInputsOutputsAndCustomProperties(); this.ComponentMetaData.RuntimeConnectionCollection.RemoveAll(); this.ComponentMetaData.InputCollection.RemoveAll(); this.ComponentMetaData.OutputCollection.RemoveAll(); //add custom properties AddProperty(Constants.HDFS_PATH_PROPERTY, "The path to store the files in HDFS", "/user/hue/somepath", true); AddProperty(Constants.SOURCE_COLUMN_INDEX, "The name of the source column", "", true); //add the input into the destination IDTSInput100 input = ComponentMetaData.InputCollection.New(); input.Name = "HDFS Input"; input.Description = "Input for the HDFS Destination"; input.HasSideEffects = true; IDTSRuntimeConnection100 connection = ComponentMetaData.RuntimeConnectionCollection.New(); connection.Name = Constants.HDFS_CONNECTION_MANAGER; connection.Description = "Connection to HDFS"; }
public DataFlowConnectionNodeFactory(IDTSRuntimeConnection100 input) { _input = input; }
/// <summary> /// Add user and hidden properties to configure the control /// </summary> public override void ProvideComponentProperties() { base.RemoveAllInputsOutputsAndCustomProperties(); ComponentMetaData.RuntimeConnectionCollection.RemoveAll(); ComponentMetaData.UsesDispositions = true; ComponentMetaData.Name = "Dynamics CRM Destination Adapter"; ComponentMetaData.ContactInfo = "*****@*****.**"; ComponentMetaData.Description = "Allows to connect to Dynamics CRM Destination"; IDTSCustomProperty100 Operation = ComponentMetaData.CustomPropertyCollection.New(); Operation.Description = "The action code for the operation to take place over an Entity"; Operation.Name = "Operation"; Operation.Value = 0; IDTSCustomProperty100 BatchSize = ComponentMetaData.CustomPropertyCollection.New(); BatchSize.Description = "Data block limit"; BatchSize.Name = "BatchSize"; BatchSize.Value = 1; IDTSCustomProperty100 CultureInfo = ComponentMetaData.CustomPropertyCollection.New(); CultureInfo.Description = "Forces specific culture info"; CultureInfo.Name = "CultureInfo"; CultureInfo.Value = 127; IDTSCustomProperty100 Entity = ComponentMetaData.CustomPropertyCollection.New(); Entity.Description = "Entity"; Entity.Name = "Entity"; Entity.TypeConverter = "NOTBROWSABLE"; IDTSCustomProperty100 Workflow = ComponentMetaData.CustomPropertyCollection.New(); Workflow.Description = "Workflow"; Workflow.Name = "Workflow"; Workflow.Value = ""; Workflow.TypeConverter = "NOTBROWSABLE"; IDTSCustomProperty100 Mapping = ComponentMetaData.CustomPropertyCollection.New(); Mapping.Description = "Mapping"; Mapping.Name = "Mapping"; Mapping.TypeConverter = "NOTBROWSABLE"; IDTSInput100 input = ComponentMetaData.InputCollection.New(); input.Name = "Input"; input.ErrorRowDisposition = DTSRowDisposition.RD_RedirectRow; IDTSOutput100 CRMErrors = ComponentMetaData.OutputCollection.New(); CRMErrors.Name = "CRMErrors"; CRMErrors.SynchronousInputID = input.ID; CRMErrors.ExclusionGroup = 1; CRMErrors.IsErrorOut = true; IDTSOutput100 CRMOK = ComponentMetaData.OutputCollection.New(); CRMOK.Name = "CRMOK"; CRMOK.SynchronousInputID = input.ID; CRMOK.ExclusionGroup = 1; ////AD CRM GUID Column IDTSOutputColumn100 outputcol = CRMOK.OutputColumnCollection.New(); outputcol.Name = "_Response_"; outputcol.Description = "_Response_"; outputcol.SetDataTypeProperties(DataType.DT_STR, 0, 0, 0, 1252); IDTSRuntimeConnection100 connection = ComponentMetaData.RuntimeConnectionCollection.New(); connection.Name = "CRMSSIS"; connection.ConnectionManagerID = "CRMSSIS"; }
/// <summary> /// Connection managers are valid, if /// - main connection is set /// /// Sofern die externe Transaktion gewählt ist, /// If external transaction is used /// - bulk connection must be set /// - main connection must be able to access tthe temporary table created with the bulk connection /// - main connection and bulk connection must not be the same connections /// </summary> /// <param name="componentMetaData">SSIS component metadata</param> /// <returns>Are all connection managers valid?</returns> private bool AreConnectionManagersValid(IDTSComponentMetaData100 componentMetaData, IsagEvents events) { IDTSRuntimeConnection100 runtimeConn = null; SqlConnection mainConn = null; SqlConnection bulkConn = null; //Main try { runtimeConn = componentMetaData.RuntimeConnectionCollection[Constants.CONNECTION_MANAGER_NAME_MAIN]; } catch (Exception) { } if (runtimeConn == null || runtimeConn.ConnectionManager == null) { events.Fire(IsagEvents.IsagEventType.Error, "ADO.NET [Main] DB Connection Manager has not been initialized."); return(false); } else { object tempConn = componentMetaData.RuntimeConnectionCollection[Constants.CONNECTION_MANAGER_NAME_MAIN].ConnectionManager.AcquireConnection(null); if (tempConn is SqlConnection) { mainConn = (SqlConnection)tempConn; } else { events.Fire(IsagEvents.IsagEventType.Error, "Only ADO.NET SQL Server connections are supported for the ADO.NET [Main] Connection."); return(false); } } runtimeConn = null; //Bulk if (!UseExternalTransaction && mainConn != null) { bulkConn = mainConn; } else { try { runtimeConn = componentMetaData.RuntimeConnectionCollection[Constants.CONNECTION_MANAGER_NAME_BULK]; } catch (Exception) { } if (runtimeConn == null || runtimeConn.ConnectionManager == null) { events.Fire(IsagEvents.IsagEventType.Error, "ADO.NET [Bulk] Connection Manager has not been initialized."); return(false); } else { object tempConn = componentMetaData.RuntimeConnectionCollection[Constants.CONNECTION_MANAGER_NAME_BULK].ConnectionManager.AcquireConnection(null); if (tempConn is SqlConnection) { bulkConn = (SqlConnection)tempConn; } else { events.Fire(IsagEvents.IsagEventType.Error, "Only ADO.NET SQL Server connections are supported for the ADO.NET [Bulk] Connection."); return(false); } } } //External Transaction if (mainConn != null && bulkConn != null && UseExternalTransaction) { string mainConnectionServer = mainConn.DataSource; string bulkConnectionServer = bulkConn.DataSource; if (mainConnectionServer.StartsWith(".")) { mainConnectionServer = "localhost" + mainConnectionServer.Substring(1); } if (bulkConnectionServer.StartsWith(".")) { bulkConnectionServer = "localhost" + bulkConnectionServer.Substring(1); } // Die Main Connection muss Zugriff auf die Temporäre Tabelle der Bulk Connection haben if (mainConnectionServer != bulkConnectionServer) { events.Fire(IsagEvents.IsagEventType.Error, "Please make sure that the Main Connection can access the temporary table created with the bulk Connection"); return(false); } // Die Main - und Bulk Connection dürfen nicht identsich sein bool areConnectionsIdentic = componentMetaData.RuntimeConnectionCollection[Constants.CONNECTION_MANAGER_NAME_MAIN].ConnectionManagerID == componentMetaData.RuntimeConnectionCollection[Constants.CONNECTION_MANAGER_NAME_BULK].ConnectionManagerID; if (areConnectionsIdentic) { events.Fire(IsagEvents.IsagEventType.Error, "Please make sure that the Main- and the Bulk Connection are not identical."); return(false); } } return(true); }
/// <summary> /// Acquire connection from SSIS /// (initializes main sql connection and if neccesarry bulk connection /// </summary> /// <param name="transaction">transaction</param> public override void AcquireConnections(object transaction) { try { InitProperties(true); IDTSRuntimeConnection100 runtimeConn = null; //Main try { runtimeConn = this.ComponentMetaData.RuntimeConnectionCollection[Constants.CONNECTION_MANAGER_NAME_MAIN]; } catch (Exception ex) { string error = "Error (Get runtime connection), Con Name: " + Constants.CONNECTION_MANAGER_NAME_MAIN + Environment.NewLine + ex.ToString(); throw new Exception(error); } if (runtimeConn == null || runtimeConn.ConnectionManager == null) { _events.Fire(IsagEvents.IsagEventType.ErrorConnectionNotInitialized, "ADO.NET [{0}] DB Connection Manager has not been initialized.", Constants.CONNECTION_MANAGER_NAME_MAIN); } else { try { object tempConn = this.ComponentMetaData.RuntimeConnectionCollection[Constants.CONNECTION_MANAGER_NAME_MAIN].ConnectionManager.AcquireConnection(transaction); if (tempConn is SqlConnection) { _mainConn = (SqlConnection)tempConn; } else { _events.Fire(IsagEvents.IsagEventType.ErrorWrongConnection, "Only ADO.NET SQL Server connections are supported for the ADO.NET [{0}] Connection.", Constants.CONNECTION_MANAGER_NAME_MAIN); } } catch (Exception ex) { string error = "Error (check if ado connection)" + Environment.NewLine + ex.ToString(); throw new Exception(error); } } runtimeConn = null; //Bulk if (!_IsagCustomProperties.UseExternalTransaction && _mainConn != null) { _bulkConn = _mainConn; } else { try { runtimeConn = this.ComponentMetaData.RuntimeConnectionCollection[Constants.CONNECTION_MANAGER_NAME_BULK]; } catch (Exception) { } if (runtimeConn == null || runtimeConn.ConnectionManager == null) { _events.Fire(IsagEvents.IsagEventType.ErrorConnectionNotInitialized, "ADO.NET [{0}] DB Connection Manager has not been initialized.", Constants.CONNECTION_MANAGER_NAME_BULK); //Events.Fire(ComponentMetaData, Events.Type.Error, "ADO.NET [Bulk] Connection Manager has not been initialized."); } else { object tempConn = this.ComponentMetaData.RuntimeConnectionCollection[Constants.CONNECTION_MANAGER_NAME_BULK].ConnectionManager.AcquireConnection(transaction); if (tempConn is SqlConnection) { _bulkConn = (SqlConnection)tempConn; } else { _events.Fire(IsagEvents.IsagEventType.ErrorWrongConnection, "Only ADO.NET SQL Server connections are supported for the ADO.NET [{0}] Connection.", Constants.CONNECTION_MANAGER_NAME_BULK); } } } } catch (Exception ex) { throw new Exception("Error (AcquireConnections)" + Environment.NewLine + ex.ToString()); } }
internal BipsProxyIDTSRuntimeConnection100(IDTSRuntimeConnection100 innerObject) { _innerObject = innerObject; }
//public static MainPipe Add(this MainPipe container, Action<MainPipe> item) //{ // // Because of SSIS's object model inconsistencies, we don't // // need to actually do anything with component here, as the // // factory method has already added it to the ComponentMetaDataCollection. // item(container); // return container; //} public static T FindObject <T>(this MainPipe container, string reference) where T : IDTSObject100 { if (container == null) { throw new ArgumentNullException(nameof(container)); } if (string.IsNullOrWhiteSpace(reference)) { throw new ArgumentException("Value cannot be null or whitespace.", nameof(reference)); } // Find the component var result = ParseNextIdentifer(reference); IDTSComponentMetaData130 component = (IDTSComponentMetaData130)container.ComponentMetaDataCollection[result.extractedValue]; if (typeof(T) == typeof(IDTSComponentMetaData130)) { return((T)component); } // Get part of component result = ParseNextIdentifer(result.remainingIdentifier); if (result.extractedValue.StartsWith("INPUTS", StringComparison.OrdinalIgnoreCase)) { IDTSInput100 input = component.InputCollection[GetValueBetweenBrackets(result.extractedValue)]; if (typeof(T) == typeof(IDTSInput100)) { return((T)input); } // Find the column result = ParseNextIdentifer(result.remainingIdentifier); if (result.extractedValue.StartsWith("COLUMNS", StringComparison.OrdinalIgnoreCase)) { IDTSInputColumn130 inputColumn = (IDTSInputColumn130)input.InputColumnCollection[GetValueBetweenBrackets(result.extractedValue)]; if (typeof(T) == typeof(IDTSInputColumn100)) { return((T)inputColumn); } } } else if (result.extractedValue.StartsWith("OUTPUTS", StringComparison.OrdinalIgnoreCase)) { IDTSOutput100 output = component.OutputCollection[GetValueBetweenBrackets(result.extractedValue)]; if (typeof(T) == typeof(IDTSOutput100)) { return((T)output); } // Find the column result = ParseNextIdentifer(result.remainingIdentifier); if (result.extractedValue.StartsWith("COLUMNS", StringComparison.OrdinalIgnoreCase)) { IDTSOutputColumn130 outputColumn = (IDTSOutputColumn130)output.OutputColumnCollection[GetValueBetweenBrackets(result.extractedValue)]; if (typeof(T) == typeof(IDTSOutputColumn100)) { return((T)outputColumn); } } throw new ArgumentException($"Could not resolve the reference '{reference}'.", nameof(reference)); } else if (result.extractedValue.StartsWith("CONNECTIONS", StringComparison.OrdinalIgnoreCase)) { IDTSRuntimeConnection100 connection = component.RuntimeConnectionCollection[GetValueBetweenBrackets(result.extractedValue)]; if (typeof(T) == typeof(IDTSRuntimeConnection100)) { return((T)connection); } } return(default(T)); }
public override void AcquireConnections(object transaction) { IDTSRuntimeConnection100 conn = ComponentMetaData.RuntimeConnectionCollection[0]; m_ConnMgr = conn.ConnectionManager; }