public override IEnumerable <MetaModel.Service.ServiceModel> GetModels(IApplication application)
 {
     return(_metaDataManager
            .GetMetaData <MetaModel.Service.ServiceModel>(new MetaDataType("Service"))
            .Where(x => x.GetPropertyValue("Consumers", "CommaSeperatedList", "").Split(',').Any(y => y.Equals(application.ApplicationName, StringComparison.OrdinalIgnoreCase)))
            .ToList());
 }
Esempio n. 2
0
        public override IEnumerable <DTOModel> GetModels(IApplication application)
        {
            var dtoModels = _metaDataManager.GetMetaData <DTOModel>(new MetaDataIdentifier("DTO"));

            dtoModels = dtoModels.Where(x => x.GetConsumers().Any(a => a.Trim() == application.ApplicationName));

            return(dtoModels.ToList());
        }
Esempio n. 3
0
        public override IEnumerable <DTOModel> GetModels(IApplication application)
        {
            var dtoModels = _metaDataManager.GetMetaData <DTOModel>(new MetaDataType("DTO"));

            dtoModels = dtoModels.Where(x => x.GetPropertyValue("Consumers", "CommaSeperatedList", "").Split(',').Any(a => a.Trim() == application.ApplicationName));

            return(dtoModels.ToList());
        }
Esempio n. 4
0
        public override IEnumerable <IDTOModel> GetModels(IApplication application)
        {
            var dtoModels = _metaDataManager.GetDTOModels(application);

            // TODO JL: Temp, filter out ones for server only, will ultimately get replaced with concept of client applications in the future
            dtoModels = dtoModels.Where(x => x.Stereotypes.All(s => s.Name != "ServerOnly") && !FolderOrParentFolderHasStereoType(x.Folder, "ServerOnly"));

            return(dtoModels.ToList());
        }
Esempio n. 5
0
 public static IClassTypeSource InApplication(IApplication application, string templateId, string collectionType = nameof(IEnumerable))
 {
     return(new ClassTypeSource((typeInfo) =>
     {
         if (typeInfo.IsCollection)
         {
             return $"{collectionType}<{FullTypeNameInApplication(application, templateId, typeInfo)}>";
         }
         return FullTypeNameInApplication(application, templateId, typeInfo);
     }));
 }
Esempio n. 6
0
        public override IEnumerable <IServiceModel> GetModels(IApplication application)
        {
            var serviceModels = _metaDataManager.GetMetaData <IServiceModel>("Services");

            serviceModels = serviceModels
                            .Where(x => GetConsumers(x).Any(y => y.Equals(application.ApplicationName, StringComparison.OrdinalIgnoreCase)))
                            .ToList();


            return(serviceModels.ToList());
        }
Esempio n. 7
0
        public override IEnumerable <MetaModel.DTO.IDTOModel> GetModels(IApplication application)
        {
            var dtoModels = _metaDataManager.GetMetaData <MetaModel.DTO.IDTOModel>(new MetaDataIdentifier("Services"));

            if (!dtoModels.Any())
            {
                dtoModels = _metaDataManager.GetMetaData <MetaModel.DTO.IDTOModel>(new MetaDataIdentifier("DTO")); // backward compatibility
            }
            return(dtoModels
                   .Where(x => x.GetConsumers().Any(y => y.Equals(application.ApplicationName, StringComparison.OrdinalIgnoreCase)))
                   .ToList());
        }
Esempio n. 8
0
        public override IEnumerable <MetaModel.Service.IServiceModel> GetModels(IApplication application)
        {
            var serviceModels = _metaDataManager.GetMetaData <MetaModel.Service.IServiceModel>("Services");

            if (!serviceModels.Any())
            {
                serviceModels = _metaDataManager.GetMetaData <MetaModel.Service.IServiceModel>("Service"); // backward compatibility
            }
            return(serviceModels
                   .Where(x => x.GetConsumers().Any(y => y.Equals(application.ApplicationName, StringComparison.OrdinalIgnoreCase)))
                   .ToList());
        }
Esempio n. 9
0
        public override IEnumerable <IClass> GetModels(Intent.SoftwareFactory.Engine.IApplication application)
        {
            var allModels      = _metaDataManager.GetDomainModels(application);
            var filteredModels = allModels.Where(p => _stereotypeNames.Any(q => p.HasStereotype(q)));

            if (!filteredModels.Any())
            {
                return(allModels);
            }

            return(filteredModels);
        }
        public override void RegisterStuff(IApplication application, IMetaDataManager metaDataManager)
        {
            var dtoModels = metaDataManager
                            .GetMetaData <DtoModel>(new MetaDataType("DtoProjection"))
                            .Where(x => x.Clients.Any(y => application.ApplicationName.Equals(y, StringComparison.OrdinalIgnoreCase)))
                            .ToList();

            var serviceModels = metaDataManager
                                .GetMetaData <ServiceModel>(new MetaDataType("Service-Legacy"))
                                .Where(x => x.Clients.Any(y => application.ApplicationName.Equals(y, StringComparison.OrdinalIgnoreCase)))
                                .ToList();

            foreach (var model in dtoModels)
            {
                RegisterTemplate(TemplateIds.ClientDtoLegacy, project => new DTOTemplate(project, model, TemplateIds.ClientDtoLegacy));
            }

            foreach (var serviceModel in serviceModels)
            {
                RegisterTemplate(TemplateIds.ClientLegacyServiceContractLegacy, project => new ServiceContractTemplate(serviceModel, project, TemplateIds.ClientLegacyServiceContractLegacy));
            }
        }
        public override void RegisterStuff(IApplication applicationManager, IMetaDataManager metaDataManager)
        {
            RegisterDecorator <AbstractDomainEntityDecorator>(nameof(DDDEntityDecorator), new DDDEntityDecorator());
            RegisterDecorator <AbstractDomainEntityDecorator>(nameof(SerializableEntityDecorator), new SerializableEntityDecorator());
            RegisterDecorator <AbstractDomainEntityInterfaceDecorator>(nameof(DDDEntityInterfaceDecorator), new DDDEntityInterfaceDecorator());
            RegisterDecorator <AbstractDomainEntityInterfaceDecorator>(nameof(SerializableEntityInterfaceDecorator), new SerializableEntityInterfaceDecorator());

            var entityModels = metaDataManager.GetMetaData <Class>(new MetaDataType("DomainEntity")).Where(x => x.Application.Name == applicationManager.ApplicationName);

            foreach (var entityModel in entityModels)
            {
                if (entityModel.Stereotypes.All(x => x.Name != "Serializable"))
                {
                    continue;
                }

                RegisterTemplate(nameof(DomainEntityTemplate), project => new DomainEntityTemplate(entityModel, project));
                RegisterTemplate(nameof(DomainEntityInterfaceTemplate), project => new DomainEntityInterfaceTemplate(entityModel, project));
                if (entityModel.Stereotypes.Any(x => x.Name == "Behaviours"))
                {
                    RegisterTemplate(nameof(DomainEntityBehaviourTemplate), project => new DomainEntityBehaviourTemplate(entityModel, project));
                }
            }
        }
Esempio n. 12
0
 public override IEnumerable <IClass> GetModels(IApplication applicationManager)
 {
     return(_metaDataManager.GetClassModels(applicationManager, "Module Builder")
            .Where(x => x.IsFileTemplate())
            .ToList());
 }
Esempio n. 13
0
 public override IEnumerable <IClass> GetModels(IApplication applicationManager)
 {
     return(_metaDataManager.GetClassModels(applicationManager, "Module Builder")
            .Where(x => (x.IsCSharpTemplate() || x.IsFileTemplate()) && x.GetRegistrationType() == RegistrationType.FilePerModel)
            .ToList());
 }
 public ConventionDecorator(IMetaDataManager metaDataManager, Intent.SoftwareFactory.Engine.IApplication application)
 {
     _metaDataManager = metaDataManager;
     _application     = application;
 }
Esempio n. 15
0
 public override IEnumerable <IApplication> GetModels(Intent.SoftwareFactory.Engine.IApplication application)
 {
     return(new[] { application });
 }
Esempio n. 16
0
 public override ITemplate CreateTemplateInstance(IProject project, Intent.SoftwareFactory.Engine.IApplication model)
 {
     return(new Template(project, model));
 }
Esempio n. 17
0
 private static string FullTypeNameInApplication(IApplication application, string templateId, ITypeReference typeInfo)
 {
     return(application.FindTemplateInstance <IHasClassDetails>(
                TemplateDependancy.OnModel <IMetaModel>(templateId, (x) => x.Id == typeInfo.Id))
            ?.FullTypeName());
 }
 public override IEnumerable <IClass> GetModels(Intent.SoftwareFactory.Engine.IApplication application)
 {
     return(_metaDataManager.GetDomainModels(application));
 }
Esempio n. 19
0
 public override IEnumerable <IClass> GetModels(Intent.SoftwareFactory.Engine.IApplication application)
 {
     return(_metaDataManager.GetDomainModels(application).Where(c => c.Name == "FileUpload"));
 }