Ejemplo n.º 1
0
        public StatisticsManager()
        {
            _homeline         = AzureFactory.GetTable(AzureFactory.MSGorillaTable.Homeline);
            _userline         = AzureFactory.GetTable(AzureFactory.MSGorillaTable.Userline);
            _eventline        = AzureFactory.GetTable(AzureFactory.MSGorillaTable.EventLine);
            _publicSquareLine = AzureFactory.GetTable(AzureFactory.MSGorillaTable.PublicSquareLine);
            _topicline        = AzureFactory.GetTable(AzureFactory.MSGorillaTable.TopicLine);
            _ownerline        = AzureFactory.GetTable(AzureFactory.MSGorillaTable.OwnerLine);
            _atline           = AzureFactory.GetTable(Azure.AzureFactory.MSGorillaTable.AtLine);
            _reply            = AzureFactory.GetTable(AzureFactory.MSGorillaTable.Reply);

            _accManager     = new AccountManager();
            _attManager     = new AttachmentManager();
            _schemaManager  = new SchemaManager();
            _notifManager   = new NotifManager();
            _topicManager   = new TopicManager();
            _richMsgManager = new RichMsgManager();
        }
Ejemplo n.º 2
0
        public MessageManager()
        {
            _homeline         = AzureFactory.GetTable(AzureFactory.MSGorillaTable.Homeline);
            _userline         = AzureFactory.GetTable(AzureFactory.MSGorillaTable.Userline);
            _eventline        = AzureFactory.GetTable(AzureFactory.MSGorillaTable.EventLine);
            _publicSquareLine = AzureFactory.GetTable(AzureFactory.MSGorillaTable.PublicSquareLine);
            _topicline        = AzureFactory.GetTable(AzureFactory.MSGorillaTable.TopicLine);
            _ownerline        = AzureFactory.GetTable(AzureFactory.MSGorillaTable.OwnerLine);
            _atline           = AzureFactory.GetTable(Azure.AzureFactory.MSGorillaTable.AtLine);
            _reply            = AzureFactory.GetTable(AzureFactory.MSGorillaTable.Reply);

            _queue            = AzureFactory.GetQueue(AzureFactory.MSGorillaQueue.Dispatcher);
            _spiderqueue      = AzureFactory.GetQueue(AzureFactory.MSGorillaQueue.SearchEngineSpider);
            _mailMessageQueue = AzureFactory.GetQueue(AzureFactory.MSGorillaQueue.MailMessage);

            _accManager     = new AccountManager();
            _attManager     = new AttachmentManager();
            _schemaManager  = new SchemaManager();
            _notifManager   = new NotifManager();
            _topicManager   = new TopicManager();
            _richMsgManager = new RichMsgManager();
            _groupManager   = new GroupManager();
        }
Ejemplo n.º 3
0
        private string GenarateMessageString(Message message)
        {
            StringBuilder sb = new StringBuilder();

            // add send user
            sb.Append(message.User + Separator);

            // add owner users
            if (message.Owner != null)
            {
                foreach (var u in message.Owner)
                {
                    sb.Append(u + Separator);
                }
            }

            // add at users
            if (message.AtUser != null)
            {
                foreach (var u in message.AtUser)
                {
                    sb.Append(u + Separator);
                }
            }

            // add topics
            if (message.TopicName != null)
            {
                foreach (var t in message.TopicName)
                {
                    sb.Append(t + Separator);
                }
            }

            // add event id
            if (!Utils.IsNullOrEmptyOrNone(message.EventID))
            {
                sb.Append(message.EventID + Separator);
            }

            // add schema id
            if (!Utils.IsNullOrEmptyOrNone(message.SchemaID))
            {
                sb.Append(message.SchemaID + Separator);
            }

            // add msg content
            if (!Utils.IsNullOrEmptyOrNone(message.MessageContent))
            {
                sb.Append(message.MessageContent + Separator);
            }

            // add rich msg
            if (!Utils.IsNullOrEmptyOrNone(message.RichMessageID))
            {
                RichMsgManager rmm  = new RichMsgManager();
                string         rich = rmm.GetRichMessage(message.RichMessageID);
                try
                {   // assume rich message is html code
                    HTMLDocumentClass doc = new HTMLDocumentClass();
                    doc.designMode = "on";
                    doc.IHTMLDocument2_write(rich);
                    string richmsg = doc.body.innerText;
                    sb.Append(richmsg + Separator);
                }
                catch
                {
                    try
                    {
                        // TODO: read the rich message in another way
                        sb.Append(StripHtml(rich) + Separator);
                    }
                    catch { }
                }
            }

            // add attached filename
            if (message.AttachmentID != null)
            {
                AttachmentManager am = new AttachmentManager();
                foreach (var a in message.AttachmentID)
                {
                    sb.Append(am.GetAttachmentInfo(a).Filename + Separator);
                }
            }

            return(sb.ToString());
        }