Ejemplo n.º 1
0
        public static void DeploySite(ModelNode model)
        {
            var clientContext    = GetClientcontext();
            var provisionService = new CSOMProvisionService();

            provisionService.RegisterModelHandlers(typeof(TaxonomyTermModelHandler).Assembly);
            provisionService.DeploySiteModel(clientContext, model);
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            using (ClientContext context = Support.Helpers.GetClientContext())
            {
                context.Load(context.Web);
                context.ExecuteQuery();
                var title = context.Web.Title;
                var url   = context.Web.Url;

                Console.WriteLine("Connected to " + url);


                var service = new CSOMProvisionService();
                service.RegisterModelHandlers(typeof(NintexFormHandler).Assembly);

                WebModel.Provision(context, service);
                //service.PreDeploymentServices.Add(new DefaultRequiredPropertiesValidationService());
            }
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            CommandLineUtils.ApplyValuesFromcommandLine(args);
            var targetSiteUrl = ConfigurationManager.AppSettings.Get("targetSiteUrl");

            using (ClientContext context = new ClientContext(targetSiteUrl))
            {
                //context.RequestTimeout = Timeout.Infinite;
                var username        = ConfigurationManager.AppSettings.Get("sharePointUserName");
                var password        = ConfigurationManager.AppSettings.Get("sharePointPassword");
                var securedPassword = new SecureString();
                if (string.IsNullOrEmpty(password))
                {
                    securedPassword = GetConsoleSecurePassword();
                }
                else
                {
                    foreach (var c in password.ToCharArray())
                    {
                        securedPassword.AppendChar(c);
                    }
                }
                context.Credentials = new SharePointOnlineCredentials(username, securedPassword);

                NintexApiSettings.ApiKey             = ConfigurationManager.AppSettings.Get("nintexApiKey");
                NintexApiSettings.WebServiceUrl      = ConfigurationManager.AppSettings.Get("nintexServiceUrl");
                NintexApiSettings.HttpRequestTimeout = TimeSpan.Parse(ConfigurationManager.AppSettings["nintexApiTimeout"]);


                context.Load(context.Web, x => x.Title, x => x.Url);
                context.ExecuteQuery();
                Console.WriteLine("Provisioning to the site with");
                Console.ForegroundColor = ConsoleColor.Yellow;
                Console.WriteLine("\ttitle:url {0}:{1}", context.Web.Title, context.Web.Url);
                Console.ForegroundColor = ConsoleColor.White;

                var service = new CSOMProvisionService();
                service.RegisterModelHandlers(typeof(NintexFormO365Handler).Assembly);
                WebModel.PreProvision(context, service);
                Console.WriteLine("please ensure that the subweb NintexTest has the nintex apps installed and then press any key");
                WebModel.Provision(context, service);
            }
        }