public void loadDocument(OleDbDataReader reader)
        {
            string bundleName = reader.GetString((int)EducationDatabase.MetadataColumns.Bundle);

            foreach (XElement bundleSpec in ProviderSpecification.DescendantNodes().Where(n => n.NodeType == System.Xml.XmlNodeType.Element))
            {
                if (bundleSpec.Name == "Bundle" && bundleSpec.Attribute("name") != null && bundleSpec.Attribute("name").Value == bundleName)
                {
                    HTMLDocument loadDoc = new HTMLDocument(this, bundleSpec.Elements("Document").First(), reader);
                    EducationDatabase.Self().EducationObjects.Add(HTMLDocument.URLForDictionary(loadDoc.URL), loadDoc);
                    EducationDatabase.Self().EducationCollection.Add(loadDoc);
                }
            }
        }
        public void loadSpecifications(LoadDepth depth = LoadDepth.Full)
        {
            currentLoadDepth = depth;
            loadCount        = 0;

            XDocument specDoc = XDocument.Load(sourceXML.LocalPath);

            //try
            {
                XElement top = specDoc.Element("CustomPatientEducation");
                ProviderSpecification = top.Element("ContentProvider");
                contentProviderName   = ProviderSpecification.Attribute("name").Value.ToString();
                TitlePostfix          = " - " + ProviderSpecification.Attribute("postfix").Value;

                string tempUri = ProviderSpecification.Attribute("url").Value.ToString();
                contentProviderUrl = new Uri(tempUri);


                XElement e = ProviderSpecification.Element("Bundle");
                if (e != null)
                {
                    // TODO Only one bundle per provider is currently supported.
                    bundleUrl         = new Uri(contentProviderUrl, e.Attribute("url").Value.ToString());
                    contentBundleName = e.Attribute("name").Value.ToString();

                    if (currentLoadDepth != LoadDepth.TopLevel)
                    {
                        ParseBundle(e);

                        ResolveDiscrepancies();

                        EducationDatabase.Self().scheduleTasks();
                    }
                }
                else
                {
                    MessageBox.Show("No content bundle found within specifications for provider " + contentProviderName, "Missing Content Bundle Definition", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            } /*catch (Exception e)
               * {
               * MessageBox.Show("Unhandled Exception: " + e.ToString(), "Patient Education Assembler");
               * }*/
        }
Beispiel #3
0
 public string GetSpecification()
 {
     return(ProviderSpecification.ToString());
 }