public void GenerateSeedData() { // Features using (var featureManager = new FeatureManager()) using (var operationManager = new OperationManager()) using (var versionManager = new VersionManager()) { var bexisFeature = featureManager.FindByName("BExIS") ?? featureManager.Create("BExIS", "This is the root!"); // Operations var o1 = operationManager.Find("Shell", "Account", "*") ?? operationManager.Create("Shell", "Account", "*"); var o2 = operationManager.Find("Shell", "Home", "*") ?? operationManager.Create("Shell", "Home", "*"); var o3 = operationManager.Find("Shell", "Error", "*") ?? operationManager.Create("Shell", "Error", "*"); var o4 = operationManager.Find("Shell", "TermsAndConditions", "*") ?? operationManager.Create("Shell", "TermsAndConditions", "*"); var o5 = operationManager.Find("Shell", "PrivacyPolicy", "*") ?? operationManager.Create("Shell", "PrivacyPolicy", "*"); var o6 = operationManager.Find("Shell", "Footer", "*") ?? operationManager.Create("Shell", "Footer", "*"); var o7 = operationManager.Find("Shell", "Ldap", "*") ?? operationManager.Create("Shell", "Ldap", "*"); var o8 = operationManager.Find("Shell", "Help", "*") ?? operationManager.Create("Shell", "Help", "*"); if (!versionManager.Exists("Shell", "2.14.0")) { versionManager.Create("Shell", "2.14.0"); } } }
public void GenerateSeedData() { #region SECURITY OperationManager operationManager = new OperationManager(); FeatureManager featureManager = new FeatureManager(); try { List <Feature> features = featureManager.FeatureRepository.Get().ToList(); Feature rootResearchAreaFeature = featureManager.FeatureRepository.Get().FirstOrDefault(f => f.Name.Equals("Research Area Management")); if (rootResearchAreaFeature == null) { rootResearchAreaFeature = featureManager.Create("Research Area Management", "Research Area Management"); } Feature researchAreasFeature = features.FirstOrDefault(f => f.Name.Equals("Research Areas")); if (researchAreasFeature == null) { researchAreasFeature = featureManager.Create("Research Areas", "Research Areas", rootResearchAreaFeature); } Feature researchAreasAdminFeature = features.FirstOrDefault(f => f.Name.Equals("Research Areas Admin")); if (researchAreasAdminFeature == null) { researchAreasAdminFeature = featureManager.Create("Research Areas Admin", "Research Areas Admin", rootResearchAreaFeature); } operationManager.Create("PMM", "Main", "*", researchAreasFeature); operationManager.Create("PMM", "MainAdmin", "*", researchAreasAdminFeature); } catch (Exception ex) { throw ex; } finally { operationManager.Dispose(); featureManager.Dispose(); } }
public void GenerateSeedData() { OperationManager operationManager = new OperationManager(); FeatureManager featureManager = new FeatureManager(); try { List <Feature> features = featureManager.FeatureRepository.Get().ToList(); Feature FileManagement = features.FirstOrDefault(f => f.Name.Equals("File Management")); if (FileManagement == null) { FileManagement = featureManager.Create("File Management", "File Management"); } List <string> controllers = GetController(); foreach (string c in controllers) { Feature feature = features.FirstOrDefault(f => f.Name.Equals(c)); if (feature == null) { feature = featureManager.Create(c, c, FileManagement); } operationManager.Create("FMT", c, "*", feature); } } catch (Exception ex) { throw ex; } finally { operationManager.Dispose(); featureManager.Dispose(); } }
public static void Init() { // Features var featureManager = new FeatureManager(); var bexisFeature = featureManager.FindByName("BExIS") ?? featureManager.Create("BExIS", "This is the root!"); // Operations var operationManager = new OperationManager(); var o1 = operationManager.Find("Shell", "Account", "*") ?? operationManager.Create("Shell", "Account", "*"); var o2 = operationManager.Find("Shell", "Home", "*") ?? operationManager.Create("Shell", "Home", "*"); var o3 = operationManager.Find("Shell", "Error", "*") ?? operationManager.Create("Shell", "Error", "*"); var o4 = operationManager.Find("Shell", "Terms", "*") ?? operationManager.Create("Shell", "Terms", "*"); var o5 = operationManager.Find("Shell", "Footer", "*") ?? operationManager.Create("Shell", "Footer", "*"); var o6 = operationManager.Find("Shell", "Ldap", "*") ?? operationManager.Create("Shell", "Ldap", "*"); }
public void GenerateSeedData() { using (FeatureManager featureManager = new FeatureManager()) using (FeaturePermissionManager featurePermissionManager = new FeaturePermissionManager()) using (OperationManager operationManager = new OperationManager()) { List <Feature> features = featureManager.FeatureRepository.Get().ToList(); Feature Search = features.FirstOrDefault(f => f.Name.Equals("Search")); if (Search == null) { Search = featureManager.Create("Search", "Search"); } if (!operationManager.Exists("MMM", "ShowMultimediaData", "*")) { operationManager.Create("MMM", "ShowMultimediaData", "*", Search); } } }
public void GenerateSeedData() { using (FeatureManager featureManager = new FeatureManager()) using (OperationManager operationManager = new OperationManager()) { //Features List <Feature> features = featureManager.FeatureRepository.Get().ToList(); Feature VAT = features.FirstOrDefault(f => f.Name.Equals("VAT")); if (VAT == null) { VAT = featureManager.Create("VAT", "Interface to a tool that provides visualize, analyze and transform functions"); } Feature AdminFeature = features.FirstOrDefault(f => f.Name.Equals("Admin") && f.Parent != null && f.Parent.Id.Equals(VAT.Id)); Feature DisplayFeature = features.FirstOrDefault(f => f.Name.Equals("Display") && f.Parent != null && f.Parent.Id.Equals(VAT.Id)); Feature API = features.FirstOrDefault(f => f.Name.Equals("API") && f.Parent != null && f.Parent.Id.Equals(VAT.Id)); //Operations operationManager.Create("VAT", "Admin", "*", AdminFeature); operationManager.Create("VAT", "Home", "*", DisplayFeature); operationManager.Create("VAT", "Config", "*", DisplayFeature); operationManager.Create("API", "GeoRef", "*", API); } }
public void GenerateSeedData() { using (FeatureManager featureManager = new FeatureManager()) using (OperationManager operationManager = new OperationManager()) { try { Feature visualization = featureManager.FeatureRepository.Get().FirstOrDefault(f => f.Name.Equals("Visualization")); if (visualization == null) { visualization = featureManager.Create("Visualization", "Visualization"); } operationManager.Create("VIM", "Visualization", "*", visualization); operationManager.Create("VIM", "Help", "*"); } catch (Exception ex) { throw ex; } } }
public void GenerateSeedData() { // Javad: // 1) all the create operations should check for existence of the record // 2) failure on creating any record should rollback the whole seed data generation. It is one transaction. // 3) failues should throw an exception with enough information to pin point the root cause // 4) only seed data related to the functions of this modules should be genereated here. // BUG: seed data creation is not working because of the changes that were done in the entities and services. // TODO: reimplement the seed data creation method. //#region Security //// Tasks using (OperationManager operationManager = new OperationManager()) using (FeatureManager featureManager = new FeatureManager()) using (var featurePermissionManager = new FeaturePermissionManager()) { // find root var root = featureManager.FindRoots().FirstOrDefault(); // administration node var administrationFeature = featureManager.FindByName("Administration") ?? featureManager.Create("Administration", "node for all administrative features", root); // users node var userFeature = featureManager.FindByName("Users") ?? featureManager.Create("Users", "", administrationFeature); var userOperation = operationManager.Find("SAM", "Users", "*") ?? operationManager.Create("SAM", "Users", "*", userFeature); // groups node var groupFeature = featureManager.FindByName("Groups") ?? featureManager.Create("Groups", "", administrationFeature); var groupOperation = operationManager.Find("SAM", "Groups", "*") ?? operationManager.Create("SAM", "Groups", "*", groupFeature); // feature permissions var featurePermissionFeature = featureManager.FindByName("Feature Permissions") ?? featureManager.Create("Feature Permissions", "", administrationFeature); var featurePermissionOperation = operationManager.Find("SAM", "FeaturePermissions", "*") ?? operationManager.Create("SAM", "FeaturePermissions", "*", featurePermissionFeature); // Entity Permissions var entityPermissionFeature = featureManager.FindByName("Entity Permissions") ?? featureManager.Create("Entity Permissions", "", administrationFeature); var entityPermissionOperation = operationManager.Find("SAM", "EntityPermissions", "*") ?? operationManager.Create("SAM", "EntityPermissions", "*", entityPermissionFeature); // User Permissions var userPermissionFeature = featureManager.FindByName("User Permissions") ?? featureManager.Create("User Permissions", "", administrationFeature); var userPermissionOperation = operationManager.Find("SAM", "UserPermissions", "*") ?? operationManager.Create("SAM", "UserPermissions", "*", userPermissionFeature); // Dataset Management var datasetManagementFeature = featureManager.FindByName("Dataset Management") ?? featureManager.Create("Dataset Management", "", administrationFeature); var datasetManagementOperation = operationManager.Find("SAM", "Datasets", "*") ?? operationManager.Create("SAM", "Datasets", "*", datasetManagementFeature); // Document Management var documentManagementFeature = featureManager.FindByName("Document Management") ?? featureManager.Create("Document Management", "", administrationFeature); var documentManagementOperation = operationManager.Find("SAM", "Files", "*") ?? operationManager.Create("SAM", "Files", "*", documentManagementFeature); // Request var requestManagementFeature = featureManager.FindByName("Request Management") ?? featureManager.Create("Request Management", "", administrationFeature); var requestManagementOperation = operationManager.Find("SAM", "RequestsAdmin", "*") ?? operationManager.Create("SAM", "RequestsAdmin", "*", requestManagementFeature); var requestOperation = operationManager.Find("SAM", "Requests", "*") ?? operationManager.Create("SAM", "Requests", "*"); // Help var helpOperation = operationManager.Find("SAM", "Help", "*") ?? operationManager.Create("SAM", "Help", "*"); if (!featurePermissionManager.Exists(null, featurePermissionFeature.Id, PermissionType.Grant)) { featurePermissionManager.Create(null, featurePermissionFeature.Id, PermissionType.Grant); } } }
public void GenerateSeedData() { FeatureManager featureManager = null; FeaturePermissionManager featurePermissionManager = new FeaturePermissionManager(); OperationManager operationManager = new OperationManager(); try { featureManager = new FeatureManager(); List <Feature> features = featureManager.FeatureRepository.Get().ToList(); Feature dataPlanning = features.FirstOrDefault(f => f.Name.Equals("Data Planning")); if (dataPlanning == null) { dataPlanning = featureManager.Create("Data Planning", "Data Planning Management"); } Feature datastructureFeature = features.FirstOrDefault(f => f.Name.Equals("Datastructure Management") && f.Parent != null && f.Parent.Id.Equals(dataPlanning.Id)); if (datastructureFeature == null) { datastructureFeature = featureManager.Create("Datastructure Management", "Datastructure Management", dataPlanning); } if (!operationManager.Exists("RPM", "DataStructureSearch", "*")) { operationManager.Create("RPM", "DataStructureSearch", "*", datastructureFeature); } if (!operationManager.Exists("RPM", "DataStructureEdit", "*")) { operationManager.Create("RPM", "DataStructureEdit", "*", datastructureFeature); } if (!operationManager.Exists("RPM", "Structures", "*")) { operationManager.Create("RPM", "Structures", "*", datastructureFeature); } if (!operationManager.Exists("RPM", "DataStructureIO", "*")) { operationManager.Create("RPM", "DataStructureIO", "*", datastructureFeature); } Feature atributeFeature = features.FirstOrDefault(f => f.Name.Equals("Variable Template Management") && f.Parent != null && f.Parent.Id.Equals(dataPlanning.Id)); if (atributeFeature == null) { atributeFeature = featureManager.Create("Variable Template Management", "Variable Template Management", dataPlanning); } ; if (!operationManager.Exists("RPM", "DataAttribute", "*")) { operationManager.Create("RPM", "DataAttribute", "*", atributeFeature); } Feature unitFeature = features.FirstOrDefault(f => f.Name.Equals("Unit Management") && f.Parent != null && f.Parent.Id.Equals(dataPlanning.Id)); if (unitFeature == null) { unitFeature = featureManager.Create("Unit Management", "Unit Management", dataPlanning); } if (!operationManager.Exists("RPM", "Unit", "*")) { operationManager.Create("RPM", "Unit", "*", unitFeature); } Feature dataTypeFeature = features.FirstOrDefault(f => f.Name.Equals("Data Type Management") && f.Parent != null && f.Parent.Id.Equals(dataPlanning.Id)); if (dataTypeFeature == null) { dataTypeFeature = featureManager.Create("Data Type Management", "Data Type Management", dataPlanning); } if (!operationManager.Exists("RPM", "Home", "*")) { operationManager.Create("RPM", "Home", "*", dataTypeFeature); } if (!operationManager.Exists("RPM", "Help", "*")) { operationManager.Create("RPM", "Help", "*"); } Feature api = features.FirstOrDefault(f => f.Name.Equals("API") && f.Parent != null && f.Parent.Id.Equals(dataPlanning.Id)); if (api == null) { api = featureManager.Create("API", "API", dataPlanning); } if (!operationManager.Exists("API", "Structures", "*")) { operationManager.Create("API", "Structures", "*", api); } //set api public featurePermissionManager.Create(null, api.Id, Security.Entities.Authorization.PermissionType.Grant); } finally { featureManager.Dispose(); featurePermissionManager.Dispose(); operationManager.Dispose(); } //create seed data from csv files MappingReader mappingReader = new MappingReader(); AttributeCreator attributeCreator = new AttributeCreator(); string filePath = AppConfiguration.GetModuleWorkspacePath("RPM"); // read data types from csv file DataTable mappedDataTypes = mappingReader.readDataTypes(filePath); // create read data types in bpp attributeCreator.CreateDataTypes(ref mappedDataTypes); //// read dimensions from csv file DataTable mappedDimensions = mappingReader.readDimensions(filePath); // create dimensions in bpp attributeCreator.CreateDimensions(ref mappedDimensions); //// read units from csv file DataTable mappedUnits = mappingReader.readUnits(filePath); // create read units in bpp attributeCreator.CreateUnits(ref mappedUnits); //// read attributes from csv file DataTable mappedAttributes = mappingReader.readAttributes(filePath); // free memory mappedDataTypes.Clear(); mappedDimensions.Clear(); // create read attributes in bpp attributeCreator.CreateAttributes(ref mappedAttributes); createResearchPlan(); //createSeedDataTypes(); //createSIUnits(); //createEmlDatasetAdv(); //createABCD(); //ImportSchema("Basic ABCD", "ABCD_2.06.XSD","Dataset","BExIS.Dlm.Entities.Data.Dataset"); //ImportSchema("Basic Eml", "eml.xsd","dataset","BExIS.Dlm.Entities.Data.Dataset"); DataStructureManager dsm = null; try { dsm = new DataStructureManager(); foreach (StructuredDataStructure sds in dsm.StructuredDataStructureRepo.Get()) { DataStructureIO.convertOrder(sds); } } finally { dsm.Dispose(); } }
public void GenerateSeedData() { #region ENTITIES List <EntityStruct> entities = new List <EntityStruct>(); entities.Add(new EntityStruct("SingleResource", typeof(SingleResource), typeof(BExIS.Rbm.Services.Resource.SingleResourceStore))); entities.Add(new EntityStruct("ResourceStructure", typeof(ResourceStructure), typeof(BExIS.Rbm.Services.ResourceStructure.ResourceStructureStore))); entities.Add(new EntityStruct("ResourceStructureAttribute", typeof(ResourceStructureAttribute), typeof(BExIS.Rbm.Services.ResourceStructure.ResourceStructureAttributeStore))); entities.Add(new EntityStruct("Activity", typeof(Activity), typeof(BExIS.Rbm.Services.Booking.ActivityStore))); entities.Add(new EntityStruct("BookingEvent", typeof(BookingEvent), typeof(BExIS.Rbm.Services.Booking.BookingEventStore))); entities.Add(new EntityStruct("Notification", typeof(Notification), typeof(BExIS.Rbm.Services.Booking.NotificationStore))); entities.Add(new EntityStruct("Schedule", typeof(Schedule), typeof(BExIS.Rbm.Services.Booking.ScheduleStore))); Dictionary <string, Type> rbmEntities = new Dictionary <string, Type>(); rbmEntities.Add("SingleResource", typeof(SingleResource)); rbmEntities.Add("ResourceStructure", typeof(ResourceStructure)); rbmEntities.Add("ResourceStructureAttribute", typeof(ResourceStructureAttribute)); rbmEntities.Add("Activity", typeof(Activity)); rbmEntities.Add("BookingEvent", typeof(BookingEvent)); rbmEntities.Add("Notification", typeof(Notification)); rbmEntities.Add("Schedule", typeof(Schedule)); using (var entityManager = new EntityManager()) { foreach (var et in entities) { Entity entity = entityManager.Entities.Where(e => e.Name.ToUpperInvariant() == et.Name.ToUpperInvariant()).FirstOrDefault(); if (entity == null) { entity = new Entity(); entity.Name = et.Name; entity.EntityType = et.Type; entity.EntityStoreType = et.StoreType; //entity.UseMetadata = true; entity.Securable = true; entityManager.Create(entity); } } } try { ResourceStructureAttribute rsa = new ResourceStructureAttribute(); using (var rsaManager = new ResourceStructureAttributeManager()) rsa = rsaManager.CreateResourceStructureAttribute("Exploratory", "Biodiversity Exploratories funded by DFG Priority Programme 1374. They serve as open research platform for all biodiversity and ecosystem research groups of Germany."); var dcManager = new DataContainerManager(); string[] keys = { "Hainich-Dün", "Schorfheide-Chorin", "Schwäbische Alb" }; List <DomainItem> domainItems = CreateDomainItems(keys); DomainConstraint dc = new DomainConstraint(ConstraintProviderSource.Internal, "", "en-US", "a simple domain validation constraint", false, null, null, null, domainItems); dcManager.AddConstraint(dc, rsa); ResourceStructureAttribute rsa2 = new ResourceStructureAttribute(); using (var rsaManager2 = new ResourceStructureAttributeManager()) rsa2 = rsaManager2.CreateResourceStructureAttribute("Type", "Type of resource."); var dcManager2 = new DataContainerManager(); string[] keys2 = { "Area", "Equipment", "Sleeping place" }; List <DomainItem> domainItems2 = CreateDomainItems(keys2); DomainConstraint dc2 = new DomainConstraint(ConstraintProviderSource.Internal, "", "en-US", "a simple domain validation constraint", false, null, null, null, domainItems2); dcManager2.AddConstraint(dc2, rsa2); ResourceStructureAttribute rsa3 = new ResourceStructureAttribute(); using (var rsaManager3 = new ResourceStructureAttributeManager()) rsa3 = rsaManager3.CreateResourceStructureAttribute("Information File", "Important information as file"); ResourceStructureManager rsManager = new ResourceStructureManager();; ResourceStructure rs = rsManager.Create("Explo resources", "Resources related to exploratories.", null, null); using (var rsaManager = new ResourceStructureAttributeManager()) rsaManager.CreateResourceAttributeUsage(rsa, rs, true, false); using (var rsaManager = new ResourceStructureAttributeManager()) rsaManager.CreateResourceAttributeUsage(rsa2, rs, true, false); using (var rsaManager = new ResourceStructureAttributeManager()) rsaManager.CreateResourceAttributeUsage(rsa3, rs, true, true); ActivityManager aManager = new ActivityManager(); aManager.CreateActivity("Adding of material (litter, dead wood, chemicals ....)", "", false); aManager.CreateActivity("Adding of organisms (seeds and others)", "", false); aManager.CreateActivity("Conference", "", false); aManager.CreateActivity("Contact stakeholder", "", false); aManager.CreateActivity("Dismantling of experiments", "", false); aManager.CreateActivity("Installation of equipment remaining for some time", "", false); aManager.CreateActivity("Measuring and marking of subplots/experiments/study organisms", "", false); aManager.CreateActivity("Observation/capture of organisms without removal", "", false); aManager.CreateActivity("Plot maintenance", "", false); aManager.CreateActivity("Removal of org. material without killing", "", false); aManager.CreateActivity("Removal of organisms", "", false); aManager.CreateActivity("Removal of soil samples", "", false); aManager.CreateActivity("Visit without activity", "", false); ResourceManager rManager = new ResourceManager();; List <newResourceStructure> rs_new = new List <newResourceStructure>(); rs_new.Add(new newResourceStructure() { name = "Forest - all EPs (SCH)", color = "#ec5959", description = "Visit of all forest EPs in Schorfheide-Chorin", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Forest - all MIPs (SCH)", color = "#ec5959", description = "Visit of all forest MIPs in Schorfheide-Chorin", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Forest - all VIPs (SCH)", color = "#ec5959", description = "Visit of all forest VIPs in Schorfheide-Chorin", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Forest - district Altenhof", color = "#ec5959", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Forest - district Arnimswalde", color = "#ec5959", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Forest - district Chorin", color = "#ec5959", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Forest - district Eichheide", color = "#ec5959", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Forest - district Glambeck", color = "#ec5959", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Forest - district Liepe", color = "#ec5959", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Forest - district Maienpfuhl", color = "#ec5959", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Forest - district Melzow", color = "#ec5959", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Forest - district Poratz", color = "#ec5959", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Forest - district Ringenwalde", color = "#ec5959", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Forest - district Senftenthal", color = "#ec5959", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Forest - district Theerofen", color = "#ec5959", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Forest - district Voigtswiese", color = "#ec5959", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Forest - Forstgut Altkuenkendorf", color = "#ec5959", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Forest - Fuerstliche Forstverwaltung Oettingen-Spielberg", color = "#ec5959", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Forest - Stiftung Schorfheide-Chorin", color = "#ec5959", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Forest - FOX (SCH)", color = "#ec5959", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Grassland - RP/UP (SCH)", color = "#ff0000", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Grassland - ABP Landwirtschaft Neugrimnitz GmbH", color = "#ff0000", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Grassland - AEVG Stegelitz-Flieth", color = "#ff0000", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Grassland - Agrargemeinschaft Greiffenberg GmbH", color = "#ff0000", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Grassland - all EPs (SCH)", color = "#ff0000", description = "Visit of all grassland EPs in Schorfheide-Chorin", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Grassland - all MIPs (SCH)", color = "#ff0000", description = "Visit of all grassland MIPs in Schorfheide-Chorin", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Grassland - all VIPs (SCH)", color = "#ff0000", description = "Visit of all grassland VIPs in Schorfheide-Chorin", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Grassland - Gut Biesenbrow", color = "#ff0000", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Grassland - Ingolf Limber", color = "#ff0000", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Grassland - Lehrschaeferei Friedrichsfelde", color = "#ff0000", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Grassland - LW-Betrieb Haferkamp", color = "#ff0000", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Grassland - Naturrind GmbH Boeckenberg", color = "#ff0000", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Grassland - Reiner Wegner", color = "#ff0000", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Grassland - Weidewirtschaft Liepe", color = "#ff0000", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "no plot visit (SCH)", color = "#e28f8f", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Sleeping place (SCH)", color = "#9c3939", description = "Sleeping places in Schorfheide-Chorin", duration = 1, quantity = 8, withActivity = false, resourceStructure = rs, type = "Sleeping place", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Drying cabinet (SCH)", color = "#940b0b", description = "Drying cabinet in Schorfheide-Chorin", duration = 1, quantity = 5, withActivity = false, resourceStructure = rs, type = "Equipment", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Fridge (SCH)", color = "#940b0b", description = "Fridge in Schorfheide-Chorin", duration = 1, quantity = 2, withActivity = false, resourceStructure = rs, type = "Equipment", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Freezer (SCH)", color = "#940b0b", description = "Freezer in Schorfheide-Chorin", duration = 1, quantity = 2, withActivity = false, resourceStructure = rs, type = "Equipment", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Metal detector (Magna Trak 100) (SCH)", color = "#940b0b", description = "Metal detector (Magna Trak 100) in Schorfheide-Chorin", duration = 1, quantity = 1, withActivity = false, resourceStructure = rs, type = "Equipment", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Binocular (SCH)", color = "#940b0b", description = "", duration = 1, quantity = 1, withActivity = false, resourceStructure = rs, type = "Equipment", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Chest freezer (SCH)", color = "#940b0b", description = "", duration = 1, quantity = 1, withActivity = false, resourceStructure = rs, type = "Equipment", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Helmet (SCH)", color = "#940b0b", description = "", duration = 1, quantity = 8, withActivity = false, resourceStructure = rs, type = "Equipment", explo = "Schorfheide-Chorin" }); rs_new.Add(new newResourceStructure() { name = "Forest - all EPs (HAI)", color = "#8cca0d", description = "Visit of all forest EPs in Hainich-Dün", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Forest - all GPs (HAI)", color = "#8cca0d", description = "Visit of all forestGPs in Hainich-Dün", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Forest - all MIPs (HAI)", color = "#8cca0d", description = "Visit of all forest MIPs in Hainich-Dün", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Forest - all VIPs (HAI)", color = "#8cca0d", description = "Visit of all forest VIPs in Hainich-Dün", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Forest - FOX (HAI)", color = "8cca0d", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Forest - district Anrode", color = "#8cca0d", description = "Forest - district Anrode", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Forest - city of Mühlhausen", color = "#8cca0d", description = "Forest - city of Mühlhausen", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Forest - district Behringen", color = "#8cca0d", description = "Forest - district Behringen", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Forest - district Geney", color = "#8cca0d", description = "Forest - district Geney", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Forest - district Keula", color = "#8cca0d", description = "Forest - district Keula", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Forest - district Langula", color = "#8cca0d", description = "Forest - district Langula", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Forest - district Sollstedt", color = "#8cca0d", description = "Forest - district Sollstedt", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Forest - district Zehnsberg", color = "#8cca0d", description = "Forest - district Zehnsberg", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Forest - national park", color = "#8cca0d", description = "Forest - national park", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Forest - national park Weberstedterholz (core zone)", color = "#8cca0d", description = "Forest - national park Weberstedterholz (core zone)", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Forest - district Westerwald", color = "#8cca0d", description = "Forest - district Westerwald", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Grassland - all GPs (HAI)", color = "#9acd32", description = "Visit of all grassland GPs in Hainich-Dün", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Grassland - all EPs (HAI)", color = "#9acd32", description = "Visit of all grassland EPs in Hainich-Dün", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Grassland - all MIPs (HAI)", color = "#9acd32", description = "Visit of all grassland MIPs in Hainich-Dün", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Grassland - all VIPs (HAI)", color = "#9acd32", description = "Visit of all grassland VIPs in Hainich-Dün", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Grassland - RP/UP (HAI)", color = "9acd32", description = "Visit of all new landuse experiment plots in HAI (HEG1,2,3,6,14,15)", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Grassland - AG Diedorf", color = "#9acd32", description = "Grassland - AG Diedorf", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Grassland - AG Großenlupnitz", color = "#9acd32", description = "Grassland - AG Großenlupnitz", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Grassland - AG Kirchheiligen", color = "#9acd32", description = "Grassland - AG Kirchheiligen", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Grassland - AG Bollstedt", color = "#9acd32", description = "Grassland - AG Bollstedt", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Grassland - AG Lengefeld", color = "#9acd32", description = "Grassland - AG Lengefeld", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Grassland - AG Mülverstedt", color = "#9acd32", description = "Grassland - AG Mülverstedt", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Grassland - AG Wartburgblick", color = "#9acd32", description = "Grassland - AG Wartburgblick", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Grassland - AG Wenigenlupnitz", color = "#9acd32", description = "Grassland - AG Wenigenlupnitz", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Grassland - AG-Struth-Eigenrieden", color = "#9acd32", description = "Grassland - AG-Struth-Eigenrieden", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Grassland - BEAG/TOA", color = "#9acd32", description = "Grassland - BEAG/TOA", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Grassland - Bundesforst Dörnaerplatz", color = "#9acd32", description = "Grassland - Bundesforst Dörnaerplatz", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Grassland - Gut Sambach", color = "#9acd32", description = "Grassland - Gut Sambach", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Grassland - Thüringen Wagyu Becker&Becker", color = "#9acd32", description = "Grassland - Thüringen Wagyu Becker&Becker", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Grassland - Heller", color = "#9acd32", description = "Grassland - Heller", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Grassland - Schaeferei Effenberger", color = "#9acd32", description = "Grassland - Schaeferei Effenberger", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Grassland - Nationalpark", color = "#9acd32", description = "Grassland - Nationalpark", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Grassland - Nordagrar (Naturrind Unstruttal)", color = "#9acd32", description = "Grassland - Nordagrar (Naturrind Unstruttal)", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Grassland - Schaeferei Goepfert", color = "#9acd32", description = "Grassland - Schaeferei Goepfert", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Grassland - Börner", color = "#9acd32", description = "Grassland - Börner", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Grassland - Strewe-Winterberg", color = "#9acd32", description = "Grassland - Strewe-Winterberg", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Grassland - TUPAG (Hainich Weiderind)", color = "#9acd32", description = "Grassland - TUPAG (Hainich Weiderind)", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "no plot visit", color = "#a9fb00", description = "No plot visit in Hainich-Dün", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Sleeping place (HAI)", color = "#78ab0f", description = "Sleeping place in Hainich-Dün", duration = 1, quantity = 8, withActivity = false, resourceStructure = rs, type = "Sleeping place", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Drying cabinet (HAI)", color = "#6a8a27", description = "Drying cabinete in Hainich-Dün", duration = 1, quantity = 4, withActivity = false, resourceStructure = rs, type = "Equipment", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Fridge (HAI)", color = "#6a8a27", description = "Fridge in Hainich-Dün", duration = 1, quantity = 2, withActivity = false, resourceStructure = rs, type = "Equipment", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Freezer (HAI)", color = "#6a8a27", description = "Freezer in Hainich-Dün", duration = 1, quantity = 3, withActivity = false, resourceStructure = rs, type = "Equipment", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Metal detector (Magna Trak 100) (HAI)", color = "#6a8a27", description = "Metal detector (Magna Trak 100) in Hainich-Dün", duration = 1, quantity = 1, withActivity = false, resourceStructure = rs, type = "Equipment", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Metal detector (Garrett ACE 150) (HAI)", color = "#6a8a27", description = "Metal detector (Garrett ACE 150) in Hainich-Dün", duration = 1, quantity = 1, withActivity = false, resourceStructure = rs, type = "Equipment", explo = "Hainich-Dün" }); rs_new.Add(new newResourceStructure() { name = "Forest - all EPs (ALB)", color = "#3a75e0", description = "Visit of all forest EPs in Schwäbische Alb", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schwäbische Alb" }); rs_new.Add(new newResourceStructure() { name = "Forest - VIP AEW1-8 (ALB)", color = "#3a75e0", description = "Visit of all VIP AEW1-8 in Schwäbische Alb", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schwäbische Alb" }); rs_new.Add(new newResourceStructure() { name = "Forest - VIP AEW9 (Alb)", color = "#3a75e0", description = "Visit of all VIP AEW9 in Schwäbische Alb", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schwäbische Alb" }); rs_new.Add(new newResourceStructure() { name = "Forest - FOX (ALB)", color = "#3a75e0", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schwäbische Alb" }); rs_new.Add(new newResourceStructure() { name = "Grassland - all EPs excluding former military training area", color = "#6495ed", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schwäbische Alb" }); rs_new.Add(new newResourceStructure() { name = "Grassland - all EPs including former military training area", color = "#6495ed", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schwäbische Alb" }); rs_new.Add(new newResourceStructure() { name = "Grassland - all VIPs (ALB)", color = "#6495ed", description = "Visit of all grassland VIPs in Schwäbische Alb", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schwäbische Alb" }); rs_new.Add(new newResourceStructure() { name = "Grassland - RP/UP (ALB)", color = "#6495ed", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schwäbische Alb" }); rs_new.Add(new newResourceStructure() { name = "no plot visit (ALB)", color = "#0057f5", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schwäbische Alb" }); rs_new.Add(new newResourceStructure() { name = "total Exploratory outside EP", color = "#0057f6", description = "", duration = 1, quantity = 0, withActivity = true, resourceStructure = rs, type = "Area", explo = "Schwäbische Alb" }); rs_new.Add(new newResourceStructure() { name = "Sleeping place (ALB)", color = "#27509a", description = "Sleeping places in Schwäbische Alb", duration = 1, quantity = 8, withActivity = false, resourceStructure = rs, type = "Sleeping place", explo = "Schwäbische Alb" }); rs_new.Add(new newResourceStructure() { name = "Drying cabinet (ALB)", color = "#7e95bf", description = "Drying cabinet in Schwäbische Alb", duration = 1, quantity = 5, withActivity = false, resourceStructure = rs, type = "Equipment", explo = "Schwäbische Alb" }); rs_new.Add(new newResourceStructure() { name = "Binocular (ALB)", color = "#7e95bf", description = "", duration = 1, quantity = 1, withActivity = false, resourceStructure = rs, type = "Equipment", explo = "Schwäbische Alb" }); rs_new.Add(new newResourceStructure() { name = "Metal detector (Magna Trak 100) (ALB)", color = "#7e95bf", description = "Metal detector (Magna Trak 100) in Schwäbische Alb", duration = 1, quantity = 1, withActivity = false, resourceStructure = rs, type = "Equipment", explo = "Schwäbische Alb" }); //get/create admin group for entity rights using (var groupManager = new GroupManager()) using (var permissionManager = new EntityPermissionManager()) using (var entityManager = new EntityManager()) using (var valueManager = new ResourceStructureAttributeManager()) { var adminGroup = groupManager.Groups.Where(r => r.Name == "administrator").FirstOrDefault(); if (adminGroup == null) { // create new group adminGroup = new Group { Name = "administrator", Description = "administrator", DisplayName = "administrator", IsSystemGroup = false, IsValid = true }; groupManager.CreateAsync(adminGroup).Wait(); } //create right type int rights = (int)RightType.Read + (int)RightType.Write + (int)RightType.Delete + (int)RightType.Grant; foreach (newResourceStructure rs_item in rs_new) { var duration = new TimeDuration(); duration.Value = rs_item.duration; var resource = rManager.CreateResource(rs_item.name, rs_item.description, rs_item.quantity, rs_item.color, rs_item.withActivity, rs_item.resourceStructure, duration); //add entity rights permissionManager.Create(adminGroup, entityManager.FindByName("SingleResource"), resource.Id, rights ); ResourceAttributeUsage usage = valueManager.GetResourceAttributeUsageById(1); valueManager.CreateResourceAttributeValue(rs_item.explo, rManager.GetResourceById(resource.Id), usage); ResourceAttributeUsage usage2 = valueManager.GetResourceAttributeUsageById(2); valueManager.CreateResourceAttributeValue(rs_item.type, rManager.GetResourceById(resource.Id), usage2); } } } catch (Exception e) { Console.WriteLine("{0} Exception caught.", e); } #endregion #region SECURITY OperationManager operationManager = new OperationManager(); FeatureManager featureManager = new FeatureManager(); try { List <Feature> features = featureManager.FeatureRepository.Get().ToList(); Feature ResourceBooking = features.FirstOrDefault(f => f.Name.Equals("Resource Booking")); if (ResourceBooking == null) { ResourceBooking = featureManager.Create("Resource Booking", "Resource Booking"); } Feature NotificationBlackboard = features.FirstOrDefault(f => f.Name.Equals("Notification Blackboard")); if (NotificationBlackboard == null) { NotificationBlackboard = featureManager.Create("Notification Blackboard", "Notification Blackboard", ResourceBooking); } Feature ResourceAdmin = features.FirstOrDefault(f => f.Name.Equals("Resource Administration")); if (ResourceAdmin == null) { ResourceAdmin = featureManager.Create("Resource Administration", "Resource Administration"); } Feature ResourceManagement = features.FirstOrDefault(f => f.Name.Equals("Resource Management")); if (ResourceManagement == null) { ResourceManagement = featureManager.Create("Resource Management", "Resource Management", ResourceAdmin); } Feature ResourceStructureManagement = features.FirstOrDefault(f => f.Name.Equals("Resource Structure Management")); if (ResourceStructureManagement == null) { ResourceStructureManagement = featureManager.Create("Resource Structure Management", "Resource Structure Management", ResourceAdmin); } Feature ResourceStructureAttributeManagement = features.FirstOrDefault(f => f.Name.Equals("Resource Structure Attribute Management")); if (ResourceStructureAttributeManagement == null) { ResourceStructureAttributeManagement = featureManager.Create("Resource Structure Attribute Management", "Resource Structure Attribute Management", ResourceAdmin); } Feature NotificationManagement = features.FirstOrDefault(f => f.Name.Equals("Notification Management")); if (NotificationManagement == null) { NotificationManagement = featureManager.Create("Notification Management", "Notification Management", ResourceAdmin); } Feature ActivityManagement = features.FirstOrDefault(f => f.Name.Equals("Activity Management")); if (ActivityManagement == null) { ActivityManagement = featureManager.Create("Activity Management", "Activity Management", ResourceAdmin); } operationManager.Create("RBM", "Schedule", "*", ResourceBooking); operationManager.Create("RBM", "Calendar", "*", ResourceBooking); operationManager.Create("RBM", " NotificationBlackboard", "*", NotificationBlackboard); operationManager.Create("RBM", "Resource", "*", ResourceManagement); operationManager.Create("RBM", "ResourceStructure", "*", ResourceStructureManagement); operationManager.Create("RBM", "ResourceStructure", "*", ResourceStructureAttributeManagement); operationManager.Create("RBM", "Notification", "*", NotificationManagement); operationManager.Create("RBM", "Activity", "*", ActivityManagement); #region Help Workflow if (!operationManager.Exists("RBM", "help", "*")) { operationManager.Create("RBM", "Help", "*"); } #endregion Help Workflow } catch (Exception ex) { throw ex; } finally { operationManager.Dispose(); featureManager.Dispose(); } #endregion }
public void GenerateSeedData() { using (FeatureManager featureManager = new FeatureManager()) using (OperationManager operationManager = new OperationManager()) using (var featurePermissionManager = new FeaturePermissionManager()) { #region SECURITY //workflows = größere sachen, vielen operation //operations = einzelne actions //1.controller -> 1.Operation List <Feature> features = featureManager.FeatureRepository.Get().ToList(); Feature DataDiscovery = features.FirstOrDefault(f => f.Name.Equals("Data Discovery")); if (DataDiscovery == null) { DataDiscovery = featureManager.Create("Data Discovery", "Data Discovery"); } Feature SearchFeature = features.FirstOrDefault(f => f.Name.Equals("Search") && f.Parent != null && f.Parent.Id.Equals(DataDiscovery.Id)); if (SearchFeature == null) { SearchFeature = featureManager.Create("Search", "Search", DataDiscovery); } Feature SearchManagementFeature = features.FirstOrDefault(f => f.Name.Equals("Search Managment") && f.Parent != null && f.Parent.Id.Equals(DataDiscovery.Id)); if (SearchManagementFeature == null) { SearchManagementFeature = featureManager.Create("Search Management", "Search Management", DataDiscovery); } Feature Dashboard = features.FirstOrDefault(f => f.Name.Equals("Dashboard") && f.Parent != null && f.Parent.Id.Equals(DataDiscovery.Id)); if (Dashboard == null) { Dashboard = featureManager.Create("Dashboard", "Dashboard", DataDiscovery); } //worklfows -> create dataset -> //WorkflowManager workflowManager = new WorkflowManager(); //var operation = new Operation(); //Workflow workflow = new Workflow(); //List<Workflow> workflows = workflowManager.WorkflowRepository.Get().ToList(); #region Help Workflow //workflow = // workflows.FirstOrDefault(w => // w.Name.Equals("Search Help") && // w.Feature != null && // w.Feature.Id.Equals(DataDiscovery.Id)); //if (workflow == null) workflow = workflowManager.Create("Search Help", "", DataDiscovery); //operationManager.Create("DDM", "Help", "*", null, workflow); operationManager.Create("DDM", "Help", "*"); #endregion #region Search Workflow // ToDo -> David, Sven // [Sven / 2017-08-21] // I had to remove the feature to get dashboard running without DDM feature permissions. // We have to think about how we can fix it in a long run. Maybe "DDM/Home" is not the proper // place for dashboard!? operationManager.Create("DDM", "PublicSearch", "*"); operationManager.Create("DDM", "Home", "*", SearchFeature); operationManager.Create("DDM", "Data", "*", SearchFeature); if (!featurePermissionManager.Exists(null, SearchFeature.Id, PermissionType.Grant)) { featurePermissionManager.Create(null, SearchFeature.Id, PermissionType.Grant); } #endregion #region Search Admin Workflow operationManager.Create("DDM", "Admin", "*", SearchManagementFeature); #endregion #region Dashboard operationManager.Create("DDM", "Dashboard", "*", Dashboard); #endregion #endregion } }
public void GenerateSeedData() { ResearchPlanManager researchPlanManager = new ResearchPlanManager(); DataStructureManager dataStructureManager = new DataStructureManager(); UnitManager unitManager = new UnitManager(); EntityManager entityManager = new EntityManager(); FeatureManager featureManager = new FeatureManager(); OperationManager operationManager = new OperationManager(); MetadataStructureManager metadataStructureManager = new MetadataStructureManager(); try { #region create none researchPlan if (!researchPlanManager.Repo.Get().Any(r => r.Title.Equals("none"))) { researchPlanManager.Create("none", "If no research plan is used."); } #endregion create none researchPlan #region create none structure if (!dataStructureManager.AllTypesDataStructureRepo.Get().Any(d => d.Name.Equals("none"))) { dataStructureManager.CreateUnStructuredDataStructure("none", "If no data strutcure is used."); } #endregion create none structure #region create none unit Dimension dimension = null; if (!unitManager.DimensionRepo.Get().Any(d => d.Name.ToLower().Equals("none"))) { dimension = unitManager.Create("none", "none", "If no unit is used."); // the null dimension should be replaced bz a proper valid one. Javad 11.06 } else { dimension = unitManager.DimensionRepo.Get().Where(d => d.Name.ToLower().Equals("none")).FirstOrDefault(); } if (!unitManager.Repo.Get().Any(u => u.Name.ToLower().Equals("none"))) { unitManager.Create("none", "none", "If no unit is used.", dimension, MeasurementSystem.Unknown); } #endregion create none unit #region create entities // Entities Entity entity = entityManager.Entities.Where(e => e.Name.ToUpperInvariant() == "Dataset".ToUpperInvariant()).FirstOrDefault(); if (entity == null) { entity = new Entity(); entity.Name = "Dataset"; entity.EntityType = typeof(Dataset); entity.EntityStoreType = typeof(Xml.Helpers.DatasetStore); entity.UseMetadata = true; entity.Securable = true; //add to Extra XmlDocument xmlDoc = new XmlDocument(); XmlDatasetHelper xmlDatasetHelper = new XmlDatasetHelper(); xmlDatasetHelper.AddReferenceToXml(xmlDoc, AttributeNames.name.ToString(), "ddm", AttributeType.parameter.ToString(), "extra/modules/module"); entity.Extra = xmlDoc; entityManager.Create(entity); } else { XmlDocument xmlDoc = new XmlDocument(); if (entity.Extra != null) { xmlDoc.AppendChild(entity.Extra); } //update to Extra XmlDatasetHelper xmlDatasetHelper = new XmlDatasetHelper(); xmlDatasetHelper.AddReferenceToXml(xmlDoc, AttributeNames.name.ToString(), "ddm", AttributeType.parameter.ToString(), "extra/modules/module"); entity.Extra = xmlDoc; entityManager.Update(entity); } #endregion create entities #region SECURITY //workflows = größere sachen, vielen operation //operations = einzelne actions //1.controller-> 1.Operation Feature DataCollectionFeature = featureManager.FeatureRepository.Get().FirstOrDefault(f => f.Name.Equals("Data Collection")); if (DataCollectionFeature == null) { DataCollectionFeature = featureManager.Create("Data Collection", "Data Collection"); } Feature DatasetCreationFeature = featureManager.FeatureRepository.Get().FirstOrDefault(f => f.Name.Equals("Data Creation")); if (DatasetCreationFeature == null) { DatasetCreationFeature = featureManager.Create("Data Creation", "Data Creation", DataCollectionFeature); } Feature DatasetUploadFeature = featureManager.FeatureRepository.Get().FirstOrDefault(f => f.Name.Equals("Dataset Upload")); if (DatasetUploadFeature == null) { DatasetUploadFeature = featureManager.Create("Dataset Upload", "Dataset Upload", DataCollectionFeature); } Feature ImportDataFeature = featureManager.FeatureRepository.Get().FirstOrDefault(f => f.Name.Equals("Import Data")); if (ImportDataFeature == null) { ImportDataFeature = featureManager.Create("Import Data", "Easy way to load data into bexis", DataCollectionFeature); } Feature MetadataManagementFeature = featureManager.FeatureRepository.Get().FirstOrDefault(f => f.Name.Equals("Metadata Management")); if (MetadataManagementFeature == null) { MetadataManagementFeature = featureManager.Create("Metadata Management", "Metadata Management", DataCollectionFeature); } #region Help Workflow operationManager.Create("DCM", "Help", "*"); #endregion Help Workflow #region Create Dataset Workflow operationManager.Create("DCM", "CreateDataset", "*", DatasetCreationFeature); operationManager.Create("DCM", "Form", "*"); operationManager.Create("Api", "DatasetIn", "*", DatasetCreationFeature); operationManager.Create("Api", "Dataset", "*", DatasetCreationFeature); operationManager.Create("Api", "MetadataIn", "*", DatasetCreationFeature); operationManager.Create("Api", "Metadata", "*", DatasetCreationFeature); #endregion Create Dataset Workflow #region Update Dataset Workflow operationManager.Create("DCM", "Submit", "*", DatasetUploadFeature); operationManager.Create("DCM", "SubmitChooseUpdateMethod", "*", DatasetUploadFeature); operationManager.Create("DCM", "SubmitGetFileInformation", "*", DatasetUploadFeature); operationManager.Create("DCM", "SubmitSelectAFile", "*", DatasetUploadFeature); operationManager.Create("DCM", "SubmitSpecifyDataset", "*", DatasetUploadFeature); operationManager.Create("DCM", "SubmitSummary", "*", DatasetUploadFeature); operationManager.Create("DCM", "SubmitValidation", "*", DatasetUploadFeature); //Load files to server operationManager.Create("DCM", "Push", "*", DatasetUploadFeature); operationManager.Create("Api", "DataIn", "*", DatasetUploadFeature); operationManager.Create("Api", "Data", "*", DatasetUploadFeature); operationManager.Create("Api", "AttachmentIn", "*", DatasetUploadFeature); operationManager.Create("Api", "Attachment", "*", DatasetUploadFeature); #endregion Update Dataset Workflow #region Easy Upload operationManager.Create("DCM", "EasyUpload", "*", ImportDataFeature); operationManager.Create("DCM", "EasyUploadSelectAFile", "*", ImportDataFeature); operationManager.Create("DCM", "EasyUploadSelectAreas", "*", ImportDataFeature); operationManager.Create("DCM", "EasyUploadSheetDataStructure", "*", ImportDataFeature); operationManager.Create("DCM", "EasyUploadSheetSelectMetaData", "*", ImportDataFeature); operationManager.Create("DCM", "EasyUploadSummary", "*", ImportDataFeature); operationManager.Create("DCM", "EasyUploadVerification", "*", ImportDataFeature); #endregion Easy Upload #region Metadata Managment Workflow operationManager.Create("DCM", "ImportMetadataStructure", "*", MetadataManagementFeature); operationManager.Create("DCM", "ImportMetadataStructureReadSource", "*", MetadataManagementFeature); operationManager.Create("DCM", "ImportMetadataStructureSelectAFile", "*", MetadataManagementFeature); operationManager.Create("DCM", "ImportMetadataStructureSetParameters", "*", MetadataManagementFeature); operationManager.Create("DCM", "ImportMetadataStructureSummary", "*", MetadataManagementFeature); operationManager.Create("DCM", "ManageMetadataStructure", "*", MetadataManagementFeature); operationManager.Create("DCM", "SubmitSpecifyDataset", "*", MetadataManagementFeature); #endregion Metadata Managment Workflow #region public available //because of reuse in ddm this controller must be public // but the funktions should be secured operationManager.Create("DCM", "Form", "*"); operationManager.Create("DCM", "EntityReference", "*"); //Attachments operationManager.Create("DCM", "Attachments", "*"); #endregion public available #endregion SECURITY #region Add Metadata if (!metadataStructureManager.Repo.Get().Any(m => m.Name.Equals("Basic ABCD"))) { string titleXPath = "Metadata/Metadata/MetadataType/Description/DescriptionType/Representation/MetadataDescriptionRepr/Title/TitleType"; string descriptionXpath = "Metadata/Metadata/MetadataType/Description/DescriptionType/Representation/MetadataDescriptionRepr/Details/DetailsType"; ImportSchema("Basic ABCD", "ABCD_2.06.XSD", "DataSet", entity.Name, entity.EntityType.FullName, titleXPath, descriptionXpath); } //if (!metadataStructureManager.Repo.Get().Any(m => m.Name.Equals("Full ABCD"))) //{ // string titleXPath = // "Metadata/Metadata/MetadataType/Description/DescriptionType/Representation/MetadataDescriptionRepr/Title/TitleType"; // string descriptionXpath = // "Metadata/Metadata/MetadataType/Description/DescriptionType/Representation/MetadataDescriptionRepr/Details/DetailsType"; // ImportSchema("Full ABCD", "ABCD_2.06.XSD", "DataSet", entity.Name, entity.EntityType.FullName, // titleXPath, descriptionXpath); //} if (!metadataStructureManager.Repo.Get().Any(m => m.Name.Equals("GBIF"))) { string titleXPath = "Metadata/Basic/BasicType/title/titleType"; string descriptionXpath = "Metadata/abstract/abstractType/para/paraType"; ImportSchema("GBIF", "eml.xsd", "Dataset", entity.Name, entity.EntityType.FullName, titleXPath, descriptionXpath); } //if (!metadataStructureManager.Repo.Get().Any(m => m.Name.Equals("Basic Eml"))) // ImportSchema("Basic Eml", "eml-dataset.xsd", entity.Name, entity.Name, entity.EntityType.FullName); #endregion Add Metadata } catch (Exception ex) { throw ex; } finally { researchPlanManager.Dispose(); dataStructureManager.Dispose(); unitManager.Dispose(); entityManager.Dispose(); featureManager.Dispose(); operationManager.Dispose(); metadataStructureManager.Dispose(); } }
public void GenerateSeedData() { SubmissionManager submissionManager = new SubmissionManager(); FeatureManager featureManager = new FeatureManager(); OperationManager operationManager = new OperationManager(); try { #region SECURITY //workflows = größere sachen, vielen operation //operations = einzelne actions //1.controller -> 1.Operation Feature DataDissemination = featureManager.FeatureRepository.Get().FirstOrDefault(f => f.Name.Equals("Data Dissemination")); if (DataDissemination == null) { DataDissemination = featureManager.Create("Data Dissemination", "Data Dissemination"); } Feature Mapping = featureManager.FeatureRepository.Get().FirstOrDefault(f => f.Name.Equals("Mapping")); if (Mapping == null) { Mapping = featureManager.Create("Mapping", "Mapping", DataDissemination); } Feature Submission = featureManager.FeatureRepository.Get().FirstOrDefault(f => f.Name.Equals("Submission")); if (Submission == null) { Submission = featureManager.Create("Submission", "Submission", DataDissemination); } #region Help Workflow operationManager.Create("DIM", "Help", "*"); #endregion #region Admin Workflow operationManager.Create("Dim", "Admin", "*", DataDissemination); operationManager.Create("Dim", "Submission", "*", Submission); operationManager.Create("Dim", "Mapping", "*", Mapping); #endregion #region Mapping Workflow //ToDo add security after Refactoring DIM mapping workflow //workflow = new Workflow(); //workflow.Name = "Mapping"; //workflowManager.Create(workflow); //operation = operationManager.Create("Dim", "Admin", "*", null, workflow); //workflow.Operations.Add(operation); //Mapping.Workflows.Add(workflow); #endregion #region Submission Workflow //ToDo add security after Refactoring DIM Submission workflow //workflow = new Workflow(); //workflow.Name = "Submission"; //workflowManager.Create(workflow); //operation = operationManager.Create("Dim", "Admin", "*", null, workflow); //workflow.Operations.Add(operation); //Submission.Workflows.Add(workflow); #endregion #endregion #region EXPORT submissionManager.Load(); createMetadataStructureRepoMaps(); #endregion #region MAPPING createMappings(); #endregion } catch (Exception ex) { throw ex; } finally { featureManager.Dispose(); operationManager.Dispose(); } //ImportPartyTypes(); }
public void GenerateSeedData() { #region create entities using (var entityManager = new EntityManager()) { // Entities Entity entity = entityManager.Entities.Where(e => e.Name.ToUpperInvariant() == "Publication".ToUpperInvariant()).FirstOrDefault(); if (entity == null) { entity = new Entity(); entity.Name = "Publication"; entity.EntityType = typeof(Dataset); entity.EntityStoreType = typeof(PublicationStore); entity.UseMetadata = true; entity.Securable = true; //add to Extra XmlDocument xmlDoc = new XmlDocument(); XmlDatasetHelper xmlDatasetHelper = new XmlDatasetHelper(); xmlDatasetHelper.AddReferenceToXml(xmlDoc, AttributeNames.name.ToString(), "pub", AttributeType.parameter.ToString(), "extra/modules/module"); entity.Extra = xmlDoc; entityManager.Create(entity); } } #endregion #region SECURITY using (FeatureManager featureManager = new FeatureManager()) using (OperationManager operationManager = new OperationManager()) { Feature PublicationFeature = featureManager.FeatureRepository.Get().FirstOrDefault(f => f.Name.Equals("Publications")); if (PublicationFeature == null) { PublicationFeature = featureManager.Create("Publications", "Publications"); } Feature PublicationCreationFeature = featureManager.FeatureRepository.Get().FirstOrDefault(f => f.Name.Equals("Publication Creation")); if (PublicationCreationFeature == null) { PublicationCreationFeature = featureManager.Create("Publication Creation", "Publication Creation", PublicationFeature); } Feature PublicationShowFeature = featureManager.FeatureRepository.Get().FirstOrDefault(f => f.Name.Equals("Publication Show")); if (PublicationShowFeature == null) { PublicationShowFeature = featureManager.Create("Publication Show", "Publication Show", PublicationFeature); } operationManager.Create("PUB", "CreatePublication", "*", PublicationCreationFeature); operationManager.Create("PUB", "UploadPublication", "*", PublicationCreationFeature); operationManager.Create("PUB", "ShowPublication", "*", PublicationShowFeature); } #endregion }
public void GenerateSeedData() { EntityManager entityManager = new EntityManager(); try { #region create Entities // Entities Entity entity = entityManager.Entities.Where(e => e.Name.ToUpperInvariant() == "Event".ToUpperInvariant()).FirstOrDefault(); if (entity == null) { entity = new Entity(); entity.Name = "Event"; entity.EntityType = typeof(Event); entity.EntityStoreType = typeof(EventStore); entity.UseMetadata = true; entity.Securable = true; entityManager.Create(entity); } #endregion #region SECURITY OperationManager operationManager = new OperationManager(); FeatureManager featureManager = new FeatureManager(); try { Feature rootEventManagementFeature = featureManager.FeatureRepository.Get().FirstOrDefault(f => f.Name.Equals("Event Management")); if (rootEventManagementFeature == null) rootEventManagementFeature = featureManager.Create("Event Management", "Event Management"); Feature eventRegistrationFeature = featureManager.FeatureRepository.Get().FirstOrDefault(f => f.Name.Equals("Event Registration")); if (eventRegistrationFeature == null) eventRegistrationFeature = featureManager.Create("Event Registration", "Event Registration", rootEventManagementFeature); Feature eventAdministrationFeature = featureManager.FeatureRepository.Get().FirstOrDefault(f => f.Name.Equals("Event Administration")); if (eventAdministrationFeature == null) eventAdministrationFeature = featureManager.Create("Event Administration", "Event Administration", rootEventManagementFeature); Feature eventRegistrationResultFeature = featureManager.FeatureRepository.Get().FirstOrDefault(f => f.Name.Equals("Event Registration Result")); if (eventRegistrationResultFeature == null) eventRegistrationResultFeature = featureManager.Create("Event Registration Result", "Event Registration Result", rootEventManagementFeature); operationManager.Create("EMM", "EventRegistration", "*", eventRegistrationFeature); operationManager.Create("EMM", "Event", "*", eventAdministrationFeature); operationManager.Create("EMM", "EventRegistrationResult", "*", eventRegistrationResultFeature); } catch (Exception ex) { throw ex; } finally { featureManager.Dispose(); operationManager.Dispose(); } #endregion } catch (Exception ex) { throw ex; } finally { entityManager.Dispose(); } }
public void GenerateSeedData() { ResearchPlanManager researchPlanManager = new ResearchPlanManager(); DataStructureManager dataStructureManager = new DataStructureManager(); UnitManager unitManager = new UnitManager(); EntityManager entityManager = new EntityManager(); FeatureManager featureManager = new FeatureManager(); OperationManager operationManager = new OperationManager(); try { #region create none researchPlan if (!researchPlanManager.Repo.Get().Any(r => r.Title.Equals("none"))) { researchPlanManager.Create("none", "If no research plan is used."); } #endregion #region create none structure if (!dataStructureManager.AllTypesDataStructureRepo.Get().Any(d => d.Name.Equals("none"))) { dataStructureManager.CreateUnStructuredDataStructure("none", "If no data strutcure is used."); } #endregion #region create none unit Dimension dimension = null; if (!unitManager.DimensionRepo.Get().Any(d => d.Name.ToLower().Equals("none"))) { dimension = unitManager.Create("none", "none", "If no unit is used."); // the null dimension should be replaced bz a proper valid one. Javad 11.06 } else { dimension = unitManager.DimensionRepo.Get().Where(d => d.Name.ToLower().Equals("none")).FirstOrDefault(); } if (!unitManager.Repo.Get().Any(u => u.Name.ToLower().Equals("none"))) { unitManager.Create("none", "none", "If no unit is used.", dimension, MeasurementSystem.Unknown); } #endregion #region create entities // Entities Entity entity = entityManager.Entities.Where(e => e.Name.ToUpperInvariant() == "Dataset".ToUpperInvariant()).FirstOrDefault(); if (entity == null) { entity = new Entity(); entity.Name = "Dataset"; entity.EntityType = typeof(Dataset); entity.EntityStoreType = typeof(Xml.Helpers.DatasetStore); entity.UseMetadata = true; entity.Securable = true; entityManager.Create(entity); } #endregion #region SECURITY //workflows = größere sachen, vielen operation //operations = einzelne actions //1.controller-> 1.Operation Feature DataCollectionFeature = featureManager.FeatureRepository.Get().FirstOrDefault(f => f.Name.Equals("Data Collection")); if (DataCollectionFeature == null) { DataCollectionFeature = featureManager.Create("Data Collection", "Data Collection"); } Feature DatasetCreationFeature = featureManager.FeatureRepository.Get().FirstOrDefault(f => f.Name.Equals("Data Creation")); if (DatasetCreationFeature == null) { DatasetCreationFeature = featureManager.Create("Data Creation", "Data Creation", DataCollectionFeature); } Feature DatasetUploadFeature = featureManager.FeatureRepository.Get().FirstOrDefault(f => f.Name.Equals("Dataset Upload")); if (DatasetUploadFeature == null) { DatasetUploadFeature = featureManager.Create("Dataset Upload", "Dataset Upload", DataCollectionFeature); } Feature MetadataManagementFeature = featureManager.FeatureRepository.Get().FirstOrDefault(f => f.Name.Equals("Metadata Management")); if (MetadataManagementFeature == null) { MetadataManagementFeature = featureManager.Create("Metadata Management", "Metadata Management", DataCollectionFeature); } #region Help Workflow operationManager.Create("DCM", "Help", "*"); #endregion #region Create Dataset Workflow operationManager.Create("DCM", "CreateDataset", "*", DatasetCreationFeature); operationManager.Create("DCM", "Form", "*"); #endregion #region Update Dataset Workflow operationManager.Create("DCM", "Push", "*", DatasetUploadFeature); operationManager.Create("DCM", "Submit", "*", DatasetUploadFeature); operationManager.Create("DCM", "SubmitDefinePrimaryKey", "*", DatasetUploadFeature); operationManager.Create("DCM", "SubmitGetFileInformation", "*", DatasetUploadFeature); operationManager.Create("DCM", "SubmitSelectAFile", "*", DatasetUploadFeature); operationManager.Create("DCM", "SubmitSpecifyDataset", "*", DatasetUploadFeature); operationManager.Create("DCM", "SubmitSummary", "*", DatasetUploadFeature); operationManager.Create("DCM", "SubmitValidation", "*", DatasetUploadFeature); #endregion #region Easy Upload operationManager.Create("DCM", "EasyUpload", "*", DatasetUploadFeature); operationManager.Create("DCM", "EasyUploadSelectAFile", "*", DatasetUploadFeature); operationManager.Create("DCM", "EasyUploadSelectAreas", "*", DatasetUploadFeature); operationManager.Create("DCM", "EasyUploadSheetDataStructure", "*", DatasetUploadFeature); operationManager.Create("DCM", "EasyUploadSheetSelectMetaData", "*", DatasetUploadFeature); operationManager.Create("DCM", "EasyUploadSummary", "*", DatasetUploadFeature); operationManager.Create("DCM", "EasyUploadVerification", "*", DatasetUploadFeature); #endregion #region Metadata Managment Workflow operationManager.Create("DCM", "ImportMetadataStructure", "*", MetadataManagementFeature); operationManager.Create("DCM", "ImportMetadataStructureReadSource", "*", MetadataManagementFeature); operationManager.Create("DCM", "ImportMetadataStructureSelectAFile", "*", MetadataManagementFeature); operationManager.Create("DCM", "ImportMetadataStructureSetParameters", "*", MetadataManagementFeature); operationManager.Create("DCM", "ImportMetadataStructureSummary", "*", MetadataManagementFeature); operationManager.Create("DCM", "ManageMetadataStructure", "*", MetadataManagementFeature); operationManager.Create("DCM", "SubmitSpecifyDataset", "*", MetadataManagementFeature); #endregion #region public available operationManager.Create("DCM", "Form", "*"); #endregion #endregion #region Add Metadata MetadataStructureManager metadataStructureManager = new MetadataStructureManager(); if (!metadataStructureManager.Repo.Get().Any(m => m.Name.Equals("Basic ABCD"))) { string titleXPath = "Metadata/Metadata/MetadataType/Description/DescriptionType/Representation/MetadataDescriptionRepr/Title/TitleType"; string descriptionXpath = "Metadata/Metadata/MetadataType/Description/DescriptionType/Representation/MetadataDescriptionRepr/Details/DetailsType"; ImportSchema("Basic ABCD", "ABCD_2.06.XSD", "DataSet", entity.Name, entity.EntityType.FullName, titleXPath, descriptionXpath); } //if (!metadataStructureManager.Repo.Get().Any(m => m.Name.Equals("Full ABCD"))) //{ // string titleXPath = // "Metadata/Metadata/MetadataType/Description/DescriptionType/Representation/MetadataDescriptionRepr/Title/TitleType"; // string descriptionXpath = // "Metadata/Metadata/MetadataType/Description/DescriptionType/Representation/MetadataDescriptionRepr/Details/DetailsType"; // ImportSchema("Full ABCD", "ABCD_2.06.XSD", "DataSet", entity.Name, entity.EntityType.FullName, // titleXPath, descriptionXpath); //} if (!metadataStructureManager.Repo.Get().Any(m => m.Name.Equals("GBIF"))) { string titleXPath = "Metadata/Basic/BasicType/title/titleType"; string descriptionXpath = "Metadata/abstract/abstractType/para/paraType"; ImportSchema("GBIF", "eml.xsd", "Dataset", entity.Name, entity.EntityType.FullName, titleXPath, descriptionXpath); } //if (!metadataStructureManager.Repo.Get().Any(m => m.Name.Equals("Basic Eml"))) // ImportSchema("Basic Eml", "eml-dataset.xsd", entity.Name, entity.Name, entity.EntityType.FullName); #endregion } catch (Exception ex) { throw ex; } finally { researchPlanManager.Dispose(); dataStructureManager.Dispose(); unitManager.Dispose(); entityManager.Dispose(); featureManager.Dispose(); operationManager.Dispose(); } }