Esempio n. 1
0
 public PlugInDescriptor[] List()
 {
     PlugInDescriptor[] descriptors = null;
     if (Rules.Count > 0)
     {
         descriptors = new PlugInDescriptor[1];
         descriptors[0] = PlugInDescriptor.Load(this.GetType());
     }
     return descriptors;
 }
Esempio n. 2
0
 public PlugInDescriptor[] List()
 {
     PlugInDescriptor[] descriptors = null;
     if (Rules.Count > 0)
     {
         descriptors    = new PlugInDescriptor[1];
         descriptors[0] = PlugInDescriptor.Load(this.GetType());
     }
     return(descriptors);
 }
Esempio n. 3
0
 public PlugInDescriptor[] List()
 {
     if (!User.IsInRole("Administrators") && !User.IsInRole("WebAdmins"))
     {
         return((PlugInDescriptor[])null);
     }
     return(new PlugInDescriptor[1]
     {
         PlugInDescriptor.Load(this.GetType())
     });
 }
        public void RunIndexing(List <int> siteIds)
        {
            SiteIds = siteIds;
            var repo             = ServiceLocator.Current.GetInstance <IScheduledJobRepository>();
            var pluginDescriptor = PlugInDescriptor.Load(typeof(LuceneSiteIndexScheduledJob));
            var job = repo.Get("Execute", pluginDescriptor.TypeName, pluginDescriptor.AssemblyName);

            if (job != null)
            {
                ServiceLocator.Current.GetInstance <IScheduledJobExecutor>().StartAsync(job);
            }
        }
Esempio n. 5
0
        public static string Execute()
        {
            var descriptor = PlugInDescriptor.Load("ScheduledParameterJob.ExampleJob.SampleParameterJob", "ScheduledParameterJob");
            var store      = typeof(ScheduledJobParameters).GetStore();
            var parameters = store.LoadPersistedValuesFor(descriptor.ID.ToString(CultureInfo.InvariantCulture));

            var cbChecked        = parameters.ContainsKey("CheckBoxSample") && (bool)parameters["CheckBoxSample"] ? "Aye!" : "Nay..";
            var tbText           = parameters.ContainsKey("TextBoxSample") ? parameters["TextBoxSample"] as string : string.Empty;
            var sampleReference  = parameters.ContainsKey("InputPageReferenceSample") ? (PageReference)parameters["InputPageReferenceSample"] : PageReference.EmptyReference;
            var samplePageName   = sampleReference != null && sampleReference != PageReference.EmptyReference ? DataFactory.Instance.GetPage(sampleReference).PageName : string.Empty;
            var cDateTime        = parameters.ContainsKey("CalendarSample") ? (DateTime?)parameters["CalendarSample"] : null;
            var ddlSelectedValue = parameters.ContainsKey("DropDownListSample") ? parameters["DropDownListSample"] as string : string.Empty;

            var result = string.Empty;

            result += string.Format("CheckBoxSample checked: <b>{0}</b><br />", cbChecked);
            result += string.Format("TextBoxSample text: <b>{0}</b><br />", tbText);
            result += string.Format("InputPageReferenceSample page name: <b>{0}</b> (PageId: <b>{1}</b>)<br />", samplePageName, sampleReference);
            result += string.Format("CalendarSample date: <b>{0}</b><br />", cDateTime.ToString());
            result += string.Format("DropDownListSample selected value: <b>{0}</b><br />", ddlSelectedValue);
            return(result);
        }
Esempio n. 6
0
        private List <ScheduledJob> GetGhostJobs(IScheduledJobRepository scheduledJobRepository)
        {
            var scheduledJobs = PlugInLocator.Search(new ScheduledPlugInAttribute());

            var scheduledJobDescriptors = PlugInDescriptor.GetAttributeArray(
                scheduledJobs,
                typeof(ScheduledPlugInAttribute));

            var ghostJobs =
                (from job in scheduledJobRepository.List()
                 let attribute = scheduledJobDescriptors.FirstOrDefault(x =>
                                                                        string.Equals(x.PlugInType.FullName, job.TypeName, StringComparison.InvariantCultureIgnoreCase))
                                 select new ScheduledJob
            {
                Id = job.ID,
                FromCode = attribute != null,
                Name = job.Name,
                AssemblyName = job.AssemblyName
            })
                .Where(x => !x.FromCode)
                .ToList();

            return(ghostJobs);
        }
Esempio n. 7
0
 public PlugInDescriptor[] List()
 {
     return(new[] { PlugInDescriptor.Load(typeof(UserSettings)) });
 }
 /// <summary>
 ///     Gets the PlugInDescriptor.
 /// </summary>
 /// <returns> The plugin descriptor </returns>
 /// <seealso cref="ICustomPlugInLoader.List()" />
 public PlugInDescriptor[] List()
 {
     return((!PrincipalInfo.HasAdminAccess)
                ? new PlugInDescriptor[] { }
                : new[] { PlugInDescriptor.Load(this.GetType()) });
 }