示例#1
0
        protected override void DoInitialise(SitecoreInitialiseArgument argument, InitialiseProjectContext context)
        {
            var identityCertificatePassword = NonceService.Generate();

            var identityCertificate = _certificateService.CreateSelfSignedCertificate("dimmy.sitecore.plugin", "localhost");

            var x509IdentityCertificate2Export       = identityCertificate.Export(X509ContentType.Pfx, identityCertificatePassword);
            var x509IdentityCertificate2Base64String = Convert.ToBase64String(x509IdentityCertificate2Export);

            context.PublicVariables.Add("DevelopmentHelper.HookName", argument.DevelopmentHelperHookName);

            context.PrivateVariables.Add("Sitecore.AdminPassword", NonceService.Generate());
            context.PrivateVariables.Add("Sitecore.MediaRequestProtectionSharedSecret", NonceService.Generate());
            context.PrivateVariables.Add("Sitecore.Id.Secret", NonceService.Generate());
            context.PrivateVariables.Add("Sitecore.Id.CertificatePassword", identityCertificatePassword);
            context.PrivateVariables.Add("Sitecore.Id.Certificate", x509IdentityCertificate2Base64String);
            context.PrivateVariables.Add("Sitecore.Rep.ApiKey", NonceService.Generate());
            context.PrivateVariables.Add("Sitecore.Xc.Engine.Authoring.ClientId", NonceService.Generate());


            context.PublicVariables.Add("Sitecore.Id.HostName", argument.IdHostName);
            context.PublicVariables.Add("Sitecore.Cd.HostName", argument.CdHostName);
            context.PublicVariables.Add("Sitecore.Cm.HostName", argument.CmHostName);

            context.PublicVariables.Add("WindowsVersion", argument.WindowsVersion);

            context.PublicVariables.Add("Sitecore.Xc.GlobalTrustedConnection",
                                        argument.XcGlobalTrustedConnection.ToString());
            context.PublicVariables.Add("Sitecore.Xc.SharedTrustedConnection",
                                        argument.XcSharedTrustedConnection.ToString());

            context.PublicVariables.Add("Sitecore.Xc.Engine.GlobalDatabaseName", argument.XcEngineGlobalDatabaseName);
            context.PublicVariables.Add("Sitecore.Xc.Engine.SharedDatabaseName", argument.XcEngineSharedDatabaseName);

            context.PublicVariables.Add("Sitecore.Xc.Braintree.Environment", argument.XcBraintreeEnvironment);
            context.PublicVariables.Add("Sitecore.Xc.Braintree.MerchantId", argument.XcBraintreeMerchantId);
            context.PublicVariables.Add("Sitecore.Xc.Braintree.PublicKey", argument.XcBraintreePublicKey);
            context.PublicVariables.Add("Sitecore.Xc.Braintree.PrivateKey", argument.XcBraintreePrivateKey);
        }