/// <summary> /// Parse the entity descriptor descriptor defined /// </summary> /// <exception cref="Siminov.Core.Exception.SiminovException">Any exception during parsing the descriptor file</exception> public void Process() { ApplicationDescriptor applicationDescriptor = resourceManager.GetApplicationDescriptor(); if (applicationDescriptor == null) { Log.Log.Error(typeof(QuickEntityDescriptorReader).FullName, "Process", "Invalid Application Descriptor Found"); throw new DeploymentException(typeof(QuickEntityDescriptorReader).FullName, "Process", "Invalid Application Descriptor Found."); } if (!applicationDescriptor.IsDatabaseNeeded()) { doesMatch = false; return; } IEnumerator <DatabaseDescriptor> databaseDescriptors = applicationDescriptor.GetDatabaseDescriptors(); while (databaseDescriptors.MoveNext()) { DatabaseDescriptor databaseDescriptor = databaseDescriptors.Current; IEnumerator <String> entityDescriptors = databaseDescriptor.GetEntityDescriptorPaths(); while (entityDescriptors.MoveNext()) { String entityDescriptorPath = entityDescriptors.Current; Stream entityDescriptorStream = null; try { ParseMessage(entityDescriptorStream); } catch (SiminovException exception) { Log.Log.Error(typeof(QuickEntityDescriptorReader).FullName, "Process", "Exception caught while parsing ENTITY-DESCRIPTOR: " + entityDescriptorPath + ", " + exception.GetMessage()); throw new SiminovException(typeof(QuickEntityDescriptorReader).FullName, "Process", "Exception caught while parsing ENTITY-DESCRIPTOR: " + entityDescriptorPath + ", " + exception.GetMessage()); } if (doesMatch) { EntityDescriptorReader entityDescriptorParser = new EntityDescriptorReader(entityDescriptorPath); this.entityDescriptor = entityDescriptorParser.GetEntityDescriptor(); databaseDescriptor.AddEntityDescriptor(entityDescriptorPath, entityDescriptor); return; } } } }
/// <summary> /// Parse the entity descriptor descriptor defined /// </summary> /// <exception cref="Siminov.Core.Exception.SiminovException">Any exception during parsing the descriptor file</exception> public void Process() { ApplicationDescriptor applicationDescriptor = resourceManager.GetApplicationDescriptor(); if (applicationDescriptor == null) { Log.Log.Error(typeof(QuickEntityDescriptorReader).FullName, "Process", "Invalid Application Descriptor Found"); throw new DeploymentException(typeof(QuickEntityDescriptorReader).FullName, "Process", "Invalid Application Descriptor Found."); } if (!applicationDescriptor.IsDatabaseNeeded()) { doesMatch = false; return; } IEnumerator<DatabaseDescriptor> databaseDescriptors = applicationDescriptor.GetDatabaseDescriptors(); while (databaseDescriptors.MoveNext()) { DatabaseDescriptor databaseDescriptor = databaseDescriptors.Current; IEnumerator<String> entityDescriptors = databaseDescriptor.GetEntityDescriptorPaths(); while (entityDescriptors.MoveNext()) { String entityDescriptorPath = entityDescriptors.Current; Stream entityDescriptorStream = null; try { ParseMessage(entityDescriptorStream); } catch (SiminovException exception) { Log.Log.Error(typeof(QuickEntityDescriptorReader).FullName, "Process", "Exception caught while parsing ENTITY-DESCRIPTOR: " + entityDescriptorPath + ", " + exception.GetMessage()); throw new SiminovException(typeof(QuickEntityDescriptorReader).FullName, "Process", "Exception caught while parsing ENTITY-DESCRIPTOR: " + entityDescriptorPath + ", " + exception.GetMessage()); } if (doesMatch) { EntityDescriptorReader entityDescriptorParser = new EntityDescriptorReader(entityDescriptorPath); this.entityDescriptor = entityDescriptorParser.GetEntityDescriptor(); databaseDescriptor.AddEntityDescriptor(entityDescriptorPath, entityDescriptor); return; } } } }
/// <summary> /// It process all EntityDescriptor.xml file defined in Application, and stores in Resource Manager. /// </summary> protected static void ProcessEntityDescriptors() { DoesDatabaseExists(); ApplicationDescriptor applicationDescriptor = coreResourceManager.GetApplicationDescriptor(); IEnumerator<DatabaseDescriptor> databaseDescriptors = applicationDescriptor.GetDatabaseDescriptors(); while (databaseDescriptors.MoveNext()) { DatabaseDescriptor databaseDescriptor = databaseDescriptors.Current; IEnumerator<String> entityDescriptorPaths = databaseDescriptor.GetEntityDescriptorPaths(); while (entityDescriptorPaths.MoveNext()) { String entityDescriptorPath = entityDescriptorPaths.Current; EntityDescriptorReader entityDescriptorParser = new EntityDescriptorReader(entityDescriptorPath); databaseDescriptor.AddEntityDescriptor(entityDescriptorPath, entityDescriptorParser.GetEntityDescriptor()); } } }