public void UpdateChannelInfo(Channel channel, Publication publication)
        {
            var teamContext = publication.GetTeamContext();
            if (teamContext == null)
                return;

            Channel = channel.ChannelName;
            Token = teamContext.Token;
            Username = teamContext.Username;
        }
        private static string PopulateSecurityrMessage(Publication publication, LoggedInArgs user, string action)
        {
            var message = string.Empty;
            if (!string.IsNullOrEmpty(publication.Message))
            {
                message = publication.Message + "\n";
            }
            message += $"User {action}\n" +
                $"User: {user.Username}\n";
            return message;

        }
예제 #3
0
        private static string PopulatePublishMessage(Publication publication, Publisher publisher, string action)
        {
            using (new SecurityDisabler())
            {
                var database =
                    Factory.GetDatabase(Settings.GetSetting("Slack.AuthoringDatabase", "master"));
                var message = "";
                if (!string.IsNullOrEmpty(publication.Message))
                {
                    message = publication.Message + "\n";
                }
                var rootItem = publisher.Options.RootItem != null
                    ? publisher.Options.RootItem.Paths.Path
                    : "site publish";
                message +=
                    $"*{(publisher.Options.RepublishAll ? "Republish" : "Publish")}* {action} to *{string.Join(", ", publisher.Options.PublishingTargets.Select(i => database.GetItem(i).DisplayName))}* database: \n " +
                    $"User: {publisher.Options.UserName}\n" +
                    $"Mode: {publisher.Options.Mode} \n" +
                    
                    $"Root Item: " + rootItem + "\n" +
                    $"Language: {publisher.Options.Language} \n" +
                    $"Publish Subitems: {publisher.Options.Deep} \n";
                if (publisher.Options.Mode == PublishMode.SingleItem)
                {
                    message += $"Publish Subitems: {publisher.Options.Deep} \n" +
                               $"Publish Related Items: {publisher.Options.PublishRelatedItems}";
                }

                return message;
            }
        }
        private static string PopulateMembershipUserMessage(Publication publication, MembershipUser membershipUser, string action)
        {
            var message = string.Empty;
            if (!string.IsNullOrEmpty(publication.Message))
            {
                message = publication.Message + "\n";
            }
            message +=
                $"User {membershipUser.UserName} {action}\n" +
                $"Email: {membershipUser.Email}\n";
            return message;

        }
예제 #5
0
 private static string PopulateItemMessage(Publication publication, Sitecore.Data.Items.Item itemEvent, string action)
 {
     var message = "";
     if (!string.IsNullOrEmpty(publication.Message))
     {
         message = publication.Message + "\n";
     }
     message +=
         $"Item {itemEvent.Name} {action}\n" +
         $"ID: {itemEvent.ID}\n" +
         $"Path: {itemEvent.Paths.Path}\n";
     return message;
 }
예제 #6
0
 private static string PopulateItemCreatedMessage(Publication publication, ItemCreatedEventArgs itemEvent, string action)
 {
     var message = "";
     if (!string.IsNullOrEmpty(publication.Message))
     {
         message = publication.Message + "\n";
     }
     message +=
         $"Item {itemEvent.Item.Name} {action}\n" +
         $"Path: {itemEvent.Item.Paths.Path}\n" +
         $"ID: {itemEvent.Item.ID}\n" +
         $"Created by: {itemEvent.Item.Security.GetOwner()}\n";
     return message;
 }