public void AppendToBuilder(StringBuilder sb, global::Umbraco.Core.Models.IContent node) { // get the node from the content cache var contentCacheNode = UmbracoContext.ContentCache.GetById(node.Id); // set variables to empty strings var name = ""; var expiryDate = ""; var liveURL = ""; var docType = ""; // perform null checks on the fields if (node.Name == null) { name = "Null"; } else { name = node.Name; } if (node.ExpireDate == null) { expiryDate = "No Expiry Date"; } else { expiryDate = node.ExpireDate.ToString(); } if (contentCacheNode == null) { liveURL = "Unpublished"; } else { liveURL = contentCacheNode.Url; } if (node.ContentType == null) { docType = "None Found"; } else { docType = node.ContentType.Name; } // if the name contains a comma, surround it in "" so the csv doesn't treat each comma as the start of a new column if (name.Contains(",")) { var temp = name; name = "\"" + temp.Replace("\"", "\"\"") + "\""; } // append to the string builder sb.Append(string.Format("{0},{1},{2},{3},{4}", name, docType, expiryDate, "/umbraco#/content/content/edit/" + node.Id, liveURL) + Environment.NewLine); }
private static void LogAction(global::Umbraco.Core.Models.IContent entity, string actionTaken) { var user = UmbracoContext.Current.Security.CurrentUser; LogHelper.Info <AuditLoggingEventHandler>($"Content '{entity.Name}' with Id '{entity.Id}' has been {actionTaken} by user '{user?.Name}' with Id '{user?.Id}'"); }
public bool SyncNode(global::Umbraco.Core.Models.IContent content) { throw new NotImplementedException(); }