public override void Display(DisplayElement dElement) { var itemElement = ExtractItem(dElement); itemElement = GetCorrectLanguage(itemElement); itemElement = GetCorrectVersion(itemElement); if (itemElement == null) { return; } dElement.Value = itemElement.Uri.ToString(); dElement.Header = itemElement.Name; foreach (var column in Columns) { if (!dElement.HasColumn(column.Header)) { var text = getColumnText(column.Name, itemElement); if (text.StartsWith("|")) { var splitvalues = text.Substring(1).Split('|'); dElement.AddColumn(column.Header, splitvalues[0], splitvalues[1]); } else { dElement.AddColumn(column.Header, string.IsNullOrEmpty(text) ? itemElement[column.Name] : text); } } } dElement.Icon = itemElement.Appearance.Icon; }
public override void Display(DisplayElement dElement) { Assert.ArgumentNotNull(dElement, "element"); Sitecore.Web.Authentication.DomainAccessGuard.Session session = dElement.Element as Sitecore.Web.Authentication.DomainAccessGuard.Session; if (session != null) { foreach (var column in Columns) { switch (column.Name) { case "user": dElement.AddColumn("User", session.UserName); break; case "created": dElement.AddColumn("Created", session.Created.ToString(GetDateFormat(null))); break; case "lastrequest": dElement.AddColumn("Last request", session.LastRequest.ToString(GetDateFormat(null))); break; case "id": dElement.AddColumn("ID", session.SessionID); break; } } dElement.Value = session.SessionID; } }
public override void Display(DisplayElement d_element) { Item itemElement = d_element.Element as Item; if (itemElement == null) { return; } d_element.Value = itemElement.Uri.ToString(); d_element.Header = itemElement.Name; for (int i = 0; i < Columns.Count; i++) { ASR.Interface.BaseColumn column = Columns[i]; string text = column.GetColumnText(itemElement, MaxLength); if (string.IsNullOrEmpty(text)) { d_element.AddColumn(column.Header, itemElement[column.Name]); } else { d_element.AddColumn(column.Header, text); } } d_element.Icon = itemElement.Appearance.Icon; }
public override void Display(DisplayElement dElement) { var role = dElement.Element as Role; if ((Account)role == (Account)null) { return; } foreach (var column in Columns) { switch (column.Name) { case "name": dElement.AddColumn(column.Header, role.DisplayName); break; case "description": dElement.AddColumn(column.Header, role.Description); break; case "domain": dElement.AddColumn(column.Header, role.Domain.Name); break; case "users": string usersInRole = string.Join("|", RolesInRolesManager.GetUsersInRole(role, true).Select(u => u.DisplayName).ToArray()); dElement.AddColumn(column.Header, usersInRole); break; } } }
public override void Display(DisplayElement dElement) { Debug.ArgumentNotNull(dElement, "element"); var logElement = dElement.Element as LogItem; if (logElement == null) { return; } dElement.Icon = GetIcon(logElement); var ai = logElement as AuditItem; foreach (var column in Columns) { switch (column.Name) { case "type": dElement.AddColumn(column.Header, logElement.Type.ToString()); break; case "date": dElement.AddColumn(column.Header, logElement.DateTime.ToString(GetDateFormat(null))); break; case "message": dElement.AddColumn(column.Header, logElement.Message); break; case "user": if (ai != null) { dElement.AddColumn(column.Header, ai.User); } break; case "verb": if (ai != null) { dElement.AddColumn(column.Header, ai.Verb); } break; } } if (ai != null) { dElement.Value = ai.ItemUri == null ? "" : ai.ItemUri.ToString(); } else { dElement.Value = dElement.Element.ToString(); } }
public override void Display(DisplayElement dElement) { Sitecore.Security.Accounts.User user = dElement.Element as Sitecore.Security.Accounts.User; if (user == null) { return; } dElement.AddColumn("Name", user.Name); dElement.AddColumn("Display Name", user.DisplayName); dElement.AddColumn("Domain", user.Domain.Name); dElement.AddColumn("Is Admin", user.IsAdministrator ? "yes" : "no"); }
public override void Display(DisplayElement dElement) { WorkflowEventCustom wec = dElement.Element as WorkflowEventCustom; if (wec == null) { return; } dElement.Value = wec.Item.Uri.ToString(); dElement.Icon = wec.Item.Appearance.Icon; foreach (var column in Columns) { switch (column.Name) { case "name": dElement.AddColumn(column.Header, wec.Item.DisplayName); break; case "date": dElement.AddColumn(column.Header, wec.WorkflowEvent.Date.ToString(GetDateFormat(null))); break; case "user": dElement.AddColumn(column.Header, wec.WorkflowEvent.User); break; case "oldstate": dElement.AddColumn(column.Header, getStateName(wec.WorkflowEvent.OldState)); break; case "newstate": dElement.AddColumn(column.Header, getStateName(wec.WorkflowEvent.NewState)); break; case "text": dElement.AddColumn(column.Header, wec.WorkflowEvent.Text); break; case "paths": dElement.AddColumn(column.Header, wec.Item.Paths.Path); break; case "language": dElement.AddColumn(column.Header, wec.Item.Language.GetDisplayName()); break; case "version": dElement.AddColumn(column.Header, wec.Item.Version.Number.ToString(CultureInfo.InvariantCulture)); break; } } }
public override void Display(DisplayElement d_element) { Item itemElement = null; if (d_element.Element is Item) { itemElement = (Item)d_element.Element; } else if (d_element.Element is ID) { itemElement = Sitecore.Context.ContentDatabase.GetItem(d_element.Element as ID); } if (itemElement == null) { return; } d_element.Value = itemElement.Uri.ToString(); d_element.Header = itemElement.Name; foreach (var column in Columns) { if (!d_element.HasColumn(column.Header)) { var text = getColumnText(column.Name, itemElement); d_element.AddColumn(column.Header, string.IsNullOrEmpty(text) ? itemElement[column.Name] : text); } } d_element.Icon = itemElement.Appearance.Icon; }
public override void Display(DisplayElement dElement) { Role role = dElement.Element as Role; if ((Account)role == (Account)null) { return; } dElement.AddColumn("Name", role.DisplayName); dElement.AddColumn("Description", role.Description); dElement.AddColumn("Domain", role.Domain.Name); string usersInRole = string.Join("|", RolesInRolesManager.GetUsersInRole(role, true).Select(u => u.DisplayName).ToArray()); dElement.AddColumn("Users", usersInRole); }
public override void Display(DisplayElement dElement) { Assert.ArgumentNotNull(dElement, "element"); Sitecore.Web.Authentication.DomainAccessGuard.Session session = dElement.Element as Sitecore.Web.Authentication.DomainAccessGuard.Session; if (session != null) { dElement.AddColumn("User", session.UserName); dElement.AddColumn("Created", session.Created.ToString("dd/MM/yy HH:mm")); dElement.AddColumn("Last request", session.LastRequest.ToString("dd/MM/yy HH:mm")); dElement.AddColumn("ID", session.SessionID); dElement.Value = session.SessionID; } //return dElement; }
public override void Display(DisplayElement _dElement) { Debug.ArgumentNotNull(_dElement, "element"); LogItem logElement = _dElement.Element as LogItem; if (logElement == null) { return; } _dElement.Value = _dElement.Element.ToString(); _dElement.Icon = getIcon(logElement); _dElement.AddColumn("Type", logElement.Type.ToString()); _dElement.AddColumn("Date", logElement.DateTime.ToShortDateString()); _dElement.AddColumn("Time", logElement.DateTime.ToShortTimeString()); AuditItem ai = logElement as AuditItem; if (ai != null) { _dElement.AddColumn("User", ai.User); _dElement.AddColumn("Verb", ai.Verb); _dElement.Value = ai.ItemUri == null ? "" : ai.ItemUri.ToString(); } _dElement.AddColumn("Message", logElement.Message); }
public override void Display(DisplayElement dElement) { User user = dElement.Element as User; if ((Account)user == (Account)null) { return; } foreach (var userRole in user.Roles) { dElement.AddColumn(userRole.Name, "yes"); } }
public override void Display(DisplayElement dElement) { var item = dElement.Element as Item; if (item == null) { return; } var alias = GetAlias(item); if (alias != null) { dElement.AddColumn("Alias", alias); } }
public override void Display(DisplayElement dElement) { WorkflowEventCustom wec = dElement.Element as WorkflowEventCustom; if (wec == null) { return; } dElement.Value = wec.Item.Uri.ToString(); dElement.Icon = wec.Item.Appearance.Icon; dElement.AddColumn("Name", wec.Item.DisplayName); dElement.AddColumn("Date", wec.WorkflowEvent.Date.ToString("dd/MM/yyyy HH:mm:ss")); dElement.AddColumn("User", wec.WorkflowEvent.User); dElement.AddColumn("OldState", getStateName(wec.WorkflowEvent.OldState)); dElement.AddColumn("NewState", getStateName(wec.WorkflowEvent.NewState)); dElement.AddColumn("Text", wec.WorkflowEvent.Text); dElement.AddColumn("Paths", wec.Item.Paths.Path); dElement.AddColumn("Language", wec.Item.Language.GetDisplayName()); dElement.AddColumn("Version", wec.Item.Version.Number.ToString()); }
public override void Display(DisplayElement dElement) { var user = dElement.Element as User; if ((Account)user == (Account)null) { return; } foreach (var userRole in user.Roles) { if (Columns == null || Columns.Any(c => c.Name.Equals(userRole.Name, StringComparison.InvariantCultureIgnoreCase))) { dElement.AddColumn(userRole.Name, "yes"); } } }
public override void Display(DisplayElement dElement) { User user = dElement.Element as User; if ((Account)user == (Account)null) { return; } dElement.AddColumn("Email", user.Profile.Email); dElement.AddColumn("FullName", user.Profile.FullName); dElement.AddColumn("Last Updated", user.Profile.LastUpdatedDate.ToString("dd/MM/yy HH:mm"), Sitecore.DateUtil.ToIsoDate(user.Profile.LastUpdatedDate)); dElement.AddColumn("Client Language", user.Profile.ClientLanguage); dElement.AddColumn("Content Language", user.Profile.ContentLanguage); dElement.AddColumn("Comment", user.Profile.Comment); }
public override void Display(DisplayElement dElement) { var itemElement = dElement.Element as Item; if (itemElement == null) { if (dElement.Element is ID) { itemElement = Sitecore.Context.ContentDatabase.GetItem((ID)dElement.Element); } else if (dElement.Element is WorkflowEventCustom) { itemElement = ((WorkflowEventCustom)dElement.Element).Item; } else if (dElement.Element is AuditItem) { itemElement = Database.GetItem(((AuditItem)dElement.Element).ItemUri); } } if (itemElement == null) { return; } dElement.Value = itemElement.Uri.ToString(); dElement.Header = itemElement.Name; foreach (var column in Columns) { if (!dElement.HasColumn(column.Header)) { var text = getColumnText(column.Name, itemElement); dElement.AddColumn(column.Header, string.IsNullOrEmpty(text) ? itemElement[column.Name] : text); } } dElement.Icon = itemElement.Appearance.Icon; }
public override void Display(DisplayElement dElement) { Sitecore.Security.Accounts.User user = dElement.Element as Sitecore.Security.Accounts.User; if (user == null) { return; } foreach (var column in Columns) { switch (column.Name) { case "name": dElement.AddColumn(column.Header, user.Name); break; case "displayname": dElement.AddColumn(column.Header, user.DisplayName); break; case "domain": dElement.AddColumn(column.Header, user.Domain.Name); break; case "isadmin": dElement.AddColumn(column.Header, user.IsAdministrator ? "yes" : "no"); break; case "roles": user.Roles.Select(r => r.DisplayName).Aggregate((a, c) => a += ", " + c); break; case "fullname": dElement.AddColumn(column.Header, user.Profile.FullName); break; case "email": dElement.AddColumn(column.Header, user.Profile.Email); break; case "lastupdated": dElement.AddColumn(column.Header, user.Profile.LastUpdatedDate.ToString("dd/MM/yy HH:mm"), Sitecore.DateUtil.ToIsoDate(user.Profile.LastUpdatedDate)); break; case "clientlanguage": dElement.AddColumn(column.Header, user.Profile.ClientLanguage); break; case "contentlanguage": dElement.AddColumn(column.Header, user.Profile.ContentLanguage); break; case "comment": dElement.AddColumn(column.Header, user.Profile.Comment); break; default: dElement.AddColumn(column.Header, user.Profile[column.Name]); break; } } }