internal static Resources.ProcessResourceView GetResource(EastFive.Azure.ProcessResourceView view, AzureApplication application, UrlHelper url) { return(new Resources.ProcessResourceView { Id = url.GetWebId <ProcessResourceView>(view.processViewId), Actor = application.GetActorLink(view.actorId, url), Resource = application.GetResourceLink(view.resourceType, view.resourceId, url), ResourceType = application.GetResourceMime(view.resourceType), CurrentProcessStep = url.GetWebId <ProcessStep>(view.currentProcessStepId), Titles = view.titles, Completions = view.completions, Invalidations = view.invalidations, ResourcesDisplayed = view.displayResources, ResourcesProvided = view.resourcesProvided .Select( resourceProvided => new Resources.ProcessResourceView.ConfirmableResource { Key = resourceProvided.key, Resource = application.GetResourceLink(resourceProvided.type, resourceProvided.resourceId, url), Type = application.GetResourceMime(resourceProvided.type), }) .ToArray(), NextStages = view.nextStages .Select(nextStageId => url.GetWebId <Resources.ProcessStage>(nextStageId.processStageId)) .ToArray(), Editable = view.editable, Completable = view.completable, }); }
internal static Resources.ProcessStep GetResource(EastFive.Azure.Process process, AzureApplication httpApplication, UrlHelper urlHelper) { return(new Resources.ProcessStep { Id = urlHelper.GetWebId <ProcessStep>(process.processId), Stage = urlHelper.GetWebId <EastFive.Api.Azure.Resources.ProcessStage>(process.processStageId), Resource = httpApplication.GetResourceLink(process.resourceType, process.resourceId, urlHelper), CreatedOn = process.createdOn, ConfirmedBy = process.confirmedBy.HasValue ? EastFive.Security.SessionServer.Library.configurationManager.GetActorLink(process.confirmedBy.Value, urlHelper) : default(WebId), ConfirmedWhen = process.confirmedWhen, Previous = urlHelper.GetWebId <ProcessStep>(process.previousStep), Resources = process.resources .Select(resource => httpApplication.GetResourceLink(process.resourceType, resource.resourceId, urlHelper)) .ToArray(), ResourceKeys = process.resources .Select(resource => (resource.key)) .ToArray(), }); }