public void Perform() { imageSettings.UpdateSettings(); tagGenerator.GetTags(wordsRepository.Get()) .Then(tags => new TagCloudVisualizer(imageBox, imageSettings, tags)) .Then(tagCloud => tagCloud.GetTagCloudImage()) .RefineError("Failed, trying to get a Tag Cloud image") .OnFail(exceptionHandler.HandleException); }
public async Task Generate(PlanTemplateCM planTemplate, string fr8AccountId) { var storage = await _tagGenerator.GetTags(planTemplate, fr8AccountId); foreach (var tag in storage.WebServiceTemplateTags) { var tags = tag.TagsWithIcons.Select(x => x.Key).ToArray(); var pageName = GeneratePageNameFromTags(tags); var pageDefinition = _pageDefinitionService.Get(x => x.PageName == pageName && x.Type == PageType).FirstOrDefault() ?? new PageDefinitionDO { PageName = pageName, Tags = tags, Type = PageType, Title = tag.Title }; if (!pageDefinition.PlanTemplatesIds.Contains(planTemplate.ParentPlanId)) { pageDefinition.PlanTemplatesIds.Add(planTemplate.ParentPlanId); } pageDefinition.Url = new Uri($"{_templateGenerator.BaseUrl}/{pageName}"); _pageDefinitionService.CreateOrUpdate(pageDefinition); var relatedPageDefinitions = _pageDefinitionService.GetAll().Where(x => x.PlanTemplatesIds.Contains(planTemplate.ParentPlanId)); var curPageDefinition = relatedPageDefinitions.FirstOrDefault(x => x.PageName == pageName); var curRelatedPlans = new List <PublishPlanTemplateDTO>(); foreach (var planTemplateId in curPageDefinition.PlanTemplatesIds) { var planDto = _planTemplateService.GetPlanTemplateDTO(fr8AccountId, Guid.Parse(planTemplateId)).Result; if (planDto != null) { curRelatedPlans.Add(planDto); } } var relatedPlans = new List <Tuple <string, string, string> >(); foreach (var publishPlanTemplateDTO in curRelatedPlans) { relatedPlans.Add(new Tuple <string, string, string>( publishPlanTemplateDTO.Name, publishPlanTemplateDTO.Description ?? publishPlanTemplateDTO.Name, CloudConfigurationManager.GetSetting("HubApiUrl") + "plan_templates/createplan/?id=" + publishPlanTemplateDTO.ParentPlanId)); } await _templateGenerator.Generate(new PlanCategoryTemplate(), pageName, new Dictionary <string, object> { ["Name"] = pageName, ["Tags"] = tag.TagsWithIcons, ["RelatedPlans"] = relatedPlans }); } }
public void Perform() { var tags = tagGenerator.GetTags(keywordsStorage.GetKeywords(), imageSettings.Center); cloudPainterFactory(canvas, imageSettings).Paint(tags); }
public void Perform() { var tags = tagGenerator.GetTags(wordsRepository.Get()); new TagCloudVisualizer(imageBox, imageSettings, tags).GetTagCloudImage(); }