Ejemplo n.º 1
0
        internal static Resources.ProcessResourceView GetResource(
            EastFive.Azure.ProcessResourceView view,
            AzureApplication application,
            IProvideUrl 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,
            });
        }
Ejemplo n.º 2
0
 public static HttpResponseMessage QueryByResourceIdAndTypeAsync(
     [QueryParameter(Name = ResourceTypePropertyName)] Type resourceType,
     [QueryParameter(Name = ResourcePropertyName)] Guid resourceId,
     AzureApplication application,
     RedirectResponse onRedirect,
     UnauthorizedResponse onUnauthorized,
     NotFoundResponse onRedirectNotFound,
     ConfigurationFailureResponse onConfigurationFailure)
 {
     return(EastFive.Web.Configuration.Settings.GetUri(
                EastFive.Azure.AppSettings.SpaSiteLocation,
                siteUrl =>
     {
         var resourceName = application.GetResourceMime(resourceType);
         var redirectUrl = siteUrl
                           .AppendToPath("redirect")
                           .AddQueryParameter("type", resourceName)
                           .AddQueryParameter("id", resourceId.ToString());
         return onRedirect(redirectUrl);
     },
                (why) => onConfigurationFailure(why, "")));
 }