//List<InputOutputThreadObjectHandler<PSTMsgParser>> outputobjects, InputOutputMessageQueue<PSTMsgParser> inqueue, InputOutputMessageQueue<PSTMsgParser> outqueue)
        protected override PSTProcessingResult ProcessQueueObjectImplementation()
        {
            IPst rdopststore = null;
            try
            {
                Logger.NLogger.Info("PSTFile: {0}  EntryID: {1}", this.PSTFile, this.EntryID);
            #if USE_PSTSTORE
                rdopststore = this.PstStore;
            #else
                rdopststore = new Pst(this.PSTFile);
            #endif
                Message rdomail = null;
                try
                {
                    rdomail = (Message)rdopststore.OpenMessage(this.EntryID);
                    rdomail.Pst = (Pst)rdopststore;
                    Logger.NLogger.Info("EntryID: {0}", rdomail.EntryID.ToString());
                }
                catch (Exception ex)
                {
                    Logger.NLogger.ErrorException("ERROR: ProcessQueueObjectImplementation", ex);
                }
                if (rdomail != null)
                {
                    try
                    {
                        HandleMessage(rdomail, this.ExportDirectory); //, outputobjects, inqueue, outqueue);
                    }
                    catch (Exception ex)
                    {
                        Logger.NLogger.ErrorException("ERROR: HandleMessage", ex);
                    }
                    rdomail.Dispose();
                    rdomail = null;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Console.WriteLine(ex.StackTrace);
            }
            finally
            {
            #if !USE_PSTSTORE
                if (rdopststore != null)
                {
                    rdopststore.Dispose();
                    rdopststore = null;
                }
            #endif
            }

            foreach (string file in this.OutputFiles)
                Console.WriteLine(file);

            PSTProcessingResult result = new PSTProcessingResult() { IsSuccessful = true, Filename = string.Empty};
            result.SetProcessingObject<PSTMsgParser>(this);
            return result;
        }
        protected override PSTProcessingResult ProcessQueueObjectImplementation()
        {
            IPst rdopststore = null;

            try
            {
                Logger.NLogger.Info("PSTFile: {0}  EntryID: {1}", this.PSTFile, this.EntryID);
#if USE_PSTSTORE
                rdopststore = this.PstStore;
#else
                rdopststore = new Pst(this.PSTFile);
#endif
                Message rdomail = null;
                try
                {
                    rdomail     = (Message)rdopststore.OpenMessage(this.EntryID);
                    rdomail.Pst = (Pst)rdopststore;
                    Logger.NLogger.Info("EntryID: {0}", rdomail.EntryID.ToString());
                }
                catch (Exception ex)
                {
                    Logger.NLogger.ErrorException("ERROR: ProcessQueueObjectImplementation", ex);
                }
                if (rdomail != null)
                {
                    try
                    {
                    }
                    catch (Exception ex)
                    {
                        Logger.NLogger.ErrorException("ERROR: HandleMessage", ex);
                    }
                    rdomail.Dispose();
                    rdomail = null;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Console.WriteLine(ex.StackTrace);
            }
            finally
            {
#if !USE_PSTSTORE
                if (rdopststore != null)
                {
                    rdopststore.Dispose();
                    rdopststore = null;
                }
#endif
            }

            PSTProcessingResult result = new PSTProcessingResult()
            {
                IsSuccessful = true, Filename = string.Empty
            };
            result.SetProcessingObject <PSTFolderParser>(this);
            return(result);
        }
Beispiel #3
0
        public void OpenMessageTest()
        {
            string   path     = string.Empty;  // TODO: Initialize to an appropriate value
            Pst      target   = new Pst(path); // TODO: Initialize to an appropriate value
            NodeID   nodeID   = new NodeID();  // TODO: Initialize to an appropriate value
            IMessage expected = null;          // TODO: Initialize to an appropriate value
            IMessage actual;

            actual = target.OpenMessage(nodeID);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
Beispiel #4
0
        public override WFState Run()
        {
            WFState retval = new WFState();

            IPst rdopststore = null;

            try
            {
                retval.Value = WFState.WFStateFail;
                WFLogger.NLogger.Info("PSTFile={0}  NodeID={1}", this.PSTFile, this.FileToProcess);

                rdopststore = new Pst(this.PSTFile);

                Message rdomail = null;
                try
                {
                    NodeID msgid = Convert.ToUInt32(this.FileToProcess);
                    if (this.ParentMsg != "0")
                    {
                        msgid = Convert.ToUInt32(this.ParentMsg);
                    }

                    rdomail            = (Message)rdopststore.OpenMessage(msgid);          //this.EntryID);
                    rdomail.Pst        = (Pst)rdopststore;
                    rdomail.FolderPath = this.FolderPath;
                    WFLogger.NLogger.Info("EntryID={0}", rdomail.EntryID.ToString());
                }
                catch (Exception ex)
                {
                    WFLogger.NLogger.ErrorException("ERROR: ProcessQueueObjectImplementation", ex);
                }
                if (rdomail != null)
                {
                    try
                    {
                        HandleMessage(rdomail, this.ExportDirectory);
                        this.ExportDirectory = this.ExportDirectory + @"\" + this.FileToProcess;
                        retval.Value         = WFState.WFStateSuccess;
                    }
                    catch (Exception ex)
                    {
                        WFLogger.NLogger.ErrorException("ERROR: HandleMessage", ex);
                    }
                    rdomail.Dispose();
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Console.WriteLine(ex.StackTrace);
            }
            finally
            {
                if (rdopststore != null)
                {
                    rdopststore.Dispose();
                }
            }

            return(retval);
        }
Beispiel #5
0
        protected override PSTProcessingResult ProcessQueueObjectImplementation()         //List<InputOutputThreadObjectHandler<PSTMsgParser>> outputobjects, InputOutputMessageQueue<PSTMsgParser> inqueue, InputOutputMessageQueue<PSTMsgParser> outqueue)
        {
            IPst rdopststore = null;

            try
            {
                Logger.NLogger.Info("PSTFile: {0}  EntryID: {1}", this.PSTFile, this.EntryID);
#if USE_PSTSTORE
                rdopststore = this.PstStore;
#else
                rdopststore = new Pst(this.PSTFile);
#endif
                Message rdomail = null;
                try
                {
                    rdomail     = (Message)rdopststore.OpenMessage(this.EntryID);
                    rdomail.Pst = (Pst)rdopststore;
                    Logger.NLogger.Info("EntryID: {0}", rdomail.EntryID.ToString());
                }
                catch (Exception ex)
                {
                    Logger.NLogger.ErrorException("ERROR: ProcessQueueObjectImplementation", ex);
                }
                if (rdomail != null)
                {
                    try
                    {
                        HandleMessage(rdomail, this.ExportDirectory);                         //, outputobjects, inqueue, outqueue);
                    }
                    catch (Exception ex)
                    {
                        Logger.NLogger.ErrorException("ERROR: HandleMessage", ex);
                    }
                    rdomail.Dispose();
                    rdomail = null;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Console.WriteLine(ex.StackTrace);
            }
            finally
            {
#if !USE_PSTSTORE
                if (rdopststore != null)
                {
                    rdopststore.Dispose();
                    rdopststore = null;
                }
#endif
            }

            foreach (string file in this.OutputFiles)
            {
                Console.WriteLine(file);
            }

            PSTProcessingResult result = new PSTProcessingResult()
            {
                IsSuccessful = true, Filename = string.Empty
            };
            result.SetProcessingObject <PSTMsgParser>(this);
            return(result);
        }
        public override void Process(PSTMsgParserData data)
        {
            this.PSTFile = data.PSTFile;             // GetProperty<string>("PSTFile", "PSTFileParserData");
            this.PSTFile = data.PSTFile;             // GetProperty<string>("PSTFile", "PSTFileParserData");
            this.ProcessedMsgs.Clear();
            this.ParentMsg         = "0";
            this.SaveAsTypes       = data.SaveAsTypes;
            this.SaveAttachments   = data.SaveAttachments;
            this.SaveEmbeddedMsgs  = data.SaveEmbeddedMsgs;
            this.Pst2MsgCompatible = data.Pst2MsgCompatible;
            this.OutputFiles       = data.OutputDocuments;
            this.FileToProcess     = data.DocumentToProcess;

            data.WFState.Value = "Fail";

            IPst rdopststore = null;

            try
            {
                WFLogger.NLogger.Info("PSTFile={0}  NodeID={1}", PSTFile, this.FileToProcess);

                rdopststore = new Pst(PSTFile);

                Message rdomail = null;
                try
                {
                    NodeID msgid = Convert.ToUInt32(this.FileToProcess);
                    if (this.ParentMsg != "0")
                    {
                        msgid = Convert.ToUInt32(this.ParentMsg);
                    }

                    rdomail            = (Message)rdopststore.OpenMessage(msgid);          //this.EntryID);
                    rdomail.Pst        = (Pst)rdopststore;
                    rdomail.FolderPath = data.FolderPath;
                    WFLogger.NLogger.Info("EntryID={0}", rdomail.EntryID.ToString());
                }
                catch (Exception ex)
                {
                    WFLogger.NLogger.ErrorException("ERROR: ProcessQueueObjectImplementation", ex);
                }
                if (rdomail != null)
                {
                    try
                    {
                        HandleMessage(rdomail, data.ExportDirectory);
                        data.ExportDirectory = data.ExportDirectory + @"\" + this.FileToProcess;
                    }
                    catch (Exception ex)
                    {
                        WFLogger.NLogger.ErrorException("ERROR: HandleMessage", ex);
                    }
                    rdomail.Dispose();
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Console.WriteLine(ex.StackTrace);
            }
            finally
            {
                if (rdopststore != null)
                {
                    rdopststore.Dispose();
                }
            }
            data.WFState.Value = "Succcess";
        }
        public override WFState Run()
        {
            WFState retval = new WFState();

            IPst rdopststore = null;
            try
            {
                retval.Value = WFState.WFStateFail;
                WFLogger.NLogger.Info("PSTFile={0}  NodeID={1}", this.PSTFile, this.FileToProcess);

                rdopststore = new Pst(this.PSTFile);

                Message rdomail = null;
                try
                {
                    NodeID msgid = Convert.ToUInt32(this.FileToProcess);
                    if (this.ParentMsg != "0")
                        msgid = Convert.ToUInt32(this.ParentMsg);

                    rdomail = (Message)rdopststore.OpenMessage(msgid); //this.EntryID);
                    rdomail.Pst = (Pst)rdopststore;
                    rdomail.FolderPath = this.FolderPath;
                    WFLogger.NLogger.Info("EntryID={0}", rdomail.EntryID.ToString());
                }
                catch (Exception ex)
                {
                    WFLogger.NLogger.ErrorException("ERROR: ProcessQueueObjectImplementation", ex);
                }
                if (rdomail != null)
                {
                    try
                    {
                        HandleMessage(rdomail, this.ExportDirectory);
                        this.ExportDirectory = this.ExportDirectory + @"\" + this.FileToProcess;
                        retval.Value = WFState.WFStateSuccess;
                    }
                    catch (Exception ex)
                    {
                        WFLogger.NLogger.ErrorException("ERROR: HandleMessage", ex);
                    }
                    rdomail.Dispose();
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Console.WriteLine(ex.StackTrace);
            }
            finally
            {
                if (rdopststore != null)
                    rdopststore.Dispose();
            }

            return retval;
        }