public override void StartElement(XmlReader reader, IDictionary <String, String> attributes) { String localName = reader.Name; tempValue = new StringBuilder(); if (localName.Equals(Constants.LIBRARY_DESCRIPTOR_LIBRARY_DESCRIPTOR, StringComparison.OrdinalIgnoreCase)) { libraryDescriptor = new LibraryDescriptor(); } else if (localName.Equals(Constants.LIBRARY_DESCRIPTOR_PROPERTY, StringComparison.OrdinalIgnoreCase)) { InitializeProperty(attributes); } }
/// <summary> /// It process all LibraryDescriptor.xml files defined by application, and stores in Resource Manager. /// </summary> protected static void ProcessLibraries() { ApplicationDescriptor applicationDescriptor = coreResourceManager.GetApplicationDescriptor(); IEnumerator <String> libraries = applicationDescriptor.GetLibraryDescriptorPaths(); while (libraries.MoveNext()) { String library = libraries.Current; /* * Parse LibraryDescriptor. */ LibraryDescriptorReader libraryDescriptorReader = new LibraryDescriptorReader(library); LibraryDescriptor libraryDescriptor = libraryDescriptorReader.GetLibraryDescriptor(); /* * Map Entity Descriptors */ IEnumerator <String> entityDescriptors = libraryDescriptor.GetEntityDescriptorPaths(); while (entityDescriptors.MoveNext()) { String libraryEntityDescriptorPath = entityDescriptors.Current; String databaseDescriptorName = libraryEntityDescriptorPath.Substring(0, libraryEntityDescriptorPath.IndexOf(Constants.LIBRARY_DESCRIPTOR_ENTITY_DESCRIPTOR_SEPRATOR)); String entityDescriptor = libraryEntityDescriptorPath.Substring(libraryEntityDescriptorPath.IndexOf(Constants.LIBRARY_DESCRIPTOR_ENTITY_DESCRIPTOR_SEPRATOR) + 1, ((libraryEntityDescriptorPath.Length - libraryEntityDescriptorPath.IndexOf(Constants.LIBRARY_DESCRIPTOR_ENTITY_DESCRIPTOR_SEPRATOR)) - 1)); IEnumerator <DatabaseDescriptor> databaseDescriptors = applicationDescriptor.GetDatabaseDescriptors(); while (databaseDescriptors.MoveNext()) { DatabaseDescriptor databaseDescriptor = databaseDescriptors.Current; if (databaseDescriptor.GetDatabaseName().Equals(databaseDescriptorName, StringComparison.OrdinalIgnoreCase)) { databaseDescriptor.AddEntityDescriptorPath(library.Replace(".", "/") + FileUtils.Separator + entityDescriptor); } } } } }