public ActionResult Create() { MetadataCreateViewModel model = new MetadataCreateViewModel { MetadataContactName = GetSecurityClaim("urn:oid:1.3.6.1.4.1.5923.1.1.1.6"), MetadataContactOrganization = GetSecurityClaim("organization"), MetadataContactEmail = GetSecurityClaim("urn:oid:1.2.840.113549.1.9.1"), }; return(View(model)); }
public ActionResult Create(MetadataCreateViewModel model) { string organization = GetSecurityClaim("organization"); model.MetadataContactOrganization = organization; if (ModelState.IsValid) { string username = GetUsername(); string uuid = _metadataService.CreateMetadata(model, username); Log.Info(string.Format("Created new metadata: {0} [uuid = {1}] for user: {2} on behalf of {3} ", model.Title, uuid, username, organization)); return(RedirectToAction("Edit", new { uuid = uuid, metadatacreated = true })); } return(View(model)); }
private void InsertOpenMetadata(string identifier, Dataset dataset, OpenMetadataEndpoint openMetadataEndpoint) { var newMetadata = new MetadataCreateViewModel(); newMetadata.Uuid = identifier; newMetadata.Type = "dataset"; newMetadata.Title = dataset.title; newMetadata.MetadataContactOrganization = !string.IsNullOrEmpty(openMetadataEndpoint.OrganizationName) ? openMetadataEndpoint.OrganizationName : dataset.publisher.name; newMetadata.MetadataContactName = dataset.contactPoint.fn; newMetadata.MetadataContactEmail = dataset.contactPoint.hasEmail.Replace("mailto:", ""); var uuid = _metadataService.CreateMetadata(newMetadata, SecurityClaim.GetUsername()); Log.Info("Created open metadata uuid: " + uuid); }