Ejemplo n.º 1
0
        /// <summary>
        /// Loads NWF File into Analyzer from provided path.
        /// </summary>
        /// <param name="fileName">Path to file including filename.</param>
        internal NWFContext NwfFileLoader(string fileName)
        {
            try
            {
                StreamReader doc = File.OpenText(fileName);

                String reader = doc.ReadToEnd();

                _nwfContext = new NWFContext(reader);

                doc.Close();

                _isFileLoaded = true;

                _fileType = FileTypes.FileType.Nwf;

                NWFObjectLoader();

                return(_nwfContext);
            }
            catch (Exception ex)
            {
                MessageBox.Show(@"Error: Could not read file from disk. Original error: " + ex.Message);
                return(null);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Loads NWF File into Analyzer from XML
        /// </summary>
        /// <param name="fileName">Workflow XML.</param>
        internal NWFContext NWFXMLLoader(string workflowXML)
        {
            try
            {
                _nwfContext = new NWFContext(workflowXML);

                _isFileLoaded = true;

                _fileType = FileTypes.FileType.Nwf;

                NWFObjectLoader();

                return(_nwfContext);
            }
            catch (Exception ex)
            {
                MessageBox.Show(@"Error: Could not read file from disk. Original error: " + ex.Message);
                return(null);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Loads Support Package File into Analyzer from provided path.
        /// </summary>
        /// <param name="fileName">Path to file including filename.</param>
        internal void SupportPackageLoader(string fileName)
        {
            using (ZipArchive packageArchive = ZipFile.Open(fileName, ZipArchiveMode.Read))
            {
                Stream farmSummaryEntry = packageArchive.GetEntry("FarmSummary.xml").Open();

                if (farmSummaryEntry == null)
                {
                    return;
                }

                Stream nintexProductsEntry = packageArchive.GetEntry("NintexProducts.xml").Open();

                if (nintexProductsEntry == null)
                {
                    return;
                }

                Stream ulsLogsEntry = packageArchive.GetEntry("ULSLogs.log").Open();

                if (ulsLogsEntry == null)
                {
                    return;
                }

                using (StreamReader reader = new StreamReader(farmSummaryEntry, Encoding.Unicode))
                {
                    XmlDocument xmlDocument = new XmlDocument();

                    xmlDocument.LoadXml(reader.ReadToEnd());
                    PluginHelper.FarmSummaryXmlDocument = xmlDocument;

                    MemoryStream memoryStream = new MemoryStream();

                    xmlDocument.Save(memoryStream);

                    memoryStream.Position = 0;

                    XmlSerializer serializer = new XmlSerializer(typeof(FarmSummary));
                    PluginHelper.FarmSummaryContext = (FarmSummary)serializer.Deserialize(memoryStream);
                }

                using (StreamReader reader = new StreamReader(nintexProductsEntry, Encoding.Unicode))
                {
                    XmlDocument xmlDocument = new XmlDocument();

                    xmlDocument.LoadXml(reader.ReadToEnd());

                    PluginHelper.NintexProductsXmlDocument = xmlDocument;

                    MemoryStream memoryStream = new MemoryStream();

                    xmlDocument.Save(memoryStream);

                    memoryStream.Position = 0;

                    XmlSerializer serializer = new XmlSerializer(typeof(NintexProductData));

                    PluginHelper.NintexProductDataContext = (NintexProductData)serializer.Deserialize(memoryStream);
                }

                using (StreamReader reader = new StreamReader(ulsLogsEntry))
                {
                    PluginHelper.ULSLogs = reader.ReadToEnd();

                    new UlsEntryListGenerator(PluginHelper.ULSLogs);
                }
            }

            _isFileLoaded = true;
            _fileType     = FileTypes.FileType.Zip;

            //Only run if the package contains workflow data.
            if (PluginHelper.NintexProductDataContext.NintexWorkflowInfo != null && !string.IsNullOrEmpty(PluginHelper.NintexProductDataContext.NintexWorkflowInfo.NWFFile))
            {
                _nwfContext = new NWFContext(PluginHelper.NintexProductDataContext.NintexWorkflowInfo.NWFFile);
            }

            if (_nwfContext != null)
            {
                NWFObjectLoader();
            }
        }
Ejemplo n.º 4
0
 public BpaDocument(NWFContext nwfContext)
 {
     BpaXmlDocument = new XDocument();
     AddRootElement();
 }
Ejemplo n.º 5
0
 internal Common(INWFContext nwfContext)
 {
     _fileType   = FileTypes.FileType.Nwf;
     _nwfContext = (NWFContext)nwfContext;
 }