Ejemplo n.º 1
0
        public void Rebuild(string documentType, string culture)
        {
            var cultureInfo = String.IsNullOrEmpty(culture) ? CultureInfo.InvariantCulture : CultureInfo.GetCultureInfo(culture);
            var task        = RebuildTasks.GetTask(CurrentInstance.Name, Type.GetType(documentType, true), cultureInfo);

            task.Start();
        }
Ejemplo n.º 2
0
        private List <IndexModel> CreateIndexModels(string name, Type modelType)
        {
            var languages = new List <string> {
                String.Empty
            };

            languages.AddRange(_languageStore.All().Select(l => l.Name));

            var models = new List <IndexModel>();

            foreach (var lang in languages)
            {
                var model = new IndexModel
                {
                    Name         = name + (!String.IsNullOrEmpty(lang) ? " (" + lang + ")" : String.Empty),
                    Culture      = lang,
                    DocumentType = modelType.AssemblyQualifiedNameWithoutVersion()
                };

                var task = RebuildTasks.GetTask(CurrentInstance.Name, modelType, CultureInfo.GetCultureInfo(lang));
                UpdateIndexModel(model, task);

                models.Add(model);
            }

            return(models);
        }
Ejemplo n.º 3
0
        public ActionResult GetRebuildingInfo(string keys)
        {
            var results  = new List <object>();
            var keyArray = keys.Split(new[] { "||" }, StringSplitOptions.RemoveEmptyEntries);

            foreach (var key in keyArray)
            {
                var parts = key.Split('|');
                var task  = RebuildTasks.GetTask(CurrentInstance.Name, Type.GetType(parts[0], true), CultureInfo.GetCultureInfo(parts[1]));

                var result = new IndexModel();
                UpdateIndexModel(result, task);

                results.Add(result);
            }

            return(JsonNet(results).UsingClientConvention());
        }