/// <summary>
        /// Fills the database columns information data set.
        /// </summary>
        /// <param name="pilotConfig">if set to <c>true</c>, the pilot configuration is loaded. Otherwise, the production configuration is loaded.</param>
        protected void FillDatabaseColumnsInformationDataSet(bool pilotConfig)
        {
            Logger.Instance.WriteMethodEntry("Pilot Config: '{0}'.", pilotConfig);

            try
            {
                var config  = pilotConfig ? this.PilotXml : this.ProductionXml;
                var dataSet = pilotConfig ? this.PilotDataSet : this.ProductionDataSet;

                var connector = config.XPathSelectElement(Documenter.GetConnectorXmlRootXPath(pilotConfig) + "/ma-data[name ='" + this.ConnectorName + "']");

                if (connector != null)
                {
                    var table = dataSet.Tables[0];

                    var columns = connector.XPathSelectElements("private-configuration/oledbma-configuration/mms-info/column-info/column");
                    foreach (var column in columns)
                    {
                        var name     = (string)column.Element("name");
                        var dataType = (string)column.Element("data-type");
                        var length   = (string)column.Element("length");
                        var nullable = (string)column.Element("isnullable") == "1" ? "Yes" : "No";
                        var type     = column.Element("mms-type") != null && (string)column.Element("mms-type").Attribute("dn") == "1" ? "Reference DN" : (string)column.Element("mms-type");
                        Documenter.AddRow(table, new object[] { name, dataType, length, nullable, type });
                    }

                    table.AcceptChanges();
                }
            }
            finally
            {
                Logger.Instance.WriteMethodExit("Pilot Config: '{0}'", pilotConfig);
            }
        }
        /// <summary>
        /// Fills the extensible2 global parameters data set.
        /// </summary>
        /// <param name="pilotConfig">if set to <c>true</c>, the pilot configuration is loaded. Otherwise, the production configuration is loaded.</param>
        protected void FillExtensible2GlobalParametersDataSet(bool pilotConfig)
        {
            Logger.Instance.WriteMethodEntry("Pilot Config: '{0}'.", pilotConfig);

            try
            {
                var config  = pilotConfig ? this.PilotXml : this.ProductionXml;
                var dataSet = pilotConfig ? this.PilotDataSet : this.ProductionDataSet;

                var connector = config.XPathSelectElement("//ma-data[name ='" + this.ConnectorName + "']");

                if (connector != null)
                {
                    var table = dataSet.Tables[0];

                    var parameterDefinitions = connector.XPathSelectElements("private-configuration/MAConfig/parameter-definitions/parameter[use = 'global' and type != 'label' and type != 'divider']");
                    var parameterValues      = connector.XPathSelectElements("private-configuration/MAConfig/parameter-values/parameter[@use = 'global']");

                    var parameterTable = this.GetExtensible2ConfigParametersTable(parameterDefinitions, parameterValues);
                    foreach (DataRow row in parameterTable.Rows)
                    {
                        Documenter.AddRow(table, new object[] { row[0], row[1], row[2], row[3] });
                    }

                    table.AcceptChanges();
                }
            }
            finally
            {
                Logger.Instance.WriteMethodExit("Pilot Config: '{0}'", pilotConfig);
            }
        }
        /// <summary>
        /// Fills the connector password management configuration data set.
        /// </summary>
        /// <param name="pilotConfig">if set to <c>true</c>, the pilot configuration is loaded. Otherwise, the production configuration is loaded.</param>
        protected void FillActiveDirectoryPasswordManagementConfigurationDataSet(bool pilotConfig)
        {
            Logger.Instance.WriteMethodEntry("Pilot Config: '{0}'.", pilotConfig);

            try
            {
                var config  = pilotConfig ? this.PilotXml : this.ProductionXml;
                var dataSet = pilotConfig ? this.PilotDataSet : this.ProductionDataSet;

                var table = dataSet.Tables[0];

                var connector = config.XPathSelectElement("//ma-data[name ='" + this.ConnectorName + "']");

                if (connector != null)
                {
                    var enablePasswordSync = !((string)connector.XPathSelectElement("password-sync-allowed") ?? string.Empty).Equals("1", StringComparison.OrdinalIgnoreCase) ? "No" : "Yes";

                    Documenter.AddRow(table, new object[] { 0, "Enable password management", enablePasswordSync });

                    if (enablePasswordSync.Equals("Yes", StringComparison.OrdinalIgnoreCase))
                    {
                        Documenter.AddRow(table, new object[] { 1, "Maximum retry count", (string)connector.XPathSelectElement("password-sync/maximum-retry-count") });
                        Documenter.AddRow(table, new object[] { 2, "Retry interval (seconds)", (string)connector.XPathSelectElement("password-sync/retry-interval") });
                        Documenter.AddRow(table, new object[] { 3, "Require secure connection for password synchronization options", !((string)connector.XPathSelectElement("password-sync/allow-low-security") ?? string.Empty).Equals("1", StringComparison.OrdinalIgnoreCase) ? "Yes" : "No" });
                        Documenter.AddRow(table, new object[] { 4, "Unlock locked accounts when resetting passwords", !((string)connector.XPathSelectElement("password-sync/unlock-account") ?? string.Empty).Equals("1", StringComparison.OrdinalIgnoreCase) ? "Yes" : "No" });
                    }

                    table.AcceptChanges();
                }
            }
            finally
            {
                Logger.Instance.WriteMethodExit("Pilot Config: '{0}'.", pilotConfig);
            }
        }
        /// <summary>
        /// Fills the Generic SQL schema page data set.
        /// </summary>
        /// <param name="pilotConfig">if set to <c>true</c>, the pilot configuration is loaded. Otherwise, the production configuration is loaded.</param>
        /// <param name="pageNumber">The page number.</param>
        protected void FillGenericSqlSchemaPageDataSet(bool pilotConfig, int pageNumber)
        {
            Logger.Instance.WriteMethodEntry("Pilot Config: '{0}'.", pilotConfig);

            try
            {
                var config  = pilotConfig ? this.PilotXml : this.ProductionXml;
                var dataSet = pilotConfig ? this.PilotDataSet : this.ProductionDataSet;

                var connector = config.XPathSelectElement(Documenter.GetConnectorXmlRootXPath(pilotConfig) + "/ma-data[name ='" + this.ConnectorName + "']");

                if (connector != null)
                {
                    var table = dataSet.Tables[0];

                    var parameterDefinitions = connector.XPathSelectElements("private-configuration/MAConfig/parameter-definitions/parameter[use = 'schema' and type != 'label' and type != 'divider' and page-number = '" + pageNumber + "']");

                    var parameterIndex = -1;
                    foreach (var parameterDefinition in parameterDefinitions)
                    {
                        ++parameterIndex;
                        var parameterName = (string)parameterDefinition.Element("name");
                        var parameter     = connector.XPathSelectElement("private-configuration/MAConfig/parameter-values/parameter[@use = 'schema' and @name = '" + parameterName + "' and @page-number = '" + pageNumber + "']");
                        var encrypted     = (string)parameter.Attribute("encrypted") == "1";
                        Documenter.AddRow(table, new object[] { parameterIndex, (string)parameter.Attribute("name"), encrypted ? "******" : (string)parameter });
                    }

                    table.AcceptChanges();
                }
            }
            finally
            {
                Logger.Instance.WriteMethodExit("Pilot Config: '{0}'", pilotConfig);
            }
        }
        /// <summary>
        /// Fills the active directory connection information data set.
        /// </summary>
        /// <param name="pilotConfig">if set to <c>true</c>, the pilot configuration is loaded. Otherwise, the production configuration is loaded.</param>
        protected void FillActiveDirectoryConnectionInformationDataSet(bool pilotConfig)
        {
            Logger.Instance.WriteMethodEntry("Pilot Config: '{0}'.", pilotConfig);

            try
            {
                var config  = pilotConfig ? this.PilotXml : this.ProductionXml;
                var dataSet = pilotConfig ? this.PilotDataSet : this.ProductionDataSet;

                var connector = config.XPathSelectElement("//ma-data[name ='" + this.ConnectorName + "']");

                if (connector != null)
                {
                    var table = dataSet.Tables[0];

                    var forestName = (string)connector.XPathSelectElement("private-configuration/adma-configuration/forest-name");
                    var userName   = (string)connector.XPathSelectElement("private-configuration/adma-configuration/forest-login-user");
                    var userDomain = (string)connector.XPathSelectElement("private-configuration/adma-configuration/forest-login-domain");

                    Documenter.AddRow(table, new object[] { 1, "Forest Name", forestName });
                    Documenter.AddRow(table, new object[] { 2, "User Name", userName });
                    Documenter.AddRow(table, new object[] { 3, "Domain", userDomain });

                    table.AcceptChanges();
                }
            }
            finally
            {
                Logger.Instance.WriteMethodExit("Pilot Config: '{0}'", pilotConfig);
            }
        }
        /// <summary>
        /// Fills the global settings data set.
        /// </summary>
        /// <param name="pilotConfig">if set to <c>true</c>, the pilot configuration is loaded. Otherwise, the production configuration is loaded.</param>
        private void FillGlobalSettingsDataSet(bool pilotConfig)
        {
            Logger.Instance.WriteMethodEntry("Pilot Config: '{0}'.", pilotConfig);

            try
            {
                var config  = pilotConfig ? this.PilotXml : this.ProductionXml;
                var dataSet = pilotConfig ? this.PilotDataSet : this.ProductionDataSet;

                var table = dataSet.Tables[0];

                var parameters = config.XPathSelectElements("//mv-data//parameter-values/parameter");

                // Sort by name
                parameters                       = from parameter in parameters
                                        let name = (string)parameter.Attribute("name")
                                                   orderby name
                                                   select parameter;

                for (var parameterIndex = 0; parameterIndex < parameters.Count(); ++parameterIndex)
                {
                    var parameter = parameters.ElementAt(parameterIndex);
                    Documenter.AddRow(table, new object[] { (string)parameter.Attribute("name"), (string)parameter });
                }

                table.AcceptChanges();
            }
            finally
            {
                Logger.Instance.WriteMethodExit("Pilot Config: '{0}'", pilotConfig);
            }
        }
        /// <summary>
        /// Fills the extensible2 extension information data set.
        /// </summary>
        /// <param name="pilotConfig">if set to <c>true</c>, the pilot configuration is loaded. Otherwise, the production configuration is loaded.</param>
        protected void FillExtensible2ExtensionInformationDataSet(bool pilotConfig)
        {
            Logger.Instance.WriteMethodEntry("Pilot Config: '{0}'.", pilotConfig);

            try
            {
                var config  = pilotConfig ? this.PilotXml : this.ProductionXml;
                var dataSet = pilotConfig ? this.PilotDataSet : this.ProductionDataSet;

                var connector = config.XPathSelectElement("//ma-data[name ='" + this.ConnectorName + "']");

                if (connector != null)
                {
                    var table = dataSet.Tables[0];

                    var connectorAssembly        = (string)connector.XPathSelectElement("private-configuration/MAConfig/extension-config/filename");
                    var connectorAssemblyVersion = (string)connector.XPathSelectElement("private-configuration/MAConfig/extension-config/assembly-version");
                    var connectorCapabilityBits  = (string)connector.XPathSelectElement("private-configuration/MAConfig/extension-config/capability-bits");

                    Documenter.AddRow(table, new object[] { 1, "Connector Assembly Name", connectorAssembly });
                    Documenter.AddRow(table, new object[] { 2, "Connector Assembly Version", connectorAssemblyVersion });
                    Documenter.AddRow(table, new object[] { 3, "Connector Capability Bits", connectorCapabilityBits });

                    table.AcceptChanges();
                }
            }
            finally
            {
                Logger.Instance.WriteMethodExit("Pilot Config: '{0}'", pilotConfig);
            }
        }
        /// <summary>
        /// Fills the active directory connection option data set.
        /// </summary>
        /// <param name="pilotConfig">if set to <c>true</c>, the pilot configuration is loaded. Otherwise, the production configuration is loaded.</param>
        protected void FillActiveDirectoryConnectionOptionDataSet(bool pilotConfig)
        {
            Logger.Instance.WriteMethodEntry("Pilot Config: '{0}'.", pilotConfig);

            try
            {
                var config  = pilotConfig ? this.PilotXml : this.ProductionXml;
                var dataSet = pilotConfig ? this.PilotDataSet : this.ProductionDataSet;

                var connector = config.XPathSelectElement("//ma-data[name ='" + this.ConnectorName + "']");

                if (connector != null)
                {
                    var table = dataSet.Tables[0];

                    var signAndSeal = connector.XPathSelectElement("private-configuration/adma-configuration/sign-and-seal");

                    if ((string)signAndSeal == "1")
                    {
                        Documenter.AddRow(table, new object[] { 1, "Sign and Encrypt LDAP traffic", "Yes" });
                    }
                    else
                    {
                        Documenter.AddRow(table, new object[] { 1, "Sign and Encrypt LDAP traffic", "No" });

                        var sslBind = connector.XPathSelectElement("private-configuration/adma-configuration/ssl-bind");

                        if ((string)sslBind == "1")
                        {
                            Documenter.AddRow(table, new object[] { 2, "Enable SSL for the connection", "Yes" });

                            var crlCheck = sslBind.Attribute("crl-check");

                            var crlCheckEnabled = (string)crlCheck == "1" ? "Yes" : "No";
                            Documenter.AddRow(table, new object[] { 3, "Enable CRL Checking", crlCheckEnabled });
                        }
                        else
                        {
                            Documenter.AddRow(table, new object[] { 2, "Enable SSL for the connection", "No" });
                        }
                    }

                    // Only applicable for AD LDS connector
                    var simpleBind = connector.XPathSelectElement("private-configuration/adma-configuration/simple-bind");

                    if ((string)simpleBind == "1")
                    {
                        Documenter.AddRow(table, new object[] { 4, "Enable Simple Bind", "Yes" });
                    }

                    table.AcceptChanges();
                }
            }
            finally
            {
                Logger.Instance.WriteMethodExit("Pilot Config: '{0}'", pilotConfig);
            }
        }
        /// <summary>
        /// Fills the database connection information data set.
        /// </summary>
        /// <param name="pilotConfig">if set to <c>true</c>, the pilot configuration is loaded. Otherwise, the production configuration is loaded.</param>
        protected void FillDatabaseConnectionInformationDataSet(bool pilotConfig)
        {
            Logger.Instance.WriteMethodEntry("Pilot Config: '{0}'.", pilotConfig);

            try
            {
                var config  = pilotConfig ? this.PilotXml : this.ProductionXml;
                var dataSet = pilotConfig ? this.PilotDataSet : this.ProductionDataSet;

                var connector = config.XPathSelectElement(Documenter.GetConnectorXmlRootXPath(pilotConfig) + "/ma-data[name ='" + this.ConnectorName + "']");

                if (connector != null)
                {
                    var table = dataSet.Tables[0];

                    var serverName          = (string)connector.XPathSelectElement("private-configuration/oledbma-configuration/connection-info/server");
                    var database            = (string)connector.XPathSelectElement("private-configuration/oledbma-configuration/connection-info/databasename");
                    var dataSource          = (string)connector.XPathSelectElement("private-configuration/oledbma-configuration/connection-info/datasource");
                    var tableName           = (string)connector.XPathSelectElement("private-configuration/oledbma-configuration/connection-info/tablename");
                    var deltaTableName      = (string)connector.XPathSelectElement("private-configuration/oledbma-configuration/connection-info/delta-tablename");
                    var multivalueTableName = (string)connector.XPathSelectElement("private-configuration/oledbma-configuration/connection-info/multivalued-tablename");
                    var integratedAuth      = ((string)connector.XPathSelectElement("private-configuration/oledbma-configuration/connection-info/authentication") ?? string.Empty).Equals("integrated", StringComparison.OrdinalIgnoreCase);
                    var userName            = (string)connector.XPathSelectElement("private-configuration/oledbma-configuration/connection-info/user");
                    var userDomain          = (string)connector.XPathSelectElement("private-configuration/oledbma-configuration/connection-info/domain");

                    Documenter.AddRow(table, new object[] { 1, "Server Name", serverName });
                    if (!string.IsNullOrEmpty(dataSource))
                    {
                        Documenter.AddRow(table, new object[] { 2, "Data Source", dataSource });
                    }
                    else
                    {
                        Documenter.AddRow(table, new object[] { 2, "Database", database });
                    }

                    Documenter.AddRow(table, new object[] { 3, "Table/View", tableName });
                    Documenter.AddRow(table, new object[] { 4, "Delta Table/View", deltaTableName });
                    Documenter.AddRow(table, new object[] { 5, "Multivalue Table", multivalueTableName });

                    if (!this.ConnectorCategory.Equals("DB2", StringComparison.OrdinalIgnoreCase))
                    {
                        Documenter.AddRow(table, new object[] { 6, "Authentication", integratedAuth ? "Windows integrated authentication" : this.ConnectorCategory.Equals("MSSQL", StringComparison.OrdinalIgnoreCase) ? "SQL authentication" : "Database authentication" });
                    }

                    Documenter.AddRow(table, new object[] { 7, "User Name", userName });
                    Documenter.AddRow(table, new object[] { 8, "Password", "******" });
                    Documenter.AddRow(table, new object[] { 9, "Domain", userDomain });

                    table.AcceptChanges();
                }
            }
            finally
            {
                Logger.Instance.WriteMethodExit("Pilot Config: '{0}'", pilotConfig);
            }
        }
        /// <summary>
        /// Fills the extensible2 run profile data set.
        /// </summary>
        /// <param name="runProfileName">Name of the run profile.</param>
        /// <param name="pilotConfig">if set to <c>true</c>, the pilot configuration is loaded. Otherwise, the production configuration is loaded.</param>
        protected override void FillConnectorRunProfileDataSet(string runProfileName, bool pilotConfig)
        {
            Logger.Instance.WriteMethodEntry("Run Profile Name: '{0}'. Pilot Config: '{1}'.", runProfileName, pilotConfig);

            try
            {
                var config  = pilotConfig ? this.PilotXml : this.ProductionXml;
                var dataSet = pilotConfig ? this.PilotDataSet : this.ProductionDataSet;

                var connector = config.XPathSelectElement("//ma-data[name ='" + this.ConnectorName + "']");

                if (connector != null)
                {
                    base.FillConnectorRunProfileDataSet(runProfileName, pilotConfig);

                    var table  = dataSet.Tables[0];
                    var table2 = dataSet.Tables[1];

                    var runProfileSteps = connector.XPathSelectElements("ma-run-data/run-configuration[name = '" + runProfileName + "']/configuration/step");

                    for (var stepIndex = 1; stepIndex <= runProfileSteps.Count(); ++stepIndex)
                    {
                        var runProfileStep = runProfileSteps.ElementAt(stepIndex - 1);

                        var batchSize = (string)runProfileStep.XPathSelectElement("custom-data/extensible2-step-data/batch-size");
                        if (!string.IsNullOrEmpty(batchSize))
                        {
                            Documenter.AddRow(table2, new object[] { stepIndex, "Batch Size (objects)", batchSize, 1000 });
                        }

                        var timeout = (string)runProfileStep.XPathSelectElement("custom-data/extensible2-step-data/timeout");
                        if (!string.IsNullOrEmpty(timeout))
                        {
                            Documenter.AddRow(table2, new object[] { stepIndex, "Timeout (seconds)", timeout, 1001 });
                        }

                        var parameterDefinitions = connector.XPathSelectElements("private-configuration/MAConfig/parameter-definitions/parameter[use = 'run-step' and type != 'label' and type != 'divider']");
                        var parameterValues      = runProfileStep.XPathSelectElements("custom-data/parameter-values/parameter");

                        var parameterTable = this.GetExtensible2ConfigParametersTable(parameterDefinitions, parameterValues);
                        foreach (DataRow row in parameterTable.Rows)
                        {
                            Documenter.AddRow(table2, new object[] { stepIndex, row[1], row[2], 1000 + (int)row[0] });
                        }
                    }

                    table.AcceptChanges();
                    table2.AcceptChanges();
                }
            }
            finally
            {
                Logger.Instance.WriteMethodExit("Run Profile Name: '{0}'. Pilot Config: '{1}'.", runProfileName, pilotConfig);
            }
        }
        /// <summary>
        /// Fills the database columns information data set.
        /// </summary>
        /// <param name="pilotConfig">if set to <c>true</c>, the pilot configuration is loaded. Otherwise, the production configuration is loaded.</param>
        protected void FillDatabaseSpecialAttributesDataSet(bool pilotConfig)
        {
            Logger.Instance.WriteMethodEntry("Pilot Config: '{0}'.", pilotConfig);

            try
            {
                var config  = pilotConfig ? this.PilotXml : this.ProductionXml;
                var dataSet = pilotConfig ? this.PilotDataSet : this.ProductionDataSet;

                var connector = config.XPathSelectElement(Documenter.GetConnectorXmlRootXPath(pilotConfig) + "/ma-data[name ='" + this.ConnectorName + "']");

                if (connector != null)
                {
                    var table = dataSet.Tables[0];

                    var anchorAttributes = connector.XPathSelectElements("private-configuration/oledbma-configuration/mms-info/anchor/attribute");
                    var anchor           = string.Empty;
                    foreach (var anchorAttribute in anchorAttributes)
                    {
                        anchor += (string)anchorAttribute + "+";
                    }

                    Documenter.AddRow(table, new object[] { 1, "Anchor", anchor.Trim('+') });

                    var objectTypeColumn = (string)connector.XPathSelectElement("private-configuration/oledbma-configuration/mms-info/object-type-info/object-type-column") ?? string.Empty;

                    if (string.IsNullOrEmpty(objectTypeColumn))
                    {
                        var objectType = (string)connector.XPathSelectElement("private-configuration/oledbma-configuration/mms-info/object-type");

                        Documenter.AddRow(table, new object[] { 2, "Fixed Object Type", (string)objectType });
                    }
                    else
                    {
                        Documenter.AddRow(table, new object[] { 3, "Object Type Column", (string)objectTypeColumn });

                        var objectTypes = connector.XPathSelectElements("private-configuration/oledbma-configuration/mms-info/object-type-info/object-type");
                        for (var objectTypeIndex = 0; objectTypeIndex < objectTypes.Count(); ++objectTypeIndex)
                        {
                            var objectType = (string)objectTypes.ElementAt(objectTypeIndex);

                            Documenter.AddRow(table, new object[] { 4 + objectTypeIndex, "Object Type", objectType });
                        }
                    }

                    table.AcceptChanges();
                }
            }
            finally
            {
                Logger.Instance.WriteMethodExit("Pilot Config: '{0}'", pilotConfig);
            }
        }
        /// <summary>
        /// Fills the Active Directory run profile data set.
        /// </summary>
        /// <param name="runProfileName">Name of the run profile.</param>
        /// <param name="pilotConfig">if set to <c>true</c>, the pilot configuration is loaded. Otherwise, the production configuration is loaded.</param>
        protected override void FillConnectorRunProfileDataSet(string runProfileName, bool pilotConfig)
        {
            Logger.Instance.WriteMethodEntry("Run Profile Name: '{0}'. Pilot Config: '{1}'.", runProfileName, pilotConfig);

            try
            {
                var config  = pilotConfig ? this.PilotXml : this.ProductionXml;
                var dataSet = pilotConfig ? this.PilotDataSet : this.ProductionDataSet;

                var connector = config.XPathSelectElement("//ma-data[name ='" + this.ConnectorName + "']");

                if (connector != null)
                {
                    base.FillConnectorRunProfileDataSet(runProfileName, pilotConfig);

                    var table  = dataSet.Tables[0];
                    var table2 = dataSet.Tables[1];

                    var runProfileSteps = connector.XPathSelectElements("ma-run-data/run-configuration[name = '" + runProfileName + "']/configuration/step");

                    for (var stepIndex = 1; stepIndex <= runProfileSteps.Count(); ++stepIndex)
                    {
                        var runProfileStep = runProfileSteps.ElementAt(stepIndex - 1);

                        var batchSize = (string)runProfileStep.XPathSelectElement("custom-data/adma-step-data/batch-size");
                        if (!string.IsNullOrEmpty(batchSize))
                        {
                            Documenter.AddRow(table2, new object[] { stepIndex, "Batch Size (objects)", batchSize, 1000 });
                        }

                        var pageSize = (string)runProfileStep.XPathSelectElement("custom-data/adma-step-data/page-size");
                        if (!string.IsNullOrEmpty(pageSize))
                        {
                            Documenter.AddRow(table2, new object[] { stepIndex, "Page Size (objects)", pageSize, 1001 });
                        }

                        var timeout = (string)runProfileStep.XPathSelectElement("custom-data/adma-step-data/time-limit");
                        if (!string.IsNullOrEmpty(timeout))
                        {
                            Documenter.AddRow(table2, new object[] { stepIndex, "Timeout (seconds)", timeout, 1002 });
                        }
                    }

                    table.AcceptChanges();
                    table2.AcceptChanges();
                }
            }
            finally
            {
                Logger.Instance.WriteMethodExit("Run Profile Name: '{0}'. Pilot Config: '{1}'.", runProfileName, pilotConfig);
            }
        }
        /// <summary>
        /// Fills the AttributeTypeDescription summary dataset.
        /// </summary>
        protected void FillAttributeTypeDescriptionSummaryDiffgramDataSet()
        {
            Logger.Instance.WriteMethodEntry();

            try
            {
                var diffgramTable = this.DiffgramDataSet.Tables[0];

                var objectType = "AttributeTypeDescription";

                var changeObjects = this.GetChangedObjects(objectType);

                if (changeObjects.Count() == 0)
                {
                    this.WriteContentParagraph(string.Format(CultureInfo.CurrentUICulture, DocumenterResources.NoCustomizationsDetected, ServiceCommonDocumenter.GetObjectTypeDisplayName(objectType)));
                }
                else
                {
                    foreach (var changeObject in changeObjects)
                    {
                        this.CurrentChangeObject = changeObject;
                        var state = this.CurrentChangeObjectState;
                        var objectModificationType = state == "Create" ? DataRowState.Added : state == "Delete" ? DataRowState.Deleted : DataRowState.Modified;
                        var attributeObjectId      = this.GetAttributeChange("ObjectID");
                        var displayNameChange      = this.GetAttributeChange("DisplayName");
                        var systemNameChange       = this.GetAttributeChange("Name");
                        var dataTypeChange         = this.GetAttributeChange("DataType");
                        var descriptionChange      = this.GetAttributeChange("Description");

                        var objectId             = attributeObjectId.NewValue;
                        var objectIdOld          = attributeObjectId.OldValue;
                        var displayName          = displayNameChange.NewValue;
                        var displayNameOld       = displayNameChange.OldValue;
                        var displayNameMarkupNew = ServiceCommonDocumenter.GetJumpToBookmarkLocationMarkup(displayName, objectId, objectModificationType);
                        var displayNameMarkupOld = ServiceCommonDocumenter.GetJumpToBookmarkLocationMarkup(displayNameOld, objectIdOld, objectModificationType);
                        var systemName           = systemNameChange.NewValue;
                        var dataType             = dataTypeChange.NewValue;
                        var description          = descriptionChange.NewValue;
                        var descriptionOld       = descriptionChange.OldValue;

                        Documenter.AddRow(diffgramTable, new object[] { displayName, displayNameMarkupNew, systemName, dataType, description, objectModificationType, displayNameOld, displayNameMarkupOld, descriptionOld });
                    }

                    this.DiffgramDataSet = Documenter.SortDataSet(this.DiffgramDataSet);
                }
            }
            finally
            {
                Logger.Instance.WriteMethodExit();
            }
        }
Esempio n. 14
0
        /// <summary>
        /// Fills the connector GAL Exchange configuration data set.
        /// </summary>
        /// <param name="pilotConfig">if set to <c>true</c>, the pilot configuration is loaded. Otherwise, the production configuration is loaded.</param>
        protected void FillActiveDirectoryGALExchangeConfigurationDataSet(bool pilotConfig)
        {
            Logger.Instance.WriteMethodEntry("Pilot Config: '{0}'.", pilotConfig);

            try
            {
                var config  = pilotConfig ? this.PilotXml : this.ProductionXml;
                var dataSet = pilotConfig ? this.PilotDataSet : this.ProductionDataSet;

                var table  = dataSet.Tables[0];
                var table2 = dataSet.Tables[1];

                var connector = config.XPathSelectElement("//ma-data[name ='" + this.ConnectorName + "']");

                if (connector != null)
                {
                    var smtpDomains = connector.XPathSelectElements("private-configuration/adma-configuration/ui-data/galma/smtp-mail-domains/domain");

                    Documenter.AddRow(table, new object[] { 0, "SMTP mail suffix(s) for mailbox and mail objects in this forest" });
                    if (smtpDomains.Count() == 0)
                    {
                        Documenter.AddRow(table2, new object[] { 0, "None" });
                    }
                    else
                    {
                        foreach (var smtpDomain in smtpDomains)
                        {
                            Documenter.AddRow(table2, new object[] { 0, smtpDomain.Value });
                        }
                    }

                    var mailRouting = ((string)connector.XPathSelectElement("private-configuration/adma-configuration/ui-data/galma/mail-routing") ?? string.Empty).Equals("true", StringComparison.OrdinalIgnoreCase) ? "Yes" : "No";

                    Documenter.AddRow(table, new object[] { 1, "Route mail through this forest for all contacts created from contacts in this forest" });
                    Documenter.AddRow(table2, new object[] { 1, mailRouting });

                    var crossForestDelegation = ((string)connector.XPathSelectElement("private-configuration/adma-configuration/ui-data/galma/cross-forest-delegation") ?? string.Empty).Equals("true", StringComparison.OrdinalIgnoreCase) ? "Yes" : "No";

                    Documenter.AddRow(table, new object[] { 2, "Support cross-forest delegation (Exchange 2007 or 2010 only)" });
                    Documenter.AddRow(table2, new object[] { 2, crossForestDelegation });

                    table.AcceptChanges();
                }
            }
            finally
            {
                Logger.Instance.WriteMethodExit("Pilot Config: '{0}'.", pilotConfig);
            }
        }
        /// <summary>
        /// Fills the BindingDescription summary dataset.
        /// </summary>
        protected void FillBindingDescriptionSummaryDiffgramDataSet()
        {
            Logger.Instance.WriteMethodEntry();

            try
            {
                var diffgramTable = this.DiffgramDataSet.Tables[0];

                var objectType = "BindingDescription";

                var changeObjects = this.GetChangedObjects(objectType);

                if (changeObjects.Count() == 0)
                {
                    this.WriteContentParagraph(string.Format(CultureInfo.CurrentUICulture, DocumenterResources.NoCustomizationsDetected, ServiceCommonDocumenter.GetObjectTypeDisplayName(objectType)));
                }
                else
                {
                    foreach (var changeObject in changeObjects)
                    {
                        this.CurrentChangeObject = changeObject;
                        var state = this.CurrentChangeObjectState;
                        var objectModificationType     = state == "Create" ? DataRowState.Added : state == "Delete" ? DataRowState.Deleted : DataRowState.Modified;
                        var bindingDescriptionIdChange = this.GetAttributeChange("ObjectID");
                        var boundObjectTypeChange      = this.GetAttributeChange("BoundObjectType");
                        var boundAttributeTypeChange   = this.GetAttributeChange("BoundAttributeType");
                        var requiredChange             = this.GetAttributeChange("Required");

                        var boundObjectType             = boundObjectTypeChange.NewValueText;
                        var boundObjectTypeMarkup       = ServiceCommonDocumenter.GetJumpToBookmarkLocationMarkup(boundObjectType, bindingDescriptionIdChange.NewValue, objectModificationType);
                        var boundObjectTypeMarkupOld    = boundObjectTypeMarkup;
                        var boundAttributeType          = boundAttributeTypeChange.NewValueText;
                        var boundAttributeTypeId        = boundAttributeTypeChange.NewId;
                        var boundAttributeTypeMarkup    = ServiceCommonDocumenter.GetJumpToBookmarkLocationMarkup(boundAttributeType, boundAttributeTypeId, objectModificationType);
                        var boundAttributeTypeMarkupOld = boundAttributeTypeMarkup;
                        var required    = requiredChange.NewValue;
                        var oldRequired = requiredChange.OldValue;

                        Documenter.AddRow(diffgramTable, new object[] { boundObjectType, boundObjectTypeMarkup, boundAttributeType, boundAttributeTypeMarkup, required, objectModificationType, boundObjectTypeMarkupOld, boundAttributeTypeMarkupOld, oldRequired });
                    }

                    this.DiffgramDataSet = Documenter.SortDataSet(this.DiffgramDataSet);
                }
            }
            finally
            {
                Logger.Instance.WriteMethodExit();
            }
        }
        /// <summary>
        /// Fills the database delta configuration data set.
        /// </summary>
        /// <param name="pilotConfig">if set to <c>true</c>, the pilot configuration is loaded. Otherwise, the production configuration is loaded.</param>
        protected void FillDatabaseDeltaConfigurationDataSet(bool pilotConfig)
        {
            Logger.Instance.WriteMethodEntry("Pilot Config: '{0}'.", pilotConfig);

            try
            {
                var config  = pilotConfig ? this.PilotXml : this.ProductionXml;
                var dataSet = pilotConfig ? this.PilotDataSet : this.ProductionDataSet;

                var connector = config.XPathSelectElement(Documenter.GetConnectorXmlRootXPath(pilotConfig) + "/ma-data[name ='" + this.ConnectorName + "']");

                if (connector != null)
                {
                    var table = dataSet.Tables[0];

                    var deltaInfo = connector.XPathSelectElement("private-configuration/oledbma-configuration/mms-info/delta-info");

                    if (deltaInfo != null)
                    {
                        var changeColumn    = (string)deltaInfo.Element("change-column");
                        var changeAdd       = (string)deltaInfo.Element("add");
                        var changeModify    = (string)deltaInfo.Element("update");
                        var changeDelete    = (string)deltaInfo.Element("delete");
                        var attributeColumn = (string)deltaInfo.Element("attribute-column");
                        var attributeModify = (string)deltaInfo.Element("update-attribute");

                        Documenter.AddRow(table, new object[] { 1, "Change type attribute", changeColumn });
                        Documenter.AddRow(table, new object[] { 2, "Modify", changeModify });
                        Documenter.AddRow(table, new object[] { 3, "Add", changeAdd });
                        Documenter.AddRow(table, new object[] { 4, "Delete", changeDelete });
                        Documenter.AddRow(table, new object[] { 5, "Enable attribute-level change type synchronization", !string.IsNullOrEmpty(attributeColumn) ? "Yes" : "No" });

                        if (!string.IsNullOrEmpty(attributeColumn))
                        {
                            Documenter.AddRow(table, new object[] { 6, "Attribute-level synchronization column", attributeColumn });
                            Documenter.AddRow(table, new object[] { 7, "Attribute modify", attributeModify });
                        }
                    }

                    table.AcceptChanges();
                }
            }
            finally
            {
                Logger.Instance.WriteMethodExit("Pilot Config: '{0}'", pilotConfig);
            }
        }
Esempio n. 17
0
        /// <summary>
        /// Fills the extensible2 anchor configurations data set.
        /// </summary>
        /// <param name="pilotConfig">if set to <c>true</c>, the pilot configuration is loaded. Otherwise, the production configuration is loaded.</param>
        protected void FillExtensible2AnchorConfigurationsDataSet(bool pilotConfig)
        {
            Logger.Instance.WriteMethodEntry("Pilot Config: '{0}'.", pilotConfig);

            try
            {
                var config  = pilotConfig ? this.PilotXml : this.ProductionXml;
                var dataSet = pilotConfig ? this.PilotDataSet : this.ProductionDataSet;

                var connector = config.XPathSelectElement(Documenter.GetConnectorXmlRootXPath(pilotConfig) + "/ma-data[name ='" + this.ConnectorName + "']");

                if (connector != null)
                {
                    var table  = dataSet.Tables[0];
                    var table2 = dataSet.Tables[1];

                    var objectTypes = connector.XPathSelectElements("private-configuration/MAConfig/importing/per-class-settings/class");

                    foreach (var objectType in objectTypes)
                    {
                        var objectName = (string)objectType.Element("name");
                        Documenter.AddRow(table, new object[] { objectName });

                        var anchor = objectType.Element("anchor");
                        if (anchor != null)
                        {
                            var anchorAttributes = anchor.Elements("attribute");

                            var attributeIndex = -1;
                            foreach (var anchorAttribute in anchorAttributes)
                            {
                                ++attributeIndex;
                                Documenter.AddRow(table2, new object[] { objectName, (string)anchorAttribute, attributeIndex });
                            }
                        }
                    }

                    table.AcceptChanges();
                    table2.AcceptChanges();
                }
            }
            finally
            {
                Logger.Instance.WriteMethodExit("Pilot Config: '{0}'", pilotConfig);
            }
        }
Esempio n. 18
0
        /// <summary>
        /// Fills the connector GAL container configuration data set.
        /// </summary>
        /// <param name="pilotConfig">if set to <c>true</c>, the pilot configuration is loaded. Otherwise, the production configuration is loaded.</param>
        protected void FillActiveDirectoryGALContainerConfigurationDataSet(bool pilotConfig)
        {
            Logger.Instance.WriteMethodEntry("Pilot Config: '{0}'.", pilotConfig);

            try
            {
                var config  = pilotConfig ? this.PilotXml : this.ProductionXml;
                var dataSet = pilotConfig ? this.PilotDataSet : this.ProductionDataSet;

                var table  = dataSet.Tables[0];
                var table2 = dataSet.Tables[1];

                var connector = config.XPathSelectElement("//ma-data[name ='" + this.ConnectorName + "']");

                if (connector != null)
                {
                    var targetOu = (string)connector.XPathSelectElement("private-configuration/adma-configuration/ui-data/galma/target-ou");

                    Documenter.AddRow(table, new object[] { 0, "Destination container for contacts synchronized with this forest" });
                    Documenter.AddRow(table2, new object[] { 0, targetOu });

                    var sourceOus = connector.XPathSelectElements("private-configuration/adma-configuration/ui-data/galma/source-contact-ous/ou");

                    Documenter.AddRow(table, new object[] { 1, "Source containers with authoritative contacts in the forest" });

                    if (sourceOus.Count() == 0)
                    {
                        Documenter.AddRow(table2, new object[] { 1, "None" });
                    }
                    else
                    {
                        foreach (var sourceOu in sourceOus)
                        {
                            Documenter.AddRow(table2, new object[] { 1, sourceOu.Value });
                        }
                    }

                    table.AcceptChanges();
                }
            }
            finally
            {
                Logger.Instance.WriteMethodExit("Pilot Config: '{0}'.", pilotConfig);
            }
        }
Esempio n. 19
0
        /// <summary>
        /// Fills the active directory partition settings data set.
        /// </summary>
        /// <param name="partitionName">Name of the partition.</param>
        /// <param name="pilotConfig">if set to <c>true</c>, the pilot configuration is loaded. Otherwise, the production configuration is loaded.</param>
        protected void FillActiveDirectoryPartitionSettingsDataSet(string partitionName, bool pilotConfig)
        {
            Logger.Instance.WriteMethodEntry("Partion Name: '{0}'. Pilot Config: '{1}'.", partitionName, pilotConfig);

            try
            {
                var config  = pilotConfig ? this.PilotXml : this.ProductionXml;
                var dataSet = pilotConfig ? this.PilotDataSet : this.ProductionDataSet;

                var connector = config.XPathSelectElement(Documenter.GetConnectorXmlRootXPath(pilotConfig) + "/ma-data[name ='" + this.ConnectorName + "']");
                if (connector != null)
                {
                    var partition = connector.XPathSelectElement("ma-partition-data/partition[selected = 1 and name = '" + partitionName + "']");

                    if (partition != null)
                    {
                        var table  = dataSet.Tables[0];
                        var table2 = dataSet.Tables[1];

                        // Preferred Domain Controllers
                        Documenter.AddRow(table, new object[] { 0, "Preferred Domain Controllers" });
                        var preferredDomainControllers = partition.XPathSelectElements("custom-data/adma-partition-data/preferred-dcs/preferred-dc");

                        var pdcIndex = -1;
                        foreach (var preferredDomainController in preferredDomainControllers)
                        {
                            ++pdcIndex;
                            Documenter.AddRow(table2, new object[] { "Preferred Domain Controllers", pdcIndex, (string)preferredDomainController });
                        }

                        // Last Domain Controller used
                        var lastDomainControllerUsed = (string)partition.XPathSelectElement("custom-data/adma-partition-data/last-dc");
                        Documenter.AddRow(table, new object[] { 1, "Last domain controller used" });
                        Documenter.AddRow(table2, new object[] { "Last domain controller used", 0, lastDomainControllerUsed });

                        table.AcceptChanges();
                        table2.AcceptChanges();
                    }
                }
            }
            finally
            {
                Logger.Instance.WriteMethodExit("Partion Name: '{0}'. Pilot Config: '{1}'.", partitionName, pilotConfig);
            }
        }
Esempio n. 20
0
        /// <summary>
        /// Fills the extensible2 extension information data set.
        /// </summary>
        /// <param name="pilotConfig">if set to <c>true</c>, the pilot configuration is loaded. Otherwise, the production configuration is loaded.</param>
        protected void FillExtensible2ExtensionInformationDataSet(bool pilotConfig)
        {
            Logger.Instance.WriteMethodEntry("Pilot Config: '{0}'.", pilotConfig);

            try
            {
                var config  = pilotConfig ? this.PilotXml : this.ProductionXml;
                var dataSet = pilotConfig ? this.PilotDataSet : this.ProductionDataSet;

                var connector = config.XPathSelectElement("//ma-data[name ='" + this.ConnectorName + "']");

                if (connector != null)
                {
                    var table = dataSet.Tables[0];

                    var importEnabled      = (string)connector.XPathSelectElement("private-configuration/MAConfig/extension-config/import-enabled") == "1";
                    var exportEnabled      = (string)connector.XPathSelectElement("private-configuration/MAConfig/extension-config/export-enabled") == "1";
                    var stepTypesSupported = importEnabled && exportEnabled ? "Import and Export" : importEnabled ? "Import Only" : exportEnabled ? "Export Only" : "??";

                    Documenter.AddRow(table, new object[] { 1, "Step Types supported", stepTypesSupported });

                    if (importEnabled)
                    {
                        var importMode = (string)connector.XPathSelectElement("private-configuration/MAConfig/extension-config/import-mode");
                        Documenter.AddRow(table, new object[] { 2, "Import Mode", importMode });
                    }

                    if (exportEnabled)
                    {
                        var exportMode = (string)connector.XPathSelectElement("private-configuration/MAConfig/extension-config/export-mode");
                        Documenter.AddRow(table, new object[] { 3, "Export Mode", exportMode });
                    }

                    var extensionDll = (string)connector.XPathSelectElement("private-configuration/MAConfig/extension-config/filename");
                    Documenter.AddRow(table, new object[] { 4, "Connected data source extension name", extensionDll });

                    table.AcceptChanges();
                }
            }
            finally
            {
                Logger.Instance.WriteMethodExit("Pilot Config: '{0}'", pilotConfig);
            }
        }
        /// <summary>
        /// Fills the database multi-value data set.
        /// </summary>
        /// <param name="pilotConfig">if set to <c>true</c>, the pilot configuration is loaded. Otherwise, the production configuration is loaded.</param>
        protected void FillDatabaseMultiValueConfigurationDataSet(bool pilotConfig)
        {
            Logger.Instance.WriteMethodEntry("Pilot Config: '{0}'.", pilotConfig);

            try
            {
                var config  = pilotConfig ? this.PilotXml : this.ProductionXml;
                var dataSet = pilotConfig ? this.PilotDataSet : this.ProductionDataSet;

                var connector = config.XPathSelectElement(Documenter.GetConnectorXmlRootXPath(pilotConfig) + "/ma-data[name ='" + this.ConnectorName + "']");

                if (connector != null)
                {
                    var table = dataSet.Tables[0];

                    var multiValueInfo = connector.XPathSelectElement("private-configuration/oledbma-configuration/mms-info/multivalued-info");

                    if (multiValueInfo != null)
                    {
                        var attributeColumn            = (string)multiValueInfo.Element("attribute-column");
                        var attributeColumnString      = (string)multiValueInfo.Element("string-column");
                        var attributeColumnLargeString = (string)multiValueInfo.Element("long-string-column");
                        var attributeColumnBinary      = (string)multiValueInfo.Element("binary-column");
                        var attributeColumnLargeBinary = (string)multiValueInfo.Element("long-binary-column");
                        var attributeColumnNumeric     = (string)multiValueInfo.Element("numeric-column");

                        Documenter.AddRow(table, new object[] { 1, "Attribute name column", attributeColumn });
                        Documenter.AddRow(table, new object[] { 2, "String attribute column", attributeColumnString });
                        Documenter.AddRow(table, new object[] { 3, "Large string attribute column", attributeColumnLargeString });
                        Documenter.AddRow(table, new object[] { 4, "Binary attribute column", attributeColumnBinary });
                        Documenter.AddRow(table, new object[] { 5, "Large Binary attribute column", attributeColumnLargeBinary });
                        Documenter.AddRow(table, new object[] { 6, "Number attribute column", attributeColumnNumeric });
                    }

                    table.AcceptChanges();
                }
            }
            finally
            {
                Logger.Instance.WriteMethodExit("Pilot Config: '{0}'", pilotConfig);
            }
        }
        /// <summary>
        /// Fills the FIM object type mapping data set.
        /// </summary>
        /// <param name="pilotConfig">if set to <c>true</c>, the pilot configuration is loaded. Otherwise, the production configuration is loaded.</param>
        protected void FillFIMObjectTypeMappingsDataSet(bool pilotConfig)
        {
            Logger.Instance.WriteMethodEntry("Pilot Config: '{0}'.", pilotConfig);

            try
            {
                var config  = pilotConfig ? this.PilotXml : this.ProductionXml;
                var dataSet = pilotConfig ? this.PilotDataSet : this.ProductionDataSet;

                var connector = config.XPathSelectElement(Documenter.GetConnectorXmlRootXPath(pilotConfig) + "/ma-data[name ='" + this.ConnectorName + "']");

                if (connector != null)
                {
                    var table = dataSet.Tables[0];

                    var projectionRules = from projectionRule in connector.XPathSelectElements("projection/class-mapping")
                                          let sourceObjectType = (string)projectionRule.Attribute("cd-object-type")
                                                                 orderby sourceObjectType
                                                                 select projectionRule;

                    if (projectionRules.Count() == 0)
                    {
                        return;
                    }

                    foreach (var projectionRule in projectionRules)
                    {
                        var sourceObjectType    = (string)projectionRule.Attribute("cd-object-type");
                        var metaverseObjectType = (string)projectionRule.Element("mv-object-type") ?? string.Empty;

                        Documenter.AddRow(table, new object[] { sourceObjectType, metaverseObjectType });
                    }

                    table.AcceptChanges();
                }
            }
            finally
            {
                Logger.Instance.WriteMethodExit("Pilot Config: '{0}'", pilotConfig);
            }
        }
        /// <summary>
        /// Fills the active directory container credential settings data set.
        /// </summary>
        /// <param name="partitionName">Name of the partition.</param>
        /// <param name="pilotConfig">if set to <c>true</c>, the pilot configuration is loaded. Otherwise, the production configuration is loaded.</param>
        protected void FillActiveDirectoryContainerCredentialSettingsDataSet(string partitionName, bool pilotConfig)
        {
            Logger.Instance.WriteMethodEntry("Partion Name: '{0}'. Pilot Config: '{1}'.", partitionName, pilotConfig);

            try
            {
                var config  = pilotConfig ? this.PilotXml : this.ProductionXml;
                var dataSet = pilotConfig ? this.PilotDataSet : this.ProductionDataSet;

                var connector = config.XPathSelectElement("//ma-data[name ='" + this.ConnectorName + "']");

                if (connector != null)
                {
                    var partition = connector.XPathSelectElement("ma-partition-data/partition[selected = 1 and name = '" + partitionName + "']");

                    if (partition != null)
                    {
                        var table = dataSet.Tables[0];

                        var loginUser   = (string)partition.XPathSelectElement("custom-data/adma-partition-data/login-user");
                        var loginDomain = (string)partition.XPathSelectElement("custom-data/adma-partition-data/login-domain");

                        if (string.IsNullOrEmpty(loginUser))
                        {
                            Documenter.AddRow(table, new object[] { "Use default forest credentials", "Yes" });
                        }
                        else
                        {
                            Documenter.AddRow(table, new object[] { "Alternate credentials for this directory partition", loginDomain + @"\" + loginUser });
                        }

                        table.AcceptChanges();
                    }
                }
            }
            finally
            {
                Logger.Instance.WriteMethodExit("Partion Name: '{0}'. Pilot Config: '{1}'.", partitionName, pilotConfig);
            }
        }
Esempio n. 24
0
        /// <summary>
        /// Fills the active directory connector parameters data set.
        /// </summary>
        /// <param name="pilotConfig">if set to <c>true</c>, the pilot configuration is loaded. Otherwise, the production configuration is loaded.</param>
        protected void FillActiveDirectoryConnectorParametersDataSet(bool pilotConfig)
        {
            Logger.Instance.WriteMethodEntry("Pilot Config: '{0}'.", pilotConfig);

            try
            {
                var config  = pilotConfig ? this.PilotXml : this.ProductionXml;
                var dataSet = pilotConfig ? this.PilotDataSet : this.ProductionDataSet;

                var connector = config.XPathSelectElement(Documenter.GetConnectorXmlRootXPath(pilotConfig) + "/ma-data[name ='" + this.ConnectorName + "']");

                if (connector != null)
                {
                    var table = dataSet.Tables[0];

                    var parameters = connector.XPathSelectElements("private-configuration/adma-configuration/parameter-values/parameter");

                    // Sort by name
                    parameters                                                     = from parameter in parameters
                                                      let name                     = (string)parameter.Attribute("name")
                                                                           let use = (string)parameter.Attribute("use")
                                                                                     where string.Equals(use, "global", StringComparison.OrdinalIgnoreCase)
                                                                                     orderby name
                                                                                     select parameter;

                    for (var parameterIndex = 0; parameterIndex < parameters.Count(); ++parameterIndex)
                    {
                        var parameter = parameters.ElementAt(parameterIndex);
                        Documenter.AddRow(table, new object[] { (string)parameter.Attribute("name"), (string)parameter });
                    }

                    table.AcceptChanges();
                }
            }
            finally
            {
                Logger.Instance.WriteMethodExit("Pilot Config: '{0}'", pilotConfig);
            }
        }
        /// <summary>
        /// Fills the connector password management configuration data set.
        /// </summary>
        /// <param name="pilotConfig">if set to <c>true</c>, the pilot configuration is loaded. Otherwise, the production configuration is loaded.</param>
        protected void FillActiveDirectoryExchangeProvisioningConfigurationDataSet(bool pilotConfig)
        {
            Logger.Instance.WriteMethodEntry("Pilot Config: '{0}'.", pilotConfig);

            try
            {
                var config  = pilotConfig ? this.PilotXml : this.ProductionXml;
                var dataSet = pilotConfig ? this.PilotDataSet : this.ProductionDataSet;

                var table = dataSet.Tables[0];

                var connector = config.XPathSelectElement("//ma-data[name ='" + this.ConnectorName + "']");

                if (connector != null)
                {
                    var exchangeUri = (string)connector.XPathSelectElement("private-configuration/adma-configuration/cd-extension/server-name");

                    if (string.IsNullOrEmpty(exchangeUri))
                    {
                        Documenter.AddRow(table, new object[] { "Provision for", "None" });
                    }
                    else
                    {
                        var exchangeVersion = (string)connector.XPathSelectElement("private-configuration/adma-configuration/cd-extension/exchange-version");

                        Documenter.AddRow(table, new object[] { "Provision for", exchangeVersion });

                        var exchangeUriLabel = exchangeVersion.Equals("Exchange 2007", StringComparison.OrdinalIgnoreCase) ? "Exchange 2007 RUS Server" : exchangeVersion.Equals("Exchange 2010", StringComparison.OrdinalIgnoreCase) ? "Exchange 2010 RPS URI" : exchangeVersion;
                        Documenter.AddRow(table, new object[] { exchangeUriLabel, exchangeUri });
                    }

                    table.AcceptChanges();
                }
            }
            finally
            {
                Logger.Instance.WriteMethodExit("Pilot Config: '{0}'.", pilotConfig);
            }
        }
        /// <summary>
        /// Fills the FIM connectivity information data set.
        /// </summary>
        /// <param name="pilotConfig">if set to <c>true</c>, the pilot configuration is loaded. Otherwise, the production configuration is loaded.</param>
        protected void FillFIMConnectivityInformationDataSet(bool pilotConfig)
        {
            Logger.Instance.WriteMethodEntry("Pilot Config: '{0}'.", pilotConfig);

            try
            {
                var config  = pilotConfig ? this.PilotXml : this.ProductionXml;
                var dataSet = pilotConfig ? this.PilotDataSet : this.ProductionDataSet;

                var connector = config.XPathSelectElement(Documenter.GetConnectorXmlRootXPath(pilotConfig) + "/ma-data[name ='" + this.ConnectorName + "']");

                if (connector != null)
                {
                    var table = dataSet.Tables[0];

                    var server         = (string)connector.XPathSelectElement("private-configuration/fimma-configuration/connection-info/server");
                    var database       = (string)connector.XPathSelectElement("private-configuration/fimma-configuration/connection-info/databasename");
                    var serviceHost    = (string)connector.XPathSelectElement("private-configuration/fimma-configuration/connection-info/serviceHost");
                    var integratedAuth = ((string)connector.XPathSelectElement("private-configuration/fimma-configuration/connection-info/authentication") ?? string.Empty).Equals("integrated", StringComparison.OrdinalIgnoreCase);
                    var userName       = (string)connector.XPathSelectElement("private-configuration/fimma-configuration/connection-info/user");
                    var domain         = (string)connector.XPathSelectElement("private-configuration/fimma-configuration/connection-info/domain");

                    Documenter.AddRow(table, new object[] { 1, "Server", server });
                    Documenter.AddRow(table, new object[] { 2, "Database", database });
                    Documenter.AddRow(table, new object[] { 3, "FIM Service base address", serviceHost });
                    Documenter.AddRow(table, new object[] { 4, "Authentication Mode", integratedAuth ? "Windows integrated authentication" : "SQL authentication" });
                    Documenter.AddRow(table, new object[] { 5, "User name", userName });
                    Documenter.AddRow(table, new object[] { 6, "Password", "*****" });
                    Documenter.AddRow(table, new object[] { 7, "Domain", domain });

                    table.AcceptChanges();
                }
            }
            finally
            {
                Logger.Instance.WriteMethodExit("Pilot Config: '{0}'", pilotConfig);
            }
        }
Esempio n. 27
0
        /// <summary>
        /// Fills the database multi-value attribute settings data set.
        /// </summary>
        /// <param name="pilotConfig">if set to <c>true</c>, the pilot configuration is loaded. Otherwise, the production configuration is loaded.</param>
        protected void FillDatabaseMultiValueAttributeSettingsDataSet(bool pilotConfig)
        {
            Logger.Instance.WriteMethodEntry("Pilot Config: '{0}'.", pilotConfig);

            try
            {
                var config  = pilotConfig ? this.PilotXml : this.ProductionXml;
                var dataSet = pilotConfig ? this.PilotDataSet : this.ProductionDataSet;

                var connector = config.XPathSelectElement("//ma-data[name ='" + this.ConnectorName + "']");

                if (connector != null)
                {
                    var table = dataSet.Tables[0];

                    var multiValueInfo = connector.XPathSelectElement("private-configuration/oledbma-configuration/mms-info/multivalued-info");

                    if (multiValueInfo != null)
                    {
                        var columns = connector.XPathSelectElements("private-configuration/oledbma-configuration/mms-info/multivalued-info/multivalued-columns/column");
                        foreach (var column in columns)
                        {
                            var name = (string)column.Element("name");
                            var type = column.Element("mms-type") != null && (string)column.Element("mms-type").Attribute("dn") == "1" ? "Reference DN" : (string)column.Element("mms-type");
                            Documenter.AddRow(table, new object[] { name, type });
                        }
                    }

                    table.AcceptChanges();
                }
            }
            finally
            {
                Logger.Instance.WriteMethodExit("Pilot Config: '{0}'", pilotConfig);
            }
        }
        /// <summary>
        /// Fills the metaverse object deletion rule data set.
        /// </summary>
        /// <param name="objectType">Type of the object.</param>
        /// <param name="pilotConfig">if set to <c>true</c>, the pilot configuration is loaded. Otherwise, the production configuration is loaded.</param>
        private void FillMetaverseObjectDeletionRuleDataSet(string objectType, bool pilotConfig)
        {
            Logger.Instance.WriteMethodEntry("Pilot Config: '{0}'.", pilotConfig);

            try
            {
                var config  = pilotConfig ? this.PilotXml : this.ProductionXml;
                var dataSet = pilotConfig ? this.PilotDataSet : this.ProductionDataSet;

                var table  = dataSet.Tables[0];
                var table2 = dataSet.Tables[1];
                var table3 = dataSet.Tables[2];

                Documenter.AddRow(table, new object[] { objectType });

                var deletionRules = config.XPathSelectElements("//SynchronizationRules/synchronizationRule[direction = 'Inbound' " + Documenter.SyncRuleDisabledCondition + " and (linkType = 'Provision' or  linkType = 'StickyJoin') and targetObjectType = '" + objectType + "']");

                for (var deletionRuleIndex = 0; deletionRuleIndex < deletionRules.Count(); ++deletionRuleIndex)
                {
                    var deletionRule         = deletionRules.ElementAt(deletionRuleIndex);
                    var deletionRuleName     = (string)deletionRule.Element("name");
                    var deletionRuleGuid     = (string)deletionRule.Element("id");
                    var deletionRuleLinkType = (string)deletionRule.Element("linkType");
                    var connectorGuid        = (string)deletionRule.Element("connector");
                    var connectorName        = from connectorData in config.XPathSelectElements("//ma-data")
                                               where ((string)connectorData.Element("id") ?? string.Empty).Equals(connectorGuid, StringComparison.OrdinalIgnoreCase)
                                               select(string) connectorData.Element("name");

                    var row2 = table2.NewRow();

                    row2[0] = objectType;
                    row2[1] = connectorName.FirstOrDefault();
                    row2[2] = connectorGuid;

                    // Expected that this is likely to result in Contraint violation
                    // so make an explict check than unnesessary error getting logged.
                    if (!table2.Rows.Contains(new[] { row2[0], row2[1] }))
                    {
                        Documenter.AddRow(table2, row2);
                    }

                    var row3 = table3.NewRow();

                    row3[0] = objectType;
                    row3[1] = connectorName.FirstOrDefault();
                    row3[2] = deletionRuleName;
                    row3[3] = deletionRuleLinkType;
                    row3[4] = connectorGuid;
                    row3[5] = deletionRuleGuid;

                    Documenter.AddRow(table3, row3);
                }

                table.AcceptChanges();
                table2.AcceptChanges();
                table3.AcceptChanges();
            }
            finally
            {
                Logger.Instance.WriteMethodExit("Pilot Config: '{0}'.", pilotConfig);
            }
        }
        /// <summary>
        /// Fills the metaverse object type data set.
        /// </summary>
        /// <param name="pilotConfig">if set to <c>true</c>, the pilot configuration is loaded. Otherwise, the production configuration is loaded.</param>
        private void FillMetaverseObjectTypeDataSet(bool pilotConfig)
        {
            Logger.Instance.WriteMethodEntry("Pilot Config: '{0}'.", pilotConfig);

            try
            {
                var config  = pilotConfig ? this.PilotXml : this.ProductionXml;
                var dataSet = pilotConfig ? this.PilotDataSet : this.ProductionDataSet;

                var table  = dataSet.Tables[0];
                var table2 = dataSet.Tables[1];
                var table3 = dataSet.Tables[2];

                var attributes = config.XPathSelectElements("//mv-data//dsml:class[dsml:name = '" + this.currentObjectType + "' ]/dsml:attribute", Documenter.NamespaceManager);

                // Sort by name
                attributes                       = from attribute in attributes
                                        let name = (string)attribute.Attribute("ref")
                                                   orderby name
                                                   select attribute;

                for (var attributeIndex = 0; attributeIndex < attributes.Count(); ++attributeIndex)
                {
                    var attribute     = attributes.ElementAt(attributeIndex);
                    var attributeName = ((string)attribute.Attribute("ref") ?? string.Empty).Trim('#');

                    // Set Logger call context items
                    Logger.SetContextItem(MetaverseDocumenter.LoggerContextItemMetaverseAttribute, attributeName);

                    Logger.Instance.WriteInfo("Processing Attribute Information.");

                    var attributeInfo = config.XPathSelectElement("//mv-data//dsml:attribute-type[dsml:name = '" + attributeName + "']", Documenter.NamespaceManager);

                    var attributeSyntax = (string)attributeInfo.Element(Documenter.DsmlNamespace + "syntax");

                    var row = table.NewRow();

                    row[0] = attributeName;
                    row[1] = Documenter.GetAttributeType(attributeSyntax, (string)attributeInfo.Attribute(Documenter.MmsDsmlNamespace + "indexable"));
                    row[2] = ((string)attributeInfo.Attribute("single-value") ?? string.Empty).Equals("true", StringComparison.OrdinalIgnoreCase) ? "No" : "Yes";
                    row[3] = ((string)attributeInfo.Attribute(Documenter.MmsDsmlNamespace + "indexed") ?? string.Empty).Equals("true", StringComparison.OrdinalIgnoreCase) ? "Yes" : "No";

                    Documenter.AddRow(table, row);

                    Logger.Instance.WriteVerbose("Processed Attribute Information.");

                    // Fetch Sync Rules
                    var syncRules = config.XPathSelectElements("//synchronizationRule[targetObjectType = '" + this.currentObjectType + "' and direction = 'Inbound' " + Documenter.SyncRuleDisabledCondition + " and attribute-mappings/mapping/dest = '" + attributeName + "']");
                    syncRules = from syncRule in syncRules
                                let precedence = (int)syncRule.Element("precedence")
                                                 orderby precedence
                                                 select syncRule;

                    for (var syncRuleIndex = 0; syncRuleIndex < syncRules.Count(); ++syncRuleIndex)
                    {
                        var syncRule = syncRules.ElementAt(syncRuleIndex);
                        var row2     = table2.NewRow();
                        row2[0] = attributeName;
                        row2[1] = syncRuleIndex + 1; // Care only about the precedence relative rank here than actual value
                        var connector = ((string)syncRule.Element("connector") ?? string.Empty).ToUpperInvariant();

                        var connectorName = (string)config.XPathSelectElement("//Connectors/ma-data[translate(id, '" + Documenter.LowercaseLetters + "', '" + Documenter.UppercaseLetters + "') = '" + connector + "']/name");
                        var syncRuleName  = (string)syncRule.Element("name");
                        row2[2] = connectorName;
                        row2[3] = syncRuleName;

                        Logger.Instance.WriteVerbose("Processing Sync Rule Info for Connector: '{0}'. Sync Rule: '{1}'.", connectorName, syncRuleName);

                        var mappingExpression      = syncRule.XPathSelectElement("attribute-mappings/mapping[dest = '" + attributeName + "']/expression");
                        var mappingSourceAttribute = syncRule.XPathSelectElement("attribute-mappings/mapping[dest = '" + attributeName + "']/src/attr");
                        var mappingSource          = syncRule.XPathSelectElement("attribute-mappings/mapping[dest = '" + attributeName + "']/src");

                        row2[4] = (string)mappingExpression ?? (string)mappingSourceAttribute ?? (string)mappingSource ?? "??";
                        row2[5] = connector;
                        row2[6] = (string)syncRule.Element("id");

                        Documenter.AddRow(table2, row2);

                        Logger.Instance.WriteVerbose("Processed Sync Rule Info for Connector: '{0}'. Sync Rule: '{1}'.", connectorName, syncRuleName);

                        // Fetch Sync Rule Scoping Conditions
                        var conditions = syncRule.XPathSelectElements("synchronizationCriteria/conditions");
                        for (var conditionIndex = 0; conditionIndex < conditions.Count(); ++conditionIndex)
                        {
                            Logger.Instance.WriteVerbose("Processing Sync Rule Scope for Connector: '{0}'. Sync Rule: '{1}'.", connectorName, syncRuleName);

                            var condition = conditions.ElementAt(conditionIndex);
                            var scopes    = condition.Elements("scope");
                            for (var scopeIndex = 0; scopeIndex < scopes.Count(); ++scopeIndex)
                            {
                                var scope = scopes.ElementAt(scopeIndex);
                                var row3  = table3.NewRow();
                                row3[0] = attributeName;
                                row3[1] = connectorName;
                                row3[2] = syncRuleName;
                                row3[3] = conditionIndex;
                                row3[4] = scopeIndex;
                                row3[5] = (string)scope.Element("csAttribute");
                                row3[6] = (string)scope.Element("csOperator");
                                row3[7] = (string)scope.Element("csValue");
                                row3[8] = connector;
                                row3[9] = (string)syncRule.Element("id");

                                Documenter.AddRow(table3, row3);
                            }

                            Logger.Instance.WriteVerbose("Processed Sync Rule Scope for Connector: '{0}'. Sync Rule: '{1}'.", connectorName, syncRuleName);
                        }
                    }
                }

                table.AcceptChanges();
                table2.AcceptChanges();
                table3.AcceptChanges();
            }
            finally
            {
                Logger.Instance.WriteMethodExit("Pilot Config: '{0}'.", pilotConfig);

                // Clear Logger call context items
                Logger.ClearContextItem(MetaverseDocumenter.LoggerContextItemMetaverseAttribute);
            }
        }
        protected DataTable GetExtensible2ConfigParametersTable(IEnumerable <XElement> parameterDefinitions, IEnumerable <XElement> parameterValues)
        {
            Logger.Instance.WriteMethodEntry();

            try
            {
                var parametersTable = new DataTable("ConfigParametersTable")
                {
                    Locale = CultureInfo.InvariantCulture
                };

                var column1 = new DataColumn("DisplayOrder", typeof(int));
                var column2 = new DataColumn("Setting");
                var column3 = new DataColumn("Configuration");
                var column4 = new DataColumn("Encrypted?");

                parametersTable.Columns.Add(column1);
                parametersTable.Columns.Add(column2);
                parametersTable.Columns.Add(column3);
                parametersTable.Columns.Add(column4);
                parametersTable.PrimaryKey = new[] { column1, column2 };

                if (parameterDefinitions != null && parameterValues != null)
                {
                    for (var parameterIndex = 0; parameterIndex < parameterDefinitions.Count(); ++parameterIndex)
                    {
                        var parameterDefinition = parameterDefinitions.ElementAt(parameterIndex);
                        var parameterName       = (string)parameterDefinition.Element("name");
                        var parameterType       = (string)parameterDefinition.Element("type") ?? string.Empty;
                        var parameterValue      = string.Empty;

                        foreach (var parameter in parameterValues)
                        {
                            if ((string)parameter.Attribute("name") == parameterName)
                            {
                                parameterValue = (string)parameter;
                                break;
                            }
                        }

                        var encrypted = parameterType.StartsWith("encrypted", StringComparison.OrdinalIgnoreCase);

                        switch (parameterType.ToUpperInvariant())
                        {
                        case "FILE":
                            try
                            {
                                parameterValue = Encoding.UTF8.GetString(Convert.FromBase64String(parameterValue));
                            }
                            catch (Exception e)
                            {
                                Logger.Instance.WriteError(e.ToString());
                            }

                            break;

                        case "CHECKBOX":
                            parameterValue = parameterValue.Equals("1", StringComparison.OrdinalIgnoreCase) || parameterValue.Equals("true", StringComparison.OrdinalIgnoreCase) ? "Yes" : "No";
                            break;
                        }

                        Documenter.AddRow(parametersTable, new object[] { parameterIndex, parameterName, encrypted ? "******" : parameterValue, encrypted ? "Yes" : "No" });
                    }

                    parametersTable.AcceptChanges();
                }

                return(parametersTable);
            }
            finally
            {
                Logger.Instance.WriteMethodEntry();
            }
        }