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());
 }
Ejemplo 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());
        }
Ejemplo 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());
        }
Ejemplo 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());
        }
Ejemplo 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);
     }));
 }
Ejemplo 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());
        }
Ejemplo 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());
        }
Ejemplo 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());
        }
Ejemplo 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);
        }
Ejemplo n.º 10
0
        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));
                }
            }
        }
Ejemplo n.º 12
0
 public override IEnumerable <IClass> GetModels(IApplication applicationManager)
 {
     return(_metaDataManager.GetClassModels(applicationManager, "Module Builder")
            .Where(x => x.IsFileTemplate())
            .ToList());
 }
Ejemplo 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;
 }
Ejemplo n.º 15
0
 public override IEnumerable <IApplication> GetModels(Intent.SoftwareFactory.Engine.IApplication application)
 {
     return(new[] { application });
 }
Ejemplo n.º 16
0
 public override ITemplate CreateTemplateInstance(IProject project, Intent.SoftwareFactory.Engine.IApplication model)
 {
     return(new Template(project, model));
 }
Ejemplo 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));
 }
Ejemplo n.º 19
0
 public override IEnumerable <IClass> GetModels(Intent.SoftwareFactory.Engine.IApplication application)
 {
     return(_metaDataManager.GetDomainModels(application).Where(c => c.Name == "FileUpload"));
 }