Esempio n. 1
0
        public override void Execute()
        {
            // Define the schema elements.
            var schema = Schemas.GetSchemaByNamespace(BasePluginConstants.DesignModel_SchemaNamespace);

            schema
            .RootElement
            .FindChildElement("Namespace")
            .GetBuilder()
            .CreateElement("Entity", "Defines an entity which is the root design model");

            // Register parser.
            var designModelElement = schema.RootElement.FindChildElement("Namespace/Entity");

            DesignModelConverterFactory.RegisterFactory(designModelElement, new EntityParser());
        }
Esempio n. 2
0
        public override void Execute()
        {
            // Define the schema elements.
            var schema = Schemas.GetSchemaByNamespace(BasePluginConstants.DesignModel_SchemaNamespace);

            schema
            .RootElement
            .FindChildElement("Namespace/Entity")
            .GetBuilder()
            .AddDeriveFromSchema("entity", true, true, DataTypeRegistry);

            // Register parsers.
            var deriveFromElement = schema.RootElement.FindChildElement("Namespace/Entity/DeriveFrom");
            var parser            = new ClassDerivationParser(DesignModelCollection);

            DesignModelConverterFactory.RegisterFactory(deriveFromElement, parser);
        }
Esempio n. 3
0
        public override void Execute()
        {
            // Define the schema elements.
            var schema     = Schemas.GetSchemaByNamespace(BasePluginConstants.DesignModel_SchemaNamespace);
            var stringType = DataTypeRegistry.Get(BasePluginConstants.DataType_string);

            schema
            .RootElement
            .FindChildElement("Namespace/Entity/Relation")
            .GetBuilder()
            .CreateElement("Attribute", "Defines an entity attribute", c => c.AllowMultiple = true)
            .CreateAttribute("name", stringType, "Attribute name", c => c.IsMandatory       = true)
            .CreateAttribute("type", stringType, "Attribute type", c => c.IsMandatory       = true);

            var designModelElement = schema.RootElement.FindChildElement("Namespace/Entity/Relation/Attribute");

            // Register parser.
            DesignModelConverterFactory.RegisterFactory(designModelElement, new EntityRelationAttributeParser(DataTypeRegistry));
        }
Esempio n. 4
0
        public override void Execute()
        {
            var inputXmlFiles = ProjectCollection
                                .Projects
                                .SelectMany(x => x.DesignModelFiles)
                                .ToList();

            var schema = Schemas.GetSchemaByNamespace(BasePluginConstants.DesignModel_SchemaNamespace);

            ParseState.Elements = new List <IXmlElement>();

            foreach (var inputXmlFile in inputXmlFiles)
            {
                using (var reader = inputXmlFile.OpenAsTextForReading())
                {
                    ParseState.Elements.Add(XmlElementParser.Parse(reader, schema, inputXmlFile));
                }
            }
        }
Esempio n. 5
0
        public override void Execute()
        {
            // Define the schema elements.
            var schema     = Schemas.GetSchemaByNamespace(BasePluginConstants.DesignModel_SchemaNamespace);
            var stringType = DataTypeRegistry.Get(BasePluginConstants.DataType_string);
            var boolType   = DataTypeRegistry.Get(BasePluginConstants.DataType_bool);

            schema
            .RootElement
            .FindChildElement("Namespace/Entity")
            .GetBuilder()
            .CreateElement("Relation", "Defines a relation to another entity")
            .CreateAttribute("name", stringType, "Relation name")
            .CreateAttribute("destination", stringType, "Destination entity name", c => c.IsMandatory          = true)
            .CreateAttribute("mandatory", boolType, "Whether this is a mandatory relation", c => c.IsMandatory = true);

            var designModelElement = schema.RootElement.FindChildElement("Namespace/Entity/Relation");

            // Register parser.
            DesignModelConverterFactory.RegisterFactory(designModelElement, new EntityRelationParser(DesignModelCollection));
        }