Esempio n. 1
0
        public override void Connect(IReadOnlyCollection <Component> instanceComponents)
        {
            Logger.Instance.Log(LogLevel.Info, "\nConfiguring component ({0}) to work with component({1}):\n", ConversionComponentId, DatabaseComponentId);

            ConversionComponent conversionComponent = instanceComponents.Single(c => c.Id == ConversionComponentId) as ConversionComponent;
            DatabaseComponent   databaseComponent   = instanceComponents.Single(c => c.Id == DatabaseComponentId) as DatabaseComponent;

            HttpServerConnection connection = ServerConnectionFactory.GetServerConnection(databaseComponent);
            Innovator            innovator  = new Innovator(connection);

            Item conversionItem = innovator.newItem("ConversionServer", "merge");

            conversionItem.setAttribute("where", string.Format(CultureInfo.InvariantCulture, "[name]='{0}'", conversionComponent.Name));
            conversionItem.setProperty("name", conversionComponent.Name);
            conversionItem.setProperty("url", conversionComponent.ConversionServiceAsmxUrl);
            conversionItem.setProperty("impersonation_user_id", "EB2D5AA617FB41A28F081345B8B5FECB");
            conversionItem = conversionItem.apply();

            if (conversionItem.isError())
            {
                throw new ConnectException(
                          string.Format(CultureInfo.InvariantCulture, "Couldn't connect conversion component '{0}' with database '{1}'. {2}",
                                        ConversionComponentId,
                                        DatabaseComponentId,
                                        conversionItem.ToString()));
            }

            conversionComponent.TargetFileSystem.XmlHelper.XmlPoke(conversionComponent.PathToConfig, "/configuration/ConversionServer/InnovatorServer/@url", databaseComponent.InnovatorServerAspxUrl);
        }
Esempio n. 2
0
        public override void Connect(IReadOnlyCollection <Component> instanceComponents)
        {
            Logger.Instance.Log(LogLevel.Info, "\nConfiguring component ({0}) to work with component({1}):\n", VaultComponentId, DatabaseComponentId);

            VaultComponent    vaultComponent    = instanceComponents.Single(c => c.Id == VaultComponentId) as VaultComponent;
            DatabaseComponent databaseComponent = instanceComponents.Single(c => c.Id == DatabaseComponentId) as DatabaseComponent;

            HttpServerConnection connection = ServerConnectionFactory.GetServerConnection(databaseComponent);
            Innovator            innovator  = new Innovator(connection);

            Item vaultItem = innovator.newItem("Vault", "merge");

            vaultItem.setAttribute("where", string.Format(CultureInfo.InvariantCulture, "[name]='{0}'", vaultComponent.Name));
            vaultItem.setProperty("name", vaultComponent.Name);
            vaultItem.setProperty("vault_url_pattern", vaultComponent.VaultServerAspxUrl);
            vaultItem = vaultItem.apply();

            if (vaultItem.isError())
            {
                throw new ConnectException(
                          string.Format(CultureInfo.InvariantCulture, "Couldn't connect vault component '{0}' with database '{1}'. {2}",
                                        VaultComponentId,
                                        DatabaseComponentId,
                                        vaultItem.ToString()));
            }

            vaultComponent.TargetFileSystem.XmlHelper.XmlPoke(vaultComponent.PathToConfig, "/configuration/appSettings/add[@key = 'InnovatorServerUrl']/@value", databaseComponent.InnovatorServerAspxUrl);
        }
        public void ApplyAml(string aml)
        {
            HttpServerConnection connection = ServerConnectionFactory.GetServerConnection(this);
            Innovator            innovator  = new Innovator(connection);
            Item result = innovator.applyAML(aml);

            if (result.isError())
            {
                Logger.Instance.Log(LogLevel.Error, result.ToString());

                throw new Exception(string.Format(CultureInfo.InvariantCulture, "Failed to apply AML {0}.", aml));
            }
        }
Esempio n. 4
0
        internal static void CheckAmlApplicability(DatabaseComponent databaseComponent)
        {
            Logger.Instance.Log(LogLevel.Info, "Checking that we can apply AML to '{0}' component", databaseComponent.Id);

            HttpServerConnection connection = ServerConnectionFactory.GetServerConnection(databaseComponent);
            Innovator            innovator  = new Innovator(connection);
            string aml    = "<AML />";
            Item   result = innovator.applyAML(aml);

            if (result.isError())
            {
                Logger.Instance.Log(LogLevel.Error, result.ToString());

                throw new ValidationException(string.Format(CultureInfo.InvariantCulture, "Failed to apply AML: {0}.", aml));
            }

            Logger.Instance.Log(LogLevel.Info, "OK");
        }