protected override GutterIconDescriptor GetIconDescriptor(Item item) { if (string.IsNullOrEmpty(item[FieldIDs.LayoutField])) { return(null); } string iconPath = Settings.GetSetting("PageGutter.Icon"); if (string.IsNullOrEmpty(iconPath)) { iconPath = "People/32x32/monitor2.png"; } string iconTooltip = Settings.GetSetting("PageGutter.Tooltip"); if (string.IsNullOrEmpty(iconTooltip)) { iconTooltip = "The item is a page."; } GutterIconDescriptor gutterIconDescriptor = new GutterIconDescriptor { Icon = iconPath, Tooltip = iconTooltip, Click = string.Format("item:setlayoutdetails(id={0})", item.ID) }; return(gutterIconDescriptor); }
protected override GutterIconDescriptor GetIconDescriptor(Item item) { if (item != null) { var layoutField = item.Fields[Sitecore.FieldIDs.LayoutField]; var layoutDefinition = LayoutDefinition.Parse(LayoutField.GetFieldValue(layoutField)); if (layoutDefinition != null && layoutDefinition.Devices.Count > 0) { GutterIconDescriptor gutterIconDescriptor = new GutterIconDescriptor { Icon = "Applications/32x32/window_colors.png", Tooltip = Translate.Text("Presentation is set for this item.") }; if (item.Access.CanWrite() && !item.Appearance.ReadOnly) { gutterIconDescriptor.Click = string.Format("item:setlayoutdetails(id={0})", item.ID); } return gutterIconDescriptor; } } return null; }
protected override GutterIconDescriptor GetIconDescriptor(Item item) { PublishStatus publishStatus = CheckPublishStatus(item); if (publishStatus != PublishStatus.Published) { GutterIconDescriptor desc = new GutterIconDescriptor(); if (publishStatus == PublishStatus.NeverPublished) { desc.Icon = "Core2/32x32/flag_red_h.png"; desc.Tooltip = "Item never published!"; } else { desc.Icon = "Core2/32x32/flag_yellow.png"; desc.Tooltip = "Item published but modified!"; } // Clicking on the Gutter icon will you will jump to that item directly, that's done using "item:load(id={item id})" desc.Click = string.Format("item:load(id={0})", item.ID); return(desc); } return(null); }
protected override GutterIconDescriptor GetIconDescriptor(Item item) { PublishedStatus publishedStatus = CheckPublishedStatus(item); if (publishedStatus != PublishedStatus.Published) { GutterIconDescriptor gutterIconDescriptor = new GutterIconDescriptor(); if (publishedStatus == PublishedStatus.NeverPublished) { gutterIconDescriptor.Icon = "Applications/32x32/bullet_ball_red.png"; gutterIconDescriptor.Tooltip = "Item was never published"; } else { gutterIconDescriptor.Icon = "Applications/32x32/bullet_ball_yellow.png"; gutterIconDescriptor.Tooltip = "Item is published but modified"; } gutterIconDescriptor.Click = string.Format("item:load(id={0})", item.ID); return(gutterIconDescriptor); } return(null); }
protected override GutterIconDescriptor GetIconDescriptor(Item item) { if (string.IsNullOrEmpty(item[FieldIDs.LayoutField])) { return null; } string iconPath = Settings.GetSetting("PageGutter.Icon"); if (string.IsNullOrEmpty(iconPath)) { iconPath = "People/32x32/monitor2.png"; } string iconTooltip = Settings.GetSetting("PageGutter.Tooltip"); if (string.IsNullOrEmpty(iconTooltip)) { iconTooltip = "The item is a page."; } GutterIconDescriptor gutterIconDescriptor = new GutterIconDescriptor { Icon = iconPath, Tooltip = iconTooltip, Click = string.Format("item:setlayoutdetails(id={0})", item.ID) }; return gutterIconDescriptor; }
/// <summary> /// Method to display gutter description /// </summary> /// <param name="item"></param> /// <returns></returns> protected override GutterIconDescriptor GetIconDescriptor(Item item) { GutterIconDescriptor desc = new GutterIconDescriptor(); PublishStatus publishStatus = CheckPublishStatus(item); if (publishStatus != PublishStatus.Published) { if (publishStatus == PublishStatus.NeverPublished) { desc.Icon = "Core2/32x32/flag_red_h.png"; desc.Tooltip = "Item never published!"; } else if (publishStatus == PublishStatus.Modified) { desc.Icon = "Core2/32x32/flag_yellow.png"; desc.Tooltip = "Item modified but not published !"; } } else { desc.Icon = "Core2/32x32/flag_greeen.png"; desc.Tooltip = "Item available on web"; } desc.Click = string.Format("item:load(id={0})", item.ID); return(desc); }
private static GutterIconDescriptor GetGutterIconDescriptor() { var descriptor = new GutterIconDescriptor { Icon = "Applications/16x16/help_earth.png", Tooltip = $"Followng Language version{(MissingLanguages.Count > 1 ? "'s" : string.Empty)} are missing: \n {string.Join("\n", MissingLanguages.Select(x => x))}" }; return(descriptor); }
protected override GutterIconDescriptor GetIconDescriptor(Sitecore.Data.Items.Item item) { if (item.Versions.Count == 0) { var descriptor = new GutterIconDescriptor(); descriptor.Icon = "Applications/32x32/scroll_delete.png"; descriptor.Tooltip = "No version of this item exists in the current language."; return(descriptor); } return(null); }
protected override GutterIconDescriptor GetIconDescriptor(Sitecore.Data.Items.Item item) { if (item.Versions.Count == 0) { var descriptor = new GutterIconDescriptor(); descriptor.Icon = "Applications/32x32/scroll_delete.png"; descriptor.Tooltip = "No version of this item exists in the current language."; return descriptor; } return null; }
protected override GutterIconDescriptor GetIconDescriptor(Item item) { Assert.ArgumentNotNull(item, nameof(item)); if (item.TemplateID == PipelineBatchTemplateId) { var gutterIconDescriptor = new GutterIconDescriptor { Icon = TemplateManager.GetTemplate(item).Icon, Tooltip = item.DisplayName }; gutterIconDescriptor.Click = "dataExchange:pipelineBatchContextMenu()"; return(gutterIconDescriptor); } return(null); }
public GutterIconDescriptor GetGutterIconDescriptor(ChangeState state) { GutterIconDescriptor descriptor = null; try { descriptor = descriptors?[state]; } catch (Exception) { } return(descriptor); }
protected override GutterIconDescriptor GetIconDescriptor(Item item) { ///sitecore/content/Applications/Content Editor/Gutters int count = GetPageVisit(item); GutterIconDescriptor descriptor = new GutterIconDescriptor(); if (count != 0) { descriptor.Icon = "Applications/32x32/bullet_ball_blue.png"; descriptor.Tooltip = "Item visit count is " + count; descriptor.Click = String.Format("item:load(ID={0})", item.ID); return(descriptor); } return(descriptor); }
protected override GutterIconDescriptor GetIconDescriptor(Item item) { Assert.ArgumentNotNull(item, "item"); if (!item.IsABucket()) { return null; } var descriptor = new GutterIconDescriptor { Icon = "business/32x32/chest_add.png", Tooltip = Util.Constants.BucketGutterWarning }; return descriptor; }
protected override GutterIconDescriptor GetIconDescriptor(Item item) { Assert.ArgumentNotNull(item, nameof(item)); if (item.Fields.Contains(EnabledField) && item.Fields["Enabled"].Value != "1" && item.Fields["Enabled"].Section == "Administration") { var gutterIconDescriptor = new GutterIconDescriptor { Icon = "Office/32x32/selection_delete.png", Tooltip = item.DisplayName + " is disabled." }; gutterIconDescriptor.Click = string.Concat("dataExchange:showEnable(id=", item.ID, ",language=", item.Language, ",version=", item.Version, ",database=", item.Database.Name, ")"); return(gutterIconDescriptor); } return(null); }
protected override GutterIconDescriptor GetIconDescriptor(Item item) { Assert.ArgumentNotNull(item, "item"); if (!item.IsABucket()) { return(null); } var descriptor = new GutterIconDescriptor { Icon = "business/32x32/chest_add.png", Tooltip = Util.Constants.BucketGutterWarning }; return(descriptor); }
protected override GutterIconDescriptor GetIconDescriptor(Item item) { GutterIconDescriptor gutterIcon = null; InstantPackageManager manager = new InstantPackageManager(new PackageSourceDictionary()); IItemKey itemKey = new ItemKey(item); if (manager.Contains(itemKey)) { gutterIcon = new GutterIconDescriptor(); gutterIcon.Icon = "Core2/32x32/attach.png"; gutterIcon.Tooltip = "This item will be downloaded with the next InstantPackage."; //TODO: Add a click handler that opens the XAML for the Instant package } return(gutterIcon); }
/// <summary>Gets the icon.</summary> /// <param name="item">The item.</param> /// <returns>The icon.</returns> protected override GutterIconDescriptor GetIconDescriptor(Item item) { Assert.ArgumentNotNull((object)item, nameof(item)); string str1 = item[FieldIDs.Workflow]; string str2 = item[FieldIDs.WorkflowState]; if (!Settings.Workflows.Enabled || !item.Access.CanWrite()) { return((GutterIconDescriptor)null); } if (string.IsNullOrEmpty(str1) || string.IsNullOrEmpty(str2)) { return((GutterIconDescriptor)null); } IWorkflowProvider workflowProvider = item.Database.WorkflowProvider; if (workflowProvider == null) { return((GutterIconDescriptor)null); } IWorkflow workflow = workflowProvider.GetWorkflow(item); if (workflow == null) { return((GutterIconDescriptor)null); } Sitecore.Workflows.WorkflowState state = workflow.GetState(item); if (state == null) { return((GutterIconDescriptor)null); } if (state.FinalState) { return((GutterIconDescriptor)null); } GutterIconDescriptor gutterIconDescriptor = new GutterIconDescriptor(); gutterIconDescriptor.Icon = state.Icon; gutterIconDescriptor.Tooltip = state.DisplayName; WorkflowCommand[] workflowCommandArray = WorkflowFilterer.FilterVisibleCommands(workflow.GetCommands(item), item); if (workflowCommandArray != null && workflowCommandArray.Length != 0) { //Modify the event subscribed to the gutterIconDescriptor to call custom command, found at ExtendedShowWorkflowCommands.cs gutterIconDescriptor.Click = "ss:extendedshowworkflowcommands(id=" + (object)item.ID + ",language=" + (object)item.Language + ",version=" + (object)item.Version + ",database=" + item.Database.Name + ")"; } return(gutterIconDescriptor); }
protected override GutterIconDescriptor GetIconDescriptor(Item item) { Assert.ArgumentNotNull(item, "item"); string childCount = item.Children.Count.ToString(); /* Commented below code for better performance * System.Diagnostics.Stopwatch s = new System.Diagnostics.Stopwatch(); * Log.Info("API Query... ", this); * s.Start(); * string descedantCount = item.Axes.GetDescendants().Count().ToString(); * s.Stop(); * Log.Info("API Query took " + s.ElapsedMilliseconds + " milliseconds count " + descedantCount.ToString(), this); */ //System.Diagnostics.Stopwatch s2 = new System.Diagnostics.Stopwatch(); //s2.Start(); SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["master"].ConnectionString); con.Open(); SqlCommand cmd = new SqlCommand("Select count(ID) from Descendants where Ancestor='" + item.ID + "'"); cmd.Connection = con; //Log.Info("DB Query.... ", this); int descedantCountDB = (int)cmd.ExecuteScalar(); //s2.Stop(); //Log.Info("DB Query took " + s2.ElapsedMilliseconds + " milliseconds. count " + descedantCountDB.ToString(), this); con.Close(); if (item.Children.Count > 0) { GutterIconDescriptor descriptor = new GutterIconDescriptor { Icon = "http://dummyimage.com/16x16/F0E68C/000000.png&text=" + childCount, Tooltip = "Subitem Count: " + childCount.ToString() + System.Environment.NewLine + "Descendant Count: " + descedantCountDB.ToString().ToString() }; return(descriptor); } else { GutterIconDescriptor descriptor = new GutterIconDescriptor { }; return(descriptor); } }
protected override GutterIconDescriptor GetIconDescriptor(Item item) { Assert.ArgumentNotNull(item, "item"); GutterIconDescriptor descriptor = new GutterIconDescriptor(); if (Database.GetDatabase("web").GetItem(item.ID) == null) { if (Helpers.IsPageItem(item) && ItemSetToUnpublishNow(item)) { // item has been unpublished descriptor.Icon = "applications/32x32/delete2.png"; // RED "DELETED" X descriptor.Tooltip = "Item Unpublished"; } } return(descriptor); }
protected override GutterIconDescriptor GetIconDescriptor(Item item) { GutterIconDescriptor iconDescriptor = base.GetIconDescriptor(item); if (item.IsProjectItem()) { string iconPath = "Office/32x32/document_pinned.png"; GutterIconDescriptor gutterIcon = new GutterIconDescriptor() { Icon = iconPath, Tooltip = "Item belongs to '" + item.ProjectTitle() + "' project" }; return(gutterIcon); } return(null); }
// Methods protected override GutterIconDescriptor GetIconDescriptor(Item item) { Assert.ArgumentNotNull(item, "item"); if (((CheckboxField)item.Fields["IsBucket"]) == null) { return null; } if (!((CheckboxField)item.Fields["IsBucket"]).Checked) { return null; } GutterIconDescriptor descriptor = new GutterIconDescriptor(); descriptor.Icon = "business/32x32/chest_add.png"; descriptor.Tooltip = "This item is a bucket and all items below this are hidden"; return descriptor; }
protected override GutterIconDescriptor GetIconDescriptor(Item item) { if (item.RuntimeSettings.IsVirtual) { var gid = new GutterIconDescriptor {Icon = "Applications/32x32/documents.png"}; if (item.RuntimeSettings.IsExternal) { gid.Tooltip = String.Format("Proxy of item in {0} database.", item.RuntimeSettings.OwnerDatabase.Name); } else { gid.Tooltip = "Proxy item. Click to see source."; gid.Click = GetLinkToSource(item); } return gid; } return null; }
protected override GutterIconDescriptor GetIconDescriptor(Item item) { Assert.ArgumentNotNull((object)item, "item"); var freshnessCheckArgs = new FreshnessCheckArgs() { Item = item }; CorePipeline.Run(PipelineNames.FreshnessCheck, freshnessCheckArgs); if (!freshnessCheckArgs.IsStale) return null; var descriptor = new GutterIconDescriptor(); var args = new BuildGutterIconDescriptorArgs() { Item = item, Descriptor = descriptor }; CorePipeline.Run(PipelineNames.BuildGutterIconDescriptor,args); return descriptor; }
protected override GutterIconDescriptor GetIconDescriptor(Item item) { Assert.ArgumentNotNull(item, "item"); GutterIconDescriptor gutterIconDescriptor = new GutterIconDescriptor(); try { ChangeState state; var commit = _commitRepository.GetSelectedOrLastCommit().ToModelCommit(); if (commit == null) { return(base.GetIconDescriptor(item)); } if (commit.Name == Constants.UncommittedChangesCommitName) { var lastCommit = _commitRepository.GetLastCommit().ToModelCommit(); var commits = _commitRepository.GetAllCommits()?.ToList().ConvertAll(x => x.ToModelCommit()); if (commits == null || commits.Count() == 0) { return(base.GetIconDescriptor(item)); } state = item.GetChangeState(new CommitsChain() { Commits = commits }, lastCommit); } else { state = item.GetCommitState(commit); } var gutter = _gutterSelector.GetGutterIconDescriptor(state); return(gutter ?? base.GetIconDescriptor(item)); } catch (Exception) { return(base.GetIconDescriptor(item)); } }
protected override GutterIconDescriptor GetIconDescriptor(Item item) { Assert.ArgumentNotNull(item, "item"); Item settingsItem = ConfigurationUtil.SettingsItem; // Display an icon next to mapped templates if ("Template".Equals(item.TemplateName, StringComparison.InvariantCultureIgnoreCase)) { Item[] domainObjectSetItems = settingsItem.Axes.SelectItems(string.Format("*[@@TemplateName='DomainObjectSet']")) ?? new Item[0]; foreach (Item domainObjectSetItem in domainObjectSetItems) { bool mapped = Sitecore.Data.ID.ParseArray(domainObjectSetItem["Templates to map to Domain Model"]).Contains(item.ID); bool contributing = ! mapped && Sitecore.Data.ID.ParseArray(domainObjectSetItem["Templates that contribute to Domain Model"]).Contains(item.ID); if (mapped || contributing) { GutterIconDescriptor descriptor = new GutterIconDescriptor(); descriptor.Icon = domainObjectSetItem.Appearance.Icon; descriptor.Tooltip = string.Format("This template is mapped {0} in domain object set '{1}'.", mapped ? "directly" : "as a contributing template", domainObjectSetItem.Name); return descriptor; } } } // Display an icon next to paths that are fixed Item[] fixedPathSetItems = settingsItem.Axes.SelectItems(string.Format("*[@@TemplateName='FixedPathSet']")) ?? new Item[0]; foreach(Item fixedPathSetItem in fixedPathSetItems) { MultilistField fixedTreeLocationsField = FieldTypeManager.GetField(fixedPathSetItem.Fields["Fixed tree locations"]) as MultilistField; Item[] fixedTreeItems = fixedTreeLocationsField.GetItems() ?? new Item[0]; foreach (Item fixedTreeItem in fixedTreeItems) { if (fixedTreeItem.Paths.FullPath.Contains(item.Paths.FullPath)) { GutterIconDescriptor descriptor = new GutterIconDescriptor(); descriptor.Icon = fixedPathSetItem.Appearance.Icon; descriptor.Tooltip = string.Format("This path is configured to be fixed in fixed path set '{0}'.", fixedPathSetItem.Name); return descriptor; } } MultilistField relativeFixedTreeLocationsField = FieldTypeManager.GetField(fixedPathSetItem.Fields["Relative fixed tree locations"]) as MultilistField; Item[] relativeFixedTreeItems = relativeFixedTreeLocationsField.GetItems() ?? new Item[0]; foreach (Item relativeFixedTreeItem in relativeFixedTreeItems) { if (item.ID.Equals(relativeFixedTreeItem.ID) || (item.Axes.GetAncestors() ?? new Item[0]).Select(it => it.ID).Contains(relativeFixedTreeItem.ID)) { GutterIconDescriptor descriptor = new GutterIconDescriptor(); descriptor.Icon = fixedPathSetItem.Appearance.Icon; descriptor.Tooltip = string.Format("This path is configured to be the base for a relative fixed path in set '{0}'.", fixedPathSetItem.Name); return descriptor; } } } return null; }