Пример #1
0
 public override void EndElement(String localName)
 {
     if (localName.Equals(Constants.DATABASE_DESCRIPTOR_PROPERTY))
     {
         databaseDescriptor.AddProperty(propertyName, tempValue.ToString());
     }
     else if (localName.Equals(Constants.DATABASE_DESCRIPTOR_ENTITY_DESCRIPTOR))
     {
         databaseDescriptor.AddEntityDescriptorPath(tempValue.ToString());
     }
 }
Пример #2
0
        /// <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);
                        }
                    }
                }
            }
        }