Esempio n. 1
0
        private async void GetClients(string clientListId)
        {
            var listClientTemp = clientListId.Split(',').ToList();

            var sp = new SPService(new Credential {
                UserName = UserName, Password = Password
            }, URL);

            IsBusy  = true;
            Clients = await sp.GetClients();

            IsBusy = false;

            if (Clients != null)
            {
                foreach (var c in Clients)
                {
                    if (listClientTemp.Exists(Id => Id == c.Id.ToString()))
                    {
                        c.Selected = true;
                    }
                    else
                    {
                        c.Selected = false;
                    }
                }

                MessagingCenter.Send <SettingPageModel, List <Client> >(this, "CLIENT_RESULT", Clients);
            }
        }
Esempio n. 2
0
        private static List <SPJobDefinition> GetAdminCmdLineJobs(SPServer server)
        {
            List <SPJobDefinition> list = new List <SPJobDefinition>();

            foreach (KeyValuePair <Guid, SPService> pair in GetLocalProvisionedServices())
            {
                SPService service = pair.Value;
                foreach (SPJobDefinition definition in service.JobDefinitions)
                {
                    if (ShouldRunAdminCmdLineJob(definition, server))
                    {
                        list.Add(definition);
                    }
                }
                SPWebService service2 = service as SPWebService;
                if (service2 != null)
                {
                    foreach (SPWebApplication application in service2.WebApplications)
                    {
                        foreach (SPJobDefinition definition2 in application.JobDefinitions)
                        {
                            if (ShouldRunAdminCmdLineJob(definition2, server))
                            {
                                list.Add(definition2);
                            }
                        }
                    }
                    continue;
                }
            }
            return(list);
        }
Esempio n. 3
0
        private async void GetTickets()
        {
            var sp = new SPService(_pageParam.Credential, _pageParam.URL);

            IsBusy  = true;
            Tickets = await sp.GetTicketByStatus(_pageParam.Title, _pageParam.ClientsId);

            IsBusy = false;
        }
        private JObject GetSharePointServiceRepresentation(SPService service)
        {
            var objBaristaService = new JObject
            {
                { "displayName", service.DisplayName },
                { "id", service.Id },
                { "status", service.Status.ToString() }
            };

            var serviceApplications = new JArray();

            foreach (var serviceApplication in service.Applications)
            {
                var objServiceApplication = new JObject
                {
                    { "displayName", serviceApplication.DisplayName },
                    { "id", serviceApplication.Id },
                    { "status", serviceApplication.Status.ToString() }
                };

                var serviceInstances = new JArray();
                foreach (var serviceInstance in serviceApplication.ServiceInstances)
                {
                    var objServiceInstance = new JObject
                    {
                        { "id", serviceInstance.Id },
                        { "serverAddress", serviceInstance.Server.Address },
                        { "name", serviceInstance.Server.Name },
                        { "status", serviceInstance.Status.ToString() }
                    };

                    serviceInstances.Add(objServiceInstance);
                }

                objServiceApplication.Add("serviceInstances", serviceInstances);
                serviceApplications.Add(objServiceApplication);
            }
            objBaristaService.Add("serviceApplications", serviceApplications);

            var localServiceInstances = new JArray();

            foreach (var instance in service.Instances)
            {
                var objServiceInstance = new JObject
                {
                    { "id", instance.Id },
                    { "serverAddress", instance.Server.Address },
                    { "name", instance.Server.Name },
                    { "status", instance.Status.ToString() }
                };
                localServiceInstances.Add(objServiceInstance);
            }
            objBaristaService.Add("serviceInstances", localServiceInstances);

            return(objBaristaService);
        }
        public SPServiceInstance(ObjectInstance prototype, SPService service)
            : this(prototype)
        {
            if (service == null)
            {
                throw new ArgumentNullException("service");
            }

            m_service = service;
        }
Esempio n. 6
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="service"></param>
 /// <param name="docType"></param>
 /// <param name="key"></param>
 /// <param name="value"></param>
 /// <param name="editText"></param>
 /// <param name="openControl"></param>
 /// <param name="delete"></param>
 public WebSiteDocItemModifier(SPService service, DocIconType docType, string key, string value, string editText, string openControl, bool delete)
     : base("DocIcon Modifier for " + key, service, null, SPJobLockType.None)
 {
     this._delete     = delete;
     this.Key         = key;
     this.Value       = value;
     this.EditText    = editText;
     this.OpenControl = openControl;
     this.docIconType = docType.ToString();
 }
Esempio n. 7
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="service"></param>
        /// <param name="featureID"></param>
        /// <param name="delete"></param>
        public WebSiteDocItemModifier(SPService service, Guid featureID, bool delete) : base("DocIcon Modifier for " + featureID.ToString(), service, null, SPJobLockType.None)
        {
            this._featureID = featureID;
            SPFeatureDefinition def = Farm.FeatureDefinitions[featureID];

            this.Key         = def.Properties[keyKey].Value;
            this.Value       = def.Properties[valueKey].Value;
            this.EditText    = def.Properties[textKey].Value;
            this.OpenControl = def.Properties[controlKey].Value;
            this.docIconType = def.Properties[typeKey].Value;
            this._delete     = delete;
        }
Esempio n. 8
0
        public ServiceNode(SPService service)
        {
            this.Tag      = service;
            this.SPParent = service.Farm;

            this.Setup();

            if (Service.Properties.Count > 0 || Service.JobDefinitions.Count > 0)
            {
                this.Nodes.Add(new ExplorerNodeBase("Dummy"));
            }
        }
Esempio n. 9
0
        public ServiceNode(SPService service)
        {
            this.Tag = service;
            this.SPParent = service.Farm;

            this.Setup();

            if (Service.Properties.Count > 0 || Service.JobDefinitions.Count > 0)
            {
                this.Nodes.Add(new ExplorerNodeBase("Dummy"));
            }
        }
Esempio n. 10
0
        private async void SearchTicket(string key)
        {
            var sp = new SPService(_credential, _url);

            if (Tickets != null)
            {
                Tickets.Clear();
            }

            IsBusy  = true;
            Tickets = await sp.GetTicketByParam(key);

            IsBusy = false;
        }
Esempio n. 11
0
        private static async Task StoredProcedureCalls(IConfiguration configuration, ServiceProvider serviceProvider)
        {
            var       databaseId = "pizzaDB"; var containerId = "pizzaHut";
            SPService spService = serviceProvider.GetService <SPService>();

            spService.SetContainer(databaseId, containerId);
            await spService.ViewStoredProcedures();

            try
            {
                // await spService.CreateStoredProcedure("Greetings");
                // await spService.ExecuteSPGreeting("Batman");
                // await spService.DeleteStoreProcedure("Greetings");

                // await spService.CreateStoredProcedure("CreateNewPizza");
                // await spService.ExecuteSPCreateNewPizza("Veg", "107TandooriPaneer");
                // await spService.ExecuteSPCreateNewPizza("Non Veg", "204SmokedChicken");
                // await spService.DeleteStoreProcedure("CreateNewPizza");

                // await spService.CreateStoredProcedure("BulkPizzaCreate");
                // await spService.ExecuteSPBulkPizzaCreate("veg", "Veg");
                // await spService.ExecuteSPBulkPizzaCreate("nonVeg", "Non Veg");
                // await spService.DeleteStoreProcedure("BulkPizzaCreate");

                // await spService.CreateStoredProcedure("GetPizzaById");
                // await spService.ExecuteSPGetPizzaById("Veg", "106");
                // await spService.ExecuteSPGetPizzaById("Non Veg", "201");
                // await spService.DeleteStoreProcedure("GetPizzaById");

                // await spService.CreateStoredProcedure("GetPizzaCount");
                // await spService.ExecuteGetPizzaCount("Veg");
                // await spService.ExecuteGetPizzaCount("Non Veg");
                // await spService.DeleteStoreProcedure("GetPizzaCount");

                // await spService.CreateStoredProcedure("GetPizzas");
                // await spService.ExecuteSPGetPizzas();
                // await spService.DeleteStoreProcedure("GetPizzas");

                // await spService.CreateStoredProcedure("DeletePizza");
                // await spService.ExecuteSPDeletePizza("Veg", "107");
                // await spService.ExecuteSPDeletePizza("Non Veg", "204");
                // await spService.DeleteStoreProcedure("DeletePizza");

                // await spService.ViewStoredProcedures();
            }
            catch (Exception ex)
            {
                WriteLine(ex.ToString());
            }
        }
Esempio n. 12
0
        protected BaseJobDefinition(string jobName, SPService service, SPServer server, SPJobLockType targetType) :
            base(jobName, service, server, targetType)
        {
            if (string.IsNullOrEmpty(jobName))
            {
                Name = string.Format("{0}", DefaultJobName);
            }

            if (!string.IsNullOrEmpty(DefaultJobTitle))
            {
                Title = DefaultJobTitle;
            }

            _logger = new Logger(Title);
        }
Esempio n. 13
0
        public static List <AttributeValuePair> GetSPServiceAttributes(SPService service)
        {
            List <AttributeValuePair> serviceAttributes = new List <AttributeValuePair>();

            try
            {
                serviceAttributes.Add(new AttributeValuePair("TypeName", service.TypeName));
                serviceAttributes.Add(new AttributeValuePair("Name", service.Name));
                serviceAttributes.Add(new AttributeValuePair("Id", service.Id.ToString()));
            }
            catch (Exception e)
            {
                serviceAttributes.Add(new AttributeValuePair("Exception", e.ToString()));
            }
            return(serviceAttributes);
        }
        public void UnRegisterSucceeds()
        {
            //Arrange
            SPService target = null;

            BSPFarm.SetLocal();
            MSPDiagnosticsServiceBase.GetLocal <DiagnosticsService>(() => new DiagnosticsService());
            MSPService.AllInstances.Delete = (b) => target = b;

            //Act
            DiagnosticsService.Unregister();

            //Assert
            Assert.IsNotNull(target);
            Assert.IsTrue(target.GetType().Equals(typeof(DiagnosticsService)));
        }
Esempio n. 15
0
        private static Dictionary <Guid, SPService> GetLocalProvisionedServices()
        {
            Dictionary <Guid, SPService> dictionary = new Dictionary <Guid, SPService>(8);

            foreach (SPServiceInstance instance in SPServer.Local.ServiceInstances)
            {
                SPService service = instance.Service;
                if (instance.Status == SPObjectStatus.Online)
                {
                    if (!dictionary.ContainsKey(service.Id))
                    {
                        dictionary.Add(service.Id, service);
                    }
                }
            }
            return(dictionary);
        }
Esempio n. 16
0
        /// <summary>;
        /// Gets the jobdefintions by name.
        /// </summary>;
        /// <param name="service">The service</param>;
        /// <param name="name">The name.</param>
        /// <returns>SPJobDefinition</returns>;
        /// <exception cref="System.ArgumentNullException">Exception is thrown when the service or name equal null</exception>
        public static SPJobDefinition GetJobDefinitionByName(this SPService service, string name)
        {
            if (service == null)
            {
                throw new ArgumentNullException("service", "Argument 'service' cannot be 'null'");
            }

            if (String.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException("name", "Argument 'name' cannot be 'null' or 'String.Empty'");
            }

            var query = from SPJobDefinition job in service.JobDefinitions
                        where job.Name == name
                        select job;

            return(query.FirstOrDefault());
        }
Esempio n. 17
0
        internal static OutputQueue EnableJobs(SPService service)
        {
            var outputQueue = new OutputQueue();

            if (service == null)
            {
                return(outputQueue);
            }

            foreach (var job in service.JobDefinitions)
            {
                try
                {
                    outputQueue.Add(EnableJob(job));
                }
                catch (Exception exception)
                {
                    outputQueue.Add(string.Format(System.Globalization.CultureInfo.CurrentCulture, Exceptions.EnableJobsUnableToEnableError, job.DisplayName, exception.Message), OutputType.Error, null, exception);
                }
            }

            return(outputQueue);
        }
 public MigrationContentJob(string jobName, SPService service, SPServer server, SPJobLockType targetType)
     : base(jobName, service, server, targetType)
 {
 }
Esempio n. 19
0
 public SyncJob(string name, SPService service)
     : base(name, service, null, SPJobLockType.Job)
 {
     Title = tJobName;
 }
 public NotificationTimerJob(string jobName, SPService service, SPServer server, SPJobLockType lockType)
     : base(jobName, service, server, lockType)
 {
     Title = jobName;
 }
Esempio n. 21
0
 public ADLDSImportJob(String name, SPService service)
     : base(name, service, null, SPJobLockType.None)
 {
     this.Title = tJobName;
 }
Esempio n. 22
0
 public BeachCampReminder(string jobName, SPService service)
     : base(jobName, service, null, SPJobLockType.None)
 {
     this.Title = jobName;
 }
        public ListTimerJob(string jobName, SPService service, SPServer server, SPJobLockType targetType)

            : base(jobName, service, server, targetType)
        {
        }
Esempio n. 24
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:Microsoft.SharePoint.Administration.SPJobDefinition"/> class and provides parameters for specifying key objects.
 /// </summary>
 /// <param name="name">Specifies the name of the job definition.</param><param name="service">Specifies an <see cref="T:Microsoft.SharePoint.Administration.SPService"/> object instance.</param><param name="server">Specifies an <see cref="T:Microsoft.SharePoint.Administration.SPServer"/> object instance.</param><param name="lockType">Specifies an enumeration value from the <see cref="T:Microsoft.SharePoint.Administration.SPJobLockType"/> enum.</param>
 protected DISPJobDefinition(string name, SPService service, SPServer server, SPJobLockType lockType)
     : base(name, service, server, lockType)
 {
     InjectProperties();
 }
Esempio n. 25
0
 public ConfigDeploymentJob(string jobName, SPService service, SPServer server, SPJobLockType targetType)
     : base(jobName, service, server, targetType)
 {
 }
 public CustCode(string jobName, SPService service) :
     base(jobName, service, null, SPJobLockType.None)
 {
     this.Title = jobName;
     //this.Title = "Task Complete Timer1";
 }
 public SpJobDefinitionBase(string name, SPService service, SPServer server, SPJobLockType lockType)
     : base(name, service, server, lockType)
 {
 }
 public JOBSynContactoADPortal(string jobName, SPService service, SPServer server, SPJobLockType targetType) : base(jobName, service, server, targetType)
 {
 }
 public PackagesDeploymentJob(string name, SPService service, SPServer server, SPJobLockType lockType)
     : base(name, service, server, lockType)
 {
 }
 public ClientAccessPolicyDeploymentJob(string jobName, SPService service, SPServer server, SPJobLockType targetType)
     : base(jobName, service, server, targetType)
 {
 }
Esempio n. 31
0
 public SSRSSyncTimerJob(string jobName, SPService service)
     : base(jobName, service, null, SPJobLockType.None)
 {
     Title = JobTitle;
 }
Esempio n. 32
0
 public CSIPortalDump(string jobName, SPService service) : base(jobName, service, null, SPJobLockType.None)
 {
     this.Title = "MTN CSI PORTAL Dump Job";
 }
Esempio n. 33
0
 public PiwikPROJSProvisioningJob(string jobName, SPService service, SPServer server, SPJobLockType targetType) : base(jobName, service, server, targetType)
 {
 }
Esempio n. 34
0
 /// <summary>
 /// Initializes a new instance of the DeadlineTimerJob class.
 /// </summary>
 /// <param name="jobName">Name of the job.</param>
 /// <param name="service">The service.</param>
 /// <param name="server">The server.</param>
 /// <param name="targetType">Type of the target.</param>
 public TimerJob(string jobName, SPService service, SPServer server, SPJobLockType targetType)
     : base(jobName, service, server, targetType)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SetBackConnectionHostNamesTimerJob"/> class.
 /// </summary>
 public SetBackConnectionHostNamesTimerJob(SPService service)
     : base(JOB_NAME + jobId, service, null, SPJobLockType.None)
 {
     Title = "Set BackConnectionHostNames Registry Key";
 }
Esempio n. 36
0
 public ADLDSImportJob(String name, SPService service, SPServer server, SPJobLockType lockType)
     : base(name, service, server, lockType)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SetBackConnectionHostNamesTimerJob"/> class.
 /// </summary>
 public SetBackConnectionHostNamesTimerJob(SPService service)
     : base(JOB_NAME + jobId, service, null, SPJobLockType.None)
 {
     Title = "Set BackConnectionHostNames Registry Key";
 }
 public DueDateNotificationJob(string jobName, SPService service) :
               base(jobName, service, null, SPJobLockType.None)
 {
     this.Title = Const.TimerJobsNames.DueDateNotificationJob;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SolutionPackageInstallerJob"/> class.
 /// </summary>
 /// <param name="name">
 /// The name.
 /// </param>
 /// <param name="service">
 /// The service.
 /// </param>
 /// <param name="server">
 /// The server.
 /// </param>
 /// <param name="lockType">
 /// The lock type.
 /// </param>
 private SolutionPackageInstallerJob(string name, SPService service, SPServer server, SPJobLockType lockType)
     : base(name, service, server, lockType)
 {
     this.InitializePackages();
 }
Esempio n. 40
0
 public SyncJob(string name, SPService service, SPServer server, SPJobLockType lockType)
     : base(name, service, server, SPJobLockType.Job)
 {
 }
Esempio n. 41
0
 public MonitoraJob(string jobName, SPService service, SPServer server, SPJobLockType targetType) :
     base(jobName, service, server, targetType)
 {
 }
 public AlertJobdefinition(string jobName, SPService service, SPServer server, SPJobLockType targetType)
     : base(jobName, service, server, targetType)
 {
 }
Esempio n. 43
0
 public AlertJobdefinition(string jobName, SPService service, SPServer server, SPJobLockType targetType)
     : base(jobName, service, server, targetType)
 { }